Skip to content

feat(coachhelm): consolidate player CoachHelm into one tabbed home - #299

Closed
njrini99-code wants to merge 1 commit into
mainfrom
feat/coachhelm-player-consolidation
Closed

feat(coachhelm): consolidate player CoachHelm into one tabbed home#299
njrini99-code wants to merge 1 commit into
mainfrom
feat/coachhelm-player-consolidation

Conversation

@njrini99-code

@njrini99-code njrini99-code commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Why

The player CoachHelm was scattered across three standalone routes that all draw from the same engine, each with its own masthead and its own sidebar rail item:

  • /golf/dashboard/coachhelm — Overview
  • /golf/dashboard/my-development — focus areas + goals
  • /golf/dashboard/my-standing — where-you-stack-up matrix

A player had three "AI" entry points instead of one. ("CoachHelm is all over the place… data thrown everywhere.")

What

Fold them into a single CoachHelm home using the existing CoachHelmShell + CoachHelmSubNav tab infrastructure (each tab is a real SSR route — not a client-side tab component, so deep links and SSR-active painting keep working):

Overview · Development · Standing

File Change
CoachHelmSubNav.tsx Add standing to the player tab set; rename player "My Development" tab → "Development"
CoachHelmShell.tsx Add standing to the CoachHelmTab union + DEFAULT_TITLE record
my-standing/page.tsx Wrap the Fairway fork in CoachHelmShell (active="standing" role="player") so it shares the masthead + sub-nav. Legacy (flag-off) branch byte-for-byte unchanged
GolfSidebar.tsx, FairwayDashboardShell.tsx Drop the duplicate standalone "My Development" player rail item — it's now a CoachHelm tab. CoachHelm AI (→ Overview) is the single rail entry

Deep links from dashboard cards / round-review CTAs still resolve to the correct tab (Development / Standing) via the sub-nav's longest-prefix matcher.

Coach-side consolidation will follow in a separate PR.

Verification

  • tsc --noEmit clean
  • npm run lint — 0 errors (2804 warnings, under the 6000 gate)
  • ✅ 39 coachhelm tests pass, incl. new CoachHelmSubNav.test.tsx:
    • player tab set = exactly Overview/Development/Standing with correct hrefs (no Signals/Effectiveness/Ask leak)
    • active="standing" paints aria-current="page" from the SSR prop
    • coach tab set intact (Standing is player-only)
  • ✅ All three routes compile + auth-redirect cleanly (307, no 500) on the dev server

Reviewer note

Hold for review of the core player experience before merge — this changes the player's primary navigation surface. Not merged.

🤖 Generated with Claude Code

Greptile Summary

This PR consolidates the player's three separate CoachHelm routes (Overview, My Development, My Standing) into a single tabbed home by wrapping each in the existing CoachHelmShell + CoachHelmSubNav infrastructure, and removes the now-redundant "My Development" rail item from both sidebars.

  • CoachHelmSubNav.tsx / CoachHelmShell.tsx: standing is added to the CoachHelmTab union and to PLAYER_TABS, giving players a three-tab nav (Overview · Development · Standing) while leaving the coach tab set intact.
  • my-standing/page.tsx: The Fairway fork branch is wrapped in CoachHelmShell active="standing" role="player", sharing the masthead and sub-nav; the legacy branch is byte-for-byte unchanged.
  • GolfSidebar.tsx / FairwayDashboardShell.tsx: The standalone "My Development" player rail item is removed from both nav registries.

Confidence Score: 4/5

Safe to merge once the redundant padding wrapper in my-standing/page.tsx is removed — the layout bug is isolated to the Standing tab and does not affect auth, data loading, or the other two tabs.

The tab wiring, auth redirect, and nav removal are all correct. The one concrete defect is the leftover max-w-[860px] px-4 py-2 md:px-6 div in my-standing/page.tsx: because CoachHelmShell already applies its own px-4 md:px-6 on both the masthead and body containers, the Standing tab renders with double horizontal padding compared to Overview and Development, making it visibly narrower and inconsistent on every screen size.

