Skip to content

fix(data-table): Header fixes#775

Merged
paanSinghCoder merged 5 commits into
mainfrom
fix/datatable-sticky-header-virtualized
May 7, 2026
Merged

fix(data-table): Header fixes#775
paanSinghCoder merged 5 commits into
mainfrom
fix/datatable-sticky-header-virtualized

Conversation

@paanSinghCoder
Copy link
Copy Markdown
Contributor

@paanSinghCoder paanSinghCoder commented May 6, 2026

Bundles a few sticky-header / group-anchor fixes for DataTable.

  • Virtualized column header: was drifting off after ~one row. Sticky class was on an inner element whose containing block was a one-row-tall wrapper. Moved it to the wrapper itself.
  • Non-virtualized section header gap: .stickySectionHeader offset was --rs-space-10 (40px), but the column header renders at ~32px. Changed to --rs-space-8.
  • Virtualized first group duplicated: .stickyGroupAnchor was taking flex-column flow space, so the natural first group header rendered separately. Added explicit height + negative margin-bottom so it occupies zero flex space; the natural header lands behind it (covered via z-index).
  • Non-virtualized column header missing bottom border: border-collapse: collapse + sticky <th> eats the border-bottom. Locally overridden to border-collapse: separate; border-spacing: 0 for DataTable.Content only.
  • Virtualized group header font size too large: .virtualSectionHeader and .stickyGroupAnchor had no font-size rule and inherited the document default (~16px), while non-virtualized renders at small (~12px) via the <table> cascade. Added font-size and line-height tokens to match.

Test plan

  • Virtualized: column header pinned for full scroll range.
  • Virtualized + grouping: only one label at the top, group anchor stacks under column header while scrolling.
  • Non-virtualized + grouping: section header flush under column header.
  • Non-virtualized: bottom border visible on column header.
  • Virtualized + grouping: group header text matches non-virtualized in size.

`position: sticky` is bounded by its containing block. The sticky class was on the inner `VirtualHeaders` rowgroup, but the wrapping `<div ref={headerRef}>` (used for measurement) became the containing block and was only one header-row tall — so the header detached after ~one row of scroll.

Move `stickyHeader` onto the wrapper itself so its containing block becomes `.virtualTable` (full content height), restoring sticky behavior for the entire scroll range.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment May 7, 2026 5:35am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40bc8cc9-48cb-469f-b096-c7d373ab374f

📥 Commits

Reviewing files that changed from the base of the PR and between 3f40e26 and de56f78.

📒 Files selected for processing (1)
  • packages/raystack/components/data-table/data-table.module.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/raystack/components/data-table/data-table.module.css

📝 Walkthrough

Walkthrough

The pull request moves the headerRef and sticky header styling (styles.stickyHeader combined with classNames.header) from inside VirtualHeaders to the outer wrapper div in VirtualizedContent.tsx, and renders VirtualHeaders without a className prop. CSS changes in data-table.module.css include: tightening the .display-popover-properties-select>span selector, adding .contentRoot table rules (border-collapse: separate; border-spacing: 0), adjusting .stickyGroupAnchor spacing/height/box-sizing with a negative bottom margin, and changing .stickySectionHeader top offset from var(--rs-space-10) to var(--rs-space-8). No virtualization or grouped-row behavior logic was changed.

Suggested reviewers

  • rsbh
  • rohanchkrabrty
  • rohilsurana
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(data-table): Header fixes' directly relates to the changeset, which addresses multiple header-related issues in the data-table component including virtualized column headers, sticky section headers, and group anchors.
Description check ✅ Passed The description comprehensively details all changes in the PR including specific fixes for virtualized column headers, section header gaps, group duplicates, column header borders, and font sizing, with a test plan provided.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@paanSinghCoder paanSinghCoder marked this pull request as draft May 6, 2026 05:52
@paanSinghCoder paanSinghCoder marked this pull request as ready for review May 6, 2026 06:40
@paanSinghCoder paanSinghCoder marked this pull request as draft May 6, 2026 06:40
@paanSinghCoder paanSinghCoder marked this pull request as ready for review May 7, 2026 03:19
@paanSinghCoder paanSinghCoder changed the title fix(data-table): keep virtualized header sticky across full scroll range fix(data-table): Header fixes May 7, 2026
`.virtualSectionHeader` and `.stickyGroupAnchor` had no font-size rule
and inherited the document default (~16px), while the non-virtualized
variant renders group headers at small (~12px) via the `<table>` font
cascade. Added font-size and line-height tokens to both so they match.
@paanSinghCoder paanSinghCoder merged commit 0ae3f82 into main May 7, 2026
5 checks passed
@paanSinghCoder paanSinghCoder deleted the fix/datatable-sticky-header-virtualized branch May 7, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants