fix(desktop): preserve browser editing shortcuts #10621
main fromrefs/pull/10621/head·merged by juliusmarminge View on GitHubPaste and other native editing shortcuts stopped working in the embedded browser because tabs and sign-in popups ignored every application-menu accelerator.
Allow standard editing shortcuts through when the browser has focus. Other T3 shortcuts stay blocked, and background browser input cannot enable menu edits in another renderer. Let Electron handle editing after the page has processed the key, preserving custom editor behavior.
Validation:
- All 89 preview-manager tests pass, including platform-specific editing chords, macOS Paste and Match Style with Option held, focused tabs and sign-in popups, key release, and continued blocking of host shortcuts.
- Targeted lint and desktop typecheck pass.
- No layout change. Julius will supply the demo recording; interactive verification was not run by the agent.
Note
Preserve browser editing shortcuts in PreviewManager preview isolation#
- Adds a direct test suite for
isPreviewEditingShortcutcovering platform-specific native editing chords (primary commands, redo variants, macOS Paste and Match Style) and rejection of conflicting or unrelated modifiers and host shortcuts. - Updates the existing shortcut-isolation test so the preview web contents are marked focused, editing keys are excluded from generic non-host cases, and unrelated key events still leave host menu shortcuts ignored.
- Adds a focused browser editing effect test covering both registered preview tabs and sign-in popups, verifying that focused paste enables native menu fallback, Meta key release does not disable it, a non-editing shortcut restores isolation, and unfocused guests remain isolated.
- Updates production shortcut routing for preview tabs and sign-in popups. Only focused native editing chords reach the application menu; other shortcuts remain isolated from the host.
Summary by CodeRabbit#
- Bug Fixes
- Improved editing shortcuts in preview tabs and sign-in popups, including copy, paste, undo, redo, and text selection.
- Added platform-specific support for macOS “Paste and Match Style” shortcuts.
- Preserved host shortcut protection while allowing native editing commands in focused inputs.
- Keeps background browser input from enabling editing shortcuts in another renderer.
Model: GPT-6. Harness: Codex.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
493dd24Macroscope's review found this PR approvable — This is a contained desktop bug fix that restores native browser editing shortcuts while continuing to suppress unrelated host accelerators and unfocused automation. The production change is limited to preview shortcut routing and is backed by focused cross-platform and popup/tab tests.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Team
Run ID:
980de99d-c727-41f3-ba85-6f21186ab549📥 Commits
Reviewing files that changed from the base of the PR and between 3384b72490a58338d1031d52d2a15bf253020c63 and 493dd24630daab9e1e7786dd3cd2ccaeaabcfe45.
📒 Files selected for processing (2)
apps/desktop/src/preview/Manager.test.tsapps/desktop/src/preview/Manager.ts
Included review availability: 7 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.
📝 Walkthrough
Walkthrough#
Preview tabs and sign-in popups now recognize platform-specific native editing shortcuts. Application menu shortcuts change according to focused WebContents, while native editing events remain available.
Changes#
Preview shortcut handling
Layer / File(s) Summary Native editing shortcut detection
apps/desktop/src/preview/Manager.ts,apps/desktop/src/preview/Manager.test.tsisPreviewEditingShortcutrecognizes platform-specific copy, paste, undo, redo, and selection shortcuts. Tests cover valid and invalid modifier combinations.Focused preview and popup routing
apps/desktop/src/preview/Manager.ts,apps/desktop/src/preview/Manager.test.tsPreview tabs and sign-in popups enable application menu shortcuts only for focused editing input. Non-editing input keeps host shortcut protection, and unfocused guest input is ignored. Tests cover both window types and event behavior. Estimated code review effort: 3 (Moderate) | ~20 minutes
Merge Risk: ⚪ Minimal · up to
493ddThis change preserves native editing shortcuts in focused preview and sign-in browser contents while retaining application shortcut isolation. No concrete merge-blocking risk remains.
Sequence Diagram(s)#
sequenceDiagram participant PreviewTab participant SignInPopup participant ApplicationMenu PreviewTab->>ApplicationMenu: enable shortcuts for focused editing input SignInPopup->>ApplicationMenu: enable shortcuts for focused editing input PreviewTab->>PreviewTab: preserve native editing event SignInPopup->>SignInPopup: ignore editing input when unfocused PreviewTab->>ApplicationMenu: disable shortcuts for non-editing inputSuggested reviewers:
maria-rcks,t3dotgg🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2… Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. Title check ✅ Passed The title clearly and concisely describes the primary change: preserving browser editing shortcuts in the desktop application. Description check ✅ Passed The description explains what changed, why it changed, scope, validation results, UI impact, and remaining verification work. It does not reproduce the checklist headings, but the required information… ✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch `fix-browser-keyboard-shortcuts`
Comment `@coderabbitai help` to get the list of available commands.macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 13.6 KiB 13.5 KiB −11 B (−0.1%) 15.1 KiB ✅ Codex Thread snapshot wire 7.0 KiB 7.0 KiB −1 B (−0.0%) 7.3 KiB ✅ Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB −10 B (−0.2%) 7.8 KiB ✅ Codex Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB ✅ Codex Live turn messages 8 8 0 (0.0%) 21 ✅ Claude Total thread wire 13.6 KiB 13.6 KiB −24 B (−0.2%) 15.1 KiB ✅ Claude Thread snapshot wire 7.0 KiB 7.1 KiB +4 B (+0.1%) 7.3 KiB ✅ Claude Live turn WebSocket wire 6.5 KiB 6.5 KiB −28 B (−0.4%) 7.8 KiB ✅ Claude Live turn WebSocket decoded 57.9 KiB 57.8 KiB −44 B (−0.1%) 66.4 KiB ✅ Claude Live turn messages 10 9 −1 (−10.0%) 21 ✅ Baseline:
ea2983a· PR result:493dd24· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 113.9 KiB
- Claude decoded thread snapshot: 114.6 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
juliusmarminge merged thise0e0bcb
juliusmarminge closed this
Sign in to join this conversation.
Bugbot is paused — on-demand spend limit reached
Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.
A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.