mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 08:03:20 +00:00
fix(ui): ignore the persistent workspace list when detecting overlays
This commit is contained in:
@@ -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)
|
||||
|
||||
document.querySelector('[data-worktree-sidebar]')!.innerHTML = '<div role="menu"></div>'
|
||||
|
||||
expect(hasVisibleOverlay()).toBe(true)
|
||||
})
|
||||
|
||||
it('ignores a display:none overlay', () => {
|
||||
mount('<div role="dialog" style="display: none"></div>')
|
||||
|
||||
|
||||
@@ -15,6 +15,10 @@ export function hasVisibleOverlay(options?: VisibleOverlayOptions): boolean {
|
||||
if (!(element instanceof HTMLElement)) {
|
||||
return false
|
||||
}
|
||||
// The persistent workspace list is page chrome, not an Escape-owning popup.
|
||||
if (element.matches('[role="listbox"][data-worktree-sidebar]')) {
|
||||
return false
|
||||
}
|
||||
if (element.closest('[aria-hidden="true"]')) {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user