Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
sidebar: Always focus agent when selecting thread (#53892)
Cameron Mcloughlinc49973d70592
diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rsindex b1ae8109455..07ca6d069e9 100644--- a/crates/sidebar/src/sidebar.rs+++ b/crates/sidebar/src/sidebar.rs@@ -2378,7 +2378,11 @@ impl Sidebar {if let Some(agent_panel) = existing_panel {load_thread(agent_panel, metadata, focus, window, cx);workspace.update(cx, |workspace, cx| {- workspace.reveal_panel::<AgentPanel>(window, cx);+ if focus {+ workspace.focus_panel::<AgentPanel>(window, cx);+ } else {+ workspace.reveal_panel::<AgentPanel>(window, cx);+ }});return;}@@ -2396,7 +2400,11 @@ impl Sidebar {});panel.update(cx, |panel, _cx| panel.begin_loading_thread());load_thread(panel, &metadata, focus, window, cx);- workspace.reveal_panel::<AgentPanel>(window, cx);+ if focus {+ workspace.focus_panel::<AgentPanel>(window, cx);+ } else {+ workspace.reveal_panel::<AgentPanel>(window, cx);+ }})?;anyhow::Ok(())@@ -3673,11 +3681,8 @@ impl Sidebar {workspace: workspace.clone(),});this.update_entries(cx);- Self::load_agent_thread_in_workspace(workspace, metadata, false, window, cx);this.dismiss_thread_switcher(cx);- workspace.update(cx, |workspace, cx| {- workspace.focus_panel::<AgentPanel>(window, cx);- });+ Self::load_agent_thread_in_workspace(workspace, metadata, true, window, cx);}ThreadSwitcherEvent::Dismissed => {if let Some(mw) = weak_multi_workspace.upgrade() {