From 67e0cec0b1f0d758d120b0191679ae6ce90593a4 Mon Sep 17 00:00:00 2001 From: Fabian Szabo Date: Thu, 22 Jan 2026 10:13:33 +0100 Subject: [PATCH] agent_ui: Fix message editor stealing focus from other panels (#47321) Closes https://github.com/zed-industries/zed/issues/41278, https://github.com/zed-industries/zed/issues/45576, https://github.com/zed-industries/zed/issues/46513 Release Notes: - Fixed message editor stealing focus (so the "Open Recent Project" modal stays open) This issue has been driving me insane haha. _Note: This is my first code contribution to this project. Please be kind and let me know if I have missed something. I tested this fix on my machine and it works. Tests are passing on my device. I have agreed to the Zed Contributor License and Feedback Agreement with my Zed Account that's linked to the same email as this GitHub account._ --- 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 ceb320321d8326f8330304f185061e58ca520e1d..98b2825cb33395b249e69c155a602b9b5815abaf 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -889,7 +889,9 @@ impl AcpThreadView { }) }); - this.message_editor.focus_handle(cx).focus(window, cx); + if this.focus_handle.contains_focused(window, cx) { + this.message_editor.focus_handle(cx).focus(window, cx); + } cx.notify(); }