Skip to content

spec(a11y): APG adoption follows the role a component already plays; CollapsibleGroup adopts Accordion's required parts - #7458

Merged
cixzhang merged 4 commits into
mainfrom
spec/apg-adoption-rule
Oct 13, 2026
Merged

cixzhang merged 4 commits into
mainfrom
spec/apg-adoption-rule

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

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 are required only 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 with aria-expanded/aria-controls), APG Accordion pattern as published (header button, aria-expanded, aria-controls, aria-disabled when not collapsible, Tab/Shift+Tab, Enter/Space; heading wrapper listed; region panels optional; no arrow keys in the current text). No record decided an adoption rule before.

Decision

Owner decision, 2026-10-13:

  • spec:AST-020 FR15: 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:CollapsibleGroup AR4: button headers named by the item title, aria-expanded, aria-controls, aria-disabled when 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 optional region role, 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

  • R1 (proposal/history tense): no — FR15, AR4 and both decisions state what the system adopts; the approval date sits in the decider lines only.
  • R2 (research in the record): no — the APG text consulted stays in this description.
  • R3 (cells naming a PR, issue, or commit): no.
  • R4 (rejected alternative outside its decision or longer than one line): no — each rejected shape is one line inside DEC-4 / DEC-1.
  • R5 (# digits, /pull/, /issues/ as standing content): none.
  • R6 (answered open question still listing options): none.
  • Prettier and pnpm check:knowledge: clean.

…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.
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 13, 2026 4:24pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 13, 2026
@astracat-bot

astracat-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 13, 2026, 5:47 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 13, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec c8663de

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

View Storybook for this PR · View Sandbox for this PR

Current run: The current change has no visual or preview-producing scope. Visual checks are not applicable; preview links are not shown.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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} in Collapsible.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-spec does 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 13, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec e378d9a

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 13, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@github-actions github-actions Bot removed the spec-auto-merge Auto-merge was enabled by the spec owner gate label Oct 13, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 13, 2026
…coverage; grouped cases pending under the Accordion contract
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec a2cafab

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@cixzhang
cixzhang merged commit 5a184b7 into main Oct 13, 2026
51 checks passed
@github-actions
github-actions Bot deleted the spec/apg-adoption-rule branch October 14, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — a2cafabe Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant