Repository navigation
feat(pdf): drop PDFs from the file manager into the page editor - #1641
Merged
Merged
Conversation
PDFs dragged from Explorer, Finder or a Linux file manager onto the page strip of the PDF page editor show the same drop line as reordering pages and are inserted there, each PDF's pages in order, then selected. InsertFilesAtAsync goes through the same path as Insert PDF, so a PDF that can't be opened gives the usual error and adds nothing. Files that aren't PDFs are left out with a status line; a drag without a PDF isn't taken. The strip scrolls near its edges while files are dragged over it. New string pdf_editor.drop_left_out and one more sentence in pdf_editor.hint, in all 23 languages. Fixes #1596 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
In the PDF page editor (Edit → Pages on the PDF donut), PDFs dragged in from Explorer, Finder or a Linux file manager can now be dropped between two pages to insert their pages there.
Headless render: a PDF dragged over the bottom half of page 2; the line marks the drop position.
What changed
DropIndex/DropLine), and scrolls near its top and bottom edges. The drag effect is always Copy, never Move, so the file manager keeps the files.PdfPageEditorViewModel.InsertFilesAtAsync(paths, index)puts each dropped PDF's pages in order at that index and selects them. It sharesAddFilesCoreAsyncwith Insert PDF, so a PDF that can't be opened gives the same error and adds nothing. The editor has no undo, so there's nothing to hook into there.pdf_editor.drop_left_out). A drop with nothing but other files shows the usual "This file type isn't supported". A drag with no PDF in it isn't taken at all: no line, and a no-drop cursor.pdf_editor.hintgets one more sentence about dropping PDFs. The new and changed strings are in all 23 languages.docs/ARCHITECTURE.md: the page editor section mentions the drop. CHANGELOG gets its entry when the next release section is written.Tests
Dropped_pdfs_are_inserted_at_the_drop_position_and_other_files_left_out(view model): drops in the middle, at the start and past the end; a mix with a picture; only a picture; a broken.pdf.Pdfs_dragged_from_the_file_manager_show_the_drop_line_and_land_there(headless window): raises DragEnter/DragOver/DragLeave/Drop on the strip and checks that a picture-only drag is refused, where the line sits, that moving from page to page inside the strip keeps the line, that the line is gone after leaving, and the resulting page order.dotnet format --verify-no-changes --severity warnis clean.Fixes #1596
🤖 Generated with Claude Code