git_ui: Improve connection between the graph and commit views#50027
git_ui: Improve connection between the graph and commit views#50027danilo-leal merged 9 commits intomainfrom
Conversation
Clear `pending_select_sha` on branch changes, and limit retries so it expires if the target SHA is never found in the graph.
|
Love this! Is there a way to navigate the other way - opening the commit view from the git graph? |
|
Yes! Added in here #49910 (already in Nightly 😄). |
|
Nice! |
Anthony-Eid
left a comment
There was a problem hiding this comment.
None of my feedback is blocking, if you want to merge this I can make the changes I want too later today
| for (idx, commit) in self.graph_data.commits.iter().enumerate() { | ||
| if commit.data.sha == oid { | ||
| self.pending_select_sha = None; | ||
| self.select_entry(idx, cx); | ||
| return; | ||
| } | ||
| } |
There was a problem hiding this comment.
We should probably make a hash map of commit shas to their row in the graph, it will be needed for git search as well. This isn't a blocker, just something to add to our todo list in the future
| self.graph_data.add_commits(commits); | ||
| }); | ||
| cx.notify(); | ||
| self.retry_pending_select(cx); |
There was a problem hiding this comment.
I think we can avoid having PENDING_SELECT_MAX_RETRIES in retry_pending select.
repository.graph_data(...).1 is true if the graph is still loading commits, we can clear the pending selection if it's false and we haven't found the commit a user wants to see
There was a problem hiding this comment.
It might be better if we make another repository event that is emitted once the graph is loaded, because there's a small race condition with repository.graph_data(...).1, so it might be true when we hit the last block of loaded commits because the task hasn't been finish yet.
git_ui: Improve connection between the graph and commit views Auto-generated documentation suggestions for review at next preview release.
Auto-applied queued documentation suggestions from: - PR #48908 - PR #48909 - PR #48910 - PR #48912 - PR #48930 - PR #44794 - PR #48763 - PR #45073 - PR #48495 - PR #49374 - PR #49139 - PR #48780 - PR #48619 - PR #48978 - PR #48962 - PR #48988 - PR #47860 - PR #49015 - PR #47095 - PR #47475 - PR #48542 - PR #46766 - PR #47754 - PR #48807 - PR #44506 - PR #49051 - PR #49069 - PR #48842 - PR #48851 - PR #48736 - PR #47673 - PR #49094 - PR #49098 - PR #49622 - PR #49554 - PR #49710 - PR #49716 - PR #49732 - PR #49788 - PR #49876 - PR #49902 - PR #49910 - PR #49390 - PR #50027 Generated with script/docs-suggest-publish for human review in draft PR.
This is a follow-up on #50027 I address my comments by adding a hash map look-up to find the selected pending commit. I also removed the limitation where we would only retry finding the pending commit 5 times. The pending selection is removed when the graph is fully loaded and doesn't contain the pending commit. This PR also cleans up some internal code structure and starts work to enable search and propagating git log error messages to the UI. UI wise I made the git graph item show the repository name instead of "Git Graph" in Zed. Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A --------- Co-authored-by: Remco Smits <djsmits12@gmail.com>
Auto-applied queued documentation suggestions from: - PR #48908 - PR #48909 - PR #48910 - PR #48912 - PR #48930 - PR #44794 - PR #48763 - PR #45073 - PR #48495 - PR #49374 - PR #49139 - PR #48780 - PR #48619 - PR #48978 - PR #48962 - PR #48988 - PR #47860 - PR #49015 - PR #47095 - PR #47475 - PR #48542 - PR #46766 - PR #47754 - PR #48807 - PR #44506 - PR #49051 - PR #49069 - PR #48842 - PR #48851 - PR #48736 - PR #47673 - PR #49094 - PR #49098 - PR #49622 - PR #49554 - PR #49710 - PR #49716 - PR #49732 - PR #49788 - PR #49876 - PR #49902 - PR #49910 - PR #49390 - PR #50027 Generated with script/docs-suggest-publish for human review in draft PR.
This is a follow-up on #50027 I address my comments by adding a hash map look-up to find the selected pending commit. I also removed the limitation where we would only retry finding the pending commit 5 times. The pending selection is removed when the graph is fully loaded and doesn't contain the pending commit. This PR also cleans up some internal code structure and starts work to enable search and propagating git log error messages to the UI. UI wise I made the git graph item show the repository name instead of "Git Graph" in Zed. Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A --------- Co-authored-by: Remco Smits <djsmits12@gmail.com>
…dustries#50027) - Enabled opening the Git Graph, with the corresponding commit detail drawer open, from the commit view - Redesigned the commit view's header and toolbar to allow addition of the Git Graph icon button - Redesigned icons for the Git Graph and commit view https://github.com/user-attachments/assets/8efef60a-0893-4752-9b40-838da21ceb54 --- 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 - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A (_Git Graph is still feature flagged, so no release notes for now_)
This is a follow-up on zed-industries#50027 I address my comments by adding a hash map look-up to find the selected pending commit. I also removed the limitation where we would only retry finding the pending commit 5 times. The pending selection is removed when the graph is fully loaded and doesn't contain the pending commit. This PR also cleans up some internal code structure and starts work to enable search and propagating git log error messages to the UI. UI wise I made the git graph item show the repository name instead of "Git Graph" in Zed. Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - N/A --------- Co-authored-by: Remco Smits <djsmits12@gmail.com>
Screenshot.2026-02-24.at.7.23.mp4
Before you mark this PR as ready for review, make sure that you have:
Release Notes: