git_ui: Open file diffs from git panel - #56152
Conversation
| this.selected_entry = Some(ix); | ||
| cx.notify(); | ||
| if event.click_count() > 1 || event.modifiers().secondary() { | ||
| this.open_file(&Default::default(), window, cx) |
There was a problem hiding this comment.
the old behaviour didn't support split (side-by-side) diff
This was exactly what I expected to happen when using Zed for the first time and double-clicked a file in git panel. |
|
Can you share a video or screenshots? Thanks for the contrib |
63adc2a to
bd873d4
Compare
bd873d4 to
ac6182a
Compare
|
Added a dedicated here is a look at the new view Screen.Recording.2026-05-15.at.5.40.51.PM.mov |
ChristopherBiscardi
left a comment
There was a problem hiding this comment.
Thank you! I've tested this and it functions as expected.
|
Thanks man 🤝 |
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 Addresses zed-industries#33773. This changes git panel file activation so double-clicking or secondary-opening a changed file opens a dedicated full-file diff tab backed by a `SplittableEditor`. The per-file diff reuses the project diff staging and restore controls, respects the configured diff view style, and focuses an existing per-file diff tab when one is already open instead of creating duplicates. Verified with `cargo run`. Release Notes: - Improved git panel file diff opening. --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
|
Is it possible to force this on click by default? instead of always doing cmd/ctrl + click. |
|
@Syntist I'm also looking to achieve that as the default |
|
Is there any way to get the old behavior back? It was really convenient to be able to open the file in that location |
"opt + enter" still opens the file |
It's not the same, it seems to open it in a locked file view and the file is not editable |
I put together a PR that achieves this. |
…ed-industries#59649) # Objective The current behavior of the git panel is that when you click a file it will open the multi-buffer view that shows all files with changes. If you use CMD+Click or CTRL+Click, it will open the solo-file experience where you only see the diff of the file you have selected. But, there is no way to customize this behavior. Related to: zed-industries#56152 (comment) ## Solution This MR adds a setting that allows you to customize the default click behavior. The alternate behavior will always be accessible via CMD+Click or CTRL+Click. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable --- Release Notes: - Added a setting to control default click behavior for git panel files --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
…ed-industries#59649) # Objective The current behavior of the git panel is that when you click a file it will open the multi-buffer view that shows all files with changes. If you use CMD+Click or CTRL+Click, it will open the solo-file experience where you only see the diff of the file you have selected. But, there is no way to customize this behavior. Related to: zed-industries#56152 (comment) ## Solution This MR adds a setting that allows you to customize the default click behavior. The alternate behavior will always be accessible via CMD+Click or CTRL+Click. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable --- Release Notes: - Added a setting to control default click behavior for git panel files --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
…ed-industries#59649) # Objective The current behavior of the git panel is that when you click a file it will open the multi-buffer view that shows all files with changes. If you use CMD+Click or CTRL+Click, it will open the solo-file experience where you only see the diff of the file you have selected. But, there is no way to customize this behavior. Related to: zed-industries#56152 (comment) ## Solution This MR adds a setting that allows you to customize the default click behavior. The alternate behavior will always be accessible via CMD+Click or CTRL+Click. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable --- Release Notes: - Added a setting to control default click behavior for git panel files --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
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 Addresses zed-industries#33773. This changes git panel file activation so double-clicking or secondary-opening a changed file opens a dedicated full-file diff tab backed by a `SplittableEditor`. The per-file diff reuses the project diff staging and restore controls, respects the configured diff view style, and focuses an existing per-file diff tab when one is already open instead of creating duplicates. Verified with `cargo run`. Release Notes: - Improved git panel file diff opening. --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
|
also see #62074, which is a follow-up for this PR. |
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 Addresses zed-industries#33773. This changes git panel file activation so double-clicking or secondary-opening a changed file opens a dedicated full-file diff tab backed by a `SplittableEditor`. The per-file diff reuses the project diff staging and restore controls, respects the configured diff view style, and focuses an existing per-file diff tab when one is already open instead of creating duplicates. Verified with `cargo run`. Release Notes: - Improved git panel file diff opening. --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
…ed-industries#59649) # Objective The current behavior of the git panel is that when you click a file it will open the multi-buffer view that shows all files with changes. If you use CMD+Click or CTRL+Click, it will open the solo-file experience where you only see the diff of the file you have selected. But, there is no way to customize this behavior. Related to: zed-industries#56152 (comment) ## Solution This MR adds a setting that allows you to customize the default click behavior. The alternate behavior will always be accessible via CMD+Click or CTRL+Click. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable --- Release Notes: - Added a setting to control default click behavior for git panel files --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>

Self-Review Checklist:
Addresses #33773.
This changes git panel file activation so double-clicking or secondary-opening a changed file opens a dedicated full-file diff tab backed by a
SplittableEditor.The per-file diff reuses the project diff staging and restore controls, respects the configured diff view style, and focuses an existing per-file diff tab when one is already open instead of creating duplicates.
Verified with
cargo run.Release Notes: