Make close sidebar button work regardless of focus state (#52260)

Like https://github.com/zed-industries/zed/pull/52045, but for the
*close* button.

Release Notes:

- N/A
This commit is contained in:
Max Brunsfeld authored and GitHub committed 2026-03-23 14:35:10 -07:00
1 parent 78df135d15
commit 0b9aeaf663
2 files changed
+6 -2

No files matched your search

+5 -1
View File
@@ -2916,7 +2916,11 @@ impl Sidebar {
.into_any_element()
}))
.on_click(|_, window, cx| {
window.dispatch_action(ToggleWorkspaceSidebar.boxed_clone(), cx);
if let Some(multi_workspace) = window.root::<MultiWorkspace>().flatten() {
multi_workspace.update(cx, |multi_workspace, cx| {
multi_workspace.close_sidebar(window, cx);
});
}
})
}
}
+1 -1
View File
@@ -278,7 +278,7 @@ impl MultiWorkspace {
cx.notify();
}
fn close_sidebar(&mut self, window: &mut Window, cx: &mut Context<Self>) {
pub fn close_sidebar(&mut self, window: &mut Window, cx: &mut Context<Self>) {
self.sidebar_open = false;
let has_notifications = self.sidebar_has_notifications(cx);
let show_toggle = self.multi_workspace_enabled(cx);