src/app/golf/(dashboard)/dashboard/my-standing/page.tsx — the redundant outer wrapper div needs to be removed.

Important Files Changed

Filename Overview
src/app/golf/(dashboard)/dashboard/my-standing/page.tsx Fairway fork wraps CoachHelmShell in a redundant max-w-[860px]/px-4/md:px-6 div, causing double horizontal padding on the Standing tab vs Overview and Development.
src/components/fairway/pages/coachhelm/CoachHelmSubNav.tsx Adds standing to CoachHelmTab union and adds the Standing tab to PLAYER_TABS with correct href/matchPrefixes; exact-match guard for the player Overview tab is preserved; coach tab set is unchanged.
src/components/fairway/pages/coachhelm/CoachHelmShell.tsx Adds standing: 'Standing' to DEFAULT_TITLE; one-liner change, correct. Prop comment for role is now slightly stale (still says "Brief + Players").
src/components/fairway/pages/coachhelm/CoachHelmSubNav.test.tsx New test file covering player tab set (3 tabs, correct hrefs, aria-current on Standing), active-tab SSR prop fallback, and coach tab set isolation — all three cases look correct.
src/app/golf/(dashboard)/FairwayDashboardShell.tsx Removes the duplicate "My Development" player rail item from the Fairway nav section — straightforward one-line deletion, consistent with GolfSidebar change.
src/components/golf/layout/GolfSidebar.tsx Removes "My Development" from playerNavItems, leaving CoachHelm AI as the single rail entry point — correct and complete.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Sidebar["GolfSidebar / FairwayDashboardShell\n(player rail)"]
    Sidebar -->|"CoachHelm AI\n/golf/dashboard/coachhelm"| Shell

    subgraph Shell["CoachHelmShell (role=player)"]
        SubNav["CoachHelmSubNav\nOverview · Development · Standing"]
        SubNav -->|"Overview\nhref=/golf/dashboard/coachhelm"| Overview["coachhelm/page.tsx"]
        SubNav -->|"Development\nhref=/golf/dashboard/my-development"| Dev["my-development/page.tsx"]
        SubNav -->|"Standing\nhref=/golf/dashboard/my-standing"| Standing["my-standing/page.tsx\n(new: CoachHelmShell wrapping)"]
    end

    style Standing fill:#fef3c7,stroke:#d97706
Loading

Comments Outside Diff (1)

  1. src/components/fairway/pages/coachhelm/CoachHelmShell.tsx, line 61 (link)

    P2 The role prop JSDoc is now stale: the player variant has three tabs (Overview / Development / Standing), not "Brief + Players".

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Claude Code

Fix All in Claude Code

Reviews (1): Last reviewed commit: "feat(coachhelm): consolidate player Coac..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

The player CoachHelm was scattered across three standalone routes that all
draw from the same engine — /coachhelm (Overview), /my-development, and
/my-standing — each with its own masthead and its own sidebar rail item.
A player had three "AI" entry points instead of one.

Fold them into a single CoachHelm home using the existing CoachHelmShell +
CoachHelmSubNav tab infrastructure (each tab is a real SSR route, not a
client tab component):

  Overview · Development · Standing

- CoachHelmSubNav: add the `standing` tab to the player tab set; rename the
  player "My Development" tab label to "Development".
- CoachHelmShell: add `standing` to the CoachHelmTab union + DEFAULT_TITLE.
- /my-standing: wrap the Fairway fork in CoachHelmShell (active="standing",
  role="player") so it shares the masthead + sub-nav instead of rendering a
  standalone header. Legacy (flag-off) branch unchanged.
- Sidebars (GolfSidebar + FairwayDashboardShell): drop the duplicate
  standalone "My Development" player rail item — it's now a CoachHelm tab.
  Deep links from dashboard cards/round-review still land on the right tab.

Coach-side consolidation follows separately.

