Repository navigation
Fix sidebar workspace reorder by drag (regressed in #18837) - #20015
Merged
Merged
Conversation
Fails on main: since #18837 the row drag also carries the Bonsplit pane-merge type, so AppKit routes it to the frontmost Bonsplit overlay, which rejects it, and the reorder view beneath never sees the drag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#18837 exported the Bonsplit pane-merge capability on every sidebar row drag. AppKit routes a drag to the frontmost view registered for one of its types, regardless of hitTest, so the full-size Bonsplit tab overlay above the reorder view took every row drag and rejected it. The overlay now hands sidebar reorder drags to the reorder view beneath it; dropping a row on a pane still merges its tabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
|
Merge receipt for
Labeled |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (3)
✨ Finishing Touches
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 |
Contributor
Author
|
Correctness review (subagent), posted after merge:
|
austinywang
added a commit
that referenced
this pull request
Oct 12, 2026
* test: a sidebar row drag ending over the Bonsplit overlay does not raise Fails on main: #20015 forwards draggingEnded: to the reorder view, which does not implement it, so AppKit raises an unrecognized selector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix a crash when a sidebar workspace drag ends (from #20015) The Bonsplit overlay forwarded draggingEnded: to the reorder view, which does not implement it. Swallow it for reorder drags, as AppKit did before #18837 when the reorder view was the destination, and type the destination as the reorder view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dragging a workspace in the vertical sidebar no longer reordered it. Caused by #18837 (48ba209, "Drop a sidebar workspace onto a pane to merge its tabs").
Cause
#18837 added the Bonsplit tab drag type to every sidebar row drag, so pane drop targets could treat the row as a merge. AppKit sends a drag to the frontmost view that is registered for one of its types and contains the pointer. It does not consult
hitTest(seeCloudSurfaceDropGateView.swift). InSidebarWorkspaceTableContainerView,bonsplitDropViewis a full-size view stacked abovereorderDropViewand registered for that Bonsplit type. After #18837 it received every row drag.BonsplitTabDragPayload.transferreturns nil for a sidebar reorder pasteboard (also #18837), so the overlay rejected the drag, and the reorder view beneath never saw it.The other suspects don't touch this path. #18303 and #18693 change the Cloud tree outline, and #19593 is a Bonsplit submodule bump for tab-bar motion.
Fix
SidebarBonsplitTabWorkspaceDropViewnow forwards dragging callbacks for sidebar reorder drags (pasteboard hasSidebarTabDragPayload's type) to the container'sreorderDropView. Bonsplit tab drags from panes keep their existing handling. Merge-onto-pane from #18837 is unchanged: pane destinations still read the row's merge capability, and inside the sidebar the reorder wins.Tests
SidebarWorkspaceReorderDropOverlayHitTestingTests.workspaceRowDragOverBonsplitOverlayStillReordersbuilds the real container and checks that the Bonsplit overlay is the frontmost registered destination for a row drag carrying both types. It then drives entered, updated, prepare, perform and conclude on that overlay and expects the reorder view's update and drop callbacks to fire. The test was committed before the fix (dc42c54). On that commit the overlay returns[]because the transfer is nil. Neither red nor green was run locally (local xcodebuild tests are not allowed), so hosted CI gives the green result.Changelog
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes dragging a workspace in the sidebar to reorder it, which regressed in #18837.
#18837 made every sidebar row drag carry the Bonsplit pane-merge type, so AppKit routed those drags to the frontmost registered destination—the full-size Bonsplit overlay—which rejected them, and the reorder view beneath never saw them. The Bonsplit overlay now forwards sidebar reorder drags to the reorder view, while dropping a row onto a pane still merges its tabs.
Written for commit 9610feb. Summary will update on new commits.