Skip to content

cmux-next: debug.mouse middle clicks keep their window-local point - #17624

Merged
teamleaderleo merged 2 commits into
feat-cmux-nextfrom
feat-cmux-next-debug-mouse-point
Oct 6, 2026
Merged

teamleaderleo merged 2 commits into
feat-cmux-nextfrom
feat-cmux-next-debug-mouse-point

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix forward for two cmux-next swift test failures on feat-cmux-next. Both came in with 76c37a6 (debug.mouse middle button):

  • DebugMouseButtonTests.middleButtonEventsKeepTheWindowLocalPoint: locationInWindow is (20, -700), expected (20, 180).
  • WorkspaceRowMiddleClickTests.middleButtonEventsAtTheRowCloseTheWorkspace: wrong point, so the row never sees the click and nothing closes.

Cause: debug.mouse makes a middle-button event by copying an NSEvent through CGEvent to set buttonNumber 2. AppKit maps the copy back through the window server's frame for the window. The tests use windows that are never shown, and for those the server's frame differs from the window's own. The offset is the screen height minus the window height: 880 for the 200-point test window, 480 for the row harness. Setting the copy's global point alone did not help (first CI run on this PR).

Fix: DebugMouse.keepingWindowPoint builds the copy once and measures the window-local point AppKit got. It moves the global point by the difference and builds it again, so the event lands at the intended point whatever frame the server holds. The row test lives in the Sidebar package, which can't reach DebugMouse, so it does the same inline.

QuitSessionsTests is a separate base red, fixed by #17605.

Testing

Changelog

none

🤖 Generated with Claude Code

76c37a6 makes a middle-button event by copying an NSEvent through
CGEvent to set buttonNumber 2. The copy kept no global point AppKit
could map back, so on the CI Mac its locationInWindow came out (20, -700)
instead of (20, 180), and DebugMouseButtonTests and
WorkspaceRowMiddleClickTests fail on feat-cmux-next. The copy is now
addressed like debug.mouse's scroll events (global point from the
primary screen's top-left, and the window under it), in one shared
helper; the row test builds its event the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9e2cfd6d-d724-4e1d-b05c-6cd1416bc807

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Not verified: macOS jobs did not run: compile and app tests were skipped on 6cc3514940; ci-status is green without them.

CI passes on 6cc3514940 (run 37516996810 attempt 1).
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped (the macos job needs both to succeed). Re-run CI once they pass, before merging.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way.

…pped wrong

Setting the copy's global point changed nothing on CI: AppKit maps a
CGEvent through the window server's frame for the window, and for the
tests' unshown windows that frame differs from the window's own by the
screen height minus the window's (880 and 480). debug.mouse now builds
the copy, measures the window-local point AppKit got, moves the global
point by the difference and builds it again; the row test does the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo merged commit b1720d4 into feat-cmux-next Oct 6, 2026
53 checks passed
@teamleaderleo
teamleaderleo deleted the feat-cmux-next-debug-mouse-point branch October 6, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant