git_graph: Add context menu operations - #55844
Conversation
|
I see this was discussed in the original PR already, but I heavily suspect this would be easier for @Anthony-Eid to review and get merged if this was split into smaller chunks, as this will get conflicts quickly. Will leave the final verdict to him but wanted to mention it already nonetheless |
# Conflicts: # crates/fs/src/fake_git_repo.rs # crates/git/src/repository.rs # crates/git_ui/src/branch_picker.rs # crates/project/src/git_store.rs # crates/proto/proto/git.proto
|
Hi @JosephTLyons, could you please take a look at this PR when you have a chance? It looks like #56110 and #56354 were developed in parallel with this PR, so there are now quite a few conflicts between the branches. Some of the original context/discussion is also in #53316. If possible, could you review this PR and, if it makes sense, pull these changes into your branch and make the necessary adjustments there? Since your newer PRs already touch the conflicting areas, I think that would be the safest way to resolve this without accidentally dropping behavior from either side. Thanks. |
|
Hey @nguyenphutrong Sorry it's taken me so long to get back to you. I decided not to merge your changes into my custom git commands branch because this PR is quite large, and ultimately it would've required a second person at Zed to review my branch alongside all of these changes. I think this PR still needs to be broken up into multiple PRs, with each one scoped to a single fix or enhancement. I also think each item should be discussed beforehand so we can make sure the team is on board (with the feature in general, and with the implementation) before we add it. Since all of these features touch the same area of the code, it's probably best to avoid opening multiple PRs here at once — otherwise your own PRs will likely conflict with each other as they get squash-merged into As a first step, I'd be happy to review a PR scoped to just your fix for not scrolling the git graph while the context menu is open, and we can go from there. I think for that fix should be applied centrally. Any list that scrolls and has entries that have context menus, should be blocked from scrolling when the context menu is open. |
|
@nguyenphutrong I’m eagerly waiting for these awesome changes. |
…ries#58781) Right-clicking a ref label (branch, remote ref, or tag) in the git graph now opens a ref-specific context menu that resolves custom git commands with the clicked ref exposed as ZED_GIT_REF, mirroring how VS Code's git graph offers ref-aware actions. Right-clicking elsewhere on a commit keeps the existing commit-scoped menu. <img width="875" height="525" alt="zed (Ubuntu) 2026_06_07 23_26_35" src="https://github.com/user-attachments/assets/140bdcdf-6536-4b5e-ac2f-9df84f744477" /> releated: zed-industries#55844 zed-industries#56354 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 Release Notes: - Added a context menu for ref labels in the git graph that runs custom git commands with the clicked ref available as `$ZED_GIT_REF`. --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
…ries#58781) Right-clicking a ref label (branch, remote ref, or tag) in the git graph now opens a ref-specific context menu that resolves custom git commands with the clicked ref exposed as ZED_GIT_REF, mirroring how VS Code's git graph offers ref-aware actions. Right-clicking elsewhere on a commit keeps the existing commit-scoped menu. <img width="875" height="525" alt="zed (Ubuntu) 2026_06_07 23_26_35" src="https://github.com/user-attachments/assets/140bdcdf-6536-4b5e-ac2f-9df84f744477" /> releated: zed-industries#55844 zed-industries#56354 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 Release Notes: - Added a context menu for ref labels in the git graph that runs custom git commands with the clicked ref available as `$ZED_GIT_REF`. --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
…ries#58781) Right-clicking a ref label (branch, remote ref, or tag) in the git graph now opens a ref-specific context menu that resolves custom git commands with the clicked ref exposed as ZED_GIT_REF, mirroring how VS Code's git graph offers ref-aware actions. Right-clicking elsewhere on a commit keeps the existing commit-scoped menu. <img width="875" height="525" alt="zed (Ubuntu) 2026_06_07 23_26_35" src="https://github.com/user-attachments/assets/140bdcdf-6536-4b5e-ac2f-9df84f744477" /> releated: zed-industries#55844 zed-industries#56354 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 Release Notes: - Added a context menu for ref labels in the git graph that runs custom git commands with the clicked ref available as `$ZED_GIT_REF`. --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
Summary
Tests
cargo fmt --allcargo test -p git_graphcargo check -p git_graphcargo check -p projectgit diff --checkSuggested .rules additions
git_graph, context-menu scroll blocking needs to cover both graph canvas handlers and tableuniform_list().track_scroll(...); blocking onlyhandle_graph_scrolldoes not stop table wheel events.Release Notes: