Repository navigation
perf(Table): a collapsed expansion chevron has no positioned box at rest - #13455
Conversation
Safari on iPhone pays for every positioned or transformed box in a table on each frame of a row glide. A long expandable table carried two per row in the chevron: the glyph box (position: relative, rotate(0deg)) and its absolutely centred child. The glyph is now centred by a floated flex box, which keeps it out of the line, so the box's baseline stays its bottom edge whatever the glyph size. A collapsed LTR chevron has no transform; RTL keeps its scaleX(-1) mirror, because the icon slot has no mirrored artwork and only CSS knows the direction. Open chevrons turn as before.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec f40c1e3 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Table | 125.8 kB (0) · 21.2 kB CSS (0) | — | ✗ · ✓ · — |
| TableBody | 6.8 kB (0) · 3.3 kB CSS (0) | — | ✗ · ✓ · ✗ |
| TableCell | 107.6 kB (0) · 20.2 kB CSS (0) | — | ✗ · ✓ · ✓ |
5 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TableFooter | 3.6 kB (0) · 3.3 kB CSS (0) | — | ✗ · ✓ · ✗ |
| TableHeader | 3.6 kB (0) · 3.3 kB CSS (0) | — | ✗ · ✓ · ✗ |
| TableHeaderCell | 107.5 kB (0) · 20.0 kB CSS (0) | — | ✗ · ✓ · ✓ |
| TableRow | 7.3 kB (0) · 4.1 kB CSS (0) | — | ✗ · ✓ · ✗ |
| TableSelectionToolbar | 78.4 kB (0) · 14.6 kB CSS (0) | — | ✗ · ✓ · ✓ |
Visual changes: 2 snapshots in 1 component
A change is a question for the reviewer, not a failure.
| Component · story | Before | After | Diff |
|---|---|---|---|
| Table · Default (neutral, dark) · inherited from main | ![]() |
![]() |
![]() |
| Table · Default (neutral, light) · inherited from main | ![]() |
![]() |
![]() |
Inheritance checked against the 7 newest reports of other pull requests.
Package size: @astryxdesign/core 7.99 MB packed (+186 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approved: CI passed on this head.
A collapsed row-expansion chevron renders with no positioned box and, outside right-to-left tables, no transform, and it looks, turns and aligns as before. The new browser test fails on main and passes here, including in CI's Chromium run, and every theme glyph size still keeps the row height.
The four optional inline notes on this head still apply (the comment wording at useTableRowExpansion.tsx lines 226-230 and 257-258, the exact matrix strings in the new test, and its @input header); none of them blocks.
Claims and files checked
Review mode: same-head; reason: none
- Claim (title and release note): a collapsed chevron has no positioned box. Verified: browser probe, and the new test fails on main and passes here.
- Claim (release note): no transform outside right-to-left tables. Verified: left-to-right has none; right-to-left keeps only its mirror.
- Claim: each row's chevron carried two such boxes. Verified on main: the relative glyph box and its absolute centring span.
- Claim: Safari pays for every such box on each frame of a row glide; this change alone does not measurably shorten the stall, and both halves together bring it to 19-68 ms. These are the author's iPhone measurements, stated in the description; no requirement depends on them.
- Claim: the chevron looks, turns and aligns the same (46 of 48 frames byte-identical, 2 off by 1/255 on 6 pixels). Verified in substance: all 17 before/after frames taken for this review are byte-identical, and the open-state transforms are unchanged in both directions.
- Claim: a theme's glyph size still leaves the row height alone. Verified: default, small, medium, large and hidden glyphs all keep a 43 px row.
- Claim: the float keeps the glyph out of the line, so the box's baseline stays its bottom edge. Verified through the row heights.
- Claim: a collapsed left-to-right chevron's transform is none, and open chevrons keep their quarter turn. Verified in the source and the computed transforms.
- Claim: right-to-left keeps its mirror because the icon slot has no mirrored artwork and Core has no render-time direction. Conclusion verified; the second reason overstates, since a render-time direction exists but must not drive rendering.
- Claim: the new test fails on main and passes here in both directions. Verified, and CI's Chromium run passes it.
- Claim: the unit, browser, type, lint, knowledge and changeset checks pass. Verified at this head: CI passed with no failing check, including the unit shards, typecheck, lint and the Chromium browser specs.
- Claim: no overlap with the four listed pull requests. Verified: none of them changes the chevron's styles.
- File
.changeset/table-expansion-chevron-unpositioned-at-rest.md: clear. - File
packages/core/src/Table/__tests__/TableRowExpandSlot.a11y.browser.spec.ts: passes; optional tolerance and header suggestions. - File
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: correct; optional comment suggestions.
|
/approve-spec b037d1f |
There was a problem hiding this comment.
Approved: CI passed on this head.
A collapsed row-expansion chevron now renders with no positioned box and, outside right-to-left tables, no transform, and it looks, turns and aligns as before. The new browser test fails on main and passes here, including in CI's Chromium run in both directions, and every theme glyph size still keeps the row height.
The four optional inline notes on this head still apply (the comment wording at useTableRowExpansion.tsx lines 229-233 and 260-261, the exact matrix strings in the new test, and its @input header); none of them blocks.
Claims and files checked
Review mode: same-head; reason: none
- Claim (title and release note): a collapsed chevron has no positioned box. Verified: a browser probe shows none on this head, against a relative and an absolute box on
main, and CI's Chromium run of the new test passes. - Claim (release note): no transform outside right-to-left tables. Verified: left-to-right has none; right-to-left keeps only its mirror (
useTableRowExpansion.tsxlines 262-267). - Claim (release note): Safari on iPhone pays for every such box on each glide frame, and a long table had two per row. Two per row verified on
main; the Safari cost is the author's device measurement. - Claim: this change alone does not measurably shorten the stall, and both halves together bring it to 19-68 ms. These are the author's iPhone measurements, stated in the description; no requirement depends on them.
- Claim (release note and description): the chevron looks, turns and aligns the same. Verified: all 11 before/after frame pairs taken on this head are byte-identical, and the open transforms are unchanged in both directions.
- Claim: the pixel comparison against
mainmatched in 46 of 48 frames, the other 2 differing by 1/255 on 6 pixels. The author's capture; the 11 pairs taken for this review, including the dark right-to-left frame with a row open, are byte-identical. - Claim (release note and description): a theme's glyph size still leaves the row height alone. Verified: default, small, medium, large and hidden glyphs all keep a 43 px row, and CI's row-height test passes.
- Claim: the float keeps the glyph out of the line, so the box's baseline stays its bottom edge. Verified through the row heights and the unchanged button offset.
- Claim: a collapsed left-to-right chevron's transform is none, and open chevrons keep their quarter turn. Verified in the source and the computed transforms; CI's row-glide test of the chevron's turn passes.
- Claim: right-to-left keeps its mirror because the icon slot has no mirrored artwork and Core has no render-time direction. Conclusion verified; the second reason overstates, since a render-time direction exists but must not drive rendering.
- Claim: the new test fails on
mainand passes here in both directions. Verified by replaying its assertions on the same story, and CI's Chromium run passes it on this head. - Claim: the unit, browser, type, lint, knowledge and changeset checks pass. Verified on this head for the Table and Icon unit tests (1,123 of 1,123), lint, the package type build, and the knowledge and changeset checks; CI passed on this head, including its Chromium browser specs for row glide (14), cell menus (6) and row expansion (3).
- Claim: no overlap with the four listed pull requests. Verified: one is now in
mainand merges cleanly, and the other three do not change the chevron's styles or markup. - File
.changeset/table-expansion-chevron-unpositioned-at-rest.md: clear. - File
packages/core/src/Table/__tests__/TableRowExpandSlot.a11y.browser.spec.ts: passes in CI; optional tolerance and header suggestions. - File
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: correct, and consistent with the merged store change; optional comment suggestions.
|
/approve-spec 0c844e2 |
… each Folds in review notes: the expanded chevron's quarter turn is compared as rounded matrix values, so an engine that keeps cos 90 degrees as a tiny number still matches; the glyph box comments are shorter and say the rendered direction comes from the DOM; the spec header names both stories.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The pull request is a draft, so its checks were skipped; they run once it leaves draft.
A collapsed row-expansion chevron renders with no positioned box and, outside right-to-left tables, no transform, and it looks, turns and aligns as before. The merge from main changes none of this pull request's files, and fresh before/after captures on this head are byte-identical.
The four optional inline notes on this head still apply (the comment wording at useTableRowExpansion.tsx lines 229-233 and 260-261, the exact matrix strings in the new test, and its @input header); none of them blocks.
Claims and files checked
Review mode: incremental; reason: none
changed rules (0): none
- Claim (title and release note): a collapsed chevron has no positioned box. Verified: a browser probe on this head shows none, against a relative and an absolute box on
main. - Claim (release note): no transform outside right-to-left tables. Verified: left-to-right has none; right-to-left keeps only its mirror (
useTableRowExpansion.tsxlines 262-267). - Claim (release note): Safari on iPhone pays for every such box on each glide frame, and a long table had two per row. Two per row verified on
main; the Safari cost is the author's device measurement. - Claim: this change alone does not measurably shorten the stall, and both halves together bring it to 19-68 ms. These are the author's iPhone measurements; no requirement depends on them.
- Claim (release note and description): the chevron looks, turns and aligns the same. Verified: all 10 before/after frame pairs taken on this head are byte-identical, and the open transforms are unchanged in both directions.
- Claim: the pixel comparison against
mainmatched in 46 of 48 frames, the other 2 differing by 1/255 on 6 pixels. The author's capture; the 10 pairs taken for this review, including dark right-to-left, are byte-identical. - Claim (release note and description): a theme's glyph size still leaves the row height alone. Verified: default, small, medium, large and hidden glyphs all keep a 43 px row in both directions.
- Claim: the float keeps the glyph out of the line, so the box's baseline stays its bottom edge. Verified through the row heights and the centred glyph at every size.
- Claim: a collapsed left-to-right chevron's transform is none, and open chevrons keep their quarter turn. Verified in the source and the computed transforms.
- Claim: right-to-left keeps its mirror because the icon slot has no mirrored artwork and Core has no render-time direction. Conclusion verified; the second reason overstates, since a render-time direction exists but must not drive mirroring.
- Claim: the new test fails on
mainand passes here in both directions. Verified by replaying its assertions on the same story at this head and its base. - Claim: the unit, browser, type, lint, knowledge and changeset checks pass. On this head the Table and Icon unit tests pass apart from one Tooltip-loading timing test that passes when run alone here and on
main; the package type build, lint of the changed files, and the knowledge and changeset checks pass. The browser specs were not run here, and CI has not run on this head. - Claim: no overlap with the four listed pull requests. Verified: one is now in
main, and the other three do not change the chevron's styles or markup. - File
.changeset/table-expansion-chevron-unpositioned-at-rest.md: clear. - File
packages/core/src/Table/__tests__/TableRowExpandSlot.a11y.browser.spec.ts: consistent with the styles; optional tolerance and header suggestions. - File
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: correct, and unchanged by the merge; optional comment suggestions.
|
/approve-spec e50bd26 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is a draft and its checks were skipped; they run once it leaves draft.
A collapsed row-expansion chevron renders with no positioned box and, outside right-to-left tables, no transform, and it looks, turns and aligns as before. The latest commit applies the four earlier optional notes.
One optional tightening: the rounded turn check in the new browser test passes from about 60° of the turn, so it can finish before the chevron settles; rounding each value to three decimals keeps the cross-engine tolerance (see the inline note).
Claims and files checked
Review mode: incremental; reason: none
changed rules (0): none
- Claim (title and release note): a collapsed chevron has no positioned box. Verified: browser probes on this head show none, against a relative and an absolute box on the base (
useTableRowExpansion.tsxlines 233-244). - Claim (release note): no transform outside right-to-left tables. Verified: left-to-right has none; right-to-left keeps only its mirror (lines 261-266).
- Claim (release note and description): Safari on iPhone pays for every such box on each glide frame, and each row carried two at rest. Two per row verified on the base; the Safari cost is the author's device measurement.
- Claim (release note and description): the chevron looks, turns and aligns the same. Verified: 13 before/after frame pairs, light and dark, both directions, at rest and with a row open, are byte-identical, and the open transforms settle to the same quarter turn.
- Claim (release note and description): a theme's glyph size still leaves the row height alone. Verified: default, small, medium, large and hidden glyphs all keep a 43 px row in both directions.
- Claim: the float keeps the glyph out of the line, so the box's baseline stays its bottom edge. Verified through the row heights and the glyph's unchanged 12 px box at every size.
- Claim: a collapsed left-to-right transform is none, open chevrons keep their quarter turn, and the turn between them is unchanged. Verified in the source, the computed transforms and mid-turn samples that match the base.
- Claim: right-to-left keeps one transformed box per row instead of two. Verified: two boxes on the base, one on this head.
- Claim: the mirror stays because the icon slot has no mirrored artwork and Core has no render-time direction. Verified in substance: the only render-time direction is the provider default, which must not drive mirroring; the code comment now says this precisely.
- Claim: this change alone does not measurably shorten the stall, and both halves together bring it to 19-68 ms. The author's iPhone measurements; no requirement depends on them.
- Claim: 46 of 48 frames matched the base and 2 differed by 1/255 on 6 pixels. The author's capture; the 13 pairs taken for this review, including dark right-to-left with a row open, are byte-identical.
- Claim: the new browser test fails on the base and passes here in both directions. Verified by replaying its assertions on the same story at the base and this head.
- Claim: unit, browser, type, lint, knowledge and changeset checks pass. Lint, formatting, the changeset check and the package build pass here; the unit and browser suites were not rerun for this comment-and-test commit, and CI has not run on this head.
- Claim: no overlap with #13359, #11569, #8861 and #8281. Verified: #13359 is merged and already in the base; the other three change lines 45-46, 854 and 1056, not the chevron's styles or markup.
- File
.changeset/table-expansion-chevron-unpositioned-at-rest.md: clear. - File
packages/core/src/Table/__tests__/TableRowExpandSlot.a11y.browser.spec.ts: consistent with the styles; optional tightening of the turn check. - File
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: correct; the rewritten comments say one thing each.
Rounds each matrix value to three decimals, so a turn still in flight does not pass, and an engine's tiny cos 90 degrees still does.
|
/approve-spec 0ffb5ee |
There was a problem hiding this comment.
Approved: CI passed on this head.
A collapsed row-expansion chevron renders with no positioned box and, outside right-to-left tables, no transform, and it looks, turns and aligns as before. Nothing is left to change.
Claims and files checked
Review mode: same-head; reason: none
changed rules (0): none
- Claim (title and release note): a collapsed chevron has no positioned box. Verified: on the base a collapsed toggle holds a
relativeand anabsolutebox; here every element in it is static (useTableRowExpansion.tsxlines 233-244, probed in both directions). - Claim (release note): no transform outside right-to-left tables. Verified: a collapsed left-to-right chevron computes
none; right-to-left keeps only its mirror (lines 259-266). - Claim (release note and description): Safari on iPhone pays for every such box on each glide frame, and each row carried two. Two per row verified on the base; the Safari cost is the author's device measurement.
- Claim (release note and description): the chevron looks, turns and aligns the same. Verified: 9 before/after frames (both directions, light and dark, at rest and with a row open) are pixel-identical, and the open chevron settles at the same quarter turn.
- Claim (release note and description): a theme's glyph size still leaves the row height alone. Verified: default, small, medium, large and hidden glyphs keep the same row heights in both directions, and CI passes the row-height test.
- Claim: the float keeps the glyph out of the line, so the box's baseline stays its bottom edge. Verified through the unchanged row heights and the glyph box's unchanged 12 px size and position.
- Claim: a collapsed left-to-right transform is none, open chevrons keep their quarter turn, and the turn between them is unchanged. Verified in the source (the transition is untouched) and in the settled transforms.
- Claim: right-to-left keeps one transformed box per row instead of two. Verified: two boxes per row on the base, one here.
- Claim: the mirror stays because the icon slot has no mirrored artwork and Core has no render-time direction. Verified in substance: Core's only render-time direction is the provider's default, which the direction rules bar as the source for mirroring.
- Claim: on its own the change does not measurably shorten the stall, and with the context-menu half removed too it drops to 19-68 ms. The author's iPhone measurements; no requirement depends on them.
- Claim: 46 of 48 frames matched main and 2 differed by 1/255 on 6 pixels. The author's capture; all 9 frames taken for this review are pixel-identical.
- Claim: the icon-slot story's rows all stay 43 px, as on main. Verified as unchanged from main: each table's rows measure 43, 43 and 42.5 px on both.
- Claim: the new browser test fails on main and passes here in both directions. Verified: CI passes all three tests here; on the base a collapsed toggle holds the two boxes the new assertion rejects.
- Claim: unit, browser, type, lint, knowledge and changeset checks pass. Verified: every CI check at this revision passed, including the unit shards, the type check, lint and the browser specs.
- Claim: no overlap with #13359, #11569, #8861 and #8281. Verified: #13359 is merged and in the base; the other three change other parts of the file (its imports, the expansion store and the glide code), not the chevron's styles or markup.
- File
.changeset/table-expansion-chevron-unpositioned-at-rest.md: clear. - File
packages/core/src/Table/__tests__/TableRowExpandSlot.a11y.browser.spec.ts: clear. - File
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: clear.






