Skip to content

git_graph: Make the graph canvas resizable (#52953) (cherry-pick to preview)#53001

Merged
Anthony-Eid merged 1 commit intov0.231.xfrom
cherry-pick-v0.231.x-73cd7ec6
Apr 2, 2026
Merged

git_graph: Make the graph canvas resizable (#52953) (cherry-pick to preview)#53001
Anthony-Eid merged 1 commit intov0.231.xfrom
cherry-pick-v0.231.x-73cd7ec6

Conversation

@zed-zippy
Copy link
Copy Markdown
Contributor

@zed-zippy zed-zippy bot commented Apr 2, 2026

Cherry-pick of #52953 to preview


Summary

This PR integrates the git graph canvas with the Table component’s
RedistributableColumnsState, making the graph column resizable while
preserving the table’s existing resize behavior. In particular, column
resizing continues to use the same cascading redistribution behavior as
the table. This is also the last PR needed to remove the feature flag on
the git graph!

Table API changes

I pulled the redistributable column logic out of Table into reusable
UI helpers so layouts outside of Table can participate in the same
column resizing behavior. This adds a shared
RedistributableColumnsState API, along with helpers for binding
drag/drop behavior, rendering resize handles, and constructing header
resize metadata. I also added ColumnWidthConfig::explicit and
TableRenderContext::for_column_widths so callers can render table like
headers and content with externally managed column widths.

The reason for this change is that the git graph now renders a custom
split layout: a graph canvas on the left and table content on the right.
By reusing the same column state and resize machinery, the graph column
can resize together with the table columns while preserving the existing
table behavior, including cascading column redistribution and double
click reset to default sizing.

I also adjusted the resize handle interaction styling so the divider
stays in its hovered/highlighted state while a drag is active, which
makes the drag target feel more stable and visually consistent during
resizing.

Preview

Screen.Recording.2026-04-01.at.10.54.28.PM.mov

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

Release Notes:

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

### Summary

This PR integrates the git graph canvas with the `Table` component’s
`RedistributableColumnsState`, making the graph column resizable while
preserving the table’s existing resize behavior. In particular, column
resizing continues to use the same cascading redistribution behavior as
the table. This is also the last PR needed to remove the feature flag on
the git graph!

### Table API changes

I pulled the redistributable column logic out of `Table` into reusable
UI helpers so layouts outside of `Table` can participate in the same
column resizing behavior. This adds a shared
`RedistributableColumnsState` API, along with helpers for binding
drag/drop behavior, rendering resize handles, and constructing header
resize metadata. I also added `ColumnWidthConfig::explicit` and
`TableRenderContext::for_column_widths` so callers can render table like
headers and content with externally managed column widths.

The reason for this change is that the git graph now renders a custom
split layout: a graph canvas on the left and table content on the right.
By reusing the same column state and resize machinery, the graph column
can resize together with the table columns while preserving the existing
table behavior, including cascading column redistribution and double
click reset to default sizing.

I also adjusted the resize handle interaction styling so the divider
stays in its hovered/highlighted state while a drag is active, which
makes the drag target feel more stable and visually consistent during
resizing.

### Preview

https://github.com/user-attachments/assets/347eed71-0cc1-4db4-9dee-a86ee5ab6f91



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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

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 2, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, nathansobo and osiewicz and removed request for a team April 2, 2026 15:41
@zed-community-bot zed-community-bot bot added the bot Pull requests authored by a bot label Apr 2, 2026
@Anthony-Eid Anthony-Eid marked this pull request as draft April 2, 2026 15:43
@cole-miller
Copy link
Copy Markdown
Member

@zed-zippy approved

@Anthony-Eid Anthony-Eid marked this pull request as ready for review April 2, 2026 19:02
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested a review from a team April 2, 2026 19:02
@Anthony-Eid Anthony-Eid merged commit ab7cd4f into v0.231.x Apr 2, 2026
42 checks passed
@Anthony-Eid Anthony-Eid deleted the cherry-pick-v0.231.x-73cd7ec6 branch April 2, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants