From e70d2524b32cac25c71d2aa3172b0e6767beab87 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 5 Jan 2026 17:30:46 +0100 Subject: [PATCH] agent_ui: Fix agent UI stealing focus on start up (#46088) Release Notes: - Fixed Zed stealing element focus away briefly after startup, interrupting user workflows --- crates/agent_ui/src/acp/thread_view.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 082ff9bca9f3daf5b2dd5ab8256223181149803a..14d857d1af7d4ca11915c0055f5240907b7545c7 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -731,7 +731,9 @@ impl AcpThreadView { }) }); - this.message_editor.focus_handle(cx).focus(window, cx); + if this.focus_handle(cx).is_focused(window) { + this.message_editor.focus_handle(cx).focus(window, cx); + } cx.notify(); }