Repository navigation
[Component Audit] ComplexSelector: the trigger is a combobox field on both paths - #6991
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Thanks for a careful, evidence-first audit — the rendered state matrix and the decision to record the two trigger gaps honestly, rather than baselining or quietly fixing them, make this easy to trust.
One maintainer decision is needed before approval: which public semantic contract should the trigger use in both modes — a combobox-like field control that can validly expose required/disabled state and preserve accepted BaseProps, or a disclosure button whose API is narrowed to only the states and inputs that role can honor? Approval waits on a maintainer providing or identifying the governing spec for that contract.
The two findings that follow from the decision are already well recorded in the change:
- The built-in trigger emits a required attribute its button role does not support, which fails the accessibility audit critically.
- Caller-rendered mode does not project disabled state or inherited BaseProps onto the caller control, so accepted inputs silently stop working in that mode.
No runtime change is requested until the contract is chosen; once it is, those two items become the required follow-through. Everything else — the contract record, the Chromium evidence, and the fail-closed CI wiring — reads as ready.
[Automated review]
2ff5a80 to
1e46355
Compare
Rebased onto main. The record now describes main's behavior (secondary variant, field part styling props, aria-disabled with a kept tab stop, BaseProps on the caller control) and records DEC-1: the trigger plays the combobox role with a dialog popup on both paths, so aria-required is valid and a caller-rendered control carries required and disabled state. The audit matrix, Chromium evidence, and CI step from the original audit are kept; tests that found the trigger as a button now find a combobox.
1e46355 to
e70405a
Compare
|
/approve-spec e70405a |
There was a problem hiding this comment.
Thanks: the combobox trigger fixes the missing required-state announcement, and the owner decision is recorded for this head. Two follow-ups are needed before merge:
- An Astryx
ButtonorIconButtonused as therenderTriggercontrol, which is the prop's own example, overwrites the handed-backaria-disabledandaria-busy, so a disabled selector is announced as enabled; lettingButtonkeep a supplied value, with a test, would fix it. - AR6 says invalid state is heard on both paths, but the caller-rendered control never receives
aria-invalid; narrow AR6 to the built-in trigger, as FR7 already does, or hand backaria-invalidfor an error status.
[Automated review]
| 'aria-controls': contentId, | ||
| 'aria-busy': isBusy || undefined, | ||
| 'aria-required': isEffectivelyRequired ? 'true' : undefined, | ||
| 'aria-disabled': isDisabled ? 'true' : undefined, |
There was a problem hiding this comment.
With an Astryx Button or IconButton as the control (the JSDoc example and the audit-matrix story), this value never reaches the DOM. Button.tsx spreads its props and then writes aria-disabled={useAriaDisabled || undefined} and aria-busy={isLoadingState || undefined}, so a disabled selector is exposed as an enabled combobox while presses do nothing. Letting Button keep a supplied aria-disabled and aria-busy, plus a disabled case with a Button control in the trigger-semantics suite, would close this.
| - **AR3 — Focus lifecycle.** The popup autofocuses its content through the Popover owner, and every supported close route returns focus to the current trigger before `onOpenChange(false)` runs. | ||
| - **AR4 — Content responsibility.** Caller content supplies the role, name, keyboard model, selected state, and focus navigation appropriate to its own selection pattern. | ||
| - **AR5 — Direction and viewport.** Logical placement and alignment mirror with inherited direction, and the scrollable popup content remains reachable at 320 CSS px. | ||
| - **AR6 — One trigger role.** Both paths expose the same combobox role and state, so a person hears required, invalid, busy, and disabled state whichever control opens the popup. |
There was a problem hiding this comment.
The handed-back props carry no aria-invalid, and status is not rendered with renderTrigger, so a caller-rendered control is announced as valid. FR7 and the validation row already limit invalid state to the built-in trigger. Either narrow AR6 to match, or hand back aria-invalid for an error status.
|
/approve-spec 02d8551 |
There was a problem hiding this comment.
Thanks: making the trigger a combobox fixes the missing required-state announcement, and the owner decision is recorded for this revision. Three follow-ups are needed before merge:
- An Astryx
ButtonorIconButtonused as therenderTriggercontrol, which is the prop's own example, overwrites the handed-backaria-disabledandaria-busy, so a disabled selector is announced as enabled; lettingButtonkeep a supplied value, with a test, would fix it. - AR6 says invalid state is heard on both paths, but the caller-rendered control never receives
aria-invalid; narrow AR6 to the built-in trigger, as FR7 already does, or hand backaria-invalidfor an error status. - The new Chromium audit spec reads the focus ring and the chevron from the trigger button, but both live on the control box, so its built-in focus test fails; point that locator at the
.astryx-complex-selectorbox.
[Automated review]
| for (const baseScenario of BUILTIN_INTERACTION_CASES) { | ||
| const {errors} = await loadScenario(page, baseScenario); | ||
| const trigger = page.getByRole('combobox', {name: 'Selected medium'}); | ||
| const owner = page.locator('[data-testid="rtl-trigger"]'); |
There was a problem hiding this comment.
[data-testid="rtl-trigger"] is the trigger <button> (data-testid reaches it through rest), but the field's keyboard ring is painted on the control box (focusOutlineStyles.focusWithin) and the button keeps outline: none. Replaying these steps in Chromium, the button is focused and matches :focus-visible yet reports outline-style: none and box-shadow: none, so the assertion at lines 676–678 fails, and owner.locator('svg') at 730–731 finds no chevron inside the button. Reading the paint and the indicator from the control box, for example page.locator('.astryx-complex-selector').filter({has: page.locator('[data-testid="rtl-trigger"]')}), would fix both.
… Button trigger carries the selector's state; narrow AR6 invalid state to the built-in trigger
|
/approve-spec bcc2f65 |
There was a problem hiding this comment.
Thanks: the trigger is now a combobox that carries required, disabled and busy state on both the built-in and renderTrigger paths, and the earlier Button, AR6 and audit-spec follow-ups are fixed. One change is needed before merge: the record's Contract at a glance still says "No API changes" in its Public contract row and names no migration in Builder impact (packages/core/src/ComplexSelector/ComplexSelector.spec.md:42, :45). Please state the four new ComplexSelectorRenderTriggerProps members and the combobox role there, and name the move from getByRole('button') to getByRole('combobox') that the Changeset already describes.
[Automated review]
| | Public contract | No API changes in this observational record. Current source exports one controlled rich-selector shell, its public props and supporting types, an imperative handle, a content render function, an optional `renderTrigger` seam governed by `spec:AST-055`, and named `container*`/`control*` styling targets in place of root styling props. | | ||
| | Behavior | The built-in path composes Field, one combobox trigger whose popup is a dialog, an indicator, and a mounted dialog popup. The caller-rendered path replaces the Field and built-in trigger chrome with one unwrapped caller control that carries the same combobox role and state, while ComplexSelector keeps anchoring, open state, popup wiring, focus return, and the popup. | | ||
| | End-user impact | People selecting through rich custom content receive one named combobox trigger that announces required, busy, and disabled state (and invalid state on the built-in trigger), keyboard and pointer opening, focus restoration, and a popup that remains reachable across logical placement and viewport direction. | | ||
| | Builder impact | Builders provide controlled value plus custom dialog content. They may use the built-in field trigger, call the imperative handle, or spread one exported trigger-props object onto a caller-rendered control, which then becomes the selector's combobox field. | |
There was a problem hiding this comment.
This projection still reads "No API changes in this observational record", and Builder impact names no migration, while FR10/AR2 and the code add role, aria-label, aria-required and aria-disabled to ComplexSelectorRenderTriggerProps and make the trigger a combobox on both paths. The knowledge-contracts projection asks this row to state the exact public delta and Builder impact to name migration work, so stating the four members and the combobox role here, and the getByRole('button') to getByRole('combobox') move in Builder impact, would close it.
…he contract projection
|
/approve-spec dde9075 |
There was a problem hiding this comment.
Thanks: the trigger is now a combobox that carries required, disabled and busy state on both the built-in and renderTrigger paths, the owner decision is recorded for this revision, and the earlier follow-ups (Button state, AR6, the audit locator and the contract projection) are all addressed. This looks ready to merge. One optional polish: the record's Builder impact row could also say that a renderTrigger control is now named by label, so a test that finds such a control by its visible text needs the new name as well as the new role.
[Automated review]
| | Public contract | The trigger plays the combobox role on both paths (DEC-1), and `ComplexSelectorRenderTriggerProps` carries `role`, `aria-label`, `aria-required`, and `aria-disabled` beside its existing ref, id, handlers, and popup props. Current source exports one controlled rich-selector shell, its public props and supporting types, an imperative handle, a content render function, an optional `renderTrigger` seam governed by `spec:AST-055`, and named `container*`/`control*` styling targets in place of root styling props. | | ||
| | Behavior | The built-in path composes Field, one combobox trigger whose popup is a dialog, an indicator, and a mounted dialog popup. The caller-rendered path replaces the Field and built-in trigger chrome with one unwrapped caller control that carries the same combobox role and state, while ComplexSelector keeps anchoring, open state, popup wiring, focus return, and the popup. | | ||
| | End-user impact | People selecting through rich custom content receive one named combobox trigger that announces required, busy, and disabled state (and invalid state on the built-in trigger), keyboard and pointer opening, focus restoration, and a popup that remains reachable across logical placement and viewport direction. | | ||
| | Builder impact | Builders provide controlled value plus custom dialog content. They may use the built-in field trigger, call the imperative handle, or spread one exported trigger-props object onto a caller-rendered control, which then becomes the selector's combobox field. Test code that finds the trigger with `getByRole('button')` uses `getByRole('combobox')`. | |
There was a problem hiding this comment.
Optional: a renderTrigger control is now named by label (AR2), so a test that finds a text-labelled control by its text needs the new name as well as the new role, as ComplexSelector.test.tsx:518 did. Saying so here would complete the migration line.
User impact
A screen-reader user filling in a required ComplexSelector was never told it was required: the trigger was a button, and browsers drop
aria-requiredon a button. A disabled trigger rendered throughrenderTriggerwas also not announced as unavailable. After this change the trigger is a combobox whose popup is a dialog, on both the built-in and caller-rendered paths, so required, invalid, busy, and disabled state reach assistive technology wherever the popup opens from.What changed
role="combobox"(it keepsaria-haspopup="dialog",aria-expanded,aria-controls). WithrenderTrigger, the handed-back props addrole: 'combobox',aria-required,aria-disabled, and anaria-labelfromlabelunless the selector is givenaria-labeloraria-labelledby: a combobox takes no name from its content. A disabled caller control keeps its tab stop and no press or key opens it or reaches a handler (spec:AST-085). Button keeps a caller-suppliedaria-disabledandaria-busy, so an AstryxButtonorIconButtonused as the control (the prop's own example) carries the selector's disabled and busy state instead of overwriting it.component:ComplexSelectoris rebased onto main (secondary variant,container*/control*part styling,aria-disabledwith a kept tab stop, BaseProps on the caller control) and records DEC-1: the trigger is a combobox field on both paths. Invalid state reaches the built-in trigger only, where the status message renders (FR7, AR6).buttonnow find acombobox(ComplexSelector, TransferListSelector composition, disabled-trigger focus spec). New tests cover the built-in required combobox and the caller control's role, required, and disabled state.API
ComplexSelectorRenderTriggerPropsgainsrole,aria-label,aria-required, andaria-disabled.getByRole('button')on the trigger becomesgetByRole('combobox'). The changeset says so.Authority
component:ComplexSelectorDEC-1 (decider cixzhang, 2026-10-24)spec:AST-085FR1, FR2, FR4;spec:AST-055FR1–FR7;family:input-fieldsFR10Writing rubric results
Testing
vitest run packages/core/src/ComplexSelector packages/lab/src/TransferList packages/core/src/__tests__/BusyOwnerAnnouncement.test.tsx: 208/208 passed;packages/core/src/Button packages/core/src/IconButton packages/core/src/ComplexSelector: 200/200 passedpnpm check:knowledge: aligned