Repository navigation
spec(a11y): APG adoption follows the role a component already plays; CollapsibleGroup adopts Accordion's required parts - #7458
Conversation
…AST-020 FR15); CollapsibleGroup adopts Accordion's required parts AST-020 FR15 and DEC-4: a pattern's required parts (role, name, state and relationship properties, Tab plus Enter/Space) are adopted wherever a component part already plays the role; the optional keyboard extras (arrow keys, Home/End) only where the component already acts as one composite control; extras a component already ships are named exceptions. CollapsibleGroup AR4 and DEC-1: button headers with aria-expanded, aria-controls and aria-disabled, Tab plus Enter/Space; no heading wrapper, no region role, no arrow-key movement between headers.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec c8663de |
PR Analysis ReportView Storybook for this PR · View Sandbox for this PR
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
This spec change needs a maintainer decision before it can be approved: a maintainer must approve or reject FR15 and DEC-4 in AST-020 and AR4 and DEC-1 in the CollapsibleGroup record, which add requirements current spec does not state yet and so far carry only the author's own approval. AR4 also needs two fixes either way:
- AR4 says every header sits in the page Tab order, but a disabled trigger is removed from it (
tabIndex={isDisabled ? -1 : undefined}inCollapsible.tsx), so scope the clause to enabled headers and list the disabled exclusion with its reason, or state the behavior change if focusable disabled headers are intended. - The AR4 verification row binds an Accordion accessibility contract that
internal/a11y-specdoes not contain yet, so mark it as pending or bind AR4 to evidence that exists today.
[Automated review]
| - **AR1 — Child semantics remain primary.** Group coordination MUST preserve each Collapsible button's accessible name, `aria-expanded`, `aria-controls`, controlled region, and keyboard activation. | ||
| - **AR2 — Presentation adds no competing interaction.** The divider wrapper MUST NOT add a role, focus target, accessible name, or keyboard behavior. | ||
| - **AR3 — Direction stays with Collapsible.** Group chevron defaults MUST preserve `component:Collapsible/AR1–AR3`, including the inward leading cue under LTR and RTL. | ||
| - **AR4 — The group adopts the APG Accordion pattern's required parts** (`spec:AST-020/FR15`): each direct item's header is a `button` whose accessible name is the item's title, with `aria-expanded` reflecting its panel, `aria-controls` naming the panel it reveals, and `aria-disabled` when it cannot be toggled; every header sits in the page Tab order and Enter or Space toggles its panel, in `single` mode collapsing the sibling that was open. Not adopted: a heading element around each header (this record requires none; the caller's document structure supplies headings), the optional `region` role on panels, and arrow-key or Home/End movement between headers — the group is a set of independent disclosures, not one composite control. |
There was a problem hiding this comment.
AR4 says every header sits in the page Tab order, but a disabled Collapsible trigger is taken out of it: it renders aria-disabled plus tabIndex={isDisabled ? -1 : undefined} in Collapsible.tsx, and the existing accessibility bindings declare both disabled states focusable: false. Since this record says released DOM output is unchanged, consider “every enabled header sits in the page Tab order” and adding the disabled header to the “Not adopted” list with its reason, as FR15 asks for a skipped required part. If focusable disabled headers are the intent, please state that behavior change and its compatibility impact explicitly.
| | ---------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | | ||
| | FR1–FR4, ORD1 | `CollapsibleGroup.test.tsx`; `useCollapsible.test.tsx` | single/multiple; controlled/uncontrolled; valued/unvalued | A sibling stays open in single mode, closes in multiple mode, controlled state mutates internally, or an unvalued item loses local state. | `audit:CollapsibleGroup/behavior` | | ||
| | FR5–FR6, ORD2–ORD3 | `CollapsibleGroup.test.tsx`; `Collapsible.test.tsx`; `themingTargets.test.ts` | plain/divided; each density; group/item/nested position | Wrapper/target reachability changes, defaults stop reaching direct items, or presentation leaks into nested content. | `audit:CollapsibleGroup/theming` | | ||
| | AR4 | Accordion accessibility contract (`internal/a11y-spec`) bound to the group, in jsdom and Chromium | single/multiple; open/closed; a non-collapsible open item; Tab order; Enter/Space round trip | A header loses its button role, name, `aria-expanded`, or `aria-controls`; Enter or Space stops toggling; arrow keys move focus between headers | `audit:CollapsibleGroup/accessibility` | |
There was a problem hiding this comment.
internal/a11y-spec has no Accordion contract yet, and its README keeps CollapsibleGroup coordination and Accordion adoption outside the disclosure contract, so this row points at verification that does not exist. Could you mark AR4's verification as pending until that contract lands, or bind it to evidence that exists today?
…ers, names the disabled item state, and cites the shipped suites with the contract pending
|
/approve-spec e378d9a |
There was a problem hiding this comment.
The spec decision is settled, so one small record fix remains before this can be approved: AR4's verification row in CollapsibleGroup.spec.md points to the wrong suites for two of its checks. The disabled-item tests are in Collapsible.test.tsx, not CollapsibleGroup.test.tsx, the only keyboard test is the Enter case in CollapsibleGroup.test.tsx, and Space and real-browser Tab reachability are covered only by the standalone disclosure bindings (Collapsible.a11y.test.tsx, Collapsible.a11y.chromium.spec.ts), so please name the right suite for each check and leave grouped Tab order, Space and the no-arrow-key check to the pending Accordion contract. This changes no requirement.
[Automated review]
| | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | | ||
| | FR1–FR4, ORD1 | `CollapsibleGroup.test.tsx`; `useCollapsible.test.tsx` | single/multiple; controlled/uncontrolled; valued/unvalued | A sibling stays open in single mode, closes in multiple mode, controlled state mutates internally, or an unvalued item loses local state. | `audit:CollapsibleGroup/behavior` | | ||
| | FR5–FR6, ORD2–ORD3 | `CollapsibleGroup.test.tsx`; `Collapsible.test.tsx`; `themingTargets.test.ts` | plain/divided; each density; group/item/nested position | Wrapper/target reachability changes, defaults stop reaching direct items, or presentation leaks into nested content. | `audit:CollapsibleGroup/theming` | | ||
| | AR4 | `CollapsibleGroup.test.tsx` (single/multiple coordination, disabled items) and `Collapsible.test.tsx` (trigger role, name, `aria-expanded`, `aria-controls`, Enter/Space) suites; Accordion accessibility contract (`internal/a11y-spec`, pending) bound to the group | single/multiple; open/closed; a disabled item, open or closed; Tab order; Enter/Space round trip | A header loses its button role, name, `aria-expanded`, or `aria-controls`; Enter or Space stops toggling; arrow keys move focus between headers | `audit:CollapsibleGroup/accessibility` | |
There was a problem hiding this comment.
The parentheticals here point to the wrong suites. CollapsibleGroup.test.tsx has no disabled-item test; those are in Collapsible.test.tsx (lines 179–251, including a grouped item). Collapsible.test.tsx has no keyboard test; the only one is the Enter case in CollapsibleGroup.test.tsx (lines 372–386), and Space is tested in neither. Space and real-browser Tab reachability are covered only by the standalone disclosure bindings (__tests__/Collapsible.a11y.test.tsx, __tests__/Collapsible.a11y.chromium.spec.ts). Could you name the suite for each check and leave grouped Tab order, the Enter/Space round trip and the no-arrow-key check to the pending Accordion contract?
…led, Enter, Space and Tab tests by name; grouped cases pending
…coverage; grouped cases pending under the Accordion contract
|
/approve-spec a2cafab |
There was a problem hiding this comment.
This revision is not approved yet: it could not be checked against the current spec on main or against the test suites that AR4's verification row cites, so approval waits on a maintainer's decision. Nothing visible in the diff needs to change: the only edit since the spec decision was settled is AR4's Verification cell, which now names each suite's coverage and leaves grouped Tab order, Space in a group and the no-arrow-key check to the pending Accordion contract.
[Automated review]
There was a problem hiding this comment.
This spec change is ready to approve. A maintainer approved the new APG adoption rule (FR15, DEC-4) and CollapsibleGroup's Accordion adoption (AR4, DEC-1) as written, and the text is consistent with the existing accessibility and Collapsible specs. AR4 also matches how CollapsibleGroup already behaves, with each verification check credited to a suite that holds it. Nothing needs to change before merge: grouped Tab order, Space inside a group and the no-arrow-key check stay marked pending until the Accordion contract lands.
[Automated review]
Exact decision needed
Whether Astryx adopts WAI-ARIA APG patterns by this rule — a pattern's required parts wherever a component part already plays that role; its optional keyboard extras only where the component already acts as one composite control — recorded in
spec:AST-020(FR15, DEC-4), and whether CollapsibleGroup adopts APG Accordion's required parts under it (AR4, DEC-1), without arrow-key movement between headers.User impact
A keyboard or screen-reader user meeting a CollapsibleGroup gets what the Accordion pattern promises for its headers — a button with the item's name, its expanded state, the panel it controls, Enter or Space to toggle, every header in the page Tab order — and keeps the page's Tab behaviour: arrow keys do not capture focus inside a set of independent disclosures. Across the system, the rule tells each component record which pattern parts it carries, so accessibility contracts gate what the component already is rather than what an APG example looks like.
Existing authority searched
spec:AST-020(current; FR2 decides that an adopted pattern cites exact APG mechanics and FR9 that APG expectations arerequiredonly once a current record adopts them — this adds the rule for WHICH parts are adopted, as FR15 next to FR1–FR3, plus DEC-4),component:CollapsibleGroup(draft; AR1–AR3 preserve Collapsible's disclosure semantics — AR4 adds the Accordion adoption),component:Collapsible(current; AR1–AR3, the button witharia-expanded/aria-controls), APG Accordion pattern as published (headerbutton,aria-expanded,aria-controls,aria-disabledwhen not collapsible, Tab/Shift+Tab, Enter/Space; heading wrapper listed;regionpanels optional; no arrow keys in the current text). No record decided an adoption rule before.Decision
Owner decision, 2026-10-13:
spec:AST-020FR15: required parts (role, accessible name, state and relationship properties, Tab plus Enter/Space) are adopted wherever a component part already plays the pattern's role; optional keyboard extras (arrow keys, Home/End) only where the component already acts as one composite control; the owning record names adopted parts, any required part it does not adopt with the reason, and any extra it already ships as a named exception. DEC-4 records the reasoning and the rejected shapes (every part everywhere; nothing until a full APG match). The applicability block lists FR15 under the accessibility trigger; the verification table gains an FR15 row.component:CollapsibleGroupAR4: button headers named by the item title,aria-expanded,aria-controls,aria-disabledwhen not toggleable, page Tab order, Enter/Space toggling (single mode collapses the open sibling). Not adopted: a heading element around each header (the record requires none; the caller's document structure supplies headings), the optionalregionrole, arrow-key/Home-End movement. DEC-1 records it; the verification map gains an AR4 row bound to the Accordion accessibility contract.The CollapsibleGroup record stays
draft(this adds one accessibility requirement to an observational draft); AST-020 is current, so this needs the owner's approval.Delta
docs/specs/AST-020/spec.md: FR15, DEC-4, applicability trigger, verification row.packages/core/src/Collapsible/CollapsibleGroup.spec.md: AR4, verification row, DEC-1.Writing rubric results
#digits,/pull/,/issues/as standing content): none.pnpm check:knowledge: clean.