Skip to content

git_graph: Make the graph canvas resizable#52953

Merged
Anthony-Eid merged 7 commits intomainfrom
resize-graph-canvas-column
Apr 2, 2026
Merged

git_graph: Make the graph canvas resizable#52953
Anthony-Eid merged 7 commits intomainfrom
resize-graph-canvas-column

Conversation

@Anthony-Eid
Copy link
Copy Markdown
Contributor

@Anthony-Eid Anthony-Eid commented Apr 2, 2026

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 ...

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 2, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Apr 2, 2026
@Anthony-Eid Anthony-Eid force-pushed the resize-graph-canvas-column branch from 890c90e to f7a464e Compare April 2, 2026 03:19
@Anthony-Eid Anthony-Eid changed the title Make git graph use table resize columns for canvas git_graph: Make the graph canvas resizable Apr 2, 2026
Anthony-Eid added a commit that referenced this pull request Apr 2, 2026
After #52953 gets merged the git graph will be ready for it's preview
release, so we can finally remove the feature flag! AKA this PR releases
the git graph
@Anthony-Eid Anthony-Eid mentioned this pull request Apr 2, 2026
5 tasks
@cole-miller cole-miller self-requested a review April 2, 2026 13:06
@Anthony-Eid Anthony-Eid merged commit 73cd7ec into main Apr 2, 2026
35 checks passed
@Anthony-Eid Anthony-Eid deleted the resize-graph-canvas-column branch April 2, 2026 14:45
Anthony-Eid added a commit that referenced this pull request Apr 2, 2026
After #52953 gets merged the git graph will be ready for it's preview
release, so we can finally remove the feature flag! AKA this PR releases
the git graph

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](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Add Git Graph. Can be accessed through the button on the bottom of the
git panel or the `git graph: Open` action
@Anthony-Eid
Copy link
Copy Markdown
Contributor Author

/cherry-pick preview

github-actions bot pushed a commit that referenced this pull request Apr 2, 2026
### 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 ...
github-actions bot pushed a commit that referenced this pull request Apr 2, 2026
After #52953 gets merged the git graph will be ready for it's preview
release, so we can finally remove the feature flag! AKA this PR releases
the git graph

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](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Add Git Graph. Can be accessed through the button on the bottom of the
git panel or the `git graph: Open` action
Anthony-Eid added a commit that referenced this pull request Apr 2, 2026
)

Cherry-pick of #52972 to preview

----
After #52953 gets merged the git graph will be ready for it's preview
release, so we can finally remove the feature flag! AKA this PR releases
the git graph

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](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Add Git Graph. Can be accessed through the button on the bottom of the
git panel or the `git graph: Open` action

Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Anthony-Eid added a commit that referenced this pull request Apr 2, 2026
…review) (#53001)

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


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 ...

Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
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 staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants