Repository navigation
table: Allow a header row height separate from the body - #3420
Merged
Merged
Conversation
A taller header was forcing every body row to grow, because both bands used Size::table_row_height. header_height sets the header band only. Page Up and Page Down subtract that band before dividing by the body row height. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thanks for the PR! I pushed a small follow-up. I renamed |
madcodelife
enabled auto-merge (squash)
October 9, 2026 03:25
madcodelife
disabled auto-merge
October 9, 2026 03:25
madcodelife
enabled auto-merge (squash)
October 9, 2026 03:25
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.
Description
DataTableused one height for header rows and body rows, so a two-line header forced every record row to grow with it.header_row_heightsets the height of each header row on its own. Body rows keepSize::table_row_height. Whenheader_row_heightis unset, header rows still use that body height, so existing tables look the same.Page Up and Page Down used to subtract one body row as a stand-in for the header. They now subtract the full header band (header row height times the number of header rows) before dividing by the body row height. With a single header row at the body height, that is the same count as before.
Screenshot
No visual change when
header_row_heightis unset. The Data Table story adds a Header Row Height menu (Default / 40px / 48px) to try it.Public API
gpui-component
gpui_component::table::DataTable::header_row_height(self, height: impl Into<gpui::Pixels>) -> Self— sets each header row's height independently of the body row size. Column-group rows use the same height. When unset, header rows keepSize::table_row_height().How to Test
cargo check -p gpui-component --lockedcargo check -p gpui-component-story --locked(passed here)cargo runand open the Data Table story. Scroll and use Page Up / Page Down. With Header Row Height on Default, the header and scrollbar match the previous build. Group Headers is on by default, so Page Up / Page Down now step one row less than before, because both header rows are subtracted. Switch Header Row Height to 40px or 48px to see taller header rows over unchanged body rows.DataTable::new(&state).with_size(Size::Size(px(20.))).header_row_height(px(34.)). Header rows are 34px and body rows stay 20px. The vertical scrollbar starts below the header band.Checklist
cargo runfor story tests related to the changes.