Skip to content

Small-fix bundle: round-detail scorecard, rounds-list copy, saved-views demo toast, On-the-Record drift, Ask rail layout - #928

Closed
njrini99-code wants to merge 1 commit into
mainfrom
fix/golf-copy-and-small-fixes
Closed

Small-fix bundle: round-detail scorecard, rounds-list copy, saved-views demo toast, On-the-Record drift, Ask rail layout#928
njrini99-code wants to merge 1 commit into
mainfrom
fix/golf-copy-and-small-fixes

Conversation

@njrini99-code

Copy link
Copy Markdown
Owner

Problem

Seven small, verified-live bugs, bundled per the parent issue set:

  1. Round detail scorecard — both the front AND back nine's total column header said "Out" (the back nine copied the front nine's hard-coded label instead of reading "In").
  2. Rounds list rows· 18h reads as "18 hours" instead of holes.
  3. Rounds list rows — a round whose course_state is set but course_city is null renders the bare state code (e.g. "Va") as a stray, unlabeled fragment next to the type chip ("TOURNAMENT Va · 18h"). Same pattern existed in the round card and the in-progress banner.
  4. Baseball Stats Center saved-viewsgetStatVisualViews is a pure SELECT but wasn't marked demoSafe, so withBaseballAction's fail-closed demo guard blocked every load for the shared read-only demo account, throwing BaseballDemoReadOnlyError and surfacing a permanent "Saved views unavailable" toast that also outlived route changes (sonner's Toaster is mounted once at the app root, independent of the component that fired the toast).
  5. "On the Record" KPI drift — Command Center derived it from the broader box-score+practice rosterPulse (any session at all counts), Stats Center derived it from officially-recorded games only (noData = zero batting/pitching/catching/fielding/baserunning events). Same team, same moment: Command Center showed 8, Stats Center showed 0.
  6. Dev-y copy + interstitial routing — Stats Center's KPI label "Needs Recalc" reads as an engineering term to a coach; and a coach who lands on the player /golf/dashboard/coachhelm route saw an interstitial pointing them at "the roster page" instead of just being routed to their own Brief.
  7. Ask CoachHelm thread rail — the "Threads" bezel heading truncated to "Thr…" against the thread-count readout (InstrumentPanel's side-by-side bezel breakpoint reads viewport width, not this narrow rail's own rendered width), and a single-crumb breadcrumb (the open thread's title) rendered with none of CoachHelmShell's breadcrumb affordances — just a bare span sitting between the masthead and the tab bar, reading as a stray echo of the thread's question.

Fix

  1. FairwayRoundDetail.tsxScorecardNine's desktop table now derives the total-column label from which nine it's rendering (Front → "Out", Back → "In") instead of a hard-coded "Out".
  2. FairwayRoundRow.tsx (+ FairwayRoundCard.tsx for the same badge pattern) — {holesPlayed}h{holesPlayed} {holesPlayed === 1 ? 'hole' : 'holes'}.
  3. FairwayRoundRow.tsx, FairwayRoundCard.tsx, FairwayUnfinishedBanner.tsx — the shared city derivation now only joins course_state onto an actual course_city; a state alone is dropped rather than rendered bare.
  4. stat-visual-views.tsgetStatVisualViews marked demoSafe: true (it performs no write, matching the established pattern for every other read-only action in stats.ts/academics.ts/discover.ts). use-stat-visual-views.ts additionally silences the toast for permission-denied/demo-flavored failures specifically (genuine load failures still toast for real owners) and captures the toast id to dismiss it in the effect's cleanup, so it can't survive an unmount/route change.
  5. command-center.tssummary.playersWithData now reads statsCenterModel.summary.playersWithData (the same getStatsCenter() call this file already makes for career-avg reconciliation) instead of re-deriving its own count from rosterPulse. Both surfaces now share one function/definition of "on the record." Added regression assertions in command-center.test.ts locking in both the practice-only (0) and box-score (1) cases.
  6. StatsCenterClient.tsx — KPI label "Needs Recalc" → "Pending Updates". golf/dashboard/coachhelm/page.tsx — a coach with a resolved organization now redirect()s straight to /golf/dashboard/intelligence (the coach Brief); the interstitial remains only for the genuine edge case of a coach with no resolved organization yet (mid-onboarding), where the Brief route can't resolve a team either.
  7. AskConversationRail.tsx — the "Threads" header is now passed as a ReactNode rather than a string, so InstrumentPanel skips its default truncate class (only applied to string headers) and the heading wraps instead of hard-ellipsizing. AskWorkspace.tsx — dropped the single-crumb thread-title breadcrumb entirely (no href, no navigational value — the rail already highlights the open thread) rather than restyling a crumb trail that never had real ancestor/chevron chrome to begin with.

Gates

  • npx tsc --noEmit -p tsconfig.json — clean.
  • npx eslint <12 changed files> — clean.
  • npx vitest run across the touched/adjacent suites — all passing:
    • command-center.test.ts + command-center-stats-center-drift.test.ts (60 tests)
    • baseball stats/product-trust contract suites (78 tests)
    • CoachHelmSubNav.test.tsx, nav-registry.test.ts, FairwayUnsyncedRoundBanner.test.ts (528 tests)
    • StatVisualsSection.import-href.test.tsx, stat-visuals.test.ts, elite-stat-events.test.ts (192 tests)

Caveats

  • Items 1–3 and 7 touch presentation-only components with no pre-existing test scaffolding in this repo; verified by careful code reading + the passing gates above rather than new component tests (no browser automation used, per house rules).
  • Did not touch FairwayRoundCard.tsx's micro-stat hover reveal or any other card content — it isn't currently mounted by FairwayRoundsLibrary (only FairwayRoundRow is), so its "18h"/city fixes are dead-code-safe consistency fixes, not a live-bug fix on their own.
  • Left NotPlayerState in place (now gated on !coach.organization_id) rather than deleting it — noUnusedLocals requires it stay reachable, and it's a reasonable fallback for a coach mid-onboarding.

Part of #908, Part of #909, Part of #916, Part of #917

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01MMdviLDsAg2YYJ8adsM6fg

Bundle of 7 small, verified-live fixes:

1. Round detail scorecard: back nine's total column said "Out" (copied
   from the front nine) — now reads "In" per golf convention.
2. Rounds list rows: "· 18h" read as hours — now "· 18 holes" / "· 9 holes".
3. Rounds list rows: a course with only course_state set (no course_city)
   rendered the bare state code ("Va") as a stray unlabeled fragment next
   to the type chip — location text is now only rendered when there's an
   actual city to anchor it. Fixed across the round row, round card, and
   the in-progress banner (same shared pattern in all three).
4. Baseball Stats Center saved-views loader: getStatVisualViews was a pure
   read but not marked demoSafe, so the shared read-only demo account hit
   withBaseballAction's fail-closed guard on every load and threw
   BaseballDemoReadOnlyError — surfacing as a permanent "Saved views
   unavailable" toast. Marked demoSafe: true (it performs no write); the
   client hook also now silences the toast for permission/demo-flavored
   failures specifically (genuine errors still toast for owners) and
   dismisses any in-flight toast on unmount so it can't outlive a route
   change.
5. "On the Record" KPI: Command Center derived it from the broader
   box-score+practice rosterPulse (any session at all), Stats Center
   derived it from officially-recorded games only — the two drifted
   (8 vs 0) for a team with only practice sessions logged. Command Center
   now reads Stats Center's own getStatsCenter() summary for this figure
   instead of re-deriving it, so both surfaces share one definition.
   Added regression coverage in command-center.test.ts.
6. Renamed the dev-y "Needs Recalc" KPI label to "Pending Updates". Golf
   /golf/dashboard/coachhelm interstitial: a coach landing there now
   redirects straight to their CoachHelm Brief (/golf/dashboard/intelligence)
   instead of seeing the "access player insights from the roster page"
   notice; the interstitial remains as a fallback for a coach with no
   resolved organization yet.
7. Ask CoachHelm thread rail: the "Threads" bezel heading truncated to
   "Thr…" against the thread-count readout because InstrumentPanel's
   side-by-side bezel breakpoint reads viewport width, not this narrow
   rail's own width — passed it as a ReactNode so InstrumentPanel skips
   its default truncate class. Also removed a single-crumb breadcrumb
   (the open thread's title) that rendered with none of CoachHelmShell's
   breadcrumb affordances — just a bare span between the masthead and the
   sub-nav tab bar, reading as a stray echo of the thread's question.

Gates: tsc --noEmit clean; eslint clean on all 12 changed files; vitest
run across command-center, stats-center, stat-visuals, and coachhelm
contract/regression suites — 60+192+78+528 tests, all passing.

Part of #908, Part of #909, Part of #916, Part of #917

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMdviLDsAg2YYJ8adsM6fg
@cursor

cursor Bot commented Jul 17, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project qmnssrrolpinvwjjnufo because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
helmv3 Ignored Ignored Jul 17, 2026 9:47pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9c0a5453-2dc1-4ef4-b9c1-c16fba99e076

📥 Commits

Reviewing files that changed from the base of the PR and between 6d25e44 and ff0df76.

📒 Files selected for processing (12)
  • src/app/baseball/actions/stat-visual-views.ts
  • src/app/golf/(dashboard)/dashboard/coachhelm/page.tsx
  • src/components/baseball/stat-visuals/use-stat-visual-views.ts
  • src/components/baseball/stats-center/StatsCenterClient.tsx
  • src/components/fairway/pages/coachhelm/AskConversationRail.tsx
  • src/components/fairway/pages/coachhelm/AskWorkspace.tsx
  • src/components/fairway/pages/rounds/FairwayRoundCard.tsx
  • src/components/fairway/pages/rounds/FairwayRoundDetail.tsx
  • src/components/fairway/pages/rounds/FairwayRoundRow.tsx
  • src/components/fairway/pages/rounds/FairwayUnfinishedBanner.tsx
  • src/lib/baseball/read-models/__tests__/command-center.test.ts
  • src/lib/baseball/read-models/command-center.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/golf-copy-and-small-fixes
  • 🛠️ helm safety pass
  • 🛠️ dashboard ux pass
  • 🛠️ rls test pass

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.

@njrini99-code

Copy link
Copy Markdown
Owner Author

🤖 Mission Control — PR summary

What it changes: Bundle of 7 small, verified-live fixes:

  1. Round-detail scorecard: back-nine total column said "Out" (copied from the front nine) → now "In".
  2. Rounds list: "· 18h" read as hours → now "· 18 holes" / "· 9 holes".
  3. Rounds list: a course with only course_state (no city) rendered a bare state code ("Va") as a stray fragment → location text now only renders with an actual city (fixed across round row, card, and in-progress banner).
  4. Baseball Stats Center: getStatVisualViews was a pure read but not marked demoSafe, so the shared read-only demo account tripped withBaseballAction's fail-closed guard and threw BaseballDemoReadOnlyError → permanent "Saved views unavailable" toast. Now demoSafe: true.
    5–7. On-the-Record drift + Ask-rail layout.

Risk / areas: golf round-detail / rounds-list, baseball stats-center demo guard, CoachHelm Ask rail.

Watch: ⚠️ fix #4 directly addresses the live BaseballDemoReadOnlyError runtime cluster currently firing in prod (stats-center / dashboard / decision-room / calendar) — confirm getStatVisualViews is genuinely a pure read before relaxing the guard.

CI: ✅ green so far — 34 checks passing, 4 pending, 0 failing; mergeable state BLOCKED on required review (no CI failure). Awaiting review.

@njrini99-code

Copy link
Copy Markdown
Owner Author

Superseded — landed on main inside merge train #938 (commit 6ecede6). Branch kept.

@njrini99-code
njrini99-code deleted the fix/golf-copy-and-small-fixes branch July 20, 2026 20:50
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