Skip to content

data_table: #5 Add independently resizable columns + fix variable list scrolling - #53295

Merged
Anthony-Eid merged 17 commits into
zed-industries:mainfrom
HalavicH:feat/data-table/implement-resizeable-columns
Apr 8, 2026
Merged

data_table: #5 Add independently resizable columns + fix variable list scrolling#53295
Anthony-Eid merged 17 commits into
zed-industries:mainfrom
HalavicH:feat/data-table/implement-resizeable-columns

Conversation

@HalavicH

@HalavicH HalavicH commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

This PR adds spreadsheet-style independently resizable columns (dragging changes total table width) and fixes scrolling issues in variable list mode.

What changed:

  • Adds ResizableColumnsState struct for independently resizable columns (spreadsheet-style)
  • Adds ColumnWidthConfig::Resizable variant for spreadsheet mode
  • Adds DraggedResizableColumn drag payload type
  • Adds ResizableHeaderInfo for double-click-to-reset functionality
  • Adds render_resize_handles_resizable function for resize handles rendering
  • Adds horizontal scroll handle to TableInteractionState
  • Adds .on_drag_move::<DraggedResizableColumn> handler to Table for drag resizing

Bug fixes:

  • Fixed missing vertical scrollbar in variable list mode
  • Fixed half-broken scrolling in variable list mode (added .measure_all() to make scrollbar aware of the height of the table)
  • Moved vertical scrollbar to be pinned at the right side of the pane with table — previously it was attached to the table content and was pushed off-screen when table content was too wide

API addition:

// New variant added:
pub enum ColumnWidthConfig {
    Static { widths: StaticColumnWidths, table_width: Option<DefiniteLength> },
    Redistributable { entity: Entity<RedistributableColumnsState>, table_width: Option<DefiniteLength> },
    Resizable(Entity<ResizableColumnsState>),  // NEW: spreadsheet-style
}

Callers updated:

  • csv_preview: Changed from ColumnWidthConfig::redistributable() to use new resizable mode
  • git_graph: Added resizable_info parameter

Context:

This is part 3 of a 3-PR series improving data table column width handling:

  1. #51059 - Extract modules into separate files (mechanical change)
  2. #51120 - Introduce width config enum for redistributable column widths (API rework)
  3. This PR: Add independently resizable columns + fix variable list scrolling (new feature + bug fixes)

The series builds on previously merged infrastructure:

  • #46341 - Data table dynamic column support
  • #46190 - Variable row height mode for data tables

