Repository navigation
Fix a crash when a sidebar workspace drag ends (from #20015) - #20018
Conversation
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>
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>
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The overlay safely completes sidebar reorder drags without forwarding an unsupported callback, and the inspected drop path remains intact. No actionable merge risk is supported. Pre-merge checks ·
|
|
Correctness review (subagent): this addresses the one critical finding on #20015 (the forwarded |
|
Merge receipt for
Labeled |
Follow-up to #20015. That fix made sidebar workspace reorder work again, but it crashes when the drag ends over the sidebar.
Cause
In #20015,
SidebarBonsplitTabWorkspaceDropViewforwardsdraggingEnded(_:)toSidebarWorkspaceReorderDropView. That view doesn't override the method, andNSViewdoesn't implementdraggingEnded:at runtime:NSView.instancesRespond(to: "draggingEnded:")is false. Swift still compiles the call because the optionalNSDraggingDestinationrequirement is imported ontoNSView, so at runtime it throwsNSInvalidArgumentException: unrecognized selector. AppKit sendsdraggingEnded:to the last destination that responds to it, and the Bonsplit overlay does, so ending a row drag over the sidebar hits this path. A correctness review subagent found it after #20015 merged.Fix
draggingEndedinstead of forwarding it. That matches how things worked before Drop a sidebar workspace onto a pane to merge its tabs #18837, when AppKit skipped the reorder view for this call.reorderDestinationis now typed asSidebarWorkspaceReorderDropView.Tests
workspaceRowDragOverBonsplitOverlayStillReordersnow also callsbonsplit.draggingEnded(sender). The test commit comes before the fix. On that commit the call throws. Neither result was run locally, because local xcodebuild tests aren't allowed here. Hosted CI provides the green result.Changelog
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes a crash when ending a workspace row drag over the sidebar. The Bonsplit overlay forwarded
draggingEnded:to the reorder drop view, which doesn't implement it, so AppKit raised an unrecognized selector exception. The overlay now swallows the call for sidebar reorder drags, andreorderDestinationis typed asSidebarWorkspaceReorderDropView.Written for commit 3e3237d. Summary will update on new commits.
Summary by CodeRabbit