Skip to content

feat(stadium): lazy-loading bundle split, CRO registration, and WCAG sweep#10

Open
DigitalBlueprint239 wants to merge 1 commit into
mainfrom
feat/stadium-optimization
Open

feat(stadium): lazy-loading bundle split, CRO registration, and WCAG sweep#10
DigitalBlueprint239 wants to merge 1 commit into
mainfrom
feat/stadium-optimization

Conversation

@DigitalBlueprint239
Copy link
Copy Markdown
Owner

Summary

Stadium-grade frontend optimization for field deployment over LTE — drastic bundle-size cuts, registration funnel CRO, and WCAG AA contrast sweep across all dark-mode surfaces.

1. Lazy-Loading Bundle Split

Three heavy dependencies removed from the initial payload via React.lazy() + <Suspense> and runtime await import():

  • html5-qrcode — Moved to dynamic await import() inside QRScanner.tsx's useEffect. StationMode further wraps QRScanner itself in React.lazy(). Result: QRScanner shell is now a 0.9kB stub; the lib is fetched only when an operator opens a station.
  • SignatureCanvas — Lazy-imported in Register.tsx (Step 3 only). 25.4kB chunk no longer loads for the 90% of registrants who abandon before the waiver.
  • recharts — Extracted from CoachPortal.tsx into a new standalone CoachRadarChart.tsx component, lazy-imported. Result: 327kB chunk only loads when a coach opens compare-mode with ≥2 athletes.

Eager bundle: only index-C3ormUOk.js (467kB / 140kB gzip) loads from index.html. Everything above is dynamic-import-only.

2. Registration CRO — 3-Step Funnel

Register.tsx Step 1 stripped to essentials only: First/Last Name, DOB, Parent Phone. Biometrics (height/weight/position), high school, film URL, and parent contact fields moved to a new optional Step 2. Waiver + signature relocated to Step 3. Progress bar relabeled Essentials → Profile → Waiver. Validation gates redistributed: DOB age (10–19) + phone digits at Step 1, parentEmail at Step 2.

3. WCAG AA Accessibility Sweep

text-zinc-600text-zinc-400 across 18 dark-mode files. Audited each occurrence to avoid regressing 9 light-surface files (modals, white cards, light-pill fallbacks):

  • Replace-all (17): AdminDashboard, LeagueAdminLayout, EnterpriseImporter, ResultsTab, AthletesTab, ProgressionMatrix, HardwareStandby, FilmEmbed, StaffAccessManagement, ComplianceAuditViewer, LeagueDashboard, B2BExports, EventHub, StationSelection, Pricing, CoachPortal, Lookup, NotFound.
  • Targeted (2): AuditTab.tsx (dark table cell only — kept light-pill fallback), AuthCallback.tsx (dark error card).
  • Skipped (9, intentionally light surfaces): Register, ClaimBand, BandsTab, AdminOps, UpdatePassword, SignatureCanvas, StationMode keypad, lib/analytics.ts pill, TrustCenter.

Defeats stadium screen glare and meets WCAG AA contrast ratios on bg-zinc-900 / bg-zinc-950 surfaces.

Test plan

  • npx tsc --noEmit — clean (0 errors)
  • npm run build — clean, 1m 59s, all chunks emitted
  • 127 / 127 tests passing — full suite green
  • Eager bundle confirmed via index.html script-tag inspection — only the main shell loads on cold start
  • html5-qrcode, SignatureCanvas, and recharts confirmed split into dedicated dynamic chunks via dist/assets/*.js size audit
  • Smoke test on staging: cold-load registration flow over throttled LTE, verify Step 1 -> Step 2 -> Step 3 progression
  • Smoke test on staging: open Coach Portal compare-mode, confirm radar chart loads after >=2 selected athletes
  • Smoke test on staging: open StationMode, confirm QR scanner initializes after Suspense fallback
  • Lighthouse contrast audit on /admin, /coach, /station/* routes — confirm 0 contrast violations

Generated with Claude Code

…sweep

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

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

Project Deployment Actions Updated (UTC)
core-elite Ready Ready Preview, Comment May 1, 2026 3:38am

Request Review

@supabase
Copy link
Copy Markdown

supabase Bot commented May 1, 2026

Updates to Preview Branch (feat/stadium-optimization) ↗︎

Deployments Status Updated
Database Fri, 01 May 2026 03:39:34 UTC
Services Fri, 01 May 2026 03:39:34 UTC
APIs Fri, 01 May 2026 03:39:34 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Fri, 01 May 2026 03:39:43 UTC
Migrations Fri, 01 May 2026 03:39:43 UTC
Seeding ⏸️ Fri, 01 May 2026 03:39:13 UTC
Edge Functions ⏸️ Fri, 01 May 2026 03:39:13 UTC

❌ Branch Error • Fri, 01 May 2026 03:39:44 UTC

ERROR: relation "results" does not exist (SQLSTATE 42P01)
At statement: 1
-- ---------------------------------------------------------------------------
-- 1. Add device_timestamp to results
-- ---------------------------------------------------------------------------

ALTER TABLE results ADD COLUMN IF NOT EXISTS device_timestamp BIGINT

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

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