Skip to content

Observe consumed shortcuts in the browser keyboard test - #3589

Merged
leaf-agent merged 2 commits into
mainfrom
fix/ci-39805869159-key-observer
Oct 22, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/ci-39805869159-key-observer

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

The browser keyboard test now observes ? during capture and navigation keys during bubbling. #3556 moved character shortcuts to a capturing listener that stops propagation after handling them, so the test's former bubbling observer missed its ? positive control. Keeping navigation keys in bubble lets the test detect a cancellation by focused content.

The focused browser test passes (uv run pytest tests/browser/drafts/test_keys.py::test_global_shortcuts_leave_other_browser_navigation_keys_alone -q -n 0). This PR changes only the test; runtime keyboard behavior is unchanged.

The global shortcut observer must run after Leaf's capture listener and before the consumed key is stopped from bubbling. This preserves the browser navigation key assertion introduced before the capture-phase dispatcher in #3556.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The capture observer reads navigation keys before focused content can call preventDefault(). A later cancellation would leave this test green even though the browser key no longer works. Keep those observations in bubble, and capture only the consumed ? control.

Comment thread tests/browser/drafts/test_keys.py Resolved
@leaf-agent
leaf-agent merged commit 0009bd7 into main Oct 22, 2026
3 checks passed
@leaf-agent
leaf-agent deleted the fix/ci-39805869159-key-observer branch October 22, 2026 18:19
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.

1 participant