Primary beneficiary: CSV preview feature (#48207)

This work is based on the original draft PR #44344, decomposed into reviewable pieces.


Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

  • N/A or Added/Fixed/Improved ...

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 7, 2026
@HalavicH
HalavicH force-pushed the feat/data-table/implement-resizeable-columns branch from 48c9015 to 8c2586c Compare April 7, 2026 10:49
@HalavicH HalavicH changed the title Feat/data table/implement resizeable columns Add independently resizable columns + fix variable list scrolling Apr 7, 2026
@HalavicH
HalavicH marked this pull request as ready for review April 7, 2026 11:02
@zed-codeowner-coordinator
zed-codeowner-coordinator Bot requested review from a team, nathansobo and osiewicz and removed request for a team April 7, 2026 11:02
@Anthony-Eid
Anthony-Eid enabled auto-merge (squash) April 8, 2026 07:09
@Anthony-Eid
Anthony-Eid disabled auto-merge April 8, 2026 07:09
@Anthony-Eid
Anthony-Eid enabled auto-merge (squash) April 8, 2026 07:09
@Anthony-Eid
Anthony-Eid merged commit 783e062 into zed-industries:main Apr 8, 2026
30 checks passed
piper-of-dawn pushed a commit to piper-of-dawn/zed that referenced this pull request Apr 25, 2026
This PR adds spreadsheet-style independently resizable columns (dragging
changes total table width) and fixes scrolling issues in variable list
mode.

**What changed:**

- Adds `ResizableColumnsState` struct for independently resizable
columns (spreadsheet-style)
- Adds `ColumnWidthConfig::Resizable` variant for spreadsheet mode
- Adds `DraggedResizableColumn` drag payload type
- Adds `ResizableHeaderInfo` for double-click-to-reset functionality
- Adds `render_resize_handles_resizable` function for resize handles
rendering
- Adds horizontal scroll handle to `TableInteractionState`
- Adds `.on_drag_move::<DraggedResizableColumn>` handler to Table for
drag resizing

**Bug fixes:**

- Fixed missing vertical scrollbar in variable list mode
- Fixed half-broken scrolling in variable list mode (added
.measure_all() to make scrollbar aware of the height of the table)
- Moved vertical scrollbar to be pinned at the right side of the pane
with table — previously it was attached to the table content and was
pushed off-screen when table content was too wide

**API addition:**

```rust
// New variant added:
pub enum ColumnWidthConfig {
    Static { widths: StaticColumnWidths, table_width: Option<DefiniteLength> },
    Redistributable { entity: Entity<RedistributableColumnsState>, table_width: Option<DefiniteLength> },
    Resizable(Entity<ResizableColumnsState>),  // NEW: spreadsheet-style
}
```

**Callers updated:**

- csv_preview: Changed from `ColumnWidthConfig::redistributable()` to
use new resizable mode
- git_graph: Added `resizable_info` parameter

**Context:**

This is part 3 of a 3-PR series improving data table column width
handling:

1. [zed-industries#51059](zed-industries#51059) - Extract
modules into separate files (mechanical change)
2. [zed-industries#51120](zed-industries#51120) -
Introduce width config enum for redistributable column widths (API
rework)
3. **This PR**: Add independently resizable columns + fix variable list
scrolling (new feature + bug fixes)

The series builds on previously merged infrastructure:

- [zed-industries#46341](zed-industries#46341) - Data
table dynamic column support
- [zed-industries#46190](zed-industries#46190) - Variable
row height mode for data tables

Primary beneficiary: CSV preview feature
([zed-industries#48207](zed-industries#48207))

This work is based on the [original draft PR
zed-industries#44344](zed-industries#44344), decomposed
into reviewable pieces.

-----

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
Zenor27 pushed a commit to Zenor27/zed that referenced this pull request Jul 4, 2026
This PR adds spreadsheet-style independently resizable columns (dragging
changes total table width) and fixes scrolling issues in variable list
mode.

**What changed:**

- Adds `ResizableColumnsState` struct for independently resizable
columns (spreadsheet-style)
- Adds `ColumnWidthConfig::Resizable` variant for spreadsheet mode
- Adds `DraggedResizableColumn` drag payload type
- Adds `ResizableHeaderInfo` for double-click-to-reset functionality
- Adds `render_resize_handles_resizable` function for resize handles
rendering
- Adds horizontal scroll handle to `TableInteractionState`
- Adds `.on_drag_move::<DraggedResizableColumn>` handler to Table for
drag resizing

**Bug fixes:**

- Fixed missing vertical scrollbar in variable list mode
- Fixed half-broken scrolling in variable list mode (added
.measure_all() to make scrollbar aware of the height of the table)
- Moved vertical scrollbar to be pinned at the right side of the pane
with table — previously it was attached to the table content and was
pushed off-screen when table content was too wide

**API addition:**

```rust
// New variant added:
pub enum ColumnWidthConfig {
    Static { widths: StaticColumnWidths, table_width: Option<DefiniteLength> },
    Redistributable { entity: Entity<RedistributableColumnsState>, table_width: Option<DefiniteLength> },
    Resizable(Entity<ResizableColumnsState>),  // NEW: spreadsheet-style
}
```

**Callers updated:**

- csv_preview: Changed from `ColumnWidthConfig::redistributable()` to
use new resizable mode
- git_graph: Added `resizable_info` parameter

**Context:**

This is part 3 of a 3-PR series improving data table column width
handling:

1. [zed-industries#51059](zed-industries#51059) - Extract
modules into separate files (mechanical change)
2. [zed-industries#51120](zed-industries#51120) -
Introduce width config enum for redistributable column widths (API
rework)
3. **This PR**: Add independently resizable columns + fix variable list
scrolling (new feature + bug fixes)

The series builds on previously merged infrastructure:

- [zed-industries#46341](zed-industries#46341) - Data
table dynamic column support
- [zed-industries#46190](zed-industries#46190) - Variable
row height mode for data tables

Primary beneficiary: CSV preview feature
([zed-industries#48207](zed-industries#48207))

This work is based on the [original draft PR
zed-industries#44344](zed-industries#44344), decomposed
into reviewable pieces.

-----

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
@HalavicH HalavicH changed the title Add independently resizable columns + fix variable list scrolling data_table: Add independently resizable columns + fix variable list scrolling Jul 13, 2026
@HalavicH HalavicH changed the title data_table: Add independently resizable columns + fix variable list scrolling data_table: #5 Add independently resizable columns + fix variable list scrolling Jul 13, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
This PR adds spreadsheet-style independently resizable columns (dragging
changes total table width) and fixes scrolling issues in variable list
mode.

**What changed:**

- Adds `ResizableColumnsState` struct for independently resizable
columns (spreadsheet-style)
- Adds `ColumnWidthConfig::Resizable` variant for spreadsheet mode
- Adds `DraggedResizableColumn` drag payload type
- Adds `ResizableHeaderInfo` for double-click-to-reset functionality
- Adds `render_resize_handles_resizable` function for resize handles
rendering
- Adds horizontal scroll handle to `TableInteractionState`
- Adds `.on_drag_move::<DraggedResizableColumn>` handler to Table for
drag resizing

**Bug fixes:**

- Fixed missing vertical scrollbar in variable list mode
- Fixed half-broken scrolling in variable list mode (added
.measure_all() to make scrollbar aware of the height of the table)
- Moved vertical scrollbar to be pinned at the right side of the pane
with table — previously it was attached to the table content and was
pushed off-screen when table content was too wide

**API addition:**

```rust
// New variant added:
pub enum ColumnWidthConfig {
    Static { widths: StaticColumnWidths, table_width: Option<DefiniteLength> },
    Redistributable { entity: Entity<RedistributableColumnsState>, table_width: Option<DefiniteLength> },
    Resizable(Entity<ResizableColumnsState>),  // NEW: spreadsheet-style
}
```

**Callers updated:**

- csv_preview: Changed from `ColumnWidthConfig::redistributable()` to
use new resizable mode
- git_graph: Added `resizable_info` parameter

**Context:**

This is part 3 of a 3-PR series improving data table column width
handling:

1. [zed-industries#51059](zed-industries#51059) - Extract
modules into separate files (mechanical change)
2. [zed-industries#51120](zed-industries#51120) -
Introduce width config enum for redistributable column widths (API
rework)
3. **This PR**: Add independently resizable columns + fix variable list
scrolling (new feature + bug fixes)

The series builds on previously merged infrastructure:

- [zed-industries#46341](zed-industries#46341) - Data
table dynamic column support
- [zed-industries#46190](zed-industries#46190) - Variable
row height mode for data tables

Primary beneficiary: CSV preview feature
([zed-industries#48207](zed-industries#48207))

This work is based on the [original draft PR
zed-industries#44344](zed-industries#44344), decomposed
into reviewable pieces.

-----

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants