From 28a0b826180eb7b772469b1c8e147971a0982e43 Mon Sep 17 00:00:00 2001 From: Xipeng Jin <56369076+xipeng-jin@users.noreply.github.com> Date: Thu, 13 Nov 2025 21:59:39 -0500 Subject: [PATCH] git_panel: Fix FocusChanges does nothing with no entries (#42553) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #31155 Release Notes: - Ensure `git_panel::FocusChanges` bypasses the panel’s `Focusable` logic and directly focuses the `ChangesList` handle so the command works even when the repository has no entries. - Keep the `Focusable` behavior from the commit 45b126a (which routes empty panels to the commit editor) by handling this special-case action rather than regressing the default focus experience. --- crates/git_ui/src/git_panel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 81732732aff257b513faaf5f87ce85596a842dd8..dbed85ba787975e3d55076440ed667e8c9d276fb 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -745,7 +745,7 @@ impl GitPanel { ) { self.select_first_entry_if_none(cx); - cx.focus_self(window); + self.focus_handle.focus(window); cx.notify(); }