Skip to content

fix(Table): drop aria-expanded from groupedRows header rows - #5612

Closed
AKnassa wants to merge 1 commit into
meta:mainfrom
AKnassa:rocky/issue-4681-groupedrows-aria-expanded
Closed

AKnassa wants to merge 1 commit into
meta:mainfrom
AKnassa:rocky/issue-4681-groupedrows-aria-expanded

Conversation

@AKnassa

@AKnassa AKnassa commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Part of #4681 (weekly a11y scan). Split out of #4690 as agreed in review: groupedRows is flat data with section headers, not a tree, so it does not ride along with the treegrid work.

What this does

The groupedRows plugin set aria-expanded on each group header <tr>. On a native table that attribute is invalid on a row (axe aria-conditional-attr: rows may only expand inside a treegrid), and a group header is a section separator of flat data, not a tree parent, so a treegrid is the wrong fix here. The header row no longer carries it. The collapse state stays announced by the group's chevron button, which already carries aria-expanded with the "Expand group X" / "Collapse group X" name.

What changed

  • useTableGroupedRows.tsx: one attribute removed from the header row.
  • Test rewritten to assert the row carries no aria-expanded and the chevron button does.
  • Baseline: the 3 TableGroupedRows::*::aria-conditional-attr entries removed, deletions only.
  • Changeset (patch) with a tr[aria-expanded] test-migration hint.

Verification

  • 15/15 groupedRows tests; eslint and prettier clean on the changed files.
  • Repo axe audit with --fail-on-new on the built Storybook: 0 issues across all 3 TableGroupedRows stories.

Observation for a follow-up

The audit reports TableGroupedRows::Default::color-contrast and TableGroupedRows::Initially Collapsed::color-contrast as no longer occurring (stale baseline entries). Left untouched here; contrast entries are out of this PR's scope.

On a native table aria-expanded is invalid on a row (axe
aria-conditional-attr: rows may only expand inside a treegrid), and a
group header is a section separator of flat data, not a tree parent. The
collapse state stays announced by the group's chevron button, which
already carries aria-expanded. Clears the 3 TableGroupedRows baseline
entries. Split out of meta#4690 as agreed in review.

Part of meta#4681
@vercel

vercel Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Error Error Aug 27, 2026 7:36pm

Request Review

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Aug 27, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 27, 2026
github-actions Bot added a commit that referenced this pull request Aug 27, 2026

@humbertovirtudes humbertovirtudes 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 is a focused semantic correction. Native grouped-header rows no longer expose invalid aria-expanded state, while the existing localized chevron button remains the keyboard-operable source of expansion state. The focused coverage checks both expanded and collapsed groups, and only the matching accessibility baseline entries are removed. No API, visual, theming, performance, or interaction behavior changes. Approved on code merits; rebase and rerun required CI before landing.

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Sep 22, 2026

@humbertovirtudes humbertovirtudes 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.

Reviewed exact head 6ec01361. Removing aria-expanded from the semantic row while retaining it on the named disclosure button is correct, and the regression test covers collapsed and expanded groups. I found no blocking issue.

Integration note: #6251 contains the same semantic fix plus later grouped-header work, and the exact patches conflict in the grouped-row test. Do not land duplicate release-note/fix hunks. If #6251 lands first, close this as superseded; otherwise land this first and rebase #6251 while preserving the single canonical implementation.

@humbertovirtudes humbertovirtudes 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.

Requesting changes to the integration disposition of 6ec01361a311cef82ebceb6e23fbfaf2a19adb51: the semantic fix is correct, but it is superseded.

Merged #6251, commit 69e21dde81d24788cc404ffc544ffb25990b0fc9, already removes grouped-header row aria-expanded, retains disclosure-button ownership, and adds a stronger transition test in these same source/test paths. Current main still contains that correction. The synthetic merge conflicts in the grouped-row test where the equivalent fix landed.

Please close this as superseded, or narrow it to a separately demonstrated remaining baseline-cleanup delta. Do not merge duplicate production fix/release-note hunks. The earlier approval was for code merits before this supersession; this review supersedes that merge-readiness conclusion, not the correctness of the original semantic correction.

AI-assisted exact-head source/history review. No new runtime defect or fresh browser test result is asserted.

@cixzhang

Copy link
Copy Markdown
Contributor

Closing as superseded by #6251. Posted by Cindy's agent on her behalf.

@cixzhang cixzhang closed this Oct 28, 2026
@github-actions
github-actions Bot deleted the rocky/issue-4681-groupedrows-aria-expanded branch October 29, 2026 12:17

This branch had an error being deployed

1 failed deployment
Preview — 6ec01361 Deployed Aug 27, 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. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants