mirror of
https://github.com/zed-industries/zed.git
synced 2026-08-20 14:34:28 +00:00
# Objective Standardize the behavior of collapsing/expanding entries between Project Panel and Git Panel. At the time of writing, using `left` or `right` on the Project Panel would find the nearest parent directory and collapse it while, on the Git Panel, that will only happen if the directory is already selected, otherwise it'll select the previous entry instead. ## Solution Update `git_ui::git_panel::GitPanel::collapse_selected_entry` in order to always try to find the nearest expanded directory, regardless of the selected entry, and then collapse it and select it. The default keymap for Vim/Helix has also been updated to ensure that `h` and `l` work for collapsing or expanding entries, similar to what already happens in Project Panel. ## Testing Tested both manually, as can be seen in the "Showcase" section as well as added a new test for these changes, `git_ui::git_panel::tests::test_collapse_selected_entry` . ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] 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 ## Showcase <details> <summary>Before</summary> https://github.com/user-attachments/assets/2fd8db03-155a-4406-a190-17a1958dda11 </details> <details> <summary>After</summary> https://github.com/user-attachments/assets/f64bd584-a3c2-4a33-b95a-2547c8b721d2 </details> --- Release Notes: - Improved `git panel: collapse selected entry` in order to find and collapse the nearest parent directory, similar to the Project Panel. - Added support for using `h` and `l`, in Vim/Helix mode, to collapse and expand entries in the Git Panel. |
||
|---|---|---|
| .. | ||
| badge | ||
| fonts | ||
| icons | ||
| images | ||
| keymaps | ||
| prompts | ||
| settings | ||
| sounds | ||
| themes | ||