Repository navigation
Fix Cloud focus convergence on middle-click - #16513
teamleaderleo wants to merge 4 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Yours to fix: compile error in CI failed on
Failures:
Matched log linesNot re-run automatically: Written by |
Dogfood tours of
|
|
Fixed the CI compile error in 73ba38a: AppKit exposes |
|
Follow-up in 5ad497b: the synthetic middle-click now uses a CGEvent bridged to NSEvent and explicitly sets the button-number field to 2, so the test exercises GhosttyNSView.otherMouseDown instead of relying on the generic AppKit constructor. |
|
Updated the PR description to the repository template, including the concrete behavior, testing evidence, changelog, demo note, and checklist. |
95a3a8b to
f21b6e2
Compare
|
Rebased onto current main at f21b6e2; scoped diff check is clean. Parked while hosted CI reruns for exact-head attribution. |
This comment has been minimized.
This comment has been minimized.
|
|
There was a problem hiding this comment.
🔇 Additional comments (3)
cmuxTests/SurfacePaneFactoryFocusTests.swift (2)
152-163: LGTM!
880-891: LGTM!Sources/GhosttyTerminalView.swift-9534-9541 (1)
9534-9541: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Extract the shared pointer-down activation to one action path.
focusFromPointerDown()has the same two calls:activateContainerFocusFromPointerDown()andclearReparentFocusSuppressionForPointerFocus().otherMouseDownnow repeats them inline. The two paths can drift apart.otherMouseDowncould reuse the shared helper, butfocusFromPointerDown()also callsmakeFirstResponder. Extract only the activation part into one private method. Call that method from bothfocusFromPointerDown()andotherMouseDown.As per coding guidelines: "The same behavior wired separately through multiple surfaces instead of one shared action path."
Proposed refactor
+ private func activatePaneFocusFromPointerDown() { + guard let terminalSurface else { return } + activateContainerFocusFromPointerDown() + terminalSurface.hostedView.clearReparentFocusSuppressionForPointerFocus() + } + func focusFromPointerDown() { - if let terminalSurface { - activateContainerFocusFromPointerDown() - terminalSurface.hostedView.clearReparentFocusSuppressionForPointerFocus() - } + activatePaneFocusFromPointerDown()- if let terminalSurface { - activateContainerFocusFromPointerDown() - terminalSurface.hostedView.clearReparentFocusSuppressionForPointerFocus() - } + activatePaneFocusFromPointerDown()Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
5cd97c62-e867-428c-b14e-5c80f4893da2
📒 Files selected for processing (2)
Sources/GhosttyTerminalView.swiftcmuxTests/SurfacePaneFactoryFocusTests.swift
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
|
Closing in the 10-13 stale sweep: parked stale/conflicting work has no approved classic merge path. Reopen if still wanted. |
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. |
This comment has been minimized.
This comment has been minimized.
|
Found 2 test failures on Blacksmith runners: Failures
|
Summary
A Cloud manual-mirror pane beside a local pane could receive a middle-click while Bonsplit still reported the local pane as focused. The visible focus ring and keyboard ownership then stayed on the local pane. Middle-click now activates the containing workspace pane before the portal callback runs, clears stale reparent-focus suppression, and forwards the event to the clicked terminal. A mixed local and Cloud regression covers the focus handoff.
Testing
swiftc -parse Sources/GhosttyNSView+PointerFocusActivation.swift Sources/GhosttyTerminalView.swift cmuxTests/SurfacePaneFactoryFocusTests.swiftpython3 scripts/verify-local.py --affected mf/main(3/3)git diff --checkThe synthetic regression uses a CGEvent bridged to NSEvent with the middle-button field set, so it exercises
otherMouseDown. Native app compilation and live dogfood were not run on the MacBook Air.Changelog
Fixed: Middle-clicking a Cloud terminal beside a local pane moves the focus ring and keyboard ownership to the clicked pane.
Demo Video
Checklist
Summary by CodeRabbit