Update the focus handle returned by the `GitPanel::focus_handle` method in order to ensure that, if the commit editor is currently expanded, using the `git_panel::ToggleFocus` action will correctly focus back on the expanded editor, rather than on the panel. # Objective When using the expanded commit editor, if one focuses away from the panel and then uses the `git panel: toggle focus` action in order to focus back on the panel, the focus will land on the panel, which is now being rendered behind the commit editor. ## Solution Update the focus handle returned by the `GitPanel` to take into consideration whether the commit editor is expanded and, in that case, return the editor's focus handle instead. ## Testing Tested both manually as well as through a newly introduced test – `git_ui::git_panel::tests::test_focus_handle`. ## 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/0e2647f3-2835-485f-8f01-2128d2de6b8e </details> <details> <summary>After</summary> https://github.com/user-attachments/assets/cc77fae7-e76c-4389-82b0-f4e7ec8258d7 </details> --- Release Notes: - Fixed `git panel: toggle focus` to focus back on the commit editor in case it is expanded.
1 file changedLine totals unavailable