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.

Always open agent panel when selecting a thread or draft (#53664)

Nathan Sobo93e36aa55ef9
diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs
index f69e5206a6e..8864d9e7faa 100644
--- a/crates/sidebar/src/sidebar.rs
+++ b/crates/sidebar/src/sidebar.rs
@@ -1718,11 +1718,6 @@ impl Sidebar {
// shown, so the user returns to whatever
// thread/draft they were looking at.
this.activate_workspace(&workspace, window, cx);
- if AgentPanel::is_visible(&workspace, cx) {
- workspace.update(cx, |workspace, cx| {
- workspace.focus_panel::<AgentPanel>(window, cx);
- });
- }
} else {
this.open_workspace_for_group(&key, window, cx);
}
@@ -2181,6 +2176,9 @@ impl Sidebar {
}
} else if let Some(workspace) = workspace {
self.activate_workspace(&workspace, window, cx);
+ workspace.update(cx, |ws, cx| {
+ ws.focus_panel::<AgentPanel>(window, cx);
+ });
} else {
self.open_workspace_for_group(&key, window, cx);
}
@@ -4152,11 +4150,9 @@ impl Sidebar {
// Placeholder with an open workspace — just
// activate it. The panel remembers its last view.
this.activate_workspace(workspace, window, cx);
- if AgentPanel::is_visible(workspace, cx) {
- workspace.update(cx, |ws, cx| {
- ws.focus_panel::<AgentPanel>(window, cx);
- });
- }
+ workspace.update(cx, |ws, cx| {
+ ws.focus_panel::<AgentPanel>(window, cx);
+ });
} else {
// No workspace at all — just open one. The
// panel's load fallback will create a draft.