Skip to content

fix(settings): render athlete stats outside form fields - #627

Merged
zacjones93 merged 34 commits into
codex/settings-profile-form-context-fixfrom
codex/settings-athlete-form-context-fix
Jul 15, 2026
Merged

fix(settings): render athlete stats outside form fields#627
zacjones93 merged 34 commits into
codex/settings-profile-form-context-fixfrom
codex/settings-athlete-form-context-fix

Conversation

@zacjones93

@zacjones93 zacjones93 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • render athlete physical-stat proxy inputs with ordinary shared Label and Input primitives instead of context-dependent React Hook Form field components
  • preserve canonical centimeter/kilogram form values while exposing accessible imperial and metric controls
  • tolerate the local feet/inches formatter's optional trailing quote during hydration
  • add route-level tests and LAT coverage for accessibility, hydration, and submission conversion

Root cause

The feet, inches, and weight controls are display proxies backed by local state, not registered FormField controls. They rendered FormItem, FormLabel, FormControl, and FormDescription without a FormField context, so the shared form invariant threw useFormField should be used within <FormField> before /settings/athlete could render.

Scope

This is stacked on #626 (codex/settings-profile-form-context-fix). It changes only the four athlete physical-stat proxy blocks and their local height hydration regex. Shared form primitives, schemas, server functions, handlers, and PR #625 evidence are unchanged.

Validation

  • tests-first proof: 4/4 focused tests failed before the route edit with the exact useFormField exception
  • focused athlete-settings tests: 4 passed
  • full WODsmith Start suite: 140 files, 2,942 tests passed
  • monorepo pre-push lint: passed (existing warnings only)
  • monorepo pre-push type-check: 12 tasks passed
  • UI inventory freshness: passed
  • page coverage freshness: passed
  • lat check: passed
  • GitNexus impact/detect-changes: LOW risk, 0 affected processes

Summary by cubic

Fixes a crash on /settings/athlete by rendering height and weight proxy inputs outside React Hook Form and introduces shared UI primitives for consistent, accessible layouts across Crew and Start. Improves mobile navigation and admin semantics, and adds focused tests.

  • Bug Fixes

    • Remove useFormField context error by composing imperial/metric stat inputs with plain controls; keep heightCm/weightKg, convert on blur, and hydrate with ^(\d+)'(\d+)"?$.
    • Improve mobile header wrapping and named landmarks; fix movement heading levels; derive demo event dates from the event timezone; stabilize admin headings and link state.
  • New Features

    • Add @repo/ui/field, @repo/ui/empty-state, and @repo/ui/metric; adopt them in judges, scaling groups, registration questions, imports, venues, invites, templates, and exports via thin app re-exports.
    • Add Storybook stories and targeted route/component tests for semantics and metric summaries.

Written for commit d6316c1. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8b40eeca-b479-4afb-bd6d-540503b58522

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/settings-athlete-form-context-fix

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.

@zacjones93

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@zacjones93

Copy link
Copy Markdown
Contributor Author

Independent review receipt for 5f91a983a (base 1319da532): LGTM — no blocking findings.

Verified the exact four-file diff. The imperial feet/inches/lbs and metric kg proxy controls now use ordinary Label + Input markup with explicit htmlFor/id and aria-describedby, so they no longer invoke useFormField without FormField context. The canonical form values remain heightCm/weightKg; hydration and 5 ft 10 in / 165 lb submission round-trip to 178 cm / 75 kg as expected. The metric height remains a real FormField, while metric weight keeps the existing canonical-on-blur path. No shared form primitive, schema, server function, handler, or package file changed. Inventory drift is exactly the added Start route label consumer (39→40 route files), and LAT scope matches the new focused tests.

Local verification: focused athlete route tests 4/4 pass; WODsmith Start type-check passes; changed-file Biome passes; lat check passes; git diff --check passes. GitNexus reports the route component as LOW blast radius with no upstream dependents (its whole-stack compare output is stale/noisy, so I did not treat that aggregate as PR evidence).

CI at review time: Start/Crew lint and Crew build pass; branch-stack and GitGuardian pass; Start build plus both E2E shards and Crew demo E2E are still pending. CodeRabbit is green only as a rate-limited status and did not provide a substantive review. Residual risk: this review has route-level jsdom proof but no fresh authenticated browser recapture of /settings/athlete; complete that evidence refresh once the local runtime topology is healthy. The new tests directly cover imperial hydration/submission and both unit-system render/accessibility paths; metric-weight submission is preserved code but is not independently asserted.

@zacjones93

Copy link
Copy Markdown
Contributor Author

Independent evidence-delta review at exact head be6c57a8c: LGTM — no blocking findings.

Findings-first checks:

  • The new commit changes only the two /settings/athlete capture bundles plus the shared capture manifest, manifest-hash cascades in the plan/ledger, the protected-athlete audit, generated ledger Markdown, and LAT. Non-athlete routes change only their shared manifest SHA-256 reference; the only substantive plan/ledger change is athlete settings moving from unassessed/error to route-specific/default with verified evidence.
  • Both captures render the populated form rather than the Something went wrong boundary. Desktop is 1440×900, requested/effective light, and exposes imperial feet/inches/lbs. Mobile is 390×844, requested/effective dark, and exposes metric cm/kg after a local unsaved unit switch. Structured DOM and screenshots agree; both report horizontalOverflow: false.
  • Both console artifacts contain only Vite connection and React DevTools development notices—no warnings or errors. Both network logs contain 552 scrubbed entries, no status >=400, only the allowed method/path/status/resourceType/mimeType fields, no query strings, and no cookies, auth headers, secrets, credentials, absolute /Users paths, or serialized form values. DOM snapshots likewise contain no field values.
  • All target artifact SHA-256 values match disk. The manifest has 33 unique captures / 147 artifacts; the ledger has exactly 33 matching manifest references, with no duplicate, missing, unreferenced, or orphan capture IDs. Both athlete scenario capture IDs and artifact sets match the manifest, and the manifest hash matches in both plan and ledger.
  • Revision provenance is sound: runtime evidence is pinned to 5f91a983a, the direct parent containing the athlete fix; be6c57a8c adds evidence/docs only. Audit/LAT totals reconcile at 327 scenarios = 142 verified / 26 blocked / 159 pending, and disposition counts change only unassessed 177→176 and route-specific 46→47.

Validation: direct check:page-coverage passes (plan and generated ledgers current, including orphan/freshness checks), lat check passes, git diff --check passes, and all 15 live PR checks are green. CodeRabbit is green but skipped substantive review because the PR is draft.

@zacjones93 zacjones93 closed this Jul 15, 2026
@zacjones93
zacjones93 merged commit d6316c1 into codex/settings-profile-form-context-fix Jul 15, 2026
53 of 184 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.

1 participant