From bf01a928e518be9ef7872f859dff423d61b856f7 Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Wed, 11 Feb 2026 12:17:29 +0100 Subject: [PATCH] agent_ui: Fix editor not getting focused when adding selections (#48926) Fixes a regression that was introduced by the thread view refactor (Nightly only). Also fixed another minor focus issue: Dropping files into the agent panel would not focus the message editor. - [x] Code Reviewed - [x] Manual QA Release Notes: - N/A --- crates/agent_ui/src/acp/thread_view.rs | 3 ++- crates/agent_ui/src/acp/thread_view/active_thread.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 34bf7caa4dbda33e151b0c58415cbf1d902c3e1d..94fbff72f780ab5f4a1fa00d53a1b068c8505247 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -2335,6 +2335,7 @@ impl AcpServerView { active_thread.update(cx, |thread, cx| { thread.message_editor.update(cx, |editor, cx| { editor.insert_dragged_files(paths, added_worktrees, window, cx); + editor.focus_handle(cx).focus(window, cx); }) }); } @@ -2469,7 +2470,7 @@ impl Render for AcpServerView { self.sync_queued_message_editors(window, cx); v_flex() - .track_focus(&self.focus_handle(cx)) + .track_focus(&self.focus_handle) .size_full() .bg(cx.theme().colors().panel_background) .child(match &self.server_state { diff --git a/crates/agent_ui/src/acp/thread_view/active_thread.rs b/crates/agent_ui/src/acp/thread_view/active_thread.rs index d8817bc2bf24d1a87905487165ff006dd3340862..bde91fbec9a77ca9554ca31c3e3b4d97b7a21c04 100644 --- a/crates/agent_ui/src/acp/thread_view/active_thread.rs +++ b/crates/agent_ui/src/acp/thread_view/active_thread.rs @@ -7154,7 +7154,7 @@ impl Render for AcpThreadView { v_flex() .key_context("AcpThread") - .track_focus(&self.focus_handle(cx)) + .track_focus(&self.focus_handle) .on_action(cx.listener(|this, _: &menu::Cancel, _, cx| { if this.parent_id.is_none() { this.cancel_generation(cx);