Skip to content

feat(pdf): drop PDFs from the file manager into the page editor - #1641

Merged
KnifeLemon merged 1 commit into
mainfrom
feat/pdf-editor-drop-1596
Nov 17, 2026
Merged

KnifeLemon merged 1 commit into
mainfrom
feat/pdf-editor-drop-1596

Conversation

@KnifeLemon

Copy link
Copy Markdown
Owner

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.

PDF page editor with a PDF dragged over the strip: the accent line under page 2 shows where its pages will go

Headless render: a PDF dragged over the bottom half of page 2; the line marks the drop position.

What changed

  • Drop line while dragging files: the page strip shows the same accent line used when reordering pages (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.
  • Insert at the drop position: PdfPageEditorViewModel.InsertFilesAtAsync(paths, index) puts each dropped PDF's pages in order at that index and selects them. It shares AddFilesCoreAsync with 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.
  • Other files: files that aren't PDFs are left out, and the status line says so (new 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.
  • Hint: pdf_editor.hint gets one more sentence about dropping PDFs. The new and changed strings are in all 23 languages.
  • Keyboard use and accessibility are unchanged. Folders and browser drags (pictures or links from a browser) aren't taken here.
  • 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 warn is clean.

Fixes #1596

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added the feature New features label Nov 17, 2026
@KnifeLemon
KnifeLemon merged commit ca93f7c into main Nov 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Drag and Drop PDF Pages for Easier Document Organization

1 participant