Skip to content

Make ThemedSplitView non-draggable for minimal mode#92

Merged
austinywang merged 1 commit intomainfrom
fix-themed-split-mouse-down-can-move-window
Apr 7, 2026
Merged

Make ThemedSplitView non-draggable for minimal mode#92
austinywang merged 1 commit intomainfrom
fix-themed-split-mouse-down-can-move-window

Conversation

@austinywang
Copy link
Copy Markdown

@austinywang austinywang commented Apr 7, 2026

Summary

NSSplitView's default mouseDownCanMoveWindow can promote back to true even with isOpaque=false when nested in a non-titlebar window. In presentationMode "minimal" (no titlebar drag region), AppKit was treating mouseDowns inside the LEFT pane of a horizontal split as window drag intents and consuming the mouseUp before SwiftUI's tap gesture could fire on tab items. Override to false to keep the entire pane hosting chain non-draggable.

Test plan

  • Verify on Intel mac that left pane tab clicks work in minimal mode after switching from right pane

🤖 Generated with Claude Code


Summary by cubic

Prevented accidental window dragging in minimal mode so tab clicks in the left pane register every time. We now force the split view to be non-draggable.

  • Bug Fixes
    • Override mouseDownCanMoveWindow to false in ThemedSplitView.
    • Stops AppKit from treating left-pane clicks as drag intents in minimal presentation mode, fixing missed SwiftUI tap gestures.

Written for commit 0e5c7f9. Summary will update on new commits.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where mouse-down events in split pane areas were interfering with SwiftUI tap gestures on tab items.

NSSplitView's default mouseDownCanMoveWindow can promote back to true
even with isOpaque=false when nested in a non-titlebar window. In
presentationMode "minimal" (no titlebar drag region), AppKit was
treating mouseDowns inside the LEFT pane of a horizontal split as
window drag intents and consuming the mouseUp before SwiftUI's tap
gesture could fire on tab items. Override to false to keep the entire
pane hosting chain non-draggable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@austinywang austinywang merged commit dd12859 into main Apr 7, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ae1fb978-7262-44ca-9fab-aee3bdaf384f

📥 Commits

Reviewing files that changed from the base of the PR and between d65b4a8 and 0e5c7f9.

📒 Files selected for processing (1)
  • Sources/Bonsplit/Internal/Views/SplitContainerView.swift

📝 Walkthrough

Walkthrough

ThemedSplitView now overrides the mouseDownCanMoveWindow property to return false, preventing AppKit from treating mouse-down events in the split view pane area as window-drag intents. This eliminates interference with SwiftUI tap gestures on tab items.

Changes

Cohort / File(s) Summary
AppKit Input Handling Fix
Sources/Bonsplit/Internal/Views/SplitContainerView.swift
Override mouseDownCanMoveWindow property in ThemedSplitView to disable AppKit's automatic window-drag detection on mouse-down events in split pane areas.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A little fix to how the split view plays,
No more window-dragging stealing tab days!
Mouse events now flow true and clean,
The happiest split view ever seen. ✨

✨ 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 fix-themed-split-mouse-down-can-move-window

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

greptile-apps bot commented Apr 7, 2026

Greptile Summary

Adds mouseDownCanMoveWindow = false to ThemedSplitView to fill a gap in the non-draggable view chain that was causing AppKit to consume mouseUp events (as window-drag intents) before SwiftUI tab-item tap gestures could fire in minimal mode. The fix follows the same pattern already applied to SplitArrangedContainerView, PaneDragContainerView, and NonDraggableHostingView / NonDraggableHostingController elsewhere in the codebase.

Confidence Score: 5/5

Safe to merge — minimal, focused fix with no side-effects

A single one-line override following an established pattern already used throughout the codebase. No P0/P1 issues found; the change is correct, well-commented, and completes an existing defensive chain.

No files require special attention

Important Files Changed

Filename Overview
Sources/Bonsplit/Internal/Views/SplitContainerView.swift Adds mouseDownCanMoveWindow=false override to ThemedSplitView, completing the non-draggable view chain for minimal mode

Sequence Diagram

sequenceDiagram
    participant U as User Click
    participant TSV as ThemedSplitView
    participant SACV as SplitArrangedContainerView
    participant NDHV as NonDraggableHostingView
    participant SG as SwiftUI Tap Gesture
    participant AK as AppKit Window Drag

    Note over TSV: BEFORE FIX: mouseDownCanMoveWindow=true (default)
    U->>TSV: mouseDown
    TSV->>AK: promotes to window drag intent
    AK--xSG: consumes mouseUp — tap never fires

    Note over TSV: AFTER FIX: mouseDownCanMoveWindow=false
    U->>TSV: mouseDown (false)
    TSV->>SACV: propagates (false)
    SACV->>NDHV: propagates (false)
    NDHV->>SG: delivers mouseUp
    SG-->>U: tab click fires ✓
Loading

Reviews (1): Last reviewed commit: "Make ThemedSplitView non-draggable for m..." | 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.

1 participant