Skip to content

fix: let Escape pass a manual popover the user is not in - #5593

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5582
Nov 6, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5582

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A manual popover the user isn't in, such as a hover card under the pointer, no longer turns Escape off for the whole page. The layer stack records every open popover. The dispatcher put an Escape boundary after each one, and the page's let-go (navigation.release) and its "back to the page" rung stood down while any layer was open. The browser closes auto and hint popovers on Escape but never a manual one, so while one was open every press did nothing.

nativeModes() in browser/runtime/keyboard/layer-stack.js now returns the layers that count as a mode over the keys beneath them: modals, auto and hint popovers, and a manual popover while focus is inside it. The dispatcher's tiers (dispatch.js) and both Escape steps in page.js read it instead of the whole stack. With a manual popover open that holds no focus, Escape now takes the step it would take with no popover open. With focus inside the card, the card stays a layer and the page beneath stays out of Escape's reach, as before. Other uses of nativeLayers(), such as the close watcher's ordering, a modal floor and the media viewer, still read every layer.

test_escape_passes_a_manual_popover_the_user_is_not_in uses the page from the issue. With the card open, Escape lets go of a focused link and leaves the panel's comment field. With focus inside the card, Escape still holds. Before the change the test fails at the link's Escape, and after it the test passes. The existing popover and Escape tests in test_key_scopes.py and test_render_floating_panel.py, pnpm run test:runtime and pnpm run check also pass.

Closes #5582 — automated triage

The layer stack recorded every open popover, and the dispatcher tiered
Escape under each with a boundary while the page's let-go and "back to
the page" rung stood down under any layer. The browser never closes a
manual popover on Escape, so a hover card shown as one left every
Escape dead, wherever focus stood, until the card closed.

`nativeModes()` (layer-stack.js) now names the layers that stand as a
mode over the keys beneath them: modals, auto and hint popovers, and a
manual popover while focus is inside it. The dispatcher's tiers and the
page's Escape steps read it. Behaviour change: with a manual popover open
that holds no focus, Escape takes the step it would take with none open.

Closes #5582
@leaf-agent
leaf-agent merged commit 5fb9799 into main Nov 6, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5582 branch November 6, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escape does nothing while a manual popover is open, wherever focus is

1 participant