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:
@@ -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>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user