From e8c6f29f444e3bede73f8253b406da7cc9a2aa48 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 14 Apr 2026 11:56:29 -0700 Subject: [PATCH] Defer sidebar sync (#53925) 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) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- crates/workspace/src/multi_workspace.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/workspace/src/multi_workspace.rs b/crates/workspace/src/multi_workspace.rs index 719b613c69f6eaf84f8a61b4f28b3cca88bee294..67e6e71ffd9f7d639973541db69ff6d37cdbb802 100644 --- a/crates/workspace/src/multi_workspace.rs +++ b/crates/workspace/src/multi_workspace.rs @@ -726,11 +726,20 @@ impl MultiWorkspace { cx: &mut Context, ) { Self::subscribe_to_workspace(workspace, window, cx); - self.sync_sidebar_to_workspace(workspace, cx); let weak_self = cx.weak_entity(); workspace.update(cx, |workspace, cx| { workspace.set_multi_workspace(weak_self, cx); }); + + let entity = cx.entity(); + cx.defer({ + let workspace = workspace.clone(); + move |cx| { + entity.update(cx, |this, cx| { + this.sync_sidebar_to_workspace(&workspace, cx); + }) + } + }); } pub fn project_group_key_for_workspace(