Repository navigation
Open files dropped on the window; ask tab vs. layer for images - #47
Merged
Merged
Conversation
Dropping a file from the OS now opens it in a new tab through the existing load_file path. A single flat image dropped while a document is open asks whether to open a tab or place the image as a new raster layer (centered, named after the file, undoable as "Place Image"). Layered formats, multi-file drops, and drops with no open document skip the question and open tabs directly. gpui turns an OS drag into synthetic left-button mouse moves, so the canvas mouse-move handler now stands down while a drag is active. Co-Authored-By: Claude Fable 5 <[email protected]>
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 file from the OS into the schist window now opens it. Behavior by drop:
Implementation notes:
.on_drop::<ExternalPaths>; decode + composite run on the background executor likeload_file.Modal::DropImagedialog modeled on the close-tab confirm.on_mouse_movenow returns early while a drag is active to keep those out of the active tool.Tested end-to-end under Xvfb with a scratch XDND drag-source client performing real protocol-level drops against gpui's X11 backend: dialog appearance, both dialog buttons, a two-file drop (two tabs, no dialog), and an
.afphotodrop (tab with intact layer stack) all verified by screenshot.cargo fmt --check,clippy -D warnings, and the app-crate tests pass.🤖 Generated with Claude Code