fix(Table): drop row tree ARIA outside treegrid - #4690
Open
AKnassa wants to merge 1 commit into
Open
Conversation
axe aria-conditional-attr (serious): aria-expanded and aria-level are valid on rows only inside a treegrid, and Astryx Table is a native table. The tree and groupedRows plugins set them on every <tr>, firing on all 10 baselined TableTree/TableGroupedRows stories plus the never-baselined Row Click Expansion story. Rows now carry no tree ARIA; expansion state stays announced by the chevron buttons (rowExpansion-plugin pattern). The per-row ref/subscription machinery existed solely to apply row ARIA and is removed with it (-77 lines). Trade-off recorded in the changeset: depth is currently visual-only via indentation; a programmatic depth cue for AT is a tracked follow-up. Baseline: -10 entries. Verified: 474/474 Table tests, core typecheck, eslint clean, axe audit 0 violations across all 12 stories with --fail-on-new. Part of facebook#4681.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
AKnassa
marked this pull request as ready for review
August 4, 2026 01:48
AKnassa
requested review from
cixzhang,
ejhammond,
humbertovirtudes and
imdreamrunner
as code owners
August 4, 2026 01:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4681 (weekly a11y scan). Clears all 10
aria-conditional-attrbaseline entries (TableTree x7, TableGroupedRows x3), plus the identical violation in the never-baselinedTableTree::Row Click Expansionstory.What this does
The tree and groupedRows Table plugins set
aria-expanded(and the tree pluginaria-level) on<tr>elements. Those attributes are only valid on rows inside atreegrid, and Astryx Table is a native<table>, so axe flags every story. Rows now carry no tree ARIA; the expand/collapse state stays announced by the chevron buttons, which already carryaria-expanded(the same pattern the rowExpansion plugin uses, which has zero baseline entries).Why not role="treegrid" instead
Treegrid contracts the full ARIA grid keyboard model (roving tabindex, arrow-key cell navigation, focusable cells), none of which BaseTable implements. Screen readers would switch users into grid interaction mode and hand them an unnavigable widget. Building that model is a feature decision, not this fix. For groupedRows it is also semantically wrong: group headers are section separators of flat data, not tree parents.
Trade-off, stated plainly
Tree depth is now conveyed visually by indentation only. The removed
aria-levelwas invalid in this context (and unreliably announced because of it), but assistive technology currently gets no programmatic depth cue. A follow-up candidate is announcing the level through the expander's accessible name; the changeset records the same trade-off so it lands as a decision, not a side effect.What changed
aria-expanded(both plugins) andaria-level(tree plugin).tr[aria-expanded]/tr[aria-level]test-migration hint.Observation for a follow-up
Local audits report
TableGroupedRows::Default::color-contrastandTableGroupedRows::Initially Collapsed::color-contrastas no longer occurring (stale baseline entries). Left untouched here; contrast entries are out of this PR's scope.Verification
474/474 tests across all 22 Table test files, core typecheck, eslint clean, and the repo's axe audit with
--fail-on-new: 0 violations across all 12 TableTree/TableGroupedRows stories.