From d0fc14c2f6dc08fc64a7e0f70fe524b704063214 Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Thu, 16 Apr 2026 17:16:48 +0200 Subject: [PATCH] agent_ui: Remove unused `pending_thread_loads` from agent panel (#54066) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #ISSUE Release Notes: - N/A --- crates/agent_ui/src/agent_panel.rs | 7 ------- crates/sidebar/src/sidebar.rs | 2 -- 2 files changed, 9 deletions(-) diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs index 4a72132875b9b06dfbf00388c41b4e7d0f3b4180..d04c5567a410ffb1d724f3fb3823e0c89ddddabf 100644 --- a/crates/agent_ui/src/agent_panel.rs +++ b/crates/agent_ui/src/agent_panel.rs @@ -761,7 +761,6 @@ pub struct AgentPanel { new_user_onboarding: Entity, new_user_onboarding_upsell_dismissed: AtomicBool, selected_agent: Agent, - pending_thread_loads: usize, worktree_creation_status: Option<(EntityId, WorktreeCreationStatus)>, _thread_view_subscription: Option, _active_thread_focus_subscription: Option, @@ -1129,7 +1128,6 @@ impl AgentPanel { new_user_onboarding: onboarding, thread_store, selected_agent: Agent::default(), - pending_thread_loads: 0, worktree_creation_status: None, _thread_view_subscription: None, _active_thread_focus_subscription: None, @@ -2490,10 +2488,6 @@ impl AgentPanel { ); } - pub fn begin_loading_thread(&mut self) { - self.pending_thread_loads += 1; - } - pub fn load_agent_thread( &mut self, agent: Agent, @@ -2505,7 +2499,6 @@ impl AgentPanel { window: &mut Window, cx: &mut Context, ) { - self.pending_thread_loads = self.pending_thread_loads.saturating_sub(1); if let Some(store) = ThreadMetadataStore::try_global(cx) { let thread_id = store .read(cx) diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs index 13d7b71e39e44195703aa955ac432013a7e64a94..7baf906f98d1617ae503f145557b4e1152bc8acc 100644 --- a/crates/sidebar/src/sidebar.rs +++ b/crates/sidebar/src/sidebar.rs @@ -2142,7 +2142,6 @@ impl Sidebar { let mut existing_panel = None; workspace.update(cx, |workspace, cx| { if let Some(panel) = workspace.panel::(cx) { - panel.update(cx, |panel, _cx| panel.begin_loading_thread()); existing_panel = Some(panel); } }); @@ -2170,7 +2169,6 @@ impl Sidebar { workspace.add_panel(panel.clone(), window, cx); panel.clone() }); - panel.update(cx, |panel, _cx| panel.begin_loading_thread()); load_thread(panel, &metadata, focus, window, cx); if focus { workspace.focus_panel::(window, cx);