Skip to content

Fix minimal mode workspace tab clicks on Intel#2650

Open
austinywang wants to merge 2 commits intomainfrom
issue-2633-minimal-mode-tab-switching
Open

Fix minimal mode workspace tab clicks on Intel#2650
austinywang wants to merge 2 commits intomainfrom
issue-2633-minimal-mode-tab-switching

Conversation

@austinywang
Copy link
Copy Markdown
Contributor

@austinywang austinywang commented Apr 6, 2026

Summary

  • keep the main window root hosting view non-draggable in minimal mode
  • route workspace tab interactions in the titlebar band to SwiftUI instead of AppKit window-drag handling
  • preserve window dragging through the existing explicit drag-handle path

Fixes #2633

Root Cause

MainWindowHostingView inherits AppKit's default mouseDownCanMoveWindow behavior. In minimal mode, the workspace tab strip sits in the titlebar band, so AppKit can treat those hits as window-drag candidates before SwiftUI receives them. On the reported Intel setup, that leaves the top workspace tabs without hover, click, or right-click interaction. The window already uses explicit drag handles for draggable titlebar space, so marking the root hosting view as non-draggable is the minimal fix.


Summary by cubic

Restore workspace and pane tab clicks in minimal mode on Intel by marking MainWindowHostingView as non-draggable so titlebar events reach SwiftUI instead of AppKit drag handling, while window dragging still works via the existing drag handles (fixes #2633).

Written for commit ee88d7c. Summary will update on new commits.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where mouse clicks on interactive UI elements (workspace/pane tabs) were being incorrectly interpreted as window-drag gestures. Interactive controls now respond properly to user input.

Note

Low Risk
Low risk: a small AppKit override that only changes mouse-down window-drag behavior on the root hosting view, which could slightly affect drag affordances but avoids data/security impact.

Overview
Fixes minimal-mode workspace/pane tab interactions by overriding MainWindowHostingView.mouseDownCanMoveWindow to false, ensuring clicks in the titlebar band are delivered to SwiftUI instead of being captured as window-drag gestures.

Reviewed by Cursor Bugbot for commit ee88d7c. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Apr 7, 2026 4:30am

@cubic-dev-ai
Copy link
Copy Markdown

cubic-dev-ai bot commented Apr 6, 2026

This review could not be run because your cubic account has exceeded the monthly review limit. If you need help restoring access, please contact contact@cubic.dev.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

📝 Walkthrough

Walkthrough

A simple override in MainWindowHostingView sets mouseDownCanMoveWindow to false, preventing the window frame from capturing mouse-down events and allowing interactive SwiftUI UI elements like tabs to receive click events properly.

Changes

Cohort / File(s) Summary
Window Mouse Handling
Sources/AppDelegate.swift
Override mouseDownCanMoveWindow to return false in MainWindowHostingView, preventing window-drag behavior from intercepting mouse events intended for interactive UI controls like tabs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰✨ A rabbit hops with glee,
Tab-switching works, as it should be!
No more window steals the click,
SwiftUI chrome now gets the trick.
Minimal Mode, you're fixed, hooray—
Tabs respond to us today! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is comprehensive and covers the what and why, with root cause analysis and linked issue reference, but is missing required template sections including testing details, demo video, review trigger, and completion checklist. Add the Testing section documenting how the change was tested, include a demo video for the UI behavior fix, copy the Review Trigger block as a comment, and complete the Checklist section with all required items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing workspace tab clicks in minimal mode on Intel hardware, which directly addresses the primary issue.
Linked Issues check ✅ Passed The code change directly addresses the linked issue #2633 by marking MainWindowHostingView as non-draggable, enabling workspace tab interactions in minimal mode on Intel macs.
Out of Scope Changes check ✅ Passed The change is minimal and scoped: only 3 lines added to override mouseDownCanMoveWindow in MainWindowHostingView, directly addressing the root cause without introducing unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-2633-minimal-mode-tab-switching

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 and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 6, 2026

Greptile Summary

This PR fixes workspace tab interactions in minimal mode on Intel by overriding mouseDownCanMoveWindow to false on MainWindowHostingView. On Intel, AppKit's default behavior could intercept mouse-down events in the titlebar band as window-drag candidates before SwiftUI received them; since dragging is already handled exclusively through WindowDragHandleView's explicit drag path, this one-line change is safe and consistent with the established mouseDownCanMoveWindow = false pattern used throughout the codebase (NonDraggableHostingView, TitlebarLeadingInsetPassthroughView, DraggableFolderNSView, etc.).

Confidence Score: 5/5

Safe to merge — minimal one-line fix consistent with established codebase patterns; existing drag infrastructure is unaffected

The change is a single property override matching the existing pattern in NonDraggableHostingView, TitlebarLeadingInsetPassthroughView, DraggableFolderNSView, and others. Window dragging is already handled exclusively through WindowDragHandleView with explicit performDrag calls, and the window is created with isMovable = false and isMovableByWindowBackground = false. No P1 or P0 findings.

No files require special attention

Important Files Changed

Filename Overview
Sources/AppDelegate.swift Adds mouseDownCanMoveWindow = false to MainWindowHostingView, preventing AppKit from intercepting titlebar-band mouse-down events as window-drag candidates before SwiftUI receives them

Sequence Diagram

sequenceDiagram
    participant U as User (Intel)
    participant AK as AppKit
    participant MWHV as MainWindowHostingView
    participant DV as DraggableView (WindowDragHandle)
    participant SUI as SwiftUI WorkspaceTab

    Note over MWHV: mouseDownCanMoveWindow = false (new)
    U->>AK: leftMouseDown on titlebar band
    AK->>MWHV: mouseDownCanMoveWindow?
    MWHV-->>AK: false — skip window drag
    AK->>SUI: event propagates to SwiftUI
    SUI-->>U: tab hover/click/right-click works

    Note over DV: Explicit drag path (unchanged)
    U->>AK: leftMouseDown on empty titlebar
    AK->>DV: hitTest → captures hit
    DV->>AK: window.performDrag(with: event)
    AK-->>U: window drag works
Loading

Reviews (1): Last reviewed commit: "Fix minimal mode workspace tab clicks" | Re-trigger Greptile

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.

Minimal Mode breaks Switching Tabs

1 participant