Skip to content

fix: accept image drops on the empty state, not only a loaded canvas - #49

Merged
tk3fftk merged 1 commit into
tk3fftk:mainfrom
2b3pro:up/1-drop
Sep 6, 2026
Merged

tk3fftk merged 1 commit into
tk3fftk:mainfrom
2b3pro:up/1-drop

Conversation

@tk3fftk

@tk3fftk tk3fftk commented Sep 6, 2026

Copy link
Copy Markdown
Owner

The drop handler lived on CanvasNSView, which is only created once a document exists. The empty state that says "drop an image" therefore had no drop registration and Finder drops did nothing.

Move drop handling to the SwiftUI canvas pane via dropDestination(for:) with a DroppedImage Transferable that accepts either a file URL (Finder) or image bytes (browser/app drags), so both states share one path. The AppKit performDragOperation is removed rather than duplicated.

)

The drop handler lived on CanvasNSView, which is only created once a
document exists. The empty state that says "drop an image" therefore
had no drop registration and Finder drops did nothing.

Move drop handling to the SwiftUI canvas pane via dropDestination(for:)
with a DroppedImage Transferable that accepts either a file URL (Finder)
or image bytes (browser/app drags), so both states share one path. The
AppKit performDragOperation is removed rather than duplicated.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
@tk3fftk
tk3fftk marked this pull request as ready for review September 6, 2026 06:12
@tk3fftk
tk3fftk merged commit 09b6269 into tk3fftk:main Sep 6, 2026
2 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.

2 participants