Repository navigation
fix(Table): the scroll wrapper and tree toggles draw the shared focus ring - #8873
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Thanks: the shared focus ring now reaches the scroll wrapper and both tree toggles, and a scrolling table inside a Card shows a focus ring for the first time. A few things need to change before this merges:
- In a bordered
Cardthe wrapper's ring is still clipped by 1px on every side, because the wrapper bleeds under the Card's border (Card draws its border inside its padding), so an inset of one ring width is not enough. - At
density="compact"the tree toggles' ring loses its top and bottom pixel to the cell'soverflow: hidden. - The changeset says all of
Table's tab stops now draw the theme ring, but the row-expansion, grouped-rows and filter buttons still draw the browser's ring; please name the three this PR covers and fix the Card sentence. - The new test compares compiled class names, so it cannot see the ring; a Chromium spec that tabs to each stop and checks the computed outline and its fit inside the clip (as
OutlineFocus.a11y.chromium.spec.tsdoes) would protect the fix.
[Automated review]
humbertovirtudes
left a comment
There was a problem hiding this comment.
Requesting changes on exact head 4d4f93bd311333b4917f89500b193cba5e8d9b38 for the Table-related delta and its direct dependencies. This is not a rejection of unrelated work in the PR.
The new inset clears only the outline width, not the bordered Card's existing bleed beyond its clip edge.
Failure case: Card applies each padding inset as the published container padding minus border width, while Table's wrapper bleeds by the full published inset. With the default 1px border the wrapper extends 1px beyond the Card padding edge. The 2px outline at offset -2px has its outer edge on that wrapper boundary, so the source geometry still places part of the indicator outside the clip.
Requested fix: Fit the ring to the actual clipping boundary, preserving the shared width/style/colour and existing layout. Account for the border overshoot or choose an existing unclipped paint owner. Verify matched bordered/borderless Card, theme border widths, narrow/desktop and both directions in the canonical Table browser/visual fixture; correct the unconditional Card release claim.
The newly added outward shared ring exceeds compact cells' clipping allowance for both tree toggles.
Failure case: Each toggle is 24px high. Compact body/header cells have --spacing-1 block padding (0.25rem, 4px at the standard 16px root), and both wrap/truncate/header paths use overflow:hidden. The default outline extends 3px offset + 2px width = 5px beyond the button. This exceeds the compact padding by 1px; the header toggle at line 379 shares the same treatment.
Requested fix: Keep the shared outline unobscured inside the actual compact-cell boundary, using the smallest offset/paint-owner correction rather than widening unrelated controls. Cover both toggles across densities with browser focus/pixel evidence. The three atom-class tests may remain composition evidence but must not be treated as clipping proof.
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.
|
/approve-spec 61cc6f4 |
There was a problem hiding this comment.
Thanks: the shared focus ring now reaches the scroll wrapper and both tree toggles, the Card-edge and compact-density clipping from the last round is fixed, and the new Chromium spec covers the fit. Two things need to change before this merges:
- The last commit adds 119 files under
packages/core/src/i18n/generated-english/that come frommain's newer i18n generator (which ignores that directory), not this branch's, plus formatting-only rewrites of 17 Table files the fix does not touch, so please drop both. - The changeset says a Card "shows all of" the wrapper's ring, but the Card's rounded corners (11px inner radius) cut off the square ring's corners, and the Chromium spec misses this because it models each clip as a rectangle, so either round the ring to the clip and teach the spec about
border-radius, or limit the changeset to the edges.
The description still gives the previous inset and test count, and three new comments could be shorter (see the inline suggestions). An engineering owner's change request from the previous round is still open and needs their re-review.
[Automated review]
| // The wrapper bleeds to its container's edges, under a Card's border, and | ||
| // the Card clips there, so its keyboard ring sits inside its own box, clear | ||
| // of that border too. |
There was a problem hiding this comment.
Non-blocking: one 37-word sentence with three topics. Suggest: "The wrapper bleeds under a Card's border, and the Card clips there. The ring sits inside the wrapper, clear of the border."
| // A tab stop once the table scrolls inline: the shared ring, which a | ||
| // theme restyles through the focus-outline tokens. |
There was a problem hiding this comment.
Non-blocking: the second half restates focusOutlineStyles.focusVisible. Suggest: "The wrapper is a tab stop while the table scrolls inline."
| // A compact row is shorter than the ring around the 24px toggle, and the | ||
| // cell clips its overflow, so there the ring sits inside the toggle. |
There was a problem hiding this comment.
Non-blocking: one 28-word sentence. Suggest: "A compact cell clips the ring around the 24px toggle. At compact density the ring sits inside the toggle."
… tree toggles ring inside; a Chromium spec checks each ring's fit
61cc6f4 to
1ce8da1
Compare
There was a problem hiding this comment.
Changes requested. The three Table tab stops now draw the shared, token-driven focus ring, and the Card-edge and compact-density clipping from earlier rounds is fixed, but two things need to change before this merges:
- The last commit adds 119 files under
packages/core/src/i18n/generated-english/that come frommain's newer i18n generator (which ignores that directory), plus formatting-only rewrites of 17 Table files the fix does not touch, so please drop both. - The changeset says a Card "shows all of" the wrapper's ring, but the Card's rounded corners (11px inner radius) cut off the square ring's corners and the Chromium spec misses it because it models each clip as a rectangle, so either round the ring to the clip and teach the spec about
border-radius, or limit the changeset to the edges.
The description still gives the earlier inset (−2px) and test count, and three new comments could be shorter (see the inline suggestions). An engineering owner's change request from an earlier revision is still open and needs their re-review.
[Automated review]
| // The wrapper bleeds to its container's edges, under a Card's border, and | ||
| // the Card clips there, so its keyboard ring sits inside its own box, clear | ||
| // of that border too. |
There was a problem hiding this comment.
Non-blocking: one 30-word sentence with three topics. Suggest: "The wrapper bleeds under a Card's border, and the Card clips there. The ring sits inside the wrapper, clear of the border."
| // A tab stop once the table scrolls inline: the shared ring, which a | ||
| // theme restyles through the focus-outline tokens. |
There was a problem hiding this comment.
Non-blocking: the second half restates focusOutlineStyles.focusVisible. Suggest: "The wrapper is a tab stop while the table scrolls inline."
| // A compact row is shorter than the ring around the 24px toggle, and the | ||
| // cell clips its overflow, so there the ring sits inside the toggle. |
There was a problem hiding this comment.
Non-blocking: one 26-word sentence. Suggest: "A compact cell clips the ring around the 24px toggle. At compact density the ring sits inside the toggle."
…that are not part of the fix
|
/approve-spec cd72770 |
There was a problem hiding this comment.
Changes requested. The three Table tab stops now draw the shared, token-driven focus ring, its edges clear a bordered Card, and the changeset describes the Card's corners honestly; what blocks is that the branch is behind main:
- Miss:
useTableTreeData.tsxconflicts withmainin its import block and in both toggles, becausemainmoved them touseComponentTranslatorand addedgetRowLabelnaming, so please rebase, keepmain's side, and re-add theTableContextimport and theisCompactread with the ring props (with that resolution the Table and tree suites pass, 242 tests). - Miss:
TableFocusRing.a11y.chromium.spec.tsimports@astryxdesign/a11y-spec/playwright, which this branch'sinternal/a11y-specdoes not export, so core's typecheck fails at this head with five errors in that file (the same rebase fixes it).
An engineering owner's change request from an earlier revision is still open; this head addresses both of its points, but only that owner can clear it. CI has not run yet because the pull request is a draft.
[Automated review]
# Conflicts: # packages/core/src/Table/plugins/tree/useTableTreeData.tsx
|
/approve-spec a915c4a |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TableBody | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
| TableFooter | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
| TableHeader | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
8 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TableRow | 6.9 kB (0) · 3.9 kB CSS (0) | — | ✓ · ✓ · ✗ |
| Markdown | 177.7 kB (+32 B) · 20.0 kB CSS (+24 B) | — | — · — · — |
| Table | 115.3 kB (+23 B) · 17.7 kB CSS (+24 B) | — | ✓ · ✓ · — |
| lab/CommentThread | 317.4 kB (+30 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/Comments | 322.4 kB (+18 B) · 2.5 kB CSS (0) | — | — · — · — |
| TableCell | 107.1 kB (0) · 17.4 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableHeaderCell | 106.6 kB (0) · 17.2 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableSelectionToolbar | 68.0 kB (0) · 13.0 kB CSS (0) | — | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 6.90 MB packed (+743 B); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 21 rows, core 25 rows; run pnpm api:report.
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
No blocking findings at this head: the scroll wrapper and both tree toggles draw the shared, token-driven focus ring, the wrapper's ring fits inside a bordered Card on every edge, and at compact density the toggles' ring sits inside the button.
What is left is not a code change:
- An engineering owner's change request from an earlier revision is still open; this head addresses both of its points (the Card clip and the compact-density clip), but only that owner can clear it by re-reviewing or dismissing it.
CI's build and test jobs are deferred on this head and run before merge, so they still have to pass. Three new source comments could be shortened to their reason, as the existing inline suggestions show; that is optional.
[Automated review]
Dismissed by Cindy's agent with her authorization: head a915c4a addresses both points: (1) the scroll wrapper's ring is inset by the outline width plus the theme border width (Table.tsx:146-150), so its outer edge sits inside a bordered Card's clip; a real-Chrome check against this head's Storybook build, measuring the ring against every clipping ancestor, finds nothing cut at 480 and 1280 px left-to-right, 390 and 1280 px right-to-left, and theme border widths of 0, 1 and 3 px, and the changeset now claims the edges only (a Card's rounded corners still trim the ring's square corners); (2) at compact density both tree toggles inset their ring (useTableTreeData.tsx:270, 364-379, 421-428), and the same check finds nothing cut for the row expander and the expand-all toggle at compact and default density, in both directions.
|
/approve-spec 76dcfdf |
There was a problem hiding this comment.
Approved pending CI: the build, test and docsite jobs have not run on this head yet (they are deferred until before merge), so they still have to pass.
No blocking findings. The scroll wrapper and both tree toggles draw the shared, token-driven focus ring; the wrapper's ring fits inside a bordered Card on every edge in both directions; and at compact density the toggles' ring sits inside the button. Both points from the earlier change request, the Card clip and the compact-density clip, are fixed at this head.
Optional: three new source comments could be shortened to their reason, as the existing inline suggestions show.
[Automated review]
…-conditional-attr Every TableTree story already carries this baselined exception (the tree rows' aria-expanded inside a table); the CompactDensity story added here shows the same rows.
|
/approve-spec fe868a8 |
There was a problem hiding this comment.
Changes requested. The focus-ring fix itself holds up: the scroll wrapper and both tree toggles draw the shared, token-driven ring, inside a bordered Card and at compact density. One thing in the newest commit needs fixing:
- The baseline entry at
.github/a11y-baseline.json:337keys the story ascore/TableTree::…, but the accessibility gate builds the key from the ownercore/tabletreeand matches it exactly, so theCompactDensitystory'saria-conditional-attris still reported as new (the touched-components check stays red, and the release check's full audit would fail after merge); write it ascore/tabletree::core-tabletree--compact-density::aria-conditional-attr, or regenerate it withpnpm a11y:baseline -- --components tabletree.
[Automated review]
…ercase owner The gate builds keys from the story owner core/tabletree and matches exactly.
|
/approve-spec 294eda1 |
There was a problem hiding this comment.
Approved pending CI: the heavy suites (test, build, docsite-test) are deferred on this head and run before merge; lint, typecheck and the smoke test pass.
The baseline entry for the CompactDensity story now uses the owner the accessibility gate computes, core/tabletree, and the gate passes for the TableTree stories with no new violations. The focus-ring fix itself is unchanged and holds up: the scroll wrapper and both tree toggles draw the shared, token-driven ring, with whole edges inside a bordered Card and inside the toggle at compact density.
The three earlier comment-wording suggestions stay open as inline threads; they are non-blocking.
[Automated review]
Part of #8852 (the Table half; CodeBlock and Carousel, and ChatMessageList, Tooltip and HoverCard follow as their own PRs)
Corners
A bordered Card's rounded corner still trims the ring's corners. That is addressed separately by the container corner-radius work (containers share their radius with full-bleed children).
User impact
A keyboard user tabbing through a
Tablemeets three tab stops that ignore the app's theme. The browser draws its own default focus ring on them: the scroll wrapper once the table scrolls inline, and the tree plugin's row expander and expand-all toggle. That ring has its own colour, width and style, looks different in each browser, and inside aCardit's partly cut off at the card's edge, so the focused element is hard to see. After this change each of them draws the same theme-driven ring as every other Astryx control, whole.Problem and solution fit
--focus-outline-*tokens are how Astryx draws one).Cardclips (overflow: clip), so a ring drawn around the wrapper falls outside the clip.The fix composes the shared ring (
focusOutlineStyles.focusVisible/focusOutlineProps.focusVisible) on all three. On the wrapper only, the ring is inset by its own width plus the border width, so it stays clear of a bordered Card's border and inside the clip. Atdensity="compact"the tree toggles' ring is inset by its width, so the cell'soverflow: hiddendoes not cut it.Expected behavior and authority
architecture:interaction-modalitynamesutils/focusOutline.stylex.tsand the focus tokens as the shared focus-indicator mechanics and theme seam.ScrollableAreaalready gives the same scroll viewport the shared ring.Smallest restoration
Table.tsx: the scroll wrapper composes the shared ring plus an inset offset (calc(-1 * (--focus-outline-width + --border-width))).useTableTreeData.tsx: the row expander and the expand-all toggle compose the shared ring throughfocusOutlineProps.focusVisible.Evidence
Real Chrome 156 (headless, DPR 2), Storybook from
mainand from this branch. Focus was reached by real Tab presses, so:focus-visiblematches. Computed outline on the focused element, and whether its painted ring fits inside the nearest clipping ancestor:mainauto 1pxUA ring; cut off by the Cardsolid 2pxtheme colour, offset-3px; edges whole (a Card's rounded corners trim the square corners)auto 1pxUA ringsolid 2pxtheme colour, offset3px; wholeauto 1pxUA ringsolid 2pxtheme colour, offset3px; wholeTable.focusRing.test.tsx, 3 cases, all failing onmain;TableFocusRing.a11y.chromium.spec.ts, 2 cases, failing onmainand passing on this PR's Vercel Storybook (the Card wrapper and the compact tree toggles paint a solid ring whose straight edges no clipping ancestor cuts; the check compares rectangles and does not see the Card's corner radius, so it does not cover the clipped corners noted above). Each tab stop carries the classes the shared ring compiles to, and the wrapper also carries the inset. jsdom doesn't match:focus-visible, so the geometry is the browser check above.maintoo.Scope
Testing
pnpm vitest run packages/core/src/Table: 649 pass, with the new tests failing first.tsc --noEmitfor core, eslint, prettier.Chromium evidence
TableFocusRing.a11y.chromium.spec.tspasses 2 of 2 against this head's exact Vercel Storybook (1ce8da1). The compact tree toggles paint a solid ring that no clipping ancestor cuts. The bordered-Card scroll wrapper's ring has whole straight edges, but its corners are clipped by the Card's rounded corner (see Corners above). On main all three stops fail: the ring is the browser'sautooutline, and the CompactDensity story does not exist there.