🎨 Palette: associate the shared gear Field label with its input - #507
Merged
Merged
Conversation
Field was rendering the label as an unassociated sibling of the input it labels, so a screen reader announced only the input's placeholder (or nothing once typed) rather than the field name. Wrapping the input in the label gives it an implicit association, matching what every other input in the app already gets. Affects the rifle/pellet forms in QuickCapture (quick score capture's add-gear flow) and Gear. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gm6wVPhe2babySKKVDq5jL
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gm6wVPhe2babySKKVDq5jL
jnnngs
marked this pull request as ready for review
September 18, 2026 16:15
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
What and why
💡 What:
Field, the shared label wrapper used across the rifle/pellet forms inQuickCapture.tsx(quick score capture's add-gear flow) andGear.tsx, rendered its<label>as a plain sibling of the<input>it labels — nohtmlFor/idpairing. Fixed by wrapping the input inside the label instead, which gives it an implicit programmatic association (the same effect ashtmlFor, with no id plumbing needed sinceField'schildrenis an arbitraryReactNode).🎯 Why: These are the Make/Model/Calibre/Power (rifle) and Brand/Model/Head size/Weight/Batch code (pellet) inputs used whenever someone adds gear — including mid-flow from Quick Capture, one of the app's highest-traffic screens. Every other input in the app already gets a real label association (per
.jules/palette.md); this one component was the outlier.♿ Accessibility: A screen reader user focusing one of these inputs previously heard only the placeholder text (or nothing, once a value was typed) instead of the field name ("Make", "Head size (mm)", etc.). It also means clicking the label text now focuses its input, per normal browser label behaviour.
How you tested it
cd frontend && npm run check— passes (tsc -b)cd frontend && npm run lint— passescd frontend && npx vitest run src/pages/__tests__/QuickCapture.test.tsx— 6/6 passing (Gear.tsxhas no dedicated page test file)<Field>usage in both files wraps exactly one plain<input>(no nested comboboxes/multi-control children that implicit labelling could break)Checklist
cd frontend && npm run check && npm run lintpasses (fullnpm test/npm run buildnot run — see above for the scoped test run instead, per this task's scope)Notes for reviewers
Small, mechanical, single-component change (net +6/-6 lines across 2 files) — no visual change, since
.blockon the outer<label>preserves the original layout.🤖 Generated with Claude Code
https://claude.ai/code/session_01Gm6wVPhe2babySKKVDq5jL
Generated by Claude Code