Gates: typecheck clean · lint 0 errors (2804 warns, under 6000) · 39
coachhelm tests pass incl. new CoachHelmSubNav.test.tsx (player tab set,
active-prop paint, coach set intact).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
helmv3 Ready Ready Preview, Comment Jun 15, 2026 2:23am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@njrini99-code, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 22 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cfed1313-de4c-4af2-a508-bd3d1d852b3d

📥 Commits

Reviewing files that changed from the base of the PR and between 5fb03a3 and d32c6a7.

📒 Files selected for processing (6)
  • src/app/golf/(dashboard)/FairwayDashboardShell.tsx
  • src/app/golf/(dashboard)/dashboard/my-standing/page.tsx
  • src/components/fairway/pages/coachhelm/CoachHelmShell.tsx
  • src/components/fairway/pages/coachhelm/CoachHelmSubNav.test.tsx
  • src/components/fairway/pages/coachhelm/CoachHelmSubNav.tsx
  • src/components/golf/layout/GolfSidebar.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/coachhelm-player-consolidation

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 and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d32c6a78f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 80 to 81
{ name: 'CoachHelm AI', href: '/golf/dashboard/coachhelm', icon: IconSparkles },
{ name: 'My Rounds', href: '/golf/dashboard/rounds', icon: IconGolf },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve My Development when the redesign is disabled

When NEXT_PUBLIC_REDESIGN is unset or false—the documented default—layout.tsx mounts the legacy GolfDashboardShell, while dashboard/coachhelm/page.tsx renders PlayerCoachHelmDashboard without the new tab navigation. Removing this link unconditionally therefore drops My Development from the player's normal navigation rather than consolidating it under CoachHelm; keep the entry for flag-off users and remove it only in the Fairway shell.

Useful? React with 👍 / 👎.

Comment on lines +113 to +122
<div className="mx-auto w-full max-w-[860px] px-4 py-2 md:px-6">
<CoachHelmShell
active="standing"
role="player"
eyebrow="My Standing"
title="Where you stack up"
description={
`${isEmpty ? 'No standing data yet' : `${totalRows} metric${totalRows === 1 ? '' : 's'} tracked`} · you vs your team and PGA Tour, refreshed nightly.`
}
>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Double horizontal padding on the Standing tab — the intermediate <div className="mx-auto w-full max-w-[860px] px-4 py-2 md:px-6"> wrapper was carried over from the old standalone page but was not removed when the content was wrapped in CoachHelmShell. The shell already provides its own px-4 md:px-6 on both the masthead and body containers, so the Standing tab ends up with 32 px of horizontal padding on each side (mobile) versus the 16 px that Overview and Development have — making it visually narrower and inconsistently padded compared to the other two tabs. Also remove the corresponding closing </div> on the line before </div> (the bg-canvas wrapper close).

Suggested change
<div className="mx-auto w-full max-w-[860px] px-4 py-2 md:px-6">
<CoachHelmShell
active="standing"
role="player"
eyebrow="My Standing"
title="Where you stack up"
description={
`${isEmpty ? 'No standing data yet' : `${totalRows} metric${totalRows === 1 ? '' : 's'} tracked`} · you vs your team and PGA Tour, refreshed nightly.`
}
>
<CoachHelmShell
active="standing"
role="player"
eyebrow="My Standing"
title="Where you stack up"
description={
`${isEmpty ? 'No standing data yet' : `${totalRows} metric${totalRows === 1 ? '' : 's'} tracked`} · you vs your team and PGA Tour, refreshed nightly.`
}
>

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@njrini99-code

Copy link
Copy Markdown
Owner Author

Superseded by #304, which rolls this onto a single branch (feat/coachhelm-stats-roundup) with all four PRs merged clean + a merge-interaction fix. Branch feat/coachhelm-player-consolidation is untouched and this PR can be reopened if needed.

@njrini99-code
njrini99-code deleted the feat/coachhelm-player-consolidation branch June 29, 2026 12:17
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.

1 participant