feat: make coach the home experience - #97
Conversation
📝 WalkthroughWalkthroughThe dashboard’s first tab is now Coach, with thread-aware routing into ChangesCoach navigation and chat experience
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant GoRouter
participant CoachTab
participant CoachChatPage
Caller->>GoRouter: Navigate with threadId
GoRouter->>CoachTab: Build CoachTab(threadId)
CoachTab->>CoachChatPage: Build chat page
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
test/shared/widgets/kynos_bottom_nav_test.dart (1)
89-91: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUpdate stale test name to match the new color assertion.
The test description still says "stand color" but the assertion on line 109 now checks for
KynosColors.purple. Update the test name to avoid confusion.✏️ Proposed fix
- testWidgets('selected tab icon uses stand color and filled style', ( + testWidgets('selected tab icon uses purple color and filled style', ( tester, ) async {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/shared/widgets/kynos_bottom_nav_test.dart` around lines 89 - 91, Update the testWidgets description for the selected tab icon test to replace the stale “stand color” wording with wording that accurately reflects the KynosColors.purple assertion, while preserving the existing test behavior.lib/features/coach_chat/presentation/widgets/assistant_bubble.dart (1)
97-105: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant bottom spacing around tool steps.
AgentToolStepListalready applies its own bottom padding internally (Padding(padding: only(bottom: Spacing.sm))peragent_tool_step_list.dart). Wrapping it here in aContainerthat also addsmargin: only(bottom: Spacing.sm)pluspadding: all(Spacing.sm)stacks extra vertical whitespace beneath the tool-steps block.🎨 Suggested tweak
Container( margin: const EdgeInsets.only(bottom: Spacing.sm), - padding: const EdgeInsets.all(Spacing.sm), + padding: const EdgeInsets.fromLTRB( + Spacing.sm, + Spacing.sm, + Spacing.sm, + 0, + ), decoration: BoxDecoration(🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/features/coach_chat/presentation/widgets/assistant_bubble.dart` around lines 97 - 105, Update the tool-steps wrapper in the assistant bubble’s AgentToolStepList block to remove the redundant bottom spacing, including the outer bottom margin and any unnecessary bottom padding, while preserving the intended container styling and internal AgentToolStepList spacing.lib/features/coach_chat/presentation/widgets/coach_chat_app_bar.dart (1)
59-61: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid magic-string sentinel for "untitled" conversation.
Comparing against the literal
'New conversation'string to decide when to fall back to'KYNOS Coach'is brittle — if the default title text used elsewhere (e.g., where a newCoachConversationis created) ever changes, this comparison silently breaks. Consider a proper nullable/boolean signal on the conversation model instead of string matching.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/features/coach_chat/presentation/widgets/coach_chat_app_bar.dart` around lines 59 - 61, Update the title selection in the coach chat app bar to stop comparing against the literal “New conversation” sentinel. Use the conversation model’s nullable or boolean indicator for an untitled/new conversation, preserving the fallback to “KYNOS Coach” while allowing custom conversation titles unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/features/coach_chat/presentation/pages/coach_chat_page.dart`:
- Around line 188-197: Guard both asynchronous callbacks against disposal: in
_createNewChat, return when the awaited id is null or mounted is false before
using ref, _textController, or _focusNode; in _confirmDeleteThread, check
mounted immediately after await deleteConversation() before calling
ensureActiveConversation() or invalidating providers. Apply these changes at
lib/features/coach_chat/presentation/pages/coach_chat_page.dart lines 188-197
and 181-185, respectively.
In `@lib/features/coach_chat/presentation/widgets/chat_input_bar.dart`:
- Around line 24-56: Wrap the chat input bar returned by the relevant build
method around the Padding/GlassCard structure with SafeArea bottom inset
handling, preserving the existing keyboard behavior and layout while ensuring
the bar stays above device home indicators and gesture areas.
---
Nitpick comments:
In `@lib/features/coach_chat/presentation/widgets/assistant_bubble.dart`:
- Around line 97-105: Update the tool-steps wrapper in the assistant bubble’s
AgentToolStepList block to remove the redundant bottom spacing, including the
outer bottom margin and any unnecessary bottom padding, while preserving the
intended container styling and internal AgentToolStepList spacing.
In `@lib/features/coach_chat/presentation/widgets/coach_chat_app_bar.dart`:
- Around line 59-61: Update the title selection in the coach chat app bar to
stop comparing against the literal “New conversation” sentinel. Use the
conversation model’s nullable or boolean indicator for an untitled/new
conversation, preserving the fallback to “KYNOS Coach” while allowing custom
conversation titles unchanged.
In `@test/shared/widgets/kynos_bottom_nav_test.dart`:
- Around line 89-91: Update the testWidgets description for the selected tab
icon test to replace the stale “stand color” wording with wording that
accurately reflects the KynosColors.purple assertion, while preserving the
existing test behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ea89ee96-4c02-40c2-8e91-0d50b7544ac1
📒 Files selected for processing (17)
CODEMAP.mdlib/app/router.dartlib/app/shell_navigation_scope.dartlib/app/shell_page.dartlib/core/theme/layout.dartlib/features/coach_chat/presentation/pages/coach_chat_page.dartlib/features/coach_chat/presentation/widgets/assistant_bubble.dartlib/features/coach_chat/presentation/widgets/chat_input_bar.dartlib/features/coach_chat/presentation/widgets/coach_chat_app_bar.dartlib/features/coach_chat/presentation/widgets/follow_up_chips.dartlib/features/coach_chat/presentation/widgets/glass_suggestion_chip.dartlib/features/coach_chat/presentation/widgets/message_list.dartlib/features/coach_chat/presentation/widgets/model_setup_screen.dartlib/shared/utils/open_coach_chat.dartlib/shared/widgets/kynos_bottom_nav.dartlib/shared/widgets/nav_icon.darttest/shared/widgets/kynos_bottom_nav_test.dart
|
Addressed the remaining CodeRabbit feedback in 9582d6e:
Validation: |
# [1.19.0](v1.18.0...v1.19.0) (2026-07-13) ### Features * make coach the home experience ([#97](#97)) ([fa90938](fa90938))
Summary
Checklist
flutter analyzeflutter test(223 tests)flutter build webdart run tool/generate_codemap.dart --checkAgent notes