Repository navigation
feat(Table): pin group headings while their section is on screen - #6234
Merged
ernestt merged 5 commits intoSep 21, 2026
Merged
Conversation
useTableGroupedRows takes hasStickyGroupHeaders. With it on, each heading holds at the top of the table's scroll container until the next section pushes it out, so a reader scrolling deep inside a long group can still see which group they are in. A sticky cell leaves its row behind, and the row is what carries the heading's fill, so the pinned cell needs a background of its own or the rows travelling under it show through. It also sits at z-index 2 to clear the body cells useTableStickyColumns pins at 1, which would otherwise paint over the heading as rows pass beneath. The offset needed the two plugins to cooperate. A heading pinned at the top of the scrollport lands on the header row useTableStickyHeader pins there too, and because tbody follows thead in the document the heading wins and hides it. useTableStickyHeader now measures its header and publishes the height as --table-sticky-header-height on the scroll container, and a pinned heading starts below that — the same way the two plugins already share --table-sticky-background. With no pinned header the variable is unset and the heading pins to the top edge, which is right for a table that only pins its headings. Co-authored-by: Cursor <[email protected]>
ernestt
requested review from
cixzhang,
humbertovirtudes,
imdreamrunner and
josephfarina
as code owners
September 10, 2026 23:42
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
AI review status for this pull request.
|
HookParamDoc spells it `default`, not `defaultValue`. The docsite compiles its generated registry against that type, so the wrong key only surfaced as a Next.js type error in the Vercel build rather than anywhere local. Co-authored-by: Cursor <[email protected]>
ernestt
added a commit
that referenced
this pull request
Sep 11, 2026
Co-authored-by: Cursor <[email protected]>
Contributor
There was a problem hiding this comment.
Thanks for keeping the existing chevron size and legacy layout unchanged. I still don’t think this should add a public sticky-layout switch: the component already owns keeping its existing collapse action reachable. The current implementation also strands that button for custom headers after horizontal scrolling in both directions, clips it in vertical writing, and leaves the measured offset behind when the sticky-header plugin is removed. Could we keep the coordination internal and cover those compositions before exposing the behavior?
…eight Per AST-025 FR1/FR3, resolve the logical block axis through the computed writing mode before reading physical geometry. In vertical and sideways writing modes the block axis is horizontal, so the published --table-sticky-header-height is the thead's width there; the physical height clipped pinned headings and the collapse control.
This branch was successfully deployed
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.
Stacked on #6221 — review that one first; this PR's diff is only the last commit.
useTableGroupedRowstakeshasStickyGroupHeaders. With it on, each group heading holds at the top of the table's scroll container until the next section pushes it out, so a reader scrolling deep inside a long group can still see which group they are in.What it looks like
Same table, same scroll position, 48 people in four teams of twelve. Scrolled far enough into Infra that the heading has left the top of the list.
hasStickyGroupHeadersoffOn the left there is nothing on screen that says which team these people are on. On the right the heading is holding under the header row — at the header's measured height, not over it and not guessed.
Scrolled on both axes with
useTableStickyColumnspinningName, the heading stays above the pinned column and below the pinned header:Why it needed both plugins
Pinning a heading vertically is not just
position: stickyon the cell.A sticky cell leaves its row behind, and the row is what carries the heading's fill — without a background of its own the pinned cell is transparent and the rows travelling under it show through. It also has to clear the body cells
useTableStickyColumnspins atz-index: 1, or a pinned column paints over the heading as rows pass beneath it.The offset is the part that needed the two plugins to cooperate. A heading pinned at the top of the scrollport lands on the header row
useTableStickyHeaderpins there too, and becausetbodyfollowstheadin the document the heading wins and hides it. There is no integer left between the sticky column's body cells at 1 and the pinned header at 2, so the fix is not a z-index but an offset:useTableStickyHeadernow measures its header and publishes the height as--table-sticky-header-heighton the scroll container, and a pinned heading starts below that. The two plugins already share--table-sticky-background, so this follows a path that exists.Nothing to wire up. Install both and the heading comes to rest under the header; with no pinned header the variable is unset and the heading pins to the top edge, which is the right answer for a table that only pins its headings.
Both need a scrollport with somewhere to travel, which is what
useTableStickyHeader'smaxHeightis for — a container with no bounded height never scrolls itself, and a heading cannot pin to a scrollport it is not inside.Verified
Measured in Storybook against the real plugins, not just in jsdom:
top: 0, 37.5px tall, publishing--table-sticky-header-height: 37.5pxTwo stories added under
Core/TableGroupedRows, plus 7 tests: the option is off by default, on when asked, applies to every heading rather than only the first, survivesrenderGroupHeader, publishes the height, publishes nothing when the header is not pinned, and keeps publishing whenuseTableStickyColumnsalso holds the wrapper ref (that last one guards ref clobbering, which is the easy way to break this).Follow-up to #6222
#6222 keeps the heading visible when the table is scrolled sideways. This is the same instinct on the other axis, split out because that one is a regression fix and this is a feature that depends on #6221.
Made with Cursor