Repository navigation
fix: accept workspace icon drops on every workspace - #296
Merged
Merged
Conversation
AppKit looks for a drop destination by walking view frames, and SwiftUI hosts each workspace cell in a container whose frame need not contain it. Most cells were out of AppKit's reach, so a drag entered the workspace it started from and no other, and dropping an icon did nothing. The bar window now registers the drag type and forwards each update to the cell under the pointer, found with the same hit-testing that clicks use. Cells no longer register for the type themselves. Closes #280
|
🎉 This PR is included in version 0.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
Dropping a workspace icon on another workspace still does nothing in 0.8.0-beta.20261023121631.363, which includes #283. The drag starts, but the destination isn't outlined, and on release the icon slides back without moving any window. Fixes #280.
Changes
-[NSView _hitTest:dragTypes:]. That lookup walks view frames and never callshitTest(_:). SwiftUI hosts each workspace cell'sNSViewRepresentablein a container view whose frame need not contain the cell, so AppKit couldn't reach most of the registered cells. On a five-workspace bar it reached two cells and part of a third, with or without glass. A drag trace on a scratch bar matched: AppKit entered the workspace where the drag began, exited at its edge and never entered another, and no drop callback ran. SwiftUI's hit-testing, which clicks use, finds every cell, and that's what the tests in fix: move windows when workspace icons are dropped #283 routed through.BarPanelregisters the workspace drag type and forwards each drag update to the cell under the pointer, found withhitTest(_:)as clicks are. The cells keep their accept and move logic but no longer register for the type. Each bar window is its own destination, so drops onto another display's bar still work.Testing
swift teston this branch plus refactor: move a bar tile's hover handling out of its body so Xcode 26.3 compiles it #295, whichmainneeds to compile with Xcode 26.3: 294 XCTest and 449 Swift Testing tests pass. CI builds this branch onmainalone.git diff --checkand commitlint pass.Merging
A merge commit or rebase merge, which keeps the one commit. As a
fix, it makes a patch release.Claude Opus 5.5 via Claude Code