Repository navigation
fix(Table): keep the grouped-rows chevron pinned under a custom header - #6222
Conversation
`useTableGroupedRows` shrink-wrapped its group-header wrapper only when the header used the built-in heading. The reasoning was that a custom `renderGroupHeader` may want the full column width — but a sticky box is confined to its containing block, so a wrapper already spanning the cell (and the cell spans every column) has no slack to take up and never moves. Any table combining `renderGroupHeader` with `useTableStickyColumns` therefore lost its collapse toggle off-screen as soon as it scrolled sideways, and userland could not fix it: the chevron belongs to the plugin, so a caller can pin their own heading but cannot reach the control. The wrapper is now shrink-wrapped unconditionally. Co-authored-by: Cursor <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: 36 accessibility violation(s) found — 2 critical, 34 serious. Button pattern - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
Checkbox pattern - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 1 issue(s)
CodeEditorPerf - 1 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
LogStream - 1 issue(s)
MediaTheme Auto - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
Radio group pattern - 1 issue(s)
RadioList - 1 issue(s)
RichTextEditor - 2 issue(s)
SelectableCard - 1 issue(s)
Stepper - 1 issue(s)
TableGroupedRows - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Visual RegressionStatus: No visual change across 2 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
The chevron is the control for an entire section and sits beside a heading, so at 12px it read as decoration on the label rather than as the thing you press, and it was the smallest hit target in the table. Row height is unchanged — the heading's line box is taller than either size, so the row was never measuring the chevron — and the button shrink-wraps the glyph, so nothing needed resizing around it. Co-authored-by: Cursor <[email protected]>
|
Added a second commit: the group-header chevron grows from 12px to 16px. It is the control for an entire section and sits beside a semibold heading, so at 12 it read as decoration on the label rather than as the thing you press — and it was the smallest hit target in the table. The button shrink-wraps the glyph, so nothing needed resizing around it, and row height is unchanged at 41px because the heading's line box is taller than either chevron size. Measured both ways in the It rides along here because it is the same element this PR is already about. |
|
Follow-up opened as #6234: the same instinct on the vertical axis, It is stacked on #6221 rather than folded in here, because it needs the header height that plugin now publishes, and because this PR is a regression fix that should stay revertable on its own. |
Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Thanks, this does keep the existing collapse control reachable after horizontal scrolling in both LTR and RTL. Two unrelated visual changes still need to come out: the custom renderer’s containing block shrinks from the full row (1128px in the browser check) to its content (281px), so trailing full-row content moves beside the label; and the icon grows from 12px to 16px. Please preserve the existing custom-header layout and icon size while pinning only the plugin-owned control.
cixzhang
left a comment
There was a problem hiding this comment.
Updating the icon seems okay. We should make sure we're not only testing this situation with the layout update and we cover its original intention
|
Added the broader icon intent in #6429. It records the default 16px control/disclosure role plus the full size, outlined/filled, color, composition, and accessibility guidance, rather than making this one Table test the source of truth. #6222 keeps focused regression coverage for the original full-width custom-header layout and the plugin-owned pinned control. |
humbertovirtudes
left a comment
There was a problem hiding this comment.
The structural fix and accepted 16px icon direction look sound, but approval still needs exact-final-head browser evidence. Please demonstrate that the toggle remains visible and keyboard-operable at horizontal scroll end while a width: 100% custom header stays full width, in both LTR and RTL. The focused unit coverage cannot verify sticky overflow geometry.
There was a problem hiding this comment.
Thanks for splitting the fix so the plugin-owned chevron is pinned while custom group headers keep their full-row width — the source and the new regression test now preserve both intended declarations, and the focused and full Table suites pass.
One check is still needed before approval: because position: sticky depends on real overflow geometry, please add or record a browser-level check on the final revision showing, in both LTR and RTL, that the chevron remains visible and keyboard-operable at horizontal scroll end while a width: 100% custom header still spans its cell. The current screenshots predate the final positioning split, and the unit test only inspects style declarations.
[Automated review]
|
Recorded the requested browser-level evidence against exact head
This covers the final split: only the plugin-owned control sticks, while the |
Abandoning
useTableGroupedRowsloses its collapse chevron off the left edge as soon as a table is scrolled sideways — but only for callers who passrenderGroupHeader.What was wrong
The group header's inner wrapper is
position: stickyso the chevron and label ride along as the table scrolls horizontally. That only works if the wrapper is narrower than the cell it sits in: a sticky box is confined to its containing block, so one that already spans the cell — and the group header cell spans every column — has no slack to take up and never moves.The shrink-wrap that provides that slack was gated behind
!renderGroupHeader, on the reasoning that a custom heading might want the full column width. The cost of that choice wasn't visible at the time: it silently disabled the pinning it was paired with.Both shots scroll the same table to its right edge. The group labels are drawn by a custom
renderGroupHeader, which pins itself, so the label survives either way — it's the chevron that goes missing.Look at "Overview" and "Pricing": before, the labels are there and the toggles are not. The chevron in the after shot is also bigger than the one that went missing — that is the second commit, below.
Why userland can't work around it
The chevron belongs to the plugin. A caller can pin whatever they render inside
renderGroupHeader, but they have no handle on the control, so there is no way to keep the toggle on screen from outside. That's what makes this a fix rather than a default worth debating: the gate protected a width choice for custom content while taking away the only interactive element in the row.The affected combination is
renderGroupHeader+useTableStickyColumns, which is what any wide comparison or spend table reaches for.The change
width: fit-contentmoves ontoheaderInnerunconditionally andheaderInnerFitContentgoes away. Net −4 lines plus comments.A custom header that genuinely wants the full column width still lays out normally inside the shrink-wrapped span for any content that fills the visible cell; what it no longer gets is a wrapper wider than the viewport, which was never useful — that width existed off-screen.
Also: the chevron was 12px
Second commit. The chevron is the control for the whole section and it sits beside a heading, so at
xsmit read as decoration on the label rather than the thing you press, and it was the smallest hit target in the table.sm— 16px — is whatCollapsibleuses for the same job.Row height is unchanged: the heading's line box is taller than either size, so the row was never measuring the chevron.
Tests
One regression test, asserting the wrapper carries the same class with and without
renderGroupHeader. Verified it fails againstmain(expected 'useTableGroupedRows__styles.headerInn…' to be …) and passes here.packages/core/src/Tableis green: 552 tests, 27 files.