Repository navigation
Conversation
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: FIX-IMAGES, image import is improved and pasting a cut picture is restored. Two ROADMAP rows: cut and copy of pictures now publish a nonempty clipboard marker through commands as well as keyboard events (and pasting that marker is fixed), and the desktop picture picker allows multiple selection, remembers the last picture folder in preferences and defaults to the active one. That is two or three fixes in one PR (clipboard, picker, folder memory), and the remembered folder is a path stored in preferences (user data that the privacy documentation should list). Pictures from the picker are untrusted: sizes and decoders are bounded in the importer I did not read. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
aiongg
left a comment
There was a problem hiding this comment.
AI-generated review (Opus). Not a maintainer decision.
No blocking problems found (not certain).
Insert Picture can now select several files and starts in the last-used picture folder or the presentation's folder. Pasting the internal object marker now restores the session's objects directly, and menu Copy/Cut publish the same nonempty marker as the keyboard shortcuts.
- crates/ui-egui/src/lib.rs:1756: when the paste text is the object marker, it goes straight to the internal clipboard, so a stale image format offered next to the marker no longer replaces the cut picture.
- crates/ui-egui/src/lib.rs:675: menu and ribbon Copy/Cut now use system_clipboard_text, the same as publish_clipboard at lib.rs:1824, so Ctrl+V is delivered for textless shapes copied from the menu.
- crates/ui-egui/src/lib.rs:1265: only insert.picture asks for multiple selection; Change Picture and SmartArt pictures stay single-select.
- crates/ui-egui/src/lib.rs:1258-1263: a remembered folder that no longer exists is skipped and the presentation's folder is used instead; relative document paths are resolved against the working directory.
- The other picture pickers still open with no starting folder and no multiple selection: crates/ui-egui/src/panes.rs:644, panes.rs:837, panes.rs:897 and the Photo Album picker at crates/ui-egui/src/dialogs.rs:220. Photo Album in particular would benefit from multiple selection.
- apps/deckcraft/src/main.rs:115 repeats the picture extension list from main.rs:99; a shared constant would keep them in sync.
- The picker change and the clipboard fix are independent; separate pull requests would be easier to review and revert.
Claims checked:
- verified: The desktop picture picker allows selecting multiple images for picture import (apps/deckcraft/src/main.rs:117 calls pick_files when multiple is set; crates/ui-egui/src/lib.rs:1265 passes multiple for insert.picture and lib.rs:1269 runs the command once per returned path)
- verified: The last selected picture folder is remembered and persisted with preferences (crates/ui-egui/src/lib.rs:1271 stores the parent of each picked path in UiState.picture_directory (lib.rs:267); UiState is serde(default) (lib.rs:243), so older settings still load)
- verified: With no valid remembered folder, the picker starts in the active presentation's directory (crates/ui-egui/src/lib.rs:1258-1263 filters the remembered folder with is_dir and otherwise uses the parent of the active document path, made absolute against current_dir)
- verified: Change Picture remains single-select (crates/ui-egui/src/lib.rs:1023 routes Change Picture to picture.change, and lib.rs:1265 sets multiple only when cmd == "insert.picture")
- verified: Pasting the object marker restores internal objects and original media without querying other system clipboard formats (crates/ui-egui/src/lib.rs:1756-1761 runs edit.paste with no text and skips clipboard_html and clipboard_image; crates/engine/src/cmd/edit.rs:348-358 pastes the clipboard shapes wi…
- verified: Copy/Cut commands publish the same nonempty marker as keyboard events (crates/ui-egui/src/lib.rs:675 sets pending_copy to system_clipboard_text(t), the same helper publish_clipboard uses at lib.rs:1824; lib.rs:327-328 maps empty text to OBJECTS_MARKER)
Recommendation: merge, after a maintainer's decision.
Reviewed at 81f4bb9.
|
Automated message. Not a maintainer decision. This branch conflicts with main. Could you merge or rebase main into it? The conflict needs a person to resolve. |
Image import previously selected only one file and reopened without a useful starting folder. The desktop picture picker now allows multiple images, persists the last selected folder, and falls back to the active presentation's directory when there is no valid remembered folder. Change Picture remains single-select.
Cut pictures could fail to paste when system clipboard formats took precedence over DeckCraft's object marker. Marker pastes now restore the internal objects and original media directly. Copy/cut commands also publish the same nonempty marker as keyboard events so Ctrl+V is delivered for objects without text.
Validation:
cargo xtask wasmpassed for all 23 checked crates.cargo xtask cipasses formatting and PDF dependency checks, then stops on the existingclippy::manual_range_containswarning incrates/model/src/trendline.rs:468. Full CI is not green; that unrelated file is unchanged.Summary by CodeRabbit
New Features
Documentation