fix(baseball): populate demo program season/risks/recruiting + Command Center & calendar polish - #937
fix(baseball): populate demo program season/risks/recruiting + Command Center & calendar polish#937njrini99-code wants to merge 1 commit into
Conversation
…d Center & calendar polish Fixes #912 + #911 polish. Problem: the public BaseballHelm demo ("Demo University Baseball", entered via /baseball/demo) promises "fully-populated" but past Phase-1 seeding shows an empty program — 0 games on record in Stats Center, 0 open risk flags, an empty recruiting board, and one stale practice on the calendar. Separately, Command Center stacked two identical "Standing by — awaiting first pitch." empty-state cards, and the calendar header's month label could collapse to "J…" at desktop widths with the event pill clipping (no ellipsis) at the calendar's right edge. Fix: - New idempotent scripts/seed-baseball-demo-program.ts (Phase 4 of the demo-seed family, re-derives Phase-1's org/team/coach/roster ids rather than re-seeding them): a believable ~20-game completed season (17 official + 3 scrimmage) with box-score-level batting/pitching lines per roster player, generated by a deterministic simulator (src/lib/baseball/seed/demo-program-sim.ts, unit-tested) whose invariants (batting R == team score, pitching R == runs allowed, IP always sums to 9) are enforced by construction, not asserted after the fact. Season stats are derived via the same recalculate_baseball_season_stats RPC the app's own box-score save flow calls, never hand-authored. Also seeds 3 open (status='active') risk flags, a recruiting board (3 fictional feeder programs + 8 recruits across all 4 active pipeline stages), a rolling lifting-session history, and more upcoming calendar events/practices. Dry-run by default; --confirm required to write; wired into the existing `npm run seed:baseball:demo` chain and verify-baseball-demo-coverage.ts's required-surface list. - CommandCenterFairway.tsx: the morning-brief empty state now reads "Standing by — the desk is quiet." (ties to the "From the desk of CoachHelm" signoff) so it no longer duplicates CoverHero's own weekly- cover "Standing by — awaiting first pitch." card verbatim. - page-header.tsx (shared calendar header, golf + baseball): the month label was the ONLY header item with `min-w-0` and no floor, so any shortfall in available width dumped entirely onto it even at desktop widths — added `md:`/`lg:` min-width floors (mobile keeps the original unconstrained behavior) and `shrink-0` on the nav/Today controls so they stop competing with the title for space. - PremiumEventBlock.tsx (month-view event chip, golf + baseball): the title span was a flex item without `min-w-0`, so `truncate`'s ellipsis never actually activated — a long title overflowed the pill and got hard -clipped (no ellipsis) at the day cell's edge instead of eliding. Gates: npx tsc --noEmit (0 errors) — npx eslint on every changed file (0 errors/warnings) — npx vitest run --project unit (full suite: 557 files, 5413 passed, 14 pre-existing skips, 0 failed), including the new demo-program-sim.test.ts (17 tests covering determinism + every by-construction invariant) and the existing scripts-no-committed-secrets.test.mjs / verify-baseball-demo-coverage tests. Also hand-verified the season generator via a standalone tsx run (20/20 games self-consistent, 9-11 record, believable score lines). Caveats: the seed script is shipped REVIEWED-ONLY — never executed against the shared prod Supabase from this session; a human runs --confirm. Season dates are evergreen (computed from "now" each run, not hardcoded to 2026) so a future re-run still reads as a just-finished spring instead of going stale. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMdviLDsAg2YYJ8adsM6fg
|
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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
🤖 Mission Control — PR summary What it changes: Populates the public BaseballHelm demo program (#912) + Command Center / calendar polish (#911). Adds idempotent Area: BaseballHelm. Risk / reviewers watch:
CI: 4 required gates green. CodeRabbit advisory + |
Problem
The public BaseballHelm demo ("Demo University Baseball", entered via
/baseball/demo) promises "fully-populated" but — once past the Phase-1 seed (scripts/seed-baseball-demo.ts) — actually shows an empty program:Separately (#911 polish):
CoverHero's weekly-cover letter and the morning-brief letter), reading as a bug rather than two distinct honest empty states."J…"at desktop widths, and a long event title in the month-view grid clipped hard (no ellipsis) at the day cell's right edge instead of eliding.Fix
New idempotent seed script —
scripts/seed-baseball-demo-program.ts(Phase 4 of the existing demo-seed family; re-derives Phase-1's org/team/coach/roster ids the same wayseed-baseball-lifting-demo.tsalready does, rather than re-seeding them):now, not hardcoded), with box-score-levelbaseball_box_score_batting/baseball_box_score_pitchinglines for the roster's 6 hitters + 2 pitchers. Generated by a new deterministic simulator,src/lib/baseball/seed/demo-program-sim.ts, whose invariants — team runs == sum of battingr, runs allowed == sum of pitchingr, IP always sums to exactly 9 — are enforced by construction (derived from the simulation, never independently targeted and reconciled after the fact).baseball_player_season_statsis then derived via the samerecalculate_baseball_season_statsRPC the app's own box-score save flow calls — never a hand-authored aggregate row.status='active')baseball_coach_insightsrisk flags, each citing real seeded data (a pitcher-workload flag, a batting cold-streak flag, a stale-recruiting-outreach flag).baseball_playersrows (recruiting_activated=true, nevercollegetype) inbaseball_watchlistsacross all 4 active pipeline stages (watchlist/high_priority/offer_extended/committed).baseball_events(practices, a team meeting, a fall exhibition) + 2 morebaseball_practices(with blocks), so Practice Planner shows more than Phase-1's single practice.Safety: dry-run by default (prints the plan, writes nothing);
--confirmrequired to write; every id is deterministic (sha1under its own namespace, distinct from every sibling seed script's); every write is.upsert(..., { onConflict })— no.delete()anywhere. Wired into the existingnpm run seed:baseball:demochain, andscripts/verify-baseball-demo-coverage.ts+docs/seed/BASEBALLHELM_DEMO_DATA_CONTRACT.mdupdated to reflect the newly-covered surfaces (baseball_games, box scores,baseball_watchlistsmoved out of "intentionally empty").UI polish (#911):
CommandCenterFairway.tsx: the morning-brief empty state now reads "Standing by — the desk is quiet." (calls back to the "— From the desk of CoachHelm" signoff already on that card) instead of duplicatingCoverHero's own weekly-cover "Standing by — awaiting first pitch." verbatim.page-header.tsx(shared calendar header, golf + baseball): the month-label<h2>was the only header item withmin-w-0and no floor — any shortfall in available width (even a small one at desktop widths) dumped entirely onto it via the flex-shrink algorithm, collapsing "September 2026" down to"J…". Addedmd:/lg:min-width floors (mobile keeps the original unconstrainedmin-w-0— the fix that already exists there for the 390px Today-pill-clipping case is untouched) andshrink-0on the nav-arrows/Today controls so they stop competing with the title for space.PremiumEventBlock.tsx(month-view event chip, golf + baseball): the title<span>was a flex item of its row withoutmin-w-0, sotruncate'soverflow:hidden/ellipsis never actually activated (flex items default tomin-width:auto, refusing to shrink below their content). A long event title overflowed the pill and got hard-clipped (no ellipsis) at the day cell's edge — visible at the calendar's right edge for the rightmost day-of-week column. Fixed withmin-w-0on the title span.Gates
npx tsc --noEmit -p tsconfig.json— 0 errors (full project)npx eslint <every changed/new file>— 0 errors, 0 warningsnpx vitest run --project unit— full suite: 557 files, 5413 passed, 14 pre-existing skips, 0 failed. Includes the newsrc/lib/baseball/seed/__tests__/demo-program-sim.test.ts(17 tests: determinism, tie-avoidance, and every invariant above, individually asserted per-game rather than spot-checked) and the existingscripts-no-committed-secrets.test.mjs(extended with the new script's allowlisted demo-password literal) andverify-baseball-demo-coverage.test.ts(unaffected — confirmed vianode --testsince that suite isn't wired into vitest, same as its 46 siblings).tsxrun outside the repo (20/20 games self-consistent under every invariant, 9-11 record, believable per-game score lines and season batting lines .244–.387) — not committed, scratch-only.Caveats
.env.localin this environment, and per instructions this ships as a script for a human to run with--confirm).docs:checkreports pre-existing, unrelated inventory drift onmemory/projects/golfhelm.md(new admin/golf routes from already-merged PRs this branch didn't touch) — confirmed unrelated and left untouched rather than folded into this diff.Fixes #912. Part of #911.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01MMdviLDsAg2YYJ8adsM6fg