Route sidebar toggle through set_active_sidebar_width

`toggle_sidebar_width` set the new width via core directly, bypassing
the picker-dismiss + hover-expand reset that lives in
`set_active_sidebar_width`. So the user could open the workspace
popover, hit toggle, see the sidebar collapse, and the popover would
reappear on re-expand because the flag never cleared.

Forward toggle through the same entry point. One sidebar-resize code
path for the keyboard, the toggle button, and the drag handle.
This commit is contained in:
2026-05-09 22:23:37 -04:00
parent cb8038f60c
commit cea5f650de
+6 -3
View File
@@ -112,9 +112,12 @@ impl ElyShell {
COLLAPSED_SIDEBAR_WIDTH_PX COLLAPSED_SIDEBAR_WIDTH_PX
}; };
if core.set_space_sidebar_width(&snapshot.active_space_id, next_width).is_ok() { // Route through `set_active_sidebar_width` instead of poking
cx.notify(); // `core.set_space_sidebar_width` directly so the same
} // popover-dismiss + hover-expand reset logic applies whether
// the user toggles via the keyboard / button or the resize
// drag.
self.set_active_sidebar_width(next_width, cx);
} }
pub(crate) fn set_active_sidebar_width(&mut self, width_px: u16, cx: &mut Context<Self>) { pub(crate) fn set_active_sidebar_width(&mut self, width_px: u16, cx: &mut Context<Self>) {