From 5c7e90d49450fff72fabe1ac4e9447a0d9b370b0 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 19 Jun 2025 14:38:37 -0300 Subject: [PATCH] agent: Move focus to the panel after sending a user message edit (#33049) Follow up to https://github.com/zed-industries/zed/pull/31611. Closes https://github.com/zed-industries/zed/issues/33005. Release Notes: - agent: Fixed a bug where, after confirming editing a previous user message while zoomed in, the focus went to the buffer and the panel got closed. --- crates/agent/src/active_thread.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rs index 7654754624985835fbd36099978467fad1304960..e6164894733780ff041f8224533fee5b44db779e 100644 --- a/crates/agent/src/active_thread.rs +++ b/crates/agent/src/active_thread.rs @@ -1618,6 +1618,14 @@ impl ActiveThread { }) .log_err(); })); + + if let Some(workspace) = self.workspace.upgrade() { + workspace.update(cx, |workspace, cx| { + if let Some(panel) = workspace.panel::(cx) { + panel.focus_handle(cx).focus(window); + } + }); + } } fn messages_after(&self, message_id: MessageId) -> &[MessageId] {