Repository navigation
Fix tab drag never starting on second-click presses - #217
Conversation
Selecting a tab and immediately dragging it delivers the press with clickCount == 2 (AppKit keeps counting presses near the same point inside the double-click interval), and trackTabMouseDown refused to arm the drag, so the drag silently never started. Regression from the native tab drag rewrite; SwiftUI .onDrag in 0.64.22 armed on any press. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AppKit increments clickCount for any press that lands near the same point inside the double-click interval, so the common click-to-select-then-drag flow arrives as clickCount 2 and the drag was silently never armed. Accept any press; a stationary double-click is unaffected because the native session only begins after the pointer crosses the movement threshold. Fixes manaflow-ai/cmux#10033 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTab dragging now accepts double-click-counted presses, forwards the threshold-crossing event, refreshes the tab frame before drag creation, and filters native interactions by enabled, editable, or actionable controls. Tests cover event forwarding, click counts, static title controls, and buttons. ChangesTab drag routing
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Tab drags silently never started when the press arrived with clickCount >= 2 — the common click-to-select-then-immediately-drag flow. Bonsplit PR: manaflow-ai/bonsplit#217 Fixes manaflow-ai#10033 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Problem
Regression from the native tab drag rewrite (
6bee68f, after cmux 0.64.22): dragging a pane tab sporadically does nothing — no drag image, no session (manaflow-ai/cmux#10033).Root cause:
trackTabMouseDownonly armed a drag whenevent.clickCount == 1. AppKit incrementsclickCountfor any press that lands near the same point inside the double-click interval, so the extremely common flow click a tab to select it, then press again and drag it arrives withclickCount == 2and the drag was silently never armed. Waiting ~500ms before dragging made it work again, which is why it felt sporadic and why clicking first "fixed" it. The 0.64.22 SwiftUI.onDragpath armed on any press.Fix
Accept any clickCount when arming a pending tab drag (control-click still excluded for context menus). A stationary double-click is unaffected: the native session only begins after the pointer crosses the 4pt movement threshold.
Tests
Commit 1 adds
secondClickOfDoubleClickStillArmsTabDrag(fails on main), commit 2 fixes it. Also carries the prior session's static-title-control coverage. Full suite: 22 tests green.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes a regression where dragging a tab after a quick second click wouldn’t start (fixes
cmux#10033). Drags now arm on any click count and control hit-testing is tuned so labels don’t block drags while actionable controls keep ownership.Written for commit 7679865. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests