Repository navigation
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 meta#4681.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual RegressionStatus: No visual change across 420 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
|
|
||
| describe('useTableTreeData — row ARIA', () => { | ||
| it('sets 1-based aria-level on every body row', () => { | ||
| it('never sets aria-level on rows — the indent conveys hierarchy (axe aria-conditional-attr: rows outside a treegrid)', () => { |
There was a problem hiding this comment.
Hmm well this seems wrong. If we include tree data the table should probably be a treegrid.
|
Yes, happy to take it on. Agreed treegrid is the right semantics. The row ARIA removed here was already treegrid shaped (1-based aria-level, aria-expanded on parents only), the container was the invalid part. Rough plan:
Two questions before I start:
|
|
Sorry for the wait on this. On a reference: Row focus versus cell navigation I don't want to answer off the cuff. You've named the cost exactly right — the table becomes one tab stop and sort headers, chevrons and selection checkboxes stop being individually tabbable — and that's a call for a maintainer rather than a review. It's queued. Yes to splitting groupedRows out. It isn't tree data, moving the expanded state onto the chevron button stands on its own, and it clears three axe entries; no reason for it to wait behind the treegrid work. If you'd rather talk it through with someone, we're in Discord. [Reviewed by Robohands] |
|
On the row-focus vs cell-navigation question that's queued with maintainers - here's the AT angle that might help the decision, since it's the part that's easy to miss when reasoning about tab stops alone. The two options aren't just "how many tab stops" - they map to different ARIA contracts, and the in-cell widgets decide which is viable: Row focus (one tab stop per row) is closer to a list/tree semantics than a grid. Cell navigation (roving per-cell) matches the APG grid pattern directly. So the deciding question isn't "row vs cell" in the abstract - it's: do the tree rows carry in-cell interactive widgets (sort headers, chevrons, selection) as part of the treegrid contract? If yes, cell navigation (or a row model with an explicit composite-entry mechanism) is the only way those stay reachable. If the treegrid v1 rows are plain data cells with the expander as the sole interaction, row focus is simpler and defensible - and the in-cell widgets can be explicitly out of scope for v1, documented, and revisited when they're added. Either way, the keyboard model and the ARIA indexes should match whatever is chosen - a row-focus model emitting per-cell |
|
Thanks for waiting. The decision window has closed: row focus is the v1 scope, with the docs naming that full cell navigation is outside v1. Existing interactive descendants must remain reachable; combinations that need cell navigation stay outside the supported v1 contract. You can proceed by composing the existing tree and grid focus primitives. Decision record [Reviewed by Robohands] |
|
On the v1 row-focus scope and the "existing interactive descendants must remain reachable" requirement - one concrete way to satisfy that without pulling in the full composite-entry pattern: In a row-focus model, the row is the single tab stop and the in-cell widgets (sort headers, chevrons, selection checkboxes) drop out of the tab order. The APG composite-widget entry pattern (Enter/F2 to enter the row, Tab within, Escape to leave) is the full solution, but it's heavy for a v1. A lighter option that keeps the widgets reachable: keep the row as the tab stop, and let the widgets inside remain reachable via the screen reader's virtual cursor / browse mode even though they're not in the sequential tab order. That's the key distinction: "reachable" for AT doesn't have to mean "in the tab order" - browse mode can still get to them. The trap to avoid is the middle ground: making the row focusable but leaving the widgets also in the tab order, which creates two competing tab stops per row and a confusing keyboard model. Either the row is the single stop (widgets reachable via browse mode / composite entry), or the widgets stay individually tabbable (which is the cell-nav model, out of v1). The one thing that doesn't work is both. So for v1: row as the single tab stop, widgets reachable via browse mode, and document that composite entry (Enter/F2) is the follow-up if keyboard-only users need direct widget access. That keeps the v1 contract clean and the widgets reachable, without the full composite-entry machinery. |
Resolved toward main's tree plugin: the review asks for a treegrid with restored row ARIA, so the row-ARIA removal this branch carried is dropped here rather than re-applied. The groupedRows half moves to its own PR (agreed in review), so those files return to main's version too. Only the 8 TableTree aria-conditional-attr baseline entries stay removed.
…ugin Review asked for a treegrid rather than stripping the row ARIA. When any row is expandable the tree plugin now names the <table> role="treegrid" (transformTable) and keeps aria-level / aria-expanded on the rows, adding aria-posinset / aria-setsize from the sibling group as flattened by useTableTreeState. Rows get the row-focus keyboard model from useTreeFocus (one roving tab stop; ArrowUp/Down, ArrowRight expand-or-enter, ArrowLeft collapse-or-parent, Home/End, Enter/Space toggle), scoped to the row that owns focus so in-cell controls keep their own keys and stay in the Tab order. v1 is row focus only per the maintainer ruling; the docs say so. Flat data is untouched. Supporting changes: TableRenderProps.ref (merged with the consumer's ref in BaseTable) so a plugin can reach the <table>; useTreeFocus resolves the focused item through itemSelector instead of a hardcoded [role="treeitem"], which is what lets the table compose it. Baseline: the 8 TableTree aria-conditional-attr entries stay removed (axe audit with --fail-on-new: 0 issues across all 9 TableTree stories). groupedRows is split into its own PR as agreed. Part of meta#4681
|
Sorry for the slow reply, @rubyycheung and @humbertovirtudes. I'm continuing with this. I've pushed the fixes and merged main. The merge was clean and brings in #6410, so the scroll region is now a Tab stop only while the table overflows sideways.
Still to do on my side: a before/after screenshot of the chevron ring and a browser recording of the keyboard model. Could you confirm that holding focus on ArrowRight is acceptable for v1? |
There was a problem hiding this comment.
Thanks for the follow-up round — the treegrid repair is now dependable for keyboard users, and approval is recommended from this review.
The issues raised on the previous revision are addressed:
- A caller's
onKeyDownoronFocusonTablenow composes with the plugin's handlers (caller first,preventDefault()opts out), a wrapper forwarding an unset handler no longer removes navigation, and a plugin'streegridrole wins over a caller's role with a development warning — each covered by tests throughTable. - The roving tab stop now follows a row focused by click or by code, while focusing an in-cell control leaves the stop in place; the fix in the shared focus hook also benefits TreeList.
- The row expander and the header expand-all toggle draw the shared focus ring, like the row.
- The intended Tab order is stated in the docs, changeset, and story and pinned by a Tab-walk test, and ArrowRight/ArrowLeft now hold focus where the treegrid pattern would enter a cell or do nothing, instead of jumping to a child or parent row.
Two things remain for the human reviewers and for you, as you noted: confirmation that holding focus on ArrowRight for an expanded row is acceptable for v1, and the before/after chevron screenshot and keyboard recording you listed as still to do.
[Automated review]
humbertovirtudes
left a comment
There was a problem hiding this comment.
Reviewed exact head 7448da82 and the surrounding tree focus, Table, and accessibility implementation. Requesting changes for two functional gaps.
-
packages/core/src/Table/plugins/tree/useTableTreeData.tsx:711-726keeps focus on an expanded row, andpackages/core/src/hooks/useTreeFocus.ts:478-497makes ArrowRight a no-op on leaves. The public docs say this follows the APG treegrid pattern, where ArrowRight from an expanded or leaf row enters the first cell. Either implement cell entry/navigation or document and specify the row-only model instead of claiming APG parity. -
The new focus and keyboard behaviour is covered only through jsdom events in
useTableTreeData.test.tsx:1182-1419. This cannot prove native<tr>focus, sequential Tab behaviour, RTL arrow routing, or visible focus in a browser. Please add browser coverage for row entry/exit, click focus, Up/Down, LTR/RTL Left/Right, in-cell controls, and the focus indicator.
Cross-PR conflict: this patch conflicts with #5995 in useTableTreeData.tsx. Rebase after #5995 and preserve its shared row-scoped interactive-target and text-selection guards. #6221 also overlaps the Table root/ref area, so retain both its scroll ownership and this PR's root-prop composition.
There was a problem hiding this comment.
Thanks for carrying this through several rounds: the row-focus treegrid behaves as documented in Chromium, and flat tables are untouched. Approval now needs a maintainer to provide or identify the governing spec for the tree plugin's treegrid contract, which no current record covers: the role and row attributes, the row-focus keys including ArrowRight holding focus on expanded and leaf rows, in-cell controls staying in the Tab order, and the new TableRenderProps.ref seam. Independently of that decision, please:
- Rebase onto
main, which now conflicts inuseTableTreeData.tsx,Table.doc.mjsandTreeList.test.tsx, keeping main's shared row-click guards and theuseTreeFocusInternalsplit. - Describe the keyboard model as a row-focus subset of the APG treegrid pattern and name its divergences instead of saying it follows the pattern, or implement cell entry.
- Add one sentence to the description classifying the change under the AST-009 assistive-technology triggers.
The engineering owners with open change requests will also need to re-review.
[Automated review]
kentonquatman
left a comment
There was a problem hiding this comment.
Thanks for looking at this @AKnassa! I'm seeing some visual regressions with the focus ring. Could we fix this before merging? I also wanted to confirm if the change in content alignment was intentional.
| Before | After |
|---|---|
![]() |
![]() |
humbertovirtudes
left a comment
There was a problem hiding this comment.
Requesting changes on 7448da8209900385bb3308d2dc0ec03431f18c25. Consumer/root handler and ref composition, row-scoped keyboard handling, roving-stop updates and flat-table preservation are credited.
-
MAJOR - public wording overstates APG parity. useTableTreeData.doc.mjs:9-10 and the release note claim the APG treegrid pattern, but inline-end arrow on an expanded/leaf row holds focus rather than entering the first cell, and descendant controls remain in ordinary page Tab order. Describe the exact owner-admitted row-focus subset and both divergences, or implement the owner-selected cell-entry model. Reconcile the PR body's stale child/parent-arrow observations with the actual source.
-
MAJOR - native focus/visual proof remains incomplete. useTableTreeData.test.tsx:1182-1419 uses synthetic focus/keys/Tab and class-based ring checks. These do not prove real
<tr>focus, reverse Tab, LTR/RTL focus paint or clipping. Provide inspectable head-bound browser keyboard/visual evidence, including nested controls, selection/sort, fit/overflow and active-row removal. The latest visual-regression review also remains unresolved; I have not independently reproduced or inspected those images.
Owner/integration hold: maintainers need to record the precise tree-module and shared Table ref/event contract in the current canonical owners. This is not a request for an external contributor to author a broad new spec. Rebase while preserving the newer row-scoped contenteditable/text-selection guards and internal tree-focus split, rather than taking stale complete files. The primary feature is not wholly superseded.
AI-assisted exact-head source review. No fresh browser/AT result is claimed; add real AT only for AT-dependent announcement/browse-mode claims, not merely static semantics or browser focus.
humbertovirtudes
left a comment
There was a problem hiding this comment.
Requesting changes on exact head 7448da8209900385bb3308d2dc0ec03431f18c25 for the Table-related delta and its direct dependencies. This is not a rejection of unrelated work in the PR.
The consumer description and release note still claim APG treegrid parity for a row-only subset.
Failure case: Inline-end on an expanded row is intercepted at useTableTreeData.tsx:715-724; inline-end on a leaf reaches useTreeFocus.ts:478-497 and holds focus. Neither enters a first cell. Descendant controls remain in ordinary page Tab order. The description says the keyboard follows the APG treegrid pattern despite conceding the missing cell entry later, and the PR body's child/parent-arrow observations are stale at this head.
Requested fix: Describe the precise row-focus subset and its two divergences consistently in normal/dense docs, release note and PR body. Retain the owner's row-focus v1 direction; do not require cell navigation merely to rescue an overstated claim. If a different keyboard contract is wanted, maintainers must decide it in the canonical owner.
The newly introduced native row-focus and visible-focus promises lack inspectable, head-bound focused browser regression evidence.
Failure case: The tests use jsdom focus, fireEvent keys and userEvent.tab, including a five-stop forward Tab walk. Ring tests compare compiled classes. They cannot establish native tr focus, reverse Tab, inherited RTL routing, clipping, or focus continuity after active-row removal. Broad successful axe/visual jobs and prose observations do not prove those transitions.
Requested fix: Provide the outstanding before/after ring evidence and keyboard recording, and focused real-browser regression coverage through the committed TableTree fixture for entry/exit, reverse Tab, click/programmatic focus, directional keys, nested selection/sort controls, fit/overflow and focused-row removal. Reuse canonical visual coverage for pixels; do not introduce a duplicate visual harness.
Validation boundary: these findings are grounded in the exact implementation and relevant tests. Isolated source/geometry probes are not fresh mounted React, browser, clipboard, screen-reader or native-device certification. Retain the applicable focused tests and head-bound evidence when updating the PR.
Resolve only the surviving narrow authority/integration questions in the existing canonical owner; do not create a parallel public API or an unrelated record to bypass them.
Conflicts kept both sides: React imports and isRenderable in BaseTable.tsx; the plugins description in Table.doc.mjs; the @input header and the row-click guard imports in useTableTreeData.tsx; test imports in TreeList.test.tsx and useTreeFocus.test.tsx; the typeahead wording in useTreeFocus.doc.mjs.
Conflicts kept both sides: the getRowLabel and hasExpandableRows dense prop descriptions in useTableTreeData.doc.mjs, and the TreeTable test fixture's getRowLabel and tableProps props in useTableTreeData.test.tsx.
Answers the meta#4690 review (humbertovirtudes, 10-22 and 11-04). A collapse or data change that removed the focused row dropped focus to the page and reset the tab stop to the first row. Focus (only if lost) and the stop now move to the nearest remaining ancestor. For focus on a collapse, that is TreeList's AR2 rule. Unlike TreeList, the stop moves even when focus is elsewhere. Alt and Meta chords now pass through, so browser Back works on a focused row. Docs, dense docs and changeset now describe the keys the same way: a row-focus subset of the APG treegrid pattern plus Enter/Space, with its two divergences named. The story summarizes them. New jsdom tests cover the dropped-row moves, the leaf and end-row holds, Space, and the modifier chords. A new browser spec (22 tests per engine) and accessibility-tree spec (6 tests) run through the committed TableTree stories. api-report.md gains the PR's ref, posInSet and setSize rows.
There was a problem hiding this comment.
Thanks for carrying this through another round: this head fixes the APG-parity wording, adds the browser proof reviewers asked for, keeps main's shared row-click guards, and leaves flat tables untouched.
Approval now needs an engineering owner to provide or identify the governing spec for the tree plugin's treegrid contract, which no current record covers: the existing useTableTreeData record contracts only expander names. What must be settled is the treegrid role and row ARIA, the row-focus keys (including ArrowRight and ArrowLeft holding focus), in-cell controls staying in the Tab order, focus moving to the nearest ancestor when a row is dropped, and the Table seams (TableRenderProps.ref, caller-first handler composition, plugin role precedence). An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner.
Independently of that decision, please:
- Regression: merge
main, which now conflicts in.github/a11y-baseline.json, keeping main's removals and dropping the eightTableTreeentries. - Newly live check: update the description's keyboard bullet, Chrome check and test counts, which still say ArrowRight enters the first child and ArrowLeft returns to the parent while the code and its browser test hold focus.
- Miss: give the chevron and the header expand-all toggle room for the shared focus ring, which now reaches 1px into the row label (
useTableTreeData.tsxlines 433 and 481). - Reduce scope, which now exceeds about 2,000 authored lines: land the
useTreeFocusfocus-follow fix and the Table root-prop composition withTableRenderProps.refas their own pull requests first (each already has its own changeset); the dropped-row focus handoff is the next natural split.
The engineering and design owners with open change requests will also need to re-review.
[Automated review]
| {...stylex.props(treeStyles.expanderButton)} | ||
| {...stylex.props( | ||
| treeStyles.expanderButton, | ||
| focusOutlineStyles.focusVisible, |
There was a problem hiding this comment.
The shared ring here is 2px at a 3px offset, so it reaches 5px past a button that sits 4px from its label. In Chromium its outer edge lands at x=57 while the row label starts at x=56, so the ring runs into the first letter (the browser ring on main left a 3px gap). The same applies to the header toggle at line 481. Giving the expander at least 1px more inline clearance before the label, or an offset that fits the 4px gap, would fix both.
| [ref, pluginTableRef], | ||
| ); | ||
|
|
||
| // The caller's <table> props compose with the plugins' instead of silently |
There was a problem hiding this comment.
Non-blocking (INV29 source comments): this comment restates the next line and the JSDoc of resolveTableHtmlProps. It can go.
| [idToItem, store], | ||
| ); | ||
|
|
||
| // The row keys come from the shared tree primitive, pointed at this |
There was a problem hiding this comment.
Non-blocking (INV29 source comments): this comment covers five topics and opens by narrating the call. Keeping only the reasons reads better, for example: "A per-instance marker keeps a nested table's rows out of this row set. Type-ahead is off: printable keys must reach a text field in a cell."
humbertovirtudes
left a comment
There was a problem hiding this comment.
Recheck at fccff4f (unchanged since 7 Nov): REVISE. Root handler/ref composition and roving-stop synchronisation are resolved, and the browser coverage you added (native row focus, forward/reverse Tab, LTR/RTL keys, nested controls, sorting, overflow, removed rows) is good. No CI has run on this head.
Blocking
- Authority.
docs/specs/components/Table/plugins/tree/useTableTreeData.spec.md:49contracts only expander naming and explicitly excludes the full plugin, keyboard and focus. Thetreegridrole/row ARIA, row-focus model, descendant Tab order, dropped-row handoff,TableRenderProps.refand root-event/role precedence aren't admitted. An engineering owner needs to extend the Table/module records (or identify current clauses) for every public API and behavioural delta first. - Conflicts with
main. Rebase, keepingmain'suseIsomorphicLayoutEffectlatest-value ref sync (this head still writes refs during render atuseTableTreeState.tsx:140) and its baseline removals, then reapplyposInSet/setSize.
Major
3. #8873 has merged and owns the row-expander and expand-all shared-ring change. Drop the duplicate ring delta here when you rebase.
4. The ring crosses into the label: the toggle-to-label gap is 4px, but the shared outline reaches 5px past the 24px button (useTableTreeData.tsx:317). Add token-based clearance of at least the ring reach, and a browser assertion that the ring doesn't cross the label's box.
5. Size: about 3.3k authored lines, including independently releasable root-prop/ref composition and shared useTreeFocus changes, each with its own changeset. Land those separately, then rebase this PR onto them.
The PR description is also stale on child/parent arrow movement and test counts.
kentonquatman
left a comment
There was a problem hiding this comment.
Design looks good! Thanks @AKnassa!
|
(Posted by Cindy's agent.) Hi @AKnassa, thanks for this PR. |
(Posted by Cindy's agent.) Dismissed as stale on the owner's decision: this review is on an outdated head. Please re-review the current head if concerns remain.


Part of #4681 (weekly a11y scan). Clears the 8
aria-conditional-attrbaseline entries for TableTree. The 3 TableGroupedRows entries move to their own PR, #5612, as agreed in review.What changed since the last round
Review asked for a treegrid instead of stripping the row ARIA, and the ruling set v1 scope to row focus. This round builds that:
useTableTreeDatanames the<table>role="treegrid"viatransformTable. Flat data keeps the native table (no role, no row ARIA, no tab stop): the migration guarantee holds.aria-level(1-based) andaria-expanded(parents only), and gainaria-posinset/aria-setsizefrom the sibling group as flattened byuseTableTreeState(aftersortSiblings).TableTreeRowMetacarries them as optionalposInSet/setSize, so a hand-built config still typechecks.useTreeFocus(the shared tree primitive) pointed at the rows through itsitemSelector: one roving tab stop across the visible rows; ArrowUp/ArrowDown move between rows; ArrowRight expands a collapsed row or enters its first child; ArrowLeft collapses an expanded row or moves to the parent; Home/End; Enter/Space toggle an expandable row; RTL flips the horizontal arrows (the hook already does). Focus survives the expand/collapse re-render because rows are keyed by id. Typeahead is off: not part of the treegrid pattern, and printable keys must reach a text field inside a cell.focusOutlineStyles.focusVisiblering, inset so it is not clipped by neighbouring rows.useTableTreeData.doc.mjsdescription,usagebest practices,hasRowClickExpansion), and the Default story's JSDoc summarises the keys.Two supporting changes outside the plugin:
TableRenderProps.ref: a plugin can now attach a ref to the<table>;BaseTablemerges it with the consumer'sref(memoised, so callback refs are not re-attached every render). MirrorsBodyRowRenderProps.ref/ScrollWrapperRenderProps.htmlProps.ref.useTreeFocusresolves the focused item withclosest(itemSelector)instead of a hardcoded[role="treeitem"]. Without this, a customitemSelectorlisted the rows but ArrowDown from a focused row went back to the first row (the focused item resolved tonull). Default behaviour is unchanged; TreeList is unaffected.Why useGridFocus is not in the composition
useGridFocusis cell geometry (columns, a cell selector, Ctrl+Home/End across cells). With row focus there are no cells to navigate, so v1 composes onuseTreeFocusalone. When cell navigation is decided, that is where the grid hook comes in.Judgment calls, stated plainly
hasRowClickExpansionis set;hasRowClickExpansionstays a pointer-only convenience.patch(the repo rule: only[breaking]bumps minor while 0.x), but the entry spells out what consumers will notice: the rows become a Tab stop, andgetByRole('table')becomestreegridfor tree tables.Verification
Table,hooks,TreeList.core typecheck,core typecheck:docs,cli typecheck:strict,storybook typecheckclean; eslint clean on the changed files (one pre-existing warning on main'sBaseTable.tsx:489).--fail-on-new, TableTree + TableGroupedRows: 0 new; 0 issues on all 9 TableTree stories; TableGroupedRows shows only its 3 baselined entries (the split PR). The audit also reportsTableGroupedRows::Default::color-contrastand::Initially Collapsed::color-contrastas resolved; left for a contrast round.Checked in Chrome on the built Storybook (Default story): the
<tr>paints the inset ring on keyboard focus, ArrowRight expands in place and then enters the first child, ArrowLeft returns to the parent, Tab from the row reaches its chevron, and arrows on the chevron do nothing. Observation: the scroll wrapper is already a Tab stop (pre-existing), so a tree table reads wrapper, then row, then in-cell controls; whether the wrapper stop should yield once rows are focusable is a separate question.Follow-ups this PR does not claim: cell navigation, an entry mode for in-cell controls.