Repository navigation
fix(core): MultiSelector search trigger no longer carries aria-required - #12123
josephfarina wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC |
|---|---|---|
| MultiSelector · Storybook | 103.5 kB (+202 B) · 17.8 kB CSS (0) | 2,754 (+28) |
| PowerSearch | 310.7 kB (+133 B) · 25.6 kB CSS (0) | — |
| richtext/RichTextEditorToolbar | 309.4 kB (+125 B) · 454 B CSS (0) | — |
45 more components
| Component | Size | LoC |
|---|---|---|
| Selector | 115.0 kB (+109 B) · 18.7 kB CSS (0) | — |
| Pagination | 147.9 kB (+103 B) · 19.1 kB CSS (0) | — |
| richtext/RichTextEditor | 308.1 kB (+4 B) · 2.7 kB CSS (0) | — |
| CheckboxListItem | 80.4 kB (+1 B) · 12.1 kB CSS (0) | — |
| Field | 59.9 kB (+1 B) · 7.3 kB CSS (0) | — |
| RadioList | 61.2 kB (+1 B) · 7.4 kB CSS (0) | — |
| Tokenizer | 106.0 kB (+1 B) · 20.4 kB CSS (0) | — |
| lab/ListInput | 95.3 kB (+1 B) · 922 B CSS (0) | — |
| CheckboxInput | 69.5 kB (0) · 10.2 kB CSS (0) | — |
| ComplexSelector | 78.9 kB (0) · 12.7 kB CSS (0) | — |
| ContextMenu | 103.5 kB (0) · 18.8 kB CSS (0) | — |
| DateInput | 203.3 kB (0) · 18.0 kB CSS (0) | — |
| DateTimeInput | 226.8 kB (0) · 19.8 kB CSS (0) | — |
| DropdownMenu | 108.9 kB (0) · 18.9 kB CSS (0) | — |
| FieldLabel | 55.7 kB (0) · 5.8 kB CSS (0) | — |
| FileInput | 75.4 kB (0) · 11.7 kB CSS (0) | — |
| InputGroup | 61.4 kB (0) · 7.9 kB CSS (0) | — |
| ListItem | 79.6 kB (0) · 12.1 kB CSS (0) | — |
| Markdown | 205.3 kB (0) · 22.1 kB CSS (0) | — |
| MoreMenu | 109.2 kB (0) · 18.9 kB CSS (0) | — |
| NumberInput | 104.2 kB (0) · 12.2 kB CSS (0) | — |
| RadioListItem | 76.5 kB (0) · 10.7 kB CSS (0) | — |
| SelectorOption | 24.2 kB (0) · 6.7 kB CSS (0) | — |
| Slider | 115.0 kB (0) · 8.9 kB CSS (0) | — |
| Table | 121.7 kB (0) · 19.8 kB CSS (0) | — |
| TableCell | 104.7 kB (0) · 19.3 kB CSS (0) | — |
| TableHeaderCell | 104.5 kB (0) · 19.1 kB CSS (0) | — |
| TextArea | 92.8 kB (0) · 9.4 kB CSS (0) | — |
| TimeInput | 178.0 kB (0) · 17.0 kB CSS (0) | — |
| Typeahead | 89.3 kB (0) · 13.5 kB CSS (0) | — |
| lab/ChatEmojiPicker | 122.8 kB (0) · 773 B CSS (0) | — |
| lab/ChatReactionBar | 124.0 kB (0) · 1.1 kB CSS (0) | — |
| lab/CommentComposer | 180.6 kB (0) · 1.9 kB CSS (0) | — |
| lab/Comments | 379.3 kB (0) · 2.5 kB CSS (0) | — |
| lab/CommentThread | 372.3 kB (0) · 2.4 kB CSS (0) | — |
| lab/EmojiPicker | 118.9 kB (0) · 751 B CSS (0) | — |
| lab/SelectableCardGroup | 69.3 kB (0) · 162 B CSS (0) | — |
| lab/TabBarMoreList | 102.5 kB (0) · 1.8 kB CSS (0) | — |
| lab/TransferList | 136.5 kB (0) · 1.2 kB CSS (0) | — |
| lab/TransferListSelector | 145.4 kB (0) · 1.4 kB CSS (0) | — |
| richtext/RichTextView | 285.3 kB (0) · 2.4 kB CSS (0) | — |
| TextInput | 99.1 kB (−1 B) · 12.0 kB CSS (0) | — |
| CheckboxList | 73.5 kB (−2 B) · 7.8 kB CSS (0) | — |
| DateRangeInput | 101.0 kB (−2 B) · 13.3 kB CSS (0) | — |
| Switch | 109.6 kB (−4 B) · 10.0 kB CSS (0) | — |
Package size: @astryxdesign/core 7.68 MB packed (+1.1 kB); no new dependencies.
Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Current run: CI concluded cancelled; parts of this report may be missing.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Thanks for this fix. The search-mode trigger no longer carries the aria-required that axe flags, and the required state now reaches assistive technology with the list closed and open; a Chromium accessibility-tree check confirms both.
Approval waits on an owner decision and one required fix:
- Spec decision: no current MultiSelector record states the closed trigger's hidden "Required" description (only Selector's record does, for Selector), so an engineering owner needs to decide whether MultiSelector follows Selector's rule here; an engineering owner records that decision by commenting
/approve-spec <full head SHA>on this pull request, and the author may do so as an engineering owner. - Required fix: the required-with-search logic in
MultiSelector.tsx(lines 2527-2538, 2543-2553 and 2726-2730) copiesSelector.tsxinstead of sharing it, so move that decision into the module both selectors already call for optionality (hooks/useResolvedRequired.ts), use it from Selector and MultiSelector, and delete both copies.
A small comment-style suggestion is inline.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- Changeset: the search trigger no longer carries
aria-required: verified (MultiSelector.tsx:2552-2553; Chromium tree). - Changeset: a required field still says so through the label marker in the trigger's name or a hidden "Required" description: verified (
MultiSelector.tsx:2532-2538,:2726-2730; new test cases 2 and 3; Chromium tree). - Changeset: the search box carries
aria-requiredwhile the list is open: verified (MultiSelector.tsx:2039; new test case 4; Chromium tree). - Changeset and body: this matches Selector: verified (
Selector.tsx:2147-2157,:2264-2276,:2371-2375). - Body: on main a required searchable trigger puts
aria-requiredon a plain button: verified (new test case 1 fails on main). - Body: ARIA does not allow
aria-requiredon a button and axe reportsaria-allowed-attr: verified (axe in Chromium fails on main, passes here). - Body: a form template uses a required searchable MultiSelector: verified (
form-wizard-dialog,form-wizard-vertical); axe was not rerun on the templates themselves. - Body: Selector's spec describes this behavior for its search mode: verified (Selector spec, accessibility contract).
- Body: MultiSelector shares the input-field contract and should behave the same: not established; no current MultiSelector record states it (the owner decision above).
- Body: without search, or read-only, the trigger is a combobox and keeps
aria-required: verified (MultiSelector.tsx:2531,:2739; new test case 5). - Body: the hidden description reuses the existing required string only when the marker is not shown: verified (
@astryx.field.required;MultiSelector.tsx:2537-2538). - Body: no prop, type, visual or interaction change: verified (built API surface unchanged; the added text is visually hidden).
- Body: the new test fails 3 of 5 cases on main and passes all 5 after: verified (rerun).
- Body: all 6 MultiSelector test files pass (276 tests): verified (rerun).
- Body: template screenshots are byte-identical and the axe finding is gone at 390 and 1280 px: not rerun on the template; the same axe rule passes here on a fixture with the same props.
- Body: eslint and prettier on the changed files: the Lint workflow passed on this head.
Files:
.changeset/multiselector-search-required.md: clear.packages/core/src/MultiSelector/MultiSelector.searchRequired.test.tsx: clear.packages/core/src/MultiSelector/MultiSelector.tsx: required fix (logic copied from Selector); non-blocking comment-style suggestion.
|
/approve-spec 5d1ad3d |
There was a problem hiding this comment.
Thanks for moving the rule into one hook: both selectors now share it, the search trigger no longer carries the aria-required that axe flags, and the required state reaches the accessibility tree with the list closed and open. The MultiSelector record change is approved for this head, which settles the earlier spec question.
One change is needed before approval:
packages/core/src/Selector/useSearchTriggerRequired.tsxis a new internal module that MultiSelector imports but no spec record names, so either move the rule intouseResolvedOptionalityinhooks/useResolvedRequired.ts, which both selectors already call, or name the module in a record (its usage, why it is needed, and why the existing hook is not enough) and have an engineering owner approve that head.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- Title and changeset: the search trigger no longer carries
aria-required: verified (useSearchTriggerRequired.tsx:63; the new test's first case fails on the base; Chromium accessibility tree). - Changeset: a required field still says so, through the label marker in the trigger's name or a hidden "Required" description: verified (
useSearchTriggerRequired.tsx:56-67; test cases 2 and 3; Chromium tree under a required form default, a calleraria-labeland an InputGroup). - Changeset: the search box carries
aria-requiredwhile the list is open: verified (MultiSelector.tsx:2050; test case 4; Chromium tree). - Changeset and description: this matches Selector: verified (Selector calls the same hook,
Selector.tsx:1271-1281). - Description: on the base a required searchable trigger puts
aria-requiredon a plain button, which axe flags asaria-allowed-attr: verified (red-first test; axe in Chromium fails on the base, passes here). - Description: a form template uses a required searchable MultiSelector: verified (
form-wizard-dialog,form-wizard-vertical). - Description: the shared hook returns the trigger's
aria-required, the description id and the description, and both selectors call it: verified (useSearchTriggerRequired.tsx:62-67;Selector.tsx:1271;MultiSelector.tsx:1225). - Description: Selector's behavior is unchanged and its tests pass: verified (same logic; Selector's search-required and main test files pass).
- Description: MultiSelector's record gains one paragraph and one verification row: verified (
MultiSelector.spec.md:196-202,:344). - Description: Selector's record describes this behavior for its search mode, and MultiSelector should behave the same: verified (Selector's accessibility contract; the MultiSelector paragraph is approved for this head).
- Description: without search, or read-only, the trigger is a combobox and keeps
aria-required: verified (useSearchTriggerRequired.tsx:63;MultiSelector.tsx:2729; test case 5). - Description: the description reuses the existing required string: verified (
@astryx.field.requiredin the English catalog). - Description: no prop, type, visual or interaction change: verified (built API surfaces identical; base and head frames pixel-identical).
- Description: the new test fails 3 of 5 cases on the base and passes all 5 after: verified (rerun).
- Description: the six MultiSelector test files pass (276 tests), and 21 files (630 tests) across both selectors: verified (rerun).
- Description: the axe finding is gone on the form wizard template at 390 and 1280 px, with identical screenshots: not rerun on the template; the same axe rule passes here on stories with the same props, whose frames are pixel-identical.
- Description: eslint and prettier on the changed files: the Lint workflow passed on this head.
Files:
.changeset/multiselector-search-required.md: clear.docs/specs/components/MultiSelector/MultiSelector.spec.md: clear (approved for this head).packages/core/src/MultiSelector/MultiSelector.searchRequired.test.tsx: clear.packages/core/src/MultiSelector/MultiSelector.tsx: clear.packages/core/src/Selector/Selector.tsx: clear.packages/core/src/Selector/useSearchTriggerRequired.tsx: blocking (a new internal module no record names).
|
/approve-spec d33cc71 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the run was refused for capacity, so please re-run all jobs before merging.
Moving the rule into hooks/useResolvedRequired.ts resolves the earlier request: both selectors now call one function, and the new module is gone. The search trigger no longer carries the aria-required that axe flags, and the required state reaches the accessibility tree with the list closed and open in every labelling case. The MultiSelector record change is approved for this head.
- Non-blocking: the reference-page size rule asks a pull request that grows a shared module to state its first-load gzip delta; measured here, docs +0 B, form +2 B, menu +0 B and table +0 B, so one line in the description covers it.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Title: the search trigger no longer carries
aria-required: verified (new test, and the Chromium accessibility tree at both revisions). - Changeset: the trigger button drops
aria-required; the label marker or a hidden "Required" description states the required state; the search box is required while open; this matches Selector: verified (MultiSelector.tsx:2042,:2552,:2725-2729;useResolvedRequired.ts:131-140; both selectors' search-required tests pass). - A form template with a required, searchable MultiSelector shows the axe error: verified (the dialog and vertical form-wizard templates render one; axe fails on the base for that field and passes on the head).
- ARIA does not allow
aria-requiredon a button: verified (axearia-allowed-attr). - The shared rule is one function beside the existing optionality hook, and each component renders the description: verified (
useResolvedRequired.ts:112-141,Selector.tsx:2150,MultiSelector.tsx:2530). - Selector's behavior is unchanged and its tests pass: verified (the removed expressions match the function line for line; 15 Selector files pass).
- The record gains one paragraph and one verification row: verified (
MultiSelector.spec.md:196-202,:344). - No prop, type, visual or interaction change: verified (no public API row in Core or the themes; captured frames are pixel-identical).
- The new test fails 3 of 5 cases on the base and passes 5 of 5 on the head: verified.
- Without search the trigger stays a combobox with
aria-required: verified (test and accessibility tree). - All six MultiSelector test files pass (276 tests); the Selector and MultiSelector folders pass (21 files, 630 tests): verified.
- ESLint and Prettier pass on the changed files: verified.
- Axe passes on the form-wizard template at 390 and 1280 px and its screenshots are unchanged: verified on the same field states (axe passes, frames pixel-identical); the template page itself was not re-run.
Files:
.changeset/multiselector-search-required.md: clear.docs/specs/components/MultiSelector/MultiSelector.spec.md: clear.packages/core/src/MultiSelector/MultiSelector.searchRequired.test.tsx: clear.packages/core/src/MultiSelector/MultiSelector.tsx: clear.packages/core/src/Selector/Selector.tsx: clear.packages/core/src/hooks/useResolvedRequired.ts: clear.
d33cc71 to
ed8d02d
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the run was refused for capacity, so please re-run all jobs before merging.
After the rebase, the search trigger still drops the aria-required that axe flags, the required state reaches the accessibility tree with the list closed and open in every labelling case, and both selectors share one rule. The MultiSelector record change is approved for this head.
- Non-blocking: the reference-page size rule asks a pull request that grows a shared module to state its first-load gzip delta; measured here, docs +0 B, form +0 B, menu +0 B and table −3 B, so one line in the description covers it.
Claims and files checked
Review mode: full; reason: rebase
Claims:
- Title: the search trigger no longer carries
aria-required: verified (the new test, and Chromium's accessibility tree at both revisions). - Changeset: the trigger button drops
aria-required, the label marker or a hidden "Required" description states the required state, the search box is required while open, and this matches Selector: verified (MultiSelector.tsx:2049,:2559,:2732-2736;useResolvedRequired.ts:131-140; both selectors' search-required tests pass). - ARIA does not allow
aria-requiredon a button, checkers flag it, and assistive technology may ignore it: verified (axearia-allowed-attron the base trigger; Chromium's tree gives the base button no required state). - A form template with a required, searchable MultiSelector shows the error: verified for that field configuration (
form-wizard-dialog/page.tsx:477,form-wizard-vertical/page.tsx:1052); the template page itself was not rendered. - The fix copies Selector's behavior, and Selector's own record describes it for search mode: verified (Selector AR1; the function equals the removed Selector expressions).
- The shared rule is one function beside the existing optionality hook, and each component renders the description: verified (
useResolvedRequired.ts:112-141,Selector.tsx:2382,MultiSelector.tsx:2732). - Selector's behavior is unchanged and its tests pass: verified (the Selector folder passes,
Selector.searchRequired.test.tsx5 of 5). - The record gains one paragraph and one verification row: verified (
MultiSelector.spec.md:196-202,:344). - Smallest restoration (trigger keeps
aria-requiredonly as a combobox; hidden description only when the marker is not shown;aria-requiredon the search box): verified (useResolvedRequired.ts:131-139,MultiSelector.tsx:2049). - No prop, type, visual or interaction change: verified (no public API row in Core or the themes; captured frames are pixel-identical).
- The new test fails 3 of 5 cases on the base and passes 5 of 5 on the head: verified.
- Without search the trigger stays a combobox with
aria-required: verified (test and accessibility tree). - Axe passes on the form wizard template at 390 and 1280 px, and its screenshots are unchanged: verified for the same field states at 1280 px (axe passes, frames pixel-identical); the template page and the 390 px width were not re-run.
- All six MultiSelector test files pass (276 tests), and the Selector and MultiSelector folders pass (21 files, 630 tests): verified that all pass; after the rebase they hold 284 tests, and 22 files with 658 tests.
- ESLint and Prettier pass on the changed files: verified (the Lint workflow passes on this head).
Files:
.changeset/multiselector-search-required.md: clear.docs/specs/components/MultiSelector/MultiSelector.spec.md: clear (owner-approved for this head).packages/core/src/MultiSelector/MultiSelector.searchRequired.test.tsx: clear.packages/core/src/MultiSelector/MultiSelector.tsx: clear.packages/core/src/Selector/Selector.tsx: clear.packages/core/src/hooks/useResolvedRequired.ts: non-blocking note (the description does not state the reference-page gzip deltas for this shared module).
- #12618 fix(cli): search's text icons label + icon-ask wording Author: @josephfarina - #12688 docs(cli): experimental icon sets — explain the icon model in one place Author: @josephfarina - #12123 fix(core): MultiSelector search trigger no longer carries aria-required Author: @josephfarina
|
Landed in #12844. |
User impact
A required
MultiSelectorwithhasSearchputsaria-required="true"on its trigger, which is a plain<button>in that mode (the search box is the combobox). ARIA does not allowaria-requiredon a button, so accessibility checkers flag it (axearia-allowed-attr) and assistive technology may ignore it or report it inconsistently. A form template that uses a required, searchableMultiSelectorshows the error.Problem and solution fit
aria-requiredfrom the field's required state. The role-less search trigger receives it too.The fix copies what
Selectoralready does in the same case. The search trigger dropsaria-required. The closed trigger states "required" through the field label's visible marker, which is part of its name, or through a visually hidden "Required" description when the marker is not shown (for example, in a form whose default is required). The search box carriesaria-requiredwhile the list is open.resolveSearchTriggerRequired, in the existinghooks/useResolvedRequired.tsmodule besideuseResolvedOptionality, which both selectors already use. It returns the trigger'saria-requiredand whether the hidden "Required" description is needed; each component keeps rendering that description. Selector's behavior is unchanged; its existing tests pass.component:SelectorAR1's required rule through the shared implementation, plus a verification-map row forMultiSelector.searchRequired.test.tsx.Expected behavior and authority
Selector's record describes this behavior for its search mode: noaria-requiredon the role-less trigger, the required text in the closed trigger's name or description, andaria-requiredon the search input while open.MultiSelectorshares the input-field contract and should behave the same. The ARIA spec listsaria-requiredas unsupported on the button role.Smallest restoration
aria-requiredon the trigger only when it is a combobox (no search, or read-only).@astryx.field.requiredstring, only when the label's marker isn't shown.aria-requiredon the search box.No prop, type, visual or interaction change.
Evidence
aria-required; no required text when the form hides the marker; search box withoutaria-required).aria-allowed-attrfinding on the form wizard template is gone at 390 and 1280 px.aria-required(tested). Screenshots of the template are byte-identical before and after. All 6 MultiSelector test files pass (276 tests).packages/core/src/MultiSelector/MultiSelector.searchRequired.test.tsx.Scope
Components: MultiSelector; Selector (internal: it now calls the shared rule, no behavior change)
Writing rubric results
Testing
vitest --project ui packages/core/src/MultiSelector packages/core/src/Selector(21 files, 630 tests)vitest --project ui packages/core/src/MultiSelector/eslintandprettieron the changed files