mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-23 12:37:09 +00:00
## 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: <img width="559" height="179" alt="image" src="https://github.com/user-attachments/assets/b3f89221-8aa9-4e8a-9a39-6f06cc8a4eea" /> Scrolled horizontally (name column dissapeared, line numbers column stayed pinned): <img width="522" height="174" alt="image" src="https://github.com/user-attachments/assets/c6695a00-5e40-49b8-81d7-0b30e26bb7bb" /> ## Implementation - New `pin_cols(n: usize)` builder method on `Table` to specify how many columns to pin - Pinned columns render in a fixed section that doesn't scroll horizontally - Scrollable columns render separately with independent scroll state - Horizontal scroll offset adjustments for proper column resize handle positioning with pinned sections - Pinned section stays at viewport left edge while scrollable section scrolls independently - Supports 0 < pinned_cols < total_cols (partial pinning) - Applied to CSV preview for better UX with wide datasets ## Context 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: - [x] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [ ] ~~Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)~~ no ui changes besides pinning itself. UI improvements out of scope of this PR Release Notes: - Improved CSV preview with column pinning to keep identifiers visible while scrolling --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||