Repository navigation
Fix foreground scope for Global Search shortcut - #8699
Conversation
|
To use Codex here, create a Codex account and connect to github. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughGlobal Search is reclassified as application-scoped, while Show/Hide All Windows remains the sole system-wide hotkey. Registration, shortcut routing, persistence, parsing, tests, documentation, and foreground UI validation are updated accordingly. ChangesShortcut scope and routing
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant KeyboardEvent
participant AppDelegate
participant GlobalSearchPalette
KeyboardEvent->>AppDelegate: Match configured globalSearch shortcut
AppDelegate->>GlobalSearchPalette: toggleGlobalSearchPalette()
Possibly related issues
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches🧪 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 SummaryThis PR migrates Global Search from a system-wide Carbon
Confidence Score: 5/5Safe to merge — the architectural change is internally consistent, all edge cases are covered by the existing policy and test suites, and no correctness-critical paths were left unguarded. The migration from Carbon to AppKit for Global Search is well-bounded: SystemWideHotkeyController is narrowed to a single action, the new routing extension rolls back chord state on non-applicable events, the CmuxSettings package policy centralises per-action validation that was previously scattered, and the managedShortcutActions set correctly propagates managed-but-explicitly-null state through multi-source merging. The @StateObject to @State change for the now-@observable observer is correct. No production blocking primitives, ambient global state, test seams, or unlocalized strings were introduced. Files Needing Attention: No files require special attention. The most complex path — routeVisibleGlobalSearchShortcutFromLocalMonitor's speculative chord-state promotion with rollback — is straightforward to audit and is covered by the visible-popover test suite. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Carbon as Carbon (OS)
participant LocalMon as NSEvent LocalMonitor
participant PopoverMon as MenubarSearchPopover Monitor
participant AppDel as AppDelegate (handleCustomShortcut)
participant Observer as KeyboardShortcutSettingsObserver
participant Palette as GlobalSearchCoordinator
Note over Carbon: showHideAllWindows only
User->>Carbon: Configured hotkey (background)
Carbon->>AppDel: toggleApplicationVisibilityFromGlobalHotkey()
Note over LocalMon: globalSearch — foreground only
User->>LocalMon: Key event (cmux active)
LocalMon->>AppDel: handleCustomShortcut(event)
AppDel->>Observer: globalSearchShortcut (cached)
Observer-->>AppDel: StoredShortcut
AppDel->>AppDel: routeVisibleGlobalSearchShortcut()
alt Palette visible
AppDel->>Palette: isPaletteVisible() → true
alt queryOwnsEditingShortcut
AppDel-->>LocalMon: .queryOwnsEvent → pass through
else shortcut matches
AppDel->>Palette: toggleGlobalSearchPalette() (close)
AppDel-->>LocalMon: .handled → consume
end
else Palette not visible
AppDel->>Palette: toggleGlobalSearchPalette() (open)
AppDel-->>LocalMon: return true (consume)
end
Note over PopoverMon: Visible palette's own local monitor
User->>PopoverMon: Key event (palette open)
PopoverMon->>AppDel: routeVisibleGlobalSearchShortcutFromLocalMonitor()
AppDel-->>PopoverMon: .handled / .queryOwnsEvent / .notApplicable
Reviews (109): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmuxUITests/GlobalSearchForegroundScopeUITests.swift`:
- Around line 30-60: Ensure
testBackgroundGlobalSearchShortcutIsDeliveredToFinder captures the diagnostic
screenshot on every exit by registering attachScreenshot(named:
"background-shortcut-delivered-to-finder") with defer at the start of the test,
and remove the later conditional call so assertion failures still trigger
capture.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 581c3f3d-5559-498a-a427-9e78afd05821
📒 Files selected for processing (1)
cmuxUITests/GlobalSearchForegroundScopeUITests.swift
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
…rch-background-hotkey
…rch-background-hotkey
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
…rch-background-hotkey # Conflicts: # Sources/KeyboardShortcutSettingsLookup.swift
…rch-background-hotkey
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
…rch-background-hotkey # Conflicts: # Packages/macOS/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift # Packages/macOS/CmuxSettingsUI/Sources/CmuxSettingsUI/Bindings/ShortcutListModel.swift # Packages/macOS/CmuxSettingsUI/Tests/CmuxSettingsUITests/ShortcutListModelTests.swift # Sources/AppDelegate.swift
…rch-background-hotkey # Conflicts: # skills/cmux-keyboard-shortcuts/SKILL.md
…rch-background-hotkey
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
…rch-background-hotkey
…rch-background-hotkey # Conflicts: # Packages/macOS/CmuxSettings/Sources/CmuxSettings/Values/ShortcutAction.swift # Sources/KeyboardShortcutSettings.swift
Summary
NSEventmonitor is mouse-only, there is no production keyboard event tap, and Show/Hide All Windows is the soleRegisterEventHotKeyowner.Fixes #8561
Testing
Exact final SHA:
5f811c134597d7aef27981ae7e287846ece1cbc5.Cloud/tagged Debug build passed: https://github.com/manaflow-ai/cmux/actions/runs/30219321326
macOS 26.4 full-display CuaDriver verification against the exact tagged app:
Exact-artifact exclusive Carbon probe registered Cmd-Option-F with
kEventHotKeyExclusivewhile cmux was running (noErr); its positive control returnedeventHotKeyExistsErrwhile a separate holder owned the chord.Exact-SHA behavior suites:
scopedVisibleGlobalSearchClosesFromAuxiliaryWindowShortcut, passed before the workflow's fixed post-test cutoff; the final two methods passed in isolated nonzero runs: https://github.com/manaflow-ai/cmux/actions/runs/30219977530, https://github.com/manaflow-ai/cmux/actions/runs/30220866225, https://github.com/manaflow-ai/cmux/actions/runs/30220866312Deterministic checks passed:
git diff --check, Xcode project normalization, test-wiring lint, workspace package grouping,Package.resolvedpolicy, 265CmuxSettingstests, 128CmuxSettingsUItests, deep strict code-sign verification, and artifact SHA-256 verification.Localization audit passed for changed English/Japanese shortcut documentation and UI catalogs; no new unlocalized user-facing string was introduced.
Warning budget TSV was untouched and no new Swift warning was introduced. All new Swift files are below 500 lines.
scripts/swift_file_length_budget.pyand.github/swift-file-length-budget.tsvdo not exist on this branch or currentmain, so no budget file was created or refreshed.Honest infrastructure caveats
.github/workflows/cmux-tui-build-package.yml:376(runs-on: ubuntu-latest); the workflow blob is identical on this branch andmain: https://github.com/manaflow-ai/cmux/actions/runs/30219558548.Demo Video
artifacts/issue-8561-global-search-background-hotkey/final-interaction-5f811c13/final-cua-5f811c13/recording-v4/edited.mp4(SHA-256 338b15c5526ec079607578c60a643861125d3e8d880a73aa6c06d01568bfe572)artifacts/issue-8561-global-search-background-hotkey/final-interaction-5f811c13/final-cua-5f811c13/recording-v4/recording.mov(SHA-256 953ca36e8a283b1505462fb40662587f9ccc48111d773da5b8d5a4c0e9de28ad)final-cua-5f811c13.The requested
/cmux-assetsroot was read-only on this machine, so the verified branch-scoped worktree artifact fallback was used.Review Trigger (Copy/Paste as PR comment)
Checklist