Repository navigation
Suppress browser editing shortcut replay - #4186
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR modifies browser key-equivalent handling in AppDelegate to suppress replay when focused web content declines a shortcut, and adds comprehensive test coverage for the Cmd+C routing behavior in both fallback-to-menu and suppression scenarios. ChangesBrowser Key-Equivalent Suppression
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 15 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Greptile SummaryMakes the window-level browser document-editing shortcut preflight (
Confidence Score: 5/5Safe to merge — the one-line production change matches the pre-existing Find-shortcut invariant exactly, and the new tests exercise both new window-path branches directly. The production delta is a targeted removal of a conditional guard that previously allowed the window dispatch path to replay WebKit; the unconditional No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant AppKit as NSWindow<br/>(swizzled)
participant CmuxWV as CmuxWebView<br/>performKeyEquivalent
participant WKWebKit as WKWebView<br/>(WebKit)
participant Menu as NSApp.mainMenu
Note over AppKit: Cmd+C pressed, focused<br/>browser child responder
AppKit->>CmuxWV: performKeyEquivalent(Cmd+C)
CmuxWV->>WKWebKit: forward Cmd+C
alt WebKit handles it
WKWebKit-->>CmuxWV: true
CmuxWV-->>AppKit: true
Note over AppKit: return true (suppressed)
else WebKit declines
WKWebKit-->>CmuxWV: false
CmuxWV->>Menu: performKeyEquivalent(Cmd+C)
alt Menu handles it
Menu-->>CmuxWV: true
CmuxWV-->>AppKit: true
else Menu declines
Menu-->>CmuxWV: false
CmuxWV-->>AppKit: false
end
Note over AppKit: return true regardless<br/>(no WebKit replay)
end
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
78ac7b5 to
47a5daa
Compare
Summary
Tests
Note
Medium Risk
Changes global
NSWindow.performKeyEquivalentrouting for browser editing shortcuts, which can affect copy/cut/select-all behavior and menu fallback across the app. Risk is mitigated by added regression tests covering focused child responders and menu-decline scenarios.Overview
Prevents double-dispatch/replay of browser document-editing command equivalents (e.g. Cmd+C) when they are preflighted through a focused
CmuxWebViewfrom the window-levelperformKeyEquivalentpath.After forwarding the shortcut into the web view, the window preflight now always consumes the event (matching the existing Find-family behavior) to avoid falling through and re-triggering WebKit.
Adds window-path unit tests to verify: (1) main-menu fallback still occurs when WebKit declines, and (2) no second web-content replay occurs when both WebKit and the menu decline.
Reviewed by Cursor Bugbot for commit 0d5eaa0. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Prevents duplicate dispatch of editing shortcuts (Cmd+C/Cmd+X/Cmd+A) by making the window preflight terminal after sending the event to
CmuxWebView, matching the Find shortcut behavior. Fixes Slack Cmd+C copy replays in embedded browsers; connects to Linear issue 4123.CmuxWebView.performKeyEquivalentwhen WebKit declines.Written for commit 0d5eaa0. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
Bug Fixes
Tests