Repository navigation
Conversation
Electron suppresses guest keyups after a prevented Ctrl+Tab keydown, so the MRU switcher never received ui:ctrlTabKeyUp and stayed stuck open (#9937). Match the main-window path: forward the chord without preventDefault. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
Closing — will re-open from Fazalkadivar21. |
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe guest keyboard handler no longer calls 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Fixes #9937.
Ctrl+Tab from a focused in-app browser opened the MRU Switch Tab overlay but never committed or closed it, because guest
before-input-eventcalledpreventDefault()on the Tab keydown and Electron then suppressed the Control keyup that should emitui:ctrlTabKeyUp.Stop preventDefault-ing that keydown in guest shortcut forwarding (same approach as the main-window path in
createMainWindow.ts), so the existing IPC commit path can fire on modifier release.What changed
Before: Guest Ctrl+Tab keydown was
preventDefault()-ed → guest keyups were dropped → overlay stayed stuck until focus left the browser tab.After: Guest Ctrl+Tab keydown is forwarded without
preventDefault()→ Control keyup reaches the guest handler →ui:ctrlTabKeyUpcommits/closes the overlay normally.Screenshots
No visual change (behavior-only fix for an existing overlay).
Testing
pnpm lintpnpm typecheckpnpm test(targeted:browser-guest-ui.test.ts,browser-manager.test.tsCtrl+Tab cases)pnpm buildpreventDefaultAI Review Report
Root cause matches the documented main-window comment: preventing the held-chord keydown suppresses the modifier keyup and strands the overlay. Alternative approach in #9954 keeps
preventDefaultand blurs the webview so renderer DOM handlers own the rest of the gesture; this PR prefers the smaller change that removes the suppression trigger and stays consistent withcreateMainWindow.Cross-platform: no new shortcuts/labels/paths; chord matching stays behind
matchesRecentTabSwitcherChord/ keybinding registry. Electron keyup-suppression after preventDefault is platform-independent (reported on Linux, same guest path on macOS/Windows). SSH unaffected (UI keyboard routing only).Security Audit
No new IPC channels or guest-supplied data paths. Change only removes
preventDefaulton an already-forwarded app chord; existing main→rendererui:ctrlTabKeyDown/ui:ctrlTabKeyUptrust boundary is unchanged. Pages may observe Ctrl+Tab (previously swallowed); most pages ignore it.Notes
Related alternative: #9954 (blur webview + focus restore + E2E). This PR is the minimal main-window-aligned fix for the same root cause.
Made with Cursor