Skip to content

Add git graph view#43106

Closed
IsraelAraujo70 wants to merge 5 commits intozed-industries:mainfrom
IsraelAraujo70:feature/git-graph
Closed

Add git graph view#43106
IsraelAraujo70 wants to merge 5 commits intozed-industries:mainfrom
IsraelAraujo70:feature/git-graph

Conversation

@IsraelAraujo70
Copy link
Copy Markdown

Summary

This PR introduces a new Git Graph view to Zed, allowing users to visualize the commit history directly within the editor.

Features

  • Visual Commit Graph: Renders the commit history as a graph with support for branching and merging lanes.
  • Compact Table Layout: Displays commit details (Graph, Description, Date, Author, Commit SHA) in a VSCode-like table format.
  • Responsive Design: The graph and columns resize and truncate gracefully.
  • Interactive: Click on a row to open the commit details.
  • Decorations: Badges for HEAD, branches, and tags.

Implementation Details

  • Added commit_graph method to GitRepository trait and implementation in crates/git.
  • Created GitGraphView in crates/git_ui using GPUI.
  • Implemented efficient lane calculation algorithm for drawing the graph connections.

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 19, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @IsraelAraujo70 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-industries-bot
Copy link
Copy Markdown
Contributor

zed-industries-bot commented Nov 19, 2025

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 5d63d25

@IsraelAraujo70
Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Nov 19, 2025

The cla-bot has been summoned, and re-checked this pull request!

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 19, 2025
@MrSubidubi MrSubidubi changed the title feat(git): Add Git Graph view Add git graph view Nov 19, 2025
@Anthony-Eid
Copy link
Copy Markdown
Contributor

example image of the git graph

image

@everdrone
Copy link
Copy Markdown
Contributor

The author and commit columns overlap if the author string is too long
image
I also noticed the commit always receiving the click when the user intends to click on the scrollbar

@IsraelAraujo70
Copy link
Copy Markdown
Author

Sure, i will also try to make the lines connect.

@Angelk90
Copy link
Copy Markdown
Contributor

@Anthony-Eid : is this the official ui that zed wants?
At the time @zanmato had made a beautiful UI in my opinion.

image

Look: #39595

@IsraelAraujo70
Copy link
Copy Markdown
Author

@Angelk90 its really more pretty!
Why did they close tho?
I will try to replicate what the other guy did.

@Angelk90
Copy link
Copy Markdown
Contributor

@IsraelAraujo70 : I'll give you a piece of advice, so you don't waste time.
Have you contacted the Zed staff to find out the exact UI for this feature and how it should be implemented?

Is it part of their current plans?

Read here: #39595 (comment)

@IsraelAraujo70
Copy link
Copy Markdown
Author

No actually, this was the only thing I missed from vsc, so I was just implementing for myself.
I really think the zed staff would approve PR 39595 as preview and then later on zed 1.0 give it a rework with the work they intended.

@IsraelAraujo70 : I'll give you a piece of advice, so you don't waste time.
Have you contacted the Zed staff to find out the exact UI for this feature and how it should be implemented?

Is it part of their current plans?

Read here: #39595 (comment)

@Angelk90
Copy link
Copy Markdown
Contributor

@IsraelAraujo70 pr#39595 has already been closed, they didn't even accept it as a preview.
I recommend you contact the staff for more details.
I don't want you to waste time like other developers have.

@Anthony-Eid
Copy link
Copy Markdown
Contributor

The git graph is a stretch goal for our current Git project, so I can't promise anything. However, it's something that I want to add, so I'll be willing to put some work in during my free time. With that said, I still need to talk with our designer and team lead to see what direction we would take this in.

@Angelk90
Copy link
Copy Markdown
Contributor

@Anthony-Eid : Could we reconsider starting from #39595?

@IsraelAraujo70
Copy link
Copy Markdown
Author

IsraelAraujo70 commented Nov 20, 2025

Yeah agree, I think the #39595 is a better starting point.
I'm willing to help so we can have this feature earlier.

@Anthony-Eid
Copy link
Copy Markdown
Contributor

@Anthony-Eid : Could we reconsider starting from #39595?

Starting from #39595 is difficult because it has a +11k line diff. Meaning that the Zed team would have to spend a lot of time auditing/reviewing the PR, and commit to maintaining that code once it's merged.

I also need to talk with the team and the design to figure out how we want the git graph to interact with Zed's UI.

With that being said, if I was working on it there are some files I would cherry pick from that PR. I still don't know if I'm going to be the one to work on the git graph btw.

@IsraelAraujo70
Copy link
Copy Markdown
Author

As the author of this PR, I'm not proud of the UI. I could do much better then this. But I'm also new to rust. So if I have a say on this, the other branch seems more like a finished product. Mine is more to fill a hole.

@Anthony-Eid : Could we reconsider starting from #39595?

Starting from #39595 is difficult because it has a +11k line diff. Meaning that the Zed team would have to spend a lot of time auditing/reviewing the PR, and commit to maintaining that code once it's merged.

I also need to talk with the team and the design to figure out how we want the git graph to interact with Zed's UI.

With that being said, if I was working on it there are some files I would cherry pick from that PR. I still don't know if I'm going to be the one to work on the git graph btw.

@IsraelAraujo70
Copy link
Copy Markdown
Author

On the weekend I'll revisit the PR and try to make it better.

@Angelk90
Copy link
Copy Markdown
Contributor

@Anthony-Eid : If you carefully analyze pr#39595, there are two large files, one of 4,304 and one of 1,812, of which the 4,304 file looks like a test file.

@LivioGama
Copy link
Copy Markdown

LivioGama commented Dec 7, 2025

Could maybe help the designers, but I personally really like the way Bitbucket display graphs (in their latest version of Bitbucket Cloud). That's probably the only thing they do great imo lol

2023-02-21 13_58_31-01-commit-graph png (PNG-Grafik, 1128 × 627 Pixel) – Mozilla Firefox

@SomeoneToIgnore
Copy link
Copy Markdown
Contributor

Looks like #44434 supersedes this one hence closing.

@github-project-automation github-project-automation bot moved this from Community PRs to Done in Quality Week – December 2025 Dec 13, 2025
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

Development

Successfully merging this pull request may close these issues.

9 participants