Repository navigation
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 | Visual · A11y · RTL |
|---|---|---|---|
| MultiSelector · Storybook | 108.1 kB (+24 B) · 19.1 kB CSS (0) | 2,856 (+16) | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 8.06 MB packed (−29 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Requesting changes for one wording fix; the code change itself matches AST-011 FR4. In Chromium, a read-only renderTrigger control now reads as combobox "Fruit" with value "Apple" and the localized read-only description, and pressing or clicking it still opens nothing.
- The Changeset (
.changeset/multiselector-readonly-trigger-semantics.md:5) says caller-rendered triggers gain combobox semantics, but only read-only ones change, so reword it, for example: "[fix] Read-only MultiSelector triggers rendered withrenderTriggernow expose the combobox role and the localized read-only description."
Optional: the comment above aria-readonly at MultiSelector.tsx:2603-2606 still says the caller's control must present the read-only state itself, but the selector now announces it through the description. CI has not run on this head yet: a maintainer adds the ci:run label so it runs.
Claims and files checked
- Claim: on the base, a read-only caller control is a plain button with no value or read-only description — verified (Chromium accessibility tree on the base).
- Claim: Chromium does not map
aria-readonlyon the button host — verified (no read-only property on base or head). - Claim: a caller
aria-activedescendantsurvived with no surface — verified (the base keeps it on the control). - Claim: the head exposes combobox, name, value and the localized description — verified (Chromium;
MultiSelector.test.tsx:4014-4069). - Claim: both search configurations keep the caller description — verified (Chromium, search and non-search with a hint).
- Claim: Enter, Space, ArrowDown and click change nothing, and the form still submits
fruit=Apple— verified (Chromium; the native button keeps its tab stop). - Claim: ending read-only restores editable disclosure and caller semantics, and disabled still wins — verified (
MultiSelector.test.tsx:4071-4126). - Claim: the new cases fail against the base source — verified (both read-only cases fail on the base; the two unchanged-path cases pass).
- Claim: the five MultiSelector test files pass, 267 tests — verified.
- Claim: build, TypeScript and Prettier pass — verified (Core build, Core typecheck including tests, Prettier on all three files); the repository-wide strict lint was not rerun, and strict ESLint on both changed source files passes.
- Claim: no new prop, export, wrapper, styling, documentation change or story — verified (no public API change; rendered frames identical).
- Changeset: combobox semantics on caller-rendered triggers — false as worded (only read-only triggers change).
.changeset/multiselector-readonly-trigger-semantics.md— finding (scope wording).packages/core/src/MultiSelector/MultiSelector.tsx— clear (one optional comment note).packages/core/src/MultiSelector/MultiSelector.test.tsx— clear.
There was a problem hiding this comment.
Requesting changes for one accessibility fix. The Changeset wording from the last review is fixed, and read-only caller controls that carry their own aria-label now read as a read-only combobox with the localized description.
- Miss: a read-only
renderTriggercontrol named by its own text, such as<Button {...props} label="Labels" />or<button {...props}>Labels</button>, becomes a combobox with no accessible name because a combobox takes no name from its content (in Chromium it goes from button "Labels" to an unnamed combobox whose value is "Labels"), which breaks AST-011 FR4's "preserve its accessible name"; hand back'aria-label': rest['aria-label'] ?? (ariaLabelledByProp != null ? undefined : label)beside the role atMultiSelector.tsx:2548, asComplexSelector.tsx:888-894does, and add a read-only test with a text-named control.
Optional: the MultiSelector record's verification map (FR7 row) still names the removed read-only test. CI has not run on this head yet: a maintainer adds the ci:run label so it runs.
Claims and files checked
- Claim: on main, a read-only caller control is a plain button with no read-only description — verified (Chromium accessibility tree).
- Claim: Chromium does not map
aria-readonlyon a button host — verified (no read-only property on either side). - Claim: a caller
aria-activedescendantsurvived with no surface — verified (main passes caller props through; the head clears it,MultiSelector.test.tsx:4014-4040). - Claim: read-only now supplies the combobox role, clears the active descendant and joins the localized description after the caller's — verified (
MultiSelector.tsx:2547-2552,:2608-2612; tests:4014-4069). - Claim: the caller still owns the element, name, content and styling — false (a control named by its text loses its name).
- Claim: the change meets the requirement for a focusable, collapsed read-only combobox with its name and value preserved — false for text-named controls; true for controls with their own
aria-label. - Claim: the reproduction control goes from button "Fruit" to combobox "Fruit" with its value and the localized description — verified (Chromium).
- Claim: both search configurations keep the caller description — verified (search test
:4042-4069; the description join does not depend on search). - Claim: Tab, click, Enter, Space and ArrowDown change nothing and form submission keeps the value — verified from code (read-only hands back only the caller's handlers and keeps the hidden inputs); not re-probed in a browser.
- Claim: ending read-only restores editable disclosure and caller semantics, and disabled still wins — verified (
:4071-4126; Chromium editable fixture unchanged). - Claim: the new cases fail against main's source — verified (both read-only cases fail; the two unchanged-path cases pass).
- Claim: the five MultiSelector test files pass, 267 tests — verified.
- Claim: lint, build, TypeScript, Prettier and whitespace checks pass — verified for strict ESLint on the changed source files, the Core and theme builds, the Core typecheck with tests, Prettier on all three files and the whitespace check; the repository-wide lint and full build were not rerun.
- Claim: Chromium trees in English, Korean and French — English re-probed; French covered by the jsdom test; Korean not re-probed.
- Claim: no new prop, export, wrapper, styling, documentation change or story — verified (no public API change; focused frames pixel-identical).
- Claim: public text carries no private context — verified.
- Changeset: read-only
renderTriggertriggers expose the combobox role and the localized read-only description — verified. .changeset/multiselector-readonly-trigger-semantics.md— clear (earlier wording finding fixed).packages/core/src/MultiSelector/MultiSelector.tsx— finding (accessible name of text-named read-only controls).packages/core/src/MultiSelector/MultiSelector.test.tsx— finding (every new read-only case names its control witharia-label, so the name loss is untested).
There was a problem hiding this comment.
Requesting changes for one description fix; the code now meets AST-011 FR4. In Chromium, a read-only renderTrigger control reads as a collapsed combobox named by label, with its value and the localized read-only description, nothing opens it, and the earlier Changeset wording and unnamed-combobox findings are fixed.
- The description says "The caller still owns the element, name, content, and styling", but read-only now names the control from
label(MultiSelector.tsx:2551-2553), so<Button label="Edit fruit" {...props} />or a control with its ownaria-labelbefore the spread becomes combobox "Fruit"; please reword it to say read-only names the control fromlabelunless a name is passed to the selector or placed after the spread.
Optional: the renderTrigger JSDoc (MultiSelector.tsx:980-982) and MultiSelector.doc.mjs:394 still describe only the editable hand-back, so one sentence on the read-only role, name and description would tell builders how to keep a different name. CI has not run on this head yet: a maintainer adds the ci:run label so it runs.
Claims and files checked
- Claim: on the base, a read-only caller control is a plain button with no read-only description — verified (Chromium accessibility tree on the base).
- Claim: Chromium does not map
aria-readonlyon a button host — verified (no read-only state on base or head). - Claim: a caller
aria-activedescendantsurvived with no surface — verified (the base passes caller props through; the new first case fails on the base). - Claim: read-only supplies the combobox role, clears the active descendant and joins the localized description after the caller's — verified (
MultiSelector.tsx:2547-2558,:2614-2618). - Claim: the caller still owns the element, name, content and styling — false (read-only names the control from
label,MultiSelector.tsx:2551-2553). - Claim: editable and disabled paths keep their wiring — verified (editable Chromium trees identical; disabled case
MultiSelector.test.tsx:4109-4130). - Claim: the reproduction control goes from button "Fruit" to combobox "Fruit" with value "Apple" and the localized description — verified (Chromium).
- Claim: both search configurations keep the caller description — verified (Chromium with search; the join does not depend on search).
- Claim: Tab, click, Enter, Space and ArrowDown change nothing, and the form still submits
fruit=Apple— verified (Chromium: focusable, no surface opens, form datafruit=Apple). - Claim: ending read-only restores editable disclosure and caller semantics, and disabled still wins — verified (
MultiSelector.test.tsx:4072-4130). - Claim: the four cases with the base source reproduce the missing combobox — verified (both read-only cases fail on the base; the two unchanged-path cases pass).
- Claim: the five MultiSelector test files pass, 267 tests — verified.
- Claim: lint, build, TypeScript and Prettier pass — verified for strict ESLint on the changed source files, the Core and theme builds, the Core typecheck with tests and docs, and Prettier on all three files; the repository-wide lint and full build were not rerun.
- Claim: Chromium trees in English, Korean and French — verified (Chromium in all three locales, with and without search, and inside an InputGroup).
- Claim: no new prop, export, wrapper, styling, documentation change or story — verified (no public API change).
- Claim: public text carries no private context — verified.
- Changeset: read-only
renderTriggertriggers expose the combobox role and the localized read-only description — verified. .changeset/multiselector-readonly-trigger-semantics.md— clear.packages/core/src/MultiSelector/MultiSelector.tsx— clear in code (optional documentation note).packages/core/src/MultiSelector/MultiSelector.test.tsx— clear.
8e602ee to
e8af6a7
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet; a maintainer adds the ci:run label so it runs. The description now matches the code, which resolves the last review's only finding; in Chromium a read-only renderTrigger control reads as a collapsed combobox named by label, with its value and the localized read-only description, nothing opens it, and the form still submits its value.
- Optional: the
renderTriggerJSDoc (MultiSelector.tsx:995-997) andMultiSelector.doc.mjs:394still describe only the editable hand-back, so one sentence on the read-only role, name and description would tell builders how to keep a different name.
Claims and files checked
- Claim: on the base, a read-only caller control is a plain button with no read-only description — verified (Chromium accessibility tree on the base).
- Claim: Chromium does not map
aria-readonlyon a button host — verified (no read-only state on base or head). - Claim: a caller
aria-activedescendantsurvived with no surface — verified (the base passes caller props through; the first new case fails on the base). - Claim: read-only supplies the combobox role, clears the active descendant and joins the localized description after the caller's — verified (
MultiSelector.tsx:2562-2573,:2631-2635). - Claim:
labelis the read-only name fallback because a combobox takes no name from its content — verified (MultiSelector.tsx:2566-2568; removing it fails the first case). - Claim: a name passed to the selector, or set after the spread, takes precedence — verified (Chromium;
MultiSelector.test.tsx:4135-4170). - Claim: the caller still owns the element, content and styling — verified (no element, class or style is handed back).
- Claim: editable and disabled paths keep their wiring — verified (Chromium trees identical on base and head;
MultiSelector.test.tsx:4172-4193). - Claim: the reproduction control goes from button "Fruit" with no value or description to combobox "Fruit" with value "Apple" and the localized description — verified (Chromium).
- Claim: both search configurations keep the caller description — verified (Chromium with and without search).
- Claim: Tab, click, Enter, Space and ArrowDown change nothing, and the form still submits
fruit=Apple— verified (Chromium: focusable, no surface opens, form datafruit=Apple). - Claim: ending read-only restores editable disclosure and caller semantics, and disabled still wins — verified (
MultiSelector.test.tsx:4135-4193). - Claim: the four cases with the base source reproduce the missing combobox in the ordinary and localized search cases — verified (both read-only cases fail on the base; the two unchanged-path cases pass).
- Claim: the five MultiSelector test files pass — verified (272 tests at this head; the rebase brought five more from the base branch than the 267 the description lists).
- Claim: lint, build, TypeScript, Prettier and the diff check pass — verified for strict ESLint on the changed source files, the Core and theme builds, the Core typecheck with tests and docs, Prettier on all three files and the diff check; the repository-wide lint and full build were not rerun.
- Claim: Chromium trees in English, Korean and French, with and without search — verified (Chromium in all three locales, and inside an InputGroup).
- Claim: no new prop, export, wrapper, styling, documentation change or story — verified (no public API change).
- Claim: public text carries no private context — verified.
- Changeset: read-only
renderTriggertriggers expose the combobox role and the localized read-only description — verified. .changeset/multiselector-readonly-trigger-semantics.md— clear.packages/core/src/MultiSelector/MultiSelector.tsx— clear (optional documentation note).packages/core/src/MultiSelector/MultiSelector.test.tsx— clear.
|
/approve-spec e8af6a7 |
|
@cixzhang Thanks for adding |
|
/approve-spec e8af6a7 |
There was a problem hiding this comment.
Approved pending CI: the required build and test checks are deferred until review passes, so they have not finished on this head yet.
A read-only renderTrigger control now reads as a collapsed combobox named by label, with its value and the localized read-only description, as AST-011 FR4 asks; the new tests fail on the base and pass here, and Chromium's accessibility tree confirms it while editable and disabled controls stay unchanged.
- Optional: the MultiSelector record's FR7 verification row still names the old test title ("a read-only selector advertises no panel on the caller's control"), so it should follow the rename.
- Optional: the
renderTriggerJSDoc could add that a read-only control also getsrole="combobox", a name fromlabeland the read-only description, which replace a role oraria-labelwritten before the spread.
Claims and files checked
Review mode: full; reason: merge-touches-pr-files
- Changeset: read-only
renderTriggercontrols expose the combobox role and the localized read-only description: verified (MultiSelector.tsx:2601-2612,:2670-2674; read-only tests; Chromium tree). - On the base the read-only caller control is a plain button with no read-only description: verified (Chromium tree on the base: button named by its value, no description).
aria-readonlyalone does not help because Chromium drops it on a button host: verified (no read-only property in Chromium's tree on the base or the head).- The read-only branch adds the combobox role, clears the active descendant, and joins the localized description after the caller's: verified (
MultiSelector.tsx:2601-2612; tests atMultiSelector.test.tsx:4337and the search-mode case). labelnames the read-only control unless the selector getsaria-labeloraria-labelledby, or the control sets one after the spread: verified (MultiSelector.tsx:2605-2607,:2615-2617; tests).- The caller still owns the element, content and styling, with no new prop, export, wrapper, styling, docs or story: verified (no public API rows; base and head frames pixel-identical; three files changed).
- Editable and disabled paths keep their wiring, and disabled wins: verified (the read-only-ends and disabled tests; Chromium tree unchanged for both).
- Search and non-search modes keep the caller's description: verified (the caller branch ignores
hasSearch; Chromium description "From your profile. Read only"). - Tab, click, Enter, Space and ArrowDown open nothing and keep the value, and the form still submits it: verified (Chromium probe; form data
fruit=Apple). - The new test group reproduces the missing combobox on the base source: verified (2 of 4 fail on the base, all pass on the head).
- All MultiSelector tests pass, 5 files and 267 tests: outdated (this head has 7 files and 287 tests, all passing).
- Strict ESLint and the build pass: verified (rerun at this head).
- Public text carries no internal context: verified.
- File
.changeset/multiselector-readonly-trigger-semantics.md: clear. - File
packages/core/src/MultiSelector/MultiSelector.tsx: clear. - File
packages/core/src/MultiSelector/MultiSelector.test.tsx: clear; the record's FR7 row still names the renamed test (optional note above).
There was a problem hiding this comment.
Approved pending CI: the heavy build and test checks are deferred until review passes, so they have not run on this head yet; they run before merge.
A read-only renderTrigger control now reads as a collapsed combobox named by label, with its value and the localized read-only description, as AST-011 FR4 asks. The new tests fail without the fix, and the merges from main leave this path unchanged.
- Optional: the MultiSelector record's FR7 verification row still names the old test title ("a read-only selector advertises no panel on the caller's control"), so it could follow the rename.
- Optional: the
renderTriggerJSDoc could add that a read-only control also getsrole="combobox", a name fromlabeland the read-only description, which replace a role oraria-labelwritten before the spread.
Claims and files checked
Review mode: full; reason: merge-touches-pr-files
- Changeset: read-only
renderTriggercontrols expose the combobox role and the localized read-only description: verified (MultiSelector.tsx:2663-2674,:2736-2740; tests atMultiSelector.test.tsx:4577,:4605). - Before the fix, a read-only caller button is a plain button with no read-only description, while its text stays visible and focusable: verified (base source; Chromium tree of the base).
aria-readonlyalone does not help because Chromium drops it on a button host: verified (the base keeps the attribute; the tree shows no read-only property).- A caller's active-descendant reference survives without the fix: verified (the base spreads caller props with no override).
- The read-only branch adds the combobox role, clears the active descendant and joins the read-only description after the caller's: verified (
MultiSelector.tsx:2663-2674). labelis the name fallback, and a name passed to the selector or set after the spread wins: verified (MultiSelector.tsx:2667-2669,:2677-2679).- The caller keeps the element, content and styling, and editable and disabled paths keep their wiring: verified (every change is gated on read-only and not disabled,
MultiSelector.tsx:1245). - The change is limited to the implementation, four focused tests and a patch Changeset, with no new prop, export, wrapper, styling, docs or story: verified (three changed files).
- The before and after Chromium results (role, name, value, description; keys and click open nothing; the form submits the value): verified on the identical patch before the latest merge, which leaves this path unchanged.
- Ending read-only removes the extra description and state and restores the editable disclosure, and disabled still wins: verified (
MultiSelector.test.tsx:4635,:4672). - The new tests fail without the fix in the ordinary and localized search cases: verified.
- Five MultiSelector test files with 267 tests pass: outdated, as the head now has eight MultiSelector unit test files; it describes no behavior.
- Lint, typecheck, build and formatting pass: lint and typecheck pass in CI on this head; build is deferred with the other heavy checks.
.changeset/multiselector-readonly-trigger-semantics.md: clear.packages/core/src/MultiSelector/MultiSelector.tsx: clear (optional JSDoc note above).packages/core/src/MultiSelector/MultiSelector.test.tsx: clear (optional record note above).
User impact
A read-only MultiSelector with a caller-rendered button exposes a generic button without a read-only description. The selected text remains visible and the control accepts focus, but its accessibility information does not identify the preserved selection or explain why it cannot be edited.
Problem and solution fit
The caller-trigger branch bypasses the built-in trigger's combobox role and localized read-only description.
aria-readonlyalone does not repair that branch: Chromium omits the property from its button-hosted accessibility mapping. Caller-provided active-descendant references can also survive when no selection surface exists.The effective read-only branch now supplies
role="combobox", clears the active-descendant reference, and joins the existing localized read-only description with the caller's description. The selector useslabelas the read-only control's accessible-name fallback, because a combobox takes no name from its content. Anaria-labeloraria-labelledbypassed to the selector, or set on the control after the trigger-props spread, takes precedence. The caller still owns the element, content, and styling. Editable and disabled paths keep their existing wiring.Expected behavior and authority
AST-011 FR1–FR5, especially FR4, require a focusable, collapsed read-only combobox with its name and value preserved, no nonexistent surface references, and a localized description when the host's accessibility mapping omits the read-only state. The MultiSelector accessibility contract applies that requirement to the component.
Smallest restoration
The existing caller-trigger implementation, four focused cases in its existing test file, and a Core patch Changeset. No new prop, export, wrapper, styling, consumer-documentation change, or shipped story.
Evidence
MultiSelectorwithisReadOnly,value={['Apple']},label="Fruit", andrenderTrigger={props => <button type="button" {...props} aria-label="Fruit">Apple</button>}. Chromium exposes rolebutton, nameFruit, no AX value, and no read-only description. The visible button text is stillApple.combobox, nameFruit, valueApple, and the localized read-only description. Both search configurations preserve caller descriptions. Real Tab, click, Enter, Space, and ArrowDown keep the value unchanged and the selection surface absent; native form submission retainsfruit=Apple.Scope
Components: MultiSelector
Testing
ASTRYX_STRICT_LINT=1 pnpm exec eslint packages/core/src/MultiSelector/MultiSelector.tsx packages/core/src/MultiSelector/MultiSelector.test.tsx --max-warnings 0— passed for the changed implementation and test file.pnpm build— passed.pnpm exec vitest run --project ui packages/core/src/MultiSelector --maxWorkers=1— 5 files, 267 tests passed.git diff --check— passed.