Skip to content

Forward tab drag threshold events - #207

Merged
austinywang merged 2 commits into
mainfrom
issue-9521-sticky-drag-latches
Aug 8, 2026
Merged

austinywang merged 2 commits into
mainfrom
issue-9521-sticky-drag-latches

Conversation

@austinywang

@austinywang austinywang commented Aug 8, 2026 •

Copy link
Copy Markdown

Summary

  • keep AppKit as the native tab-drag lifecycle owner
  • forward the threshold-crossing mouse-drag event after starting the native session
  • let SwiftUI cancel the pending tab tap/press before AppKit owns terminal mouse-up

Regression coverage

Commit 6c436f2 adds a focused test that fails against the previous behavior because the threshold event is swallowed. Commit c39140f forwards the event and makes the test pass.

Related to manaflow-ai/cmux#9521 and manaflow-ai/cmux#9787.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Forward the threshold-crossing mouse-drag to SwiftUI when starting the native AppKit tab-drag session so SwiftUI cancels the pending tab tap/press. Prevents swallowed events and sticky drag latches; aligns with manaflow-ai/cmux#9521 and manaflow-ai/cmux#9787.

  • Bug Fixes
    • Start AppKit tab-drag on threshold and forward that same event instead of consuming it, letting SwiftUI fail the press before mouse-up.
    • Added TabBarDragEventRoutingTests to cover the regression.

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

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved tab dragging so pending tab presses are correctly canceled when a drag begins.
    • Ensured the initial drag event is forwarded reliably, allowing native dragging to start smoothly.
  • Tests
    • Added coverage for tab drag event routing and drag initiation.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ff5e5c49-aabc-4d96-a5e6-3cf748e61e4d

📥 Commits

Reviewing files that changed from the base of the PR and between cfe006e and c39140f.

📒 Files selected for processing (2)
  • Sources/Bonsplit/Internal/Views/TabBarView.swift
  • Tests/BonsplitTests/TabBarDragEventRoutingTests.swift

📝 Walkthrough

Walkthrough

Tab drag handling now forwards the threshold-crossing drag event after native drag startup. The tab drag view and handler are internal. New AppKit tests verify event forwarding and drag initiation.

Changes

Tab drag event routing

Layer / File(s) Summary
Forward threshold-crossing drag events
Sources/Bonsplit/Internal/Views/TabBarView.swift
TabBarDragAndHoverView and handleTabDragEvent are internal. The handler returns the original drag event after invoking onBeginTabDrag.
Validate tab drag routing
Tests/BonsplitTests/TabBarDragEventRoutingTests.swift
The test suite builds an AppKit tab-bar hierarchy, simulates mouse events, and verifies event forwarding and drag initiation for the registered tab.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: lawrencecchen, azooz2003-bit

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: forwarding tab drag threshold events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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-9521-sticky-drag-latches

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.

@austinywang
austinywang merged commit ea4d4f3 into main Aug 8, 2026
6 checks passed
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