Skip to content

Certificates, den placement, racer stats & UI polish#19

Merged
Rio517 merged 6 commits intomainfrom
certificate-updates
Mar 12, 2026
Merged

Certificates, den placement, racer stats & UI polish#19
Rio517 merged 6 commits intomainfrom
certificate-updates

Conversation

@Rio517
Copy link
Copy Markdown
Contributor

@Rio517 Rio517 commented Mar 12, 2026

Summary

  • Den placement strip on racer profile — shows "3rd in Wolves" below the banner with den-specific accent colors (top 3 always shown, hide bottom 2)
  • Best Lane stat card — replaces wins card when racer has 0 wins; computed from avg time (or avg place fallback)
  • Certificate print overhaul — landscape A4 scaling, white print background, larger text, absolute medal positioning, +30% den icons, doubled stat gaps
  • Light-accent dens — Bears/AOLs/Lions use DENS_WITH_LIGHT_ACCENT for text contrast on both profiles and certificates
  • Nav & label updates — "Schedule" → "Races", completed tab → "History", completed events redirect to standings
  • Race Format accessible without selecting an event
  • Race Complete buttons matched to same height (h-14)
  • Webelos image fixmax-w-12 prevents cropping of tall SVG in standings
  • Extracted racer-stats.tsbestLane() and computeRacerStats() shared between profiles and certificates
  • Tests — 8 new bestLane tests, updated shouldShowDenRank and classifyRacer tests

Screenshots

Racer Profile (den placement strip + best lane)

racer-profile-with-photo

racer-profile-no-photo

Certificate

certificate

Heat Schedule ("Races" nav, "History" tab)

heat-schedule

Standings (Webelos icon fix)

standings

Test plan

  • bun test — bestLane, den-rankings, classifyRacer tests pass
  • Visual check: racer profile den strip colors for each den
  • Print certificate to landscape A4 — no gaps, white background
  • Select completed event → lands on standings
  • Race Format accessible with no event selected

🤖 Generated with Claude Code

Rio517 and others added 5 commits March 12, 2026 18:01
…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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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>
@Rio517 Rio517 force-pushed the certificate-updates branch from 2db51a5 to 6bd56e5 Compare March 12, 2026 17:19
@Rio517 Rio517 merged commit 088b8f0 into main Mar 12, 2026
3 checks passed
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