mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-24 10:08:00 -06:00
* M4: Ctrl-drag copies pages in the Organize grid (#2997) Dragging thumbnails in the Organize page grid with Ctrl held (Option on macOS) drops copies at the gap instead of moving the pages: a "+" badge by the pointer, the copies land at the gap selected, and one undo step takes them out. The insertion point joins the engine edit (Edit::DuplicatePages { at }) so the copy is one undo step rather than a duplicate plus a move. page_duplicate takes a 1-based "at" (the first copy becomes page "at"), so agents can drive the same thing, and the UI control channel's ui.drag modifiers now reach the input state -- which gestures that read it (this copy-drag, and Alt-drag column select) need. Closes #2997. * fix(ui): take the grid's copy modifier from the runtime OS (#3092 review) Option-drag in the Organize grid moved the pages instead of copying them in a Mac browser: `cfg!(target_os = "macos")` is false in the wasm build, and eframe sets the context's OS from the browser. `copy_modifier` now takes the context and asks `commands::mac_shortcuts`, as the shortcut labels do. The drag helpers in `tests/editing.rs` and `tests/control.rs` picked the modifier the same compile-time way, so they would have sent Ctrl on a Mac host; both read the context's OS now. The new regression test `option_copies_and_ctrl_moves_when_the_context_reports_macos` drives a Mac context — Ctrl moves, Option copies — and fails without this change.