feat(forms): add SelectField for labelled, accessible selects - #8101
feat(forms): add SelectField for labelled, accessible selects#8101talissoncosta wants to merge 4 commits into
Conversation
Adds a SelectField component: the design-system counterpart to InputGroup for a react-select control. It wires the label, inline error, and aria relationships off a single id (htmlFor -> inputId, aria-invalid, aria-errormessage), which the InputGroup `component` slot does not do. First cut only. No call sites migrated yet; the error-state styling and react-select aria verification are follow-ups tracked in SELECT_FIELD_MIGRATION.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a generic Estimated code review effort: 2 (Simple) | ~10 minutes 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. Comment |
Records the decision to drop the Select E2E (TestCafe-era) fork in its own Select-only PR, after the SelectField call-site migration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Target selects by role and accessible name rather than data-test, so the E2E suite doubles as an accessibility regression guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Docker builds report
|
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #18799 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-16 — run #18799 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-16 — run #18799 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #18799 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to #7364
Adds
SelectField, the design-system counterpart toInputGroupfor a react-select control.Today, a labelled select is built as
<InputGroup component={<Select />} />. That slot renders the control with no accessibility wiring: the label'shtmlForpoints at an id nothing has, the select is never marked invalid, and the error text is not linked to it.SelectFieldwires all of it off one id: labelhtmlForto the select'sinputId, plusaria-invalidandaria-errormessageto theFieldError.This is a first cut. No call sites are migrated yet. The error-state styling (so consumers stop hand-rolling the red border via react-select
styles) and verifying the exact aria forwarding through react-select v5 are deliberate follow-ups, kept out to keep this reviewable. The full plan to retire thecomponentprop is infrontend/SELECT_FIELD_MIGRATION.md.How did you test this code?
Manually, via the Storybook story (
Components/Forms/SelectField): Default, Required, WithTooltip, WithError, Disabled. Lint passes on the new files. Note the repo's localtscbaseline is noisy in a fresh worktree, so CI typecheck is the authority here;SelectField.tsxintroduces no new errors.