Repository navigation
Stop interrupting focused work: sidebar jumps, Computer Use focus steal, quit dialog on logout - #14961
Conversation
An agent's first Computer Use tool call opened the setup window with NSApp.activate(ignoringOtherApps:) and orderFrontRegardless, pulling cmux over whatever app the user was typing in. The onboarding coordinator now tells the window who asked. A Settings action still activates cmux and focuses the window. A tool invocation orders the window front without taking key focus when cmux is already active; otherwise it keeps the window behind the active app, bounces the Dock icon, and brings the window forward when the user switches to cmux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A notification for the pane the user is looking at suppresses desktop, sound, and pane flash but still moves its workspace in the sidebar. This test expects reorderWorkspace to be off in that case and fails until the fix in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A notification for the pane the user is already looking at turned off desktop, sound, and pane flash but still reordered the sidebar, so the workspace being typed in jumped. The focused-pane delivery decision now also turns off reorderWorkspace, and the terminal notification store applies the same rule once it knows the target pane is focused, so both the Feed lane and direct terminal notifications leave that workspace in place. History, unread state, and the automation hook are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
applicationShouldTerminate showed the quit dialog for every quit, so with confirmation enabled a logout, restart, or shutdown stalled until the user answered it. It now reads kAEQuitReason from the current quit Apple Event and, for the logout, restart, and shutdown codes, goes straight to the confirmed-termination path. The decision is QuitRequestReason plus a quitReason parameter on QuitConfirmationStore.shouldShowConfirmation, covered by CmuxSettings package tests. Cmd+Q, the menu, and the Dock are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedNext included review available in 3 seconds. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (14)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (14)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe changes distinguish session-ending quits from user quits, vary onboarding window activation by presentation origin, and prevent notification effects from reordering the focused workspace. ChangesQuit reason handling
Onboarding presentation origin
Focused-pane notification ordering
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Tool
participant ComputerUseOnboardingCoordinator
participant ComputerUseUXCoordinator
participant ComputerUseOnboardingWindowController
participant AppKit
Tool->>ComputerUseOnboardingCoordinator: Request automatic onboarding
ComputerUseOnboardingCoordinator->>ComputerUseUXCoordinator: Present overview with toolInvocation origin
ComputerUseUXCoordinator->>ComputerUseOnboardingWindowController: Present starting point and origin
alt cmux is active
ComputerUseOnboardingWindowController->>ComputerUseOnboardingWindowController: Show window without focus
else cmux is inactive
ComputerUseOnboardingWindowController->>AppKit: Order window behind active app and request Dock attention
ComputerUseOnboardingWindowController->>AppKit: Observe cmux activation
AppKit-->>ComputerUseOnboardingWindowController: Notify cmux activation
ComputerUseOnboardingWindowController->>ComputerUseOnboardingWindowController: Bring visible window forward
end
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The changes are mergeable after normal checks. Live focus, notification ordering, and session-ending quit behavior remain worth validating, but no concrete blocking issue is established. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The main concern is whether a quit request can claim to be part of logout or shutdown and skip the configured warning for dirty workspaces. The other changes appear to preserve their existing permission and notification controls. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 inconclusive)
✅ Passed checks (23 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 32.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 28 functions across 12 files. (2 skipped: 1 unsupported, 1 too large.) Full details: Cmux Swift Package BoundariesExplanation The focused-notification change keeps independently testable domain logic in the app target. Resolution Move the notification delivery domain boundary out of the app target. Extend the existing ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
⚔️ Resolve merge conflicts 💡
🧪 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 |
…-work # Conflicts: # CHANGELOG.md
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. |
…interrupting-focused-work # Conflicts: # CHANGELOG.md
…#14987) Delta CI (#14659) routes diff(last green head, merge), which carries everything main gained since the pull request last synced. When main moved further than the pull request, that routes more than the pull request's own diff: #14961 routed 40 files for a 15-file diff and #14960 43 for 10, picked about 130 unrelated unit test classes, and failed suite-coverage on main's cmuxUITests/ edits from #14966. Take the delta only when it is no larger than the pull request diff and carries no cmuxUITests/ edit the pull request did not make. Otherwise route the usual pull request diff, as every other skip does. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-work # Conflicts: # cmux.xcodeproj/project.pbxproj
…-work # Conflicts: # cmux.xcodeproj/project.pbxproj
|
Merge receipt for |
648d5c1 Add a Paste Last Screenshot action with an unbound shortcut (manaflow-ai#14955) ff61677 ci: avoid partial blobs in catch-up merges (manaflow-ai#15023) 4d0d112 ci: retry transient catch-up GraphQL failures (manaflow-ai#15021) 212e808 ci: attribution scores a lone suspect and reports app-host crashes apart (manaflow-ai#14952) 4cabdf4 test: settle the window before measuring the unread sidebar-row invalidation (manaflow-ai#14568) 12ec99b Add a release-media capture tool for changelog screenshots and clips (manaflow-ai#15010) ee2cda0 Backfill Unreleased changelog and draft next release cards (manaflow-ai#14999) be4adf8 Show a brief notice when Cmd+V fails on an oversized image or a timeout (manaflow-ai#14953) 23d22d7 ci: an owned pool the run starts on now beats an earlier one it queues on (manaflow-ai#14993) 05d0190 ci: catch-up posts once per head, says less, and merges inserted declarations (manaflow-ai#15018) 4ee4b21 ci: fail stalled Swift package tests instead of waiting out the job timeout (manaflow-ai#14997) 9ce512a merge-main: run local guards only when asked (manaflow-ai#15016) d60108a ci: clear test-e2e's fixed DerivedData with clear-dirs.sh (manaflow-ai#14994) 1d7895e ci: run the shell and CLI no-socket lanes in parallel (manaflow-ai#14990) 6e7d25f Honor macOS Differentiate Without Color, Increase Contrast and Reduce Transparency (manaflow-ai#14991) 966b355 Stop interrupting focused work: sidebar jumps, Computer Use focus steal, quit dialog on logout (manaflow-ai#14961) e1f1cb2 Strip control characters from feedback attachment filenames (manaflow-ai#14783) 0758c9f test: find the onboarding window the test presented, not a leftover (manaflow-ai#15015) b35c540 fix(spm): resolve GhosttyKit/GhosttyRuntimeTestStubs target name collisions (manaflow-ai#10569) ef33bed Map .purs artifacts to the Haskell highlight.js grammar (manaflow-ai#14202) e2a167a Highlight Elixir and Erlang files in the file editor (manaflow-ai#13732) 972c449 fix: wrap Linux browser download card label (manaflow-ai#11157) f563884 Add Aside to browser data import detection (manaflow-ai#13379) 091d0ea Add cmux send --paste and hint at it for large multi-line sends (manaflow-ai#14937) 3ffcdbb test(ios): keep folder-tap stat tests off the real 2 s deadline (manaflow-ai#15017) 68d3936 test: keep CmuxTerminal pasteboard tests off the cooperative pool (manaflow-ai#15006)
singlePaneToSplitKeepsSelectAndInputTargetsAlignedForNewPane checks that selecting the window container activates the tmux-active inner pane. That activation goes through GhosttySurfaceScrollView.setActive, which only takes effect while Workspace.portalRenderingEnabled(for:) holds for the mirror workspace. The mirror joins the window unselected, so the mount reconcile turns its rendering off, and selectWorkspace only turns it back on when SwiftUI delivers the selection change, which this synchronous test never yields for. The test passed because the projected-pane notification it sends moved the workspace to the top of the sidebar. That tabs publish ran the mount reconcile synchronously with the new selection. Since #14961 a notification for the focused pane no longer reorders the sidebar, so the reconcile never ran and both activation checks failed whenever the test app was frontmost. Enable portal rendering for the selected mirror explicitly after selecting it, as RemoteTmuxProjectedFocusInteractionTests already does. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Three places where cmux interrupted work the user was focused on.
Focused-pane notifications no longer move the workspace. A notification for the pane you're already looking at turned off the banner, sound, and pane flash but still reordered the sidebar, so the workspace you were typing in jumped.
TerminalNotificationDeliveryDecisionnow turns offreorderWorkspacein its focused-pane case, andTerminalNotificationStore.applyNotificationapplies the same rule (keepingFocusedWorkspaceInPlace(isFocusedPane:)) once it knows the target pane is focused. History, unread state, and the automation hook still run. Notifications for other panes, tabs, or with cmux in the background still reorder as before.An agent's Computer Use tool call no longer steals focus. The first functional
cmux-cuatool call opens Computer Use setup, and it did so withNSApp.activate(ignoringOtherApps:),makeKeyAndOrderFront, andorderFrontRegardless, pulling cmux over whatever app you were typing in.ComputerUseOnboardingCoordinatornow passes who asked. From Settings, the window still activates cmux and takes focus. From a tool invocation: if cmux is active, the window is ordered front without becoming key; otherwise it stays behind the active app, the Dock icon bounces once, and the window comes forward when you switch to cmux.The tool path still turns on
computerUse.enabledwithout checking theisComputerUseUXEnabledPostHog flag. That's intended: the flag gates the menu bar and automatic target following, andexplicitToolRequestEnablesComputerUseEvenWhenMenuFeatureIsOffpins the opt-in-on-first-explicit-request behavior from the onboarding work. The policy kill switch (computerUseDisabledByPolicy) is still checked first. So this PR leaves it alone.Quit confirmation no longer blocks logout, restart, or shutdown.
applicationShouldTerminateshowed the quit dialog for every quit, so with confirmation on, a logout or restart stalled until the user answered it. It now readskAEQuitReasonfrom the current quit Apple Event and skips the dialog forkAELogOut,kAEReallyLogOut,kAEShowRestartDialog,kAERestart,kAEShowShutdownDialog, andkAEShutDown, going straight to the existing confirmed-termination path (session snapshot, cleanup). The decision lives inCmuxSettingsasQuitRequestReasonplus aquitReasonparameter onQuitConfirmationStore.shouldShowConfirmation. Cmd+Q, the menu, and the Dock behave as before.Verification
swift test --package-path Packages/macOS/CmuxSettings --filter QuitConfirmationPolicyTests: 8 tests passed on 181c74b. With thequitReasonguard removed,sessionEndNeverWarnsfailed both cases, so the test detects the bug.cmuxTests/TerminalNotificationDeliveryDecisionTests.swift. Commit 98a176a adds it alone and it should fail there onreorderWorkspace; 5c5cacc is the fix.ComputerUseOnboardingIntentTests.toolInvocationPresentsWithoutTakingFocus: tool requests reach the presenter as.toolInvocationand Settings as.userAction, and the activation plan for each origin and app-active state.xcrun swiftc -parseon every changed Swift file.Changelog
Fixed: A notification for the pane you're looking at no longer moves its workspace in the sidebar, an agent's first Computer Use tool call no longer pulls cmux over the app you're typing in, and the quit confirmation no longer blocks logout, restart, or shutdown
🤖 Generated with Claude Code
Summary by cubic
Fixes three ways cmux interrupted focused work: notifications for the pane you're already looking at no longer move its workspace in the sidebar, the first Computer Use tool call no longer steals focus from the active app, and the quit confirmation no longer blocks logout, restart, or shutdown.
Focused-pane notifications
App-level focus and quit fixes
cmux-cuatool call opens Computer Use setup without activating cmux: if cmux is active the window orders front without key focus, otherwise it stays behind the active app and bounces the Dock icon once; Settings still activates and focuses the window.kAEQuitReason, going straight to the confirmed-termination path; Cmd+Q, the menu, and the Dock behave as before.QuitConfirmationPolicyTests(including the failing-without-fixsessionEndNeverWarnscase) and app-host tests for the delivery decision and activation plan; live window ordering and a real logout are not yet verified.Written for commit f587aa1. Summary will update on new commits.
Summary by CodeRabbit