Certificates, den placement, racer stats & UI polish#19
Merged
Conversation
…ents - Add den placement row below profile banner (colored by den accent) - Podium racers get navy strip, others get den-specific colors - Best Lane stat card shown when wins is 0 (extracted to certificate-stats.ts) - shouldShowDenRank: top 3 always shown, hide bottom 2 in larger dens - Den accent updates: Wolves red, Bears turquoise, AOLs gold - Certificate print: scale-based preview matching print proportions - Certificate print: white background, no grey page wrapper - Certificate: larger stats gaps, den icons, medal positioning - Fix Webelos image cropping in standings (h-9 max-w-12) - 8 best-lane tests, updated den-rankings and classify-racer tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move bestLane + computeRacerStats to lib/racer-stats.ts (re-exported from certificate-stats.ts for backwards compat) - Extract DenPlacementStrip component from IIFE in RacerProfileView - Consolidate light-accent den logic into DEN_LIGHT set in den-utils.ts (replaces TOO_LOW_CONTRAST_DENS and inline isLight arrays) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…style
- bestLane: when any lane has timing, only timed lanes compete
(fixes nonsensical ms vs place comparison)
- Scope --cert-scale to .cert-scale-wrapper instead of :root
- Replace inline style={{ width/height }} with Tailwind w-full h-full
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tton heights - Nav "Schedule" → "Races", heats tab "Completed" → "History" - Selecting a completed event navigates to /standings instead of /register - Race Format route no longer requires an active event - Race Complete buttons use explicit h-14 for consistent height - Document den-utils, den-rankings, racer-stats in AGENTS.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR enhances racer-facing UX (profile den placement strip + “Best Lane” stat), overhauls certificate printing/layout, and applies several navigation/label/visual polish updates across the frontend, with supporting shared stat helpers and test updates.
Changes:
- Add den placement strip + “Best Lane” stat card on racer profiles, backed by shared racer analytics helpers.
- Revamp certificate layout/print scaling and improve den accent contrast handling for light accents.
- Update navigation labels/redirect behavior and apply small UI alignment fixes (buttons, icons), plus expand/adjust unit tests.
Reviewed changes
Copilot reviewed 14 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/den-rankings.test.ts | Updates den-rank visibility expectations (top 3 always shown; hide bottom 2). |
| tests/classify-racer.test.ts | Adjusts certificate tier classification tests to match updated den-rank rules. |
| tests/best-lane.test.ts | Adds coverage for new bestLane() logic. |
| src/frontend/views/standings/StandingRow.tsx | Prevents tall den SVGs from being cropped via width constraint adjustment. |
| src/frontend/views/RacerProfileView.tsx | Adds den placement strip UI and “Best Lane” stat card behavior. |
| src/frontend/views/RaceConsoleView.tsx | Normalizes “Race Complete” action button heights. |
| src/frontend/views/HeatsView.tsx | Renames “Completed” tab label to “History”. |
| src/frontend/views/CertificateView.tsx | Implements certificate print/layout overhaul (scaling, spacing, medal positioning, print background). |
| src/frontend/main.tsx | Redirects completed events to standings; makes Race Format route accessible without event; renames nav label to “Races”. |
| src/frontend/lib/racer-stats.ts | Introduces shared racer stat utilities (bestLane, computeRacerStats). |
| src/frontend/lib/den-utils.ts | Adjusts den accent colors and adds DENS_WITH_LIGHT_ACCENT. |
| src/frontend/lib/den-rankings.ts | Updates shouldShowDenRank() rule to always show top 3. |
| src/frontend/lib/certificate-stats.ts | Re-exports racer stat helpers from racer-stats.ts and uses updated den ranking logic. |
| screenshots/13-racer-profile-no-photo.png | Updates snapshot for racer profile UI changes. |
| screenshots/08-race-control-no-photos.png | Updates snapshot for race console button sizing changes. |
| AGENTS.md | Documents new/updated shared frontend helpers in src/frontend/lib/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- bestLane averaged time over all runs including untimed; now uses separate timeCount for timed-only average - Add denPlace guard before showDen for TypeScript strict null narrowing - Add test for mixed timed/untimed runs on the same lane Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2db51a5 to
6bd56e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DENS_WITH_LIGHT_ACCENTfor text contrast on both profiles and certificatesmax-w-12prevents cropping of tall SVG in standingsracer-stats.ts—bestLane()andcomputeRacerStats()shared between profiles and certificatesbestLanetests, updatedshouldShowDenRankandclassifyRacertestsScreenshots
Racer Profile (den placement strip + best lane)
Certificate
Heat Schedule ("Races" nav, "History" tab)
Standings (Webelos icon fix)
Test plan
bun test— bestLane, den-rankings, classifyRacer tests pass🤖 Generated with Claude Code