What changes for people
A long Table with row expansion stalls on iPhone when a row glides open: Safari pays for every positioned or transformed box in the table on each frame of the glide. Each row's chevron carried two of them at rest. This change takes both out of a collapsed chevron. It looks, turns and aligns the same.
This is one of the two per-row costs behind the stall. The other is the cell context menu's trigger and cursor anchor, which waits on a design decision. On its own, this change doesn't measurably shorten the stall: at 1,000 rows on an iPhone 14, the chevron-only arm was 2.68–2.74 s against a 2.72–2.93 s control, because the context-menu boxes still dominate. With both removed, the stall drops to 19–68 ms at 250–1,000 rows, against 0.18–2.9 s before.
How
useTableRowExpansion's glyph box losesposition: relative. Its glyph is centred by a floated flex box instead of an absolutely positioned one. The float keeps the glyph out of the line, so the box's baseline is still its bottom edge, and a theme's glyph size still leaves the row height alone. That's what the absolute box did.noneinstead ofrotate(0deg)in LTR. Open chevrons keeprotate(90deg), and the turn between them is unchanged.scaleX(-1)mirror, so it has one transformed box per row instead of two. The icon slot (table-row-expand, state{expanded}) has no mirrored artwork for a theme's glyph, and Core has no render-time direction, so the glyph can't be swapped instead of mirrored.Evidence
TableRowExpandSlot.a11y.browser.spec.tsfails on main (a collapsed toggle hasrelativeandabsoluteboxes) and passes here, in LTR and RTL.Overlap checked: #13359, #11569, #8861, #8281 (they edit useTableRowExpansion.tsx's store, row press or context-menu paths, not the chevron's styles or markup; no shared lines)