Skip to content

feat: make coach the home experience - #97

Merged
YKDBontekoe merged 3 commits into
mainfrom
cursor/coach-home-redesign-codex
Jul 13, 2026
Merged

YKDBontekoe merged 3 commits into
mainfrom
cursor/coach-home-redesign-codex

Conversation

@YKDBontekoe

@YKDBontekoe YKDBontekoe commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Make KYNOS Coach the default home experience, with thread-aware navigation from training and other app surfaces.
  • Simplify the Coach chat UI: compact app bar actions, streamlined assistant responses, horizontal follow-up chips, and a multiline, gesture-safe input.
  • Refresh the floating navigation with a Coach tab, refined active state, and correct bottom placement on wide web layouts.
  • Make web startup resilient where OPFS is unavailable by using Cache API model storage.

Checklist

  • flutter analyze
  • flutter test (223 tests)
  • flutter build web
  • dart run tool/generate_codemap.dart --check
  • Live web verification: onboarding skip, Coach home/setup shell, and Coach-to-Training navigation with bottom navigation placement.

Agent notes

  • The live web preview renders correctly without a configured on-device model. Chat generation itself requires the user to configure a model or cloud backend, so that external setup was not changed during this UI task.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The dashboard’s first tab is now Coach, with thread-aware routing into CoachChatPage. Chat creation, model setup, input, assistant responses, suggestions, navigation styling, and related tests are updated.

Changes

Coach navigation and chat experience

Layer / File(s) Summary
Coach routing and shell integration
lib/app/router.dart, lib/app/shell_navigation_scope.dart, lib/shared/utils/open_coach_chat.dart
Dashboard and coach-chat routes now resolve to a thread-aware Coach tab, replacing the former DashboardTab flow.
Chat page creation and model setup
lib/features/coach_chat/presentation/pages/coach_chat_page.dart, lib/features/coach_chat/presentation/widgets/model_setup_screen.dart
CoachChatPage creates new conversations, wires app-bar actions, and configures model setup visibility and retry behavior.
Chat interaction and presentation widgets
lib/features/coach_chat/presentation/widgets/*
Chat headers, multiline input, assistant responses, follow-up suggestions, empty states, and suggestion chips receive updated controls and layouts.
Navigation visuals and validation
lib/app/shell_page.dart, lib/core/theme/layout.dart, lib/shared/widgets/*, test/shared/widgets/kynos_bottom_nav_test.dart, CODEMAP.md
Shell navigation responds to keyboard visibility, bottom-nav styling and icons change for Coach, tests are updated, and CODEMAP records are regenerated.

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
Loading

Possibly related PRs

Suggested labels: released

Poem

I’m a bunny hopping through Coach’s new door,
Threads find their chats as they did before.
Fresh bubbles glow, suggestions align,
A purple nav pill makes the path shine.
New chats spring up—what a delightful design!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise, conventional-commit style, and accurately summarizes the main change: making Coach the home experience.
Description check ✅ Passed The description follows the template with Summary, Checklist, and Agent notes, and it includes the main validation items.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
test/shared/widgets/kynos_bottom_nav_test.dart (1)

89-91: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Update 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 value

Redundant bottom spacing around tool steps.

AgentToolStepList already applies its own bottom padding internally (Padding(padding: only(bottom: Spacing.sm)) per agent_tool_step_list.dart). Wrapping it here in a Container that also adds margin: only(bottom: Spacing.sm) plus padding: 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 win

Avoid 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 new CoachConversation is 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

📥 Commits

Reviewing files that changed from the base of the PR and between fe301f0 and a6bf2ad.

📒 Files selected for processing (17)
  • CODEMAP.md
  • lib/app/router.dart
  • lib/app/shell_navigation_scope.dart
  • lib/app/shell_page.dart
  • lib/core/theme/layout.dart
  • lib/features/coach_chat/presentation/pages/coach_chat_page.dart
  • lib/features/coach_chat/presentation/widgets/assistant_bubble.dart
  • lib/features/coach_chat/presentation/widgets/chat_input_bar.dart
  • lib/features/coach_chat/presentation/widgets/coach_chat_app_bar.dart
  • lib/features/coach_chat/presentation/widgets/follow_up_chips.dart
  • lib/features/coach_chat/presentation/widgets/glass_suggestion_chip.dart
  • lib/features/coach_chat/presentation/widgets/message_list.dart
  • lib/features/coach_chat/presentation/widgets/model_setup_screen.dart
  • lib/shared/utils/open_coach_chat.dart
  • lib/shared/widgets/kynos_bottom_nav.dart
  • lib/shared/widgets/nav_icon.dart
  • test/shared/widgets/kynos_bottom_nav_test.dart

Comment thread lib/features/coach_chat/presentation/pages/coach_chat_page.dart
Comment thread lib/features/coach_chat/presentation/widgets/chat_input_bar.dart Outdated
@YKDBontekoe

Copy link
Copy Markdown
Owner Author

Addressed the remaining CodeRabbit feedback in 9582d6e:

  • Added disposal guards around asynchronous conversation actions.
  • Restored SafeArea handling for the chat input.
  • Removed redundant tool-step spacing.
  • Removed the stale app-bar title sentinel and corrected the nav test description.
  • Updated this PR description to include Summary, Checklist, and Agent notes.

Validation: flutter analyze, flutter test (223 passing), flutter build web, CODEMAP check, and a live browser smoke test of onboarding, Coach home/setup, and Training navigation.

@YKDBontekoe
YKDBontekoe merged commit fa90938 into main Jul 13, 2026
13 checks passed
@YKDBontekoe
YKDBontekoe deleted the cursor/coach-home-redesign-codex branch July 13, 2026 11:06
kynos-release-bot Bot pushed a commit that referenced this pull request Jul 13, 2026
# [1.19.0](v1.18.0...v1.19.0) (2026-07-13)

### Features

* make coach the home experience ([#97](#97)) ([fa90938](fa90938))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants