csv_preview: Implement data_table columns pining#56619
Merged
smitbarmase merged 12 commits intoMay 15, 2026
Merged
Conversation
Contributor
|
I think for a feature like this it's important to have tests asserting the behavior we want cc: @smitbarmase |
smitbarmase
requested changes
May 14, 2026
smitbarmase
left a comment
Member
There was a problem hiding this comment.
Thanks, I found a few nits, but there is one panic here that we should address first.
- Fix panic: clamp pinned_cols to valid range before slicing widths - Remove 4 redundant clones in header rendering (clippy errors) - Consolidate duplicate "disable if" cell-styling logic with render_cell() helper - Move pinned_width/total_scrollable_width computation into render_resize_handles_resizable()
smitbarmase
approved these changes
May 15, 2026
smitbarmase
left a comment
Member
There was a problem hiding this comment.
Thanks, I refactored the code a bit and added a few basic tests. I think this is much cleaner now.
Merged
via the queue into
zed-industries:main
with commit May 15, 2026
dca5976
49 of 51 checks passed
This was referenced May 27, 2026
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.
Summary
Adds column pinning (freeze) capability to data tables, allowing the first N columns to remain visible while scrolling horizontally through the rest of the table content.
Common spreadsheet/data table UX pattern. When viewing wide tables with many columns, users need to see identifying information (row labels, IDs) while scrolling right to explore data.
Demo
Idle state:


Scrolled horizontally (name column dissapeared, line numbers column stayed pinned):
Implementation
pin_cols(n: usize)builder method onTableto specify how many columns to pinContext
Part of CSV preview feature series, following PR #53496 (settings UI).
Before you mark this PR as ready for review, make sure that you have:
Aligned any UI changes with the UI checklistno ui changes besides pinning itself. UI improvements out of scope of this PRRelease Notes: