Suppress workspace popover when sidebar isn't expanded

The disclosure anchors to fixed window coords sized for the picker pill
in the expanded sidebar. If the sidebar is collapsed or hidden when
`workspace_picker_open` is true, the popover would float disconnected
from any visible trigger. Gate the render on
`!sidebar_collapsed && !sidebar_hidden` so the popover only shows when
the pill is actually painted.
This commit is contained in:
2026-05-09 21:53:46 -04:00
parent adb278b3bb
commit 4a29e2d23c
+11 -4
View File
@@ -93,10 +93,17 @@ impl ElyShell {
.when(hover_expanded, |el| {
el.child(self.render_hidden_sidebar_overlay(&snapshot, cx))
})
.when(self.workspace_picker_open, |el| {
el.child(render_workspace_disclosure_backdrop(cx))
.child(render_workspace_disclosure(&snapshot, cx))
})
// Workspace popover only makes sense when the picker pill is
// visible — i.e. the sidebar is expanded. Compact/hidden
// modes don't render the trigger, so showing the disclosure
// would float a stranded card with no anchor.
.when(
self.workspace_picker_open && !sidebar_collapsed && !sidebar_hidden,
|el| {
el.child(render_workspace_disclosure_backdrop(cx))
.child(render_workspace_disclosure(&snapshot, cx))
},
)
.children(render_command_overlay(self, &snapshot, cx))
.into_any_element()
}