From ab936157166eb5dafd90751ace5fea07267beab4 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Wed, 15 Apr 2026 07:25:04 -0300 Subject: [PATCH] sidebar: Fix removed projects not immediately disappearing from the UI (#53974) Release Notes: - N/A --- crates/sidebar/src/sidebar.rs | 3 ++- crates/workspace/src/multi_workspace.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs index 0a00102fcc3dcbcfa1139c40486c961e04b6b50a..c7b1c6fc8e13d1cde7b9868728848df587d93553 100644 --- a/crates/sidebar/src/sidebar.rs +++ b/crates/sidebar/src/sidebar.rs @@ -408,7 +408,8 @@ impl Sidebar { this.subscribe_to_workspace(workspace, window, cx); this.update_entries(cx); } - MultiWorkspaceEvent::WorkspaceRemoved(_) => { + MultiWorkspaceEvent::WorkspaceRemoved(_) + | MultiWorkspaceEvent::ProjectGroupsChanged => { this.update_entries(cx); } }, diff --git a/crates/workspace/src/multi_workspace.rs b/crates/workspace/src/multi_workspace.rs index 504f1f3543b0e118f702561f24c22e592b89e92a..228597971e5815bdc6a97f13415053f9e78a0a80 100644 --- a/crates/workspace/src/multi_workspace.rs +++ b/crates/workspace/src/multi_workspace.rs @@ -105,6 +105,7 @@ pub enum MultiWorkspaceEvent { ActiveWorkspaceChanged, WorkspaceAdded(Entity), WorkspaceRemoved(EntityId), + ProjectGroupsChanged, } pub enum SidebarEvent { @@ -854,6 +855,7 @@ impl MultiWorkspace { // Now remove the group. self.project_groups.retain(|group| group.key != *group_key); + cx.emit(MultiWorkspaceEvent::ProjectGroupsChanged); let excluded_workspaces = workspaces.clone(); self.remove(