Repository navigation
fix(emcn): a modal over a native surface takes keys as soon as it takes focus - #10393
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
waleedlatif1
marked this pull request as ready for review
November 25, 2026 00:58
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe modal now accepts keyboard input immediately after readiness commits and focus moves inside it.
Reviews (1) · Last reviewed commit: "test(desktop): drop the Escape-step inst..." · Reviewed by Greptile |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
browser-page-dialogsdesktop-e2e failure "dialog … was showing when Escape was pressed": Stay was focused, Escape was sent, and the blocking listener dropped it before the frame that would have lifted the block.flushSync) so focus moves into the dialog, and lifts the block right after. Focus and keyboard input now become available at the same moment. Custom takeover surfaces (useNativeSurfaceOcclusionReady) keep the next-frame release.Evidence
An instrumented run of the step (8 tries in one CI shard) timed renderer events. On the failing try, Stay took focus at t=10268ms and Escape reached the window's capture listener at t=10281ms. The block was lifted after that keydown, in the same millisecond, and the key never reached the document. The page wasn't loading, the shell window and webContents had focus, the page view's
before-input-eventsaw no Escape, and the dialog requestId never changed. With the fix, 12/12 tries passed, and the block lifted 0–3ms after Stay took focus, always before the key.Type of Change
Testing
modal.test.tsx: the control that holds focus once the modal is ready now gets the very next key. This fails on the pre-fix modal (key blocked) and passes with the fix.browser-panel-occlusion.test.tspasses.Checklist
🤖 Generated with Claude Code