Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Move focus to the panel after dismissing a user message edit (#31611)

Danilo Leale12106e025b3
diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rs
index 46f924c153e..de8553e1ccf 100644
--- a/crates/agent/src/active_thread.rs
+++ b/crates/agent/src/active_thread.rs
@@ -1533,9 +1533,22 @@ impl ActiveThread {
});
}
- fn cancel_editing_message(&mut self, _: &menu::Cancel, _: &mut Window, cx: &mut Context<Self>) {
+ fn cancel_editing_message(
+ &mut self,
+ _: &menu::Cancel,
+ window: &mut Window,
+ cx: &mut Context<Self>,
+ ) {
self.editing_message.take();
cx.notify();
+
+ if let Some(workspace) = self.workspace.upgrade() {
+ workspace.update(cx, |workspace, cx| {
+ if let Some(panel) = workspace.panel::<AgentPanel>(cx) {
+ panel.focus_handle(cx).focus(window);
+ }
+ });
+ }
}
fn confirm_editing_message(