Repository navigation
fix(slides): dragging several selected slides moves them all - #1418
Conversation
Dragging one of several selected slides in the thumbnail pane or the
Slide Sorter moved only the dragged slide. Now the whole selection moves
as one run in deck order, in one undo step, stays selected and joins the
section it lands in; an unselected slide still moves alone.
- slide.move takes `ids` (checked against the deck while parsed, repeats
fold), alongside the unchanged `{from, to}`.
- The slide drag records its slides and the presentation it began in; a
drag in another presentation, or one whose release no view saw (a
Sorter double-click opening Normal view mid-gesture), is dropped
instead of moving slides on a later release.
- Normal-view thumbnails carry a "Slide N" label, like Sorter cells.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Multi-slide move command crates/engine/src/cmd/slide.rs |
slide.move accepts ids, preserves deck order, and moves the slides as one run. The command updates selection and section membership. Tests cover movement, undo/redo, section assignment, and invalid IDs. |
Shared drag lifecycle and UI integration crates/ui-egui/src/thumbs.rs, crates/ui-egui/src/lib.rs, crates/ui-egui/src/sorter.rs, crates/ui-egui/src/sorter_tests.rs, ROADMAP.md, docs/ui-parity.md |
The thumbnail pane and Slide Sorter use shared drag state and helpers. Selected slides move together, while dragging an unselected slide moves only that slide. Tests cover drop behavior and undo; the roadmap and parity documentation record the behavior. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
actor User
participant UI as Thumbnail pane or Slide Sorter
participant Thumbs as thumbs.rs
participant Command as slide.move
participant Deck as Deck state
User->>UI: Drag a thumbnail
UI->>Thumbs: Start and update drag
User->>UI: Release at destination
UI->>Thumbs: Drop slide drag
Thumbs->>Command: Move selected slide IDs to destination
Command->>Deck: Reorder slides and update selection and sections
Suggested reviewers: nikitkara
Merge Risk: 
Minimal · up to 03939
-
No merge-blocking issue was established for grouped slide dragging. The change is ready to merge after normal checks.
Security architecture risk: 
Low · up to 03939
-
Grouped moves remain limited to the active presentation and retain existing undo protections. No increased editing authority was identified. Deployed automation access and request limits remain unverified.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — One request can now reorder every slide in the active presentation and update associated sections and selection. This increases per-command editing scope, but existing command access already permits repeated slide mutations. The inspected change does not add access to another presentation, credentials, services, or infrastructure.
Security Findings and Attack Paths
- inferred — No introduced material attack path was established. Caller-supplied IDs reach document reordering through existing dispatchers, but membership validation precedes mutation. Large lists incur linear input work without a new list-length-times-deck amplification. Deployment exposure and authentication remain unknown, so this conclusion is limited to the inspected source paths.
Trust Boundaries and Controls
- observed — Drag state records the originating presentation UID. Liveness rejects a different active presentation or an ended gesture, and drop independently rechecks the UID and current membership of all dragged IDs. State is taken before validation or submission, preventing the same stored drag from being applied twice.
Resilience and Maintainability Implications
- observed — Session execution requires exclusive mutable access, and the grouped edit uses the existing transactional document replacement and history path. Invalid IDs return before replacement, containing partial-failure effects within the active document. Same-document edits between drag initiation and drop are handled by re-resolving current IDs and positions, not by a revision-token check.
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "fix(slides): dragging several selected slides moves them all" names the main change. The PR makes dragging a selected slide move the whole selection as one group in the thumbnail pane and Slide Sorter, and adds an
idsform toslide.move. The title is specific, uses a conventional commit prefix, and contains no vague terms. It omits the engineidsform and the missed-release handling, which is acceptable because it does not need to cover every detail.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 44.19% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 43 functions across 5 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
🔧 Clippy (1.99.0)
-
Clippy execution timed out
Comment @coderabbitai help to get the list of available commands.
fix(slides): dragging several selected slides moves them all
|
Landed on main, thank you @fchinu for the contribution! If you haven't already, come join us on Discord: https://discord.gg/artcraft |
|
Note on what I changed before landing: merged main in and carried the change onto the split files (panels/thumbs.rs, sorter/ui_tests.rs). |
Summary
Dragging one of several selected slides in the thumbnail pane or the Slide Sorter moved only the slide under the pointer. Now the whole selection moves, as PowerPoint does:
Changes
Engine:
slide.movetakesids(crates/engine/src/cmd/slide.rs){ids: [slide id], to}.tois counted in the deck without the moved slides. The old{from?, to}form is unchanged.reassign_sections. It uses a position map, not aposition()call per slide.UI: the drag carries every dragged slide (
crates/ui-egui/src/thumbs.rs,sorter.rs,lib.rs)thumb_dragis now aSlideDrag { uid, ids, slot }. Both views use the same helpers:start_slide_drag,slide_drag_live,slides_move_destanddrop_slide_drag.uidguard the Sorter's inline rename uses.main): if no view saw a drag's release, the drag stayed live. That happens when a Sorter double-click opens Normal view mid-gesture, and it was reproduced through the control channel. The next unrelated release in the thumbnail pane then moved slides. A drag is now dropped once the primary button is neitherheld nor just released.Slide Naccessibility label, like the Sorter cells, so tests can drag them.Tests
topast the end; selection after the move; one undo and one redo; sections, including a section emptied by the move; badids(empty, unknown, negative, string, float,u64::MAX, not a list, 100k unknown ids, 100k repeats); the legacy{from, to}path.slides_move_destcases.Docs
docs/ui-parity.md: row, status line and revision history.ROADMAP.md: status line, progress log and revision history.docs/gaps.mdhad no matching entry. The "Reorder slides" checklist row stays D.Checks
cargo xtask cion top ofmain(aaf6c1c): fmt, clippy (-D warnings), layers, assets, wasm and doctests all pass.The full test run with
--no-fail-fastpasses except one test that already fails onmainlocally:deckcraft-pdftests::unembeddable_font_returns_error_instead_of_a_pdf_missing_text. It depends on the local font setup and is unrelated to this change.🤖 Generated with Claude Code
Summary by CodeRabbit