fix(ui): ignore the persistent workspace list when detecting overlays (#18881)

This commit is contained in:
Neil
2026-09-06 16:44:52 -07:00
committed by GitHub
parent f7d5216016
commit 6fd03a74ef
2 changed files with 13 additions and 1 deletions
@@ -30,6 +30,16 @@ describe('hasVisibleOverlay', () => {
expect(hasVisibleOverlay()).toBe(false)
})
it('ignores the persistent workspace list while preserving its nested popups', () => {
mount('<div role="listbox" data-worktree-sidebar></div>')
expect(hasVisibleOverlay()).toBe(false)
mount('<div role="listbox" data-worktree-sidebar><div role="menu"></div></div>')
expect(hasVisibleOverlay()).toBe(true)
})
it('ignores a display:none overlay', () => {
mount('<div role="dialog" style="display: none"></div>')
+3 -1
View File
@@ -1,4 +1,6 @@
const OVERLAY_SELECTOR = '[role="dialog"], [role="alertdialog"], [role="listbox"], [role="menu"]'
// The always-mounted worktree sidebar is page chrome, not an Escape-owning popup.
const OVERLAY_SELECTOR =
'[role="dialog"], [role="alertdialog"], [role="listbox"]:not([data-worktree-sidebar]), [role="menu"]'
type VisibleOverlayOptions = {
/** Overlays inside a match are treated as page content, not as a layer above it. */