From cb8038f60cd31b9cdad70dad29574fa724ee8194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sat, 9 May 2026 22:23:08 -0400 Subject: [PATCH] Auto-dismiss workspace popover when sidebar collapses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picker pill is only painted in the expanded sidebar, but workspace_picker_open lived independently of sidebar width. If a user opened the picker, then collapsed the sidebar via the toggle or by dragging the resize handle below the COLLAPSED threshold, the popover state stayed `true` — re-expanding the sidebar would surprise them with a stranded popover from before. Drop the picker_open flag inside set_active_sidebar_width whenever the new width is at or below COLLAPSED_SIDEBAR_WIDTH_PX, so the popover state stays in sync with the trigger's visibility. --- crates/ely_app/src/shell/sidebar.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/ely_app/src/shell/sidebar.rs b/crates/ely_app/src/shell/sidebar.rs index d879661..3b7dc62 100644 --- a/crates/ely_app/src/shell/sidebar.rs +++ b/crates/ely_app/src/shell/sidebar.rs @@ -130,6 +130,14 @@ impl ElyShell { if width_px > HIDDEN_SIDEBAR_WIDTH_PX { self.sidebar_hover_expanded = false; } + // Picker pill only shows in the expanded sidebar. If the + // sidebar drops below the expanded threshold while the + // picker is open, dismiss the popover so its state never + // gets stranded waiting for a trigger that's no longer + // visible. + if width_px <= COLLAPSED_SIDEBAR_WIDTH_PX && self.workspace_picker_open { + self.workspace_picker_open = false; + } cx.notify(); } }