Move workspace popover to window root + dismiss on outside click

Previously the disclosure was an absolute child of the picker row,
clipped by the sidebar's overflow_hidden, with no way for an outside
click to close it. Real popovers (Arc, Linear, Raycast) close the
moment you click anywhere else, and they spill past their host
container so a long workspace list isn't cut at the sidebar edge.

Lift the disclosure to the render_browser tree:

* `render_workspace_disclosure_backdrop` paints a fullscreen
  transparent layer that closes the picker on mouse-down — no
  on_click so the close fires immediately, before any synthetic click.
* `render_workspace_disclosure` paints next, pinned to fixed
  window-relative anchor coords (top 98, left 66, width 180) that
  match the picker pill's row in the default sidebar layout.

The picker row inside the sidebar header drops the inline disclosure
child entirely.

cargo test --workspace: 440 passed, 0 failed.
This commit is contained in:
2026-05-09 21:42:37 -04:00
parent 85d1e09916
commit 41b5208006
3 changed files with 60 additions and 15 deletions
+6 -1
View File
@@ -10,7 +10,8 @@ use gpui::{
use super::chrome::command_match::visible_command_rows;
use super::chrome::{
SANS_FAMILY, panel_bg, panel_shadow, render_command_overlay,
render_topbar as render_topbar_chrome, render_wallpaper,
render_topbar as render_topbar_chrome, render_wallpaper, render_workspace_disclosure,
render_workspace_disclosure_backdrop,
};
use super::sidebar::collapsed_sidebar_active;
use super::{ElyShell, ShellState};
@@ -92,6 +93,10 @@ 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))
})
.children(render_command_overlay(self, &snapshot, cx))
.into_any_element()
}