Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
AI-generated review (Claude Opus 5.5). Not a maintainer decision.
No blocking problems found (not certain).
section.move now captures the active slide's ID before reordering and restores its new index after the slides are re-sorted, so the selection stays on the same slide.
- crates/engine/src/cmd/slide.rs:706 reads the active slide with doc.slides.get(sel.slide), so an out-of-range or empty selection is handled without panicking.
- crates/engine/src/cmd/slide.rs:713-715 only updates sel.slide when the slide is still found, leaving the previous selection unchanged otherwise.
- The new test moving_a_section_keeps_the_current_slide_selected covers the moved order and the selected slide after move, undo and redo.
- Worth checking whether other commands that reorder slides keep an index-based selection in the same way and need the same ID-based remapping.
Claims checked:
- verified: Moving a section keeps the active slide by ID and resolves its new index inside the same edit. (crates/engine/src/cmd/slide.rs:706 captures doc.slides.get(sel.slide).map(|slide| slide.id) before sections are moved; crates/engine/src/cmd/slide.rs:713-715 sets sel.slide from doc.slide_index(id) after…
- unverified: The selected slide is kept after undoing and redoing a section move. (crates/engine/src/cmd/slide.rs:886-891 asserts the selection after edit.undo and edit.redo; whether Session::edit snapshots and restores the selection is decided outside the diff and could not be read.)
- verified: An empty section move leaves the fallback selection intact. (crates/engine/src/cmd/slide.rs:713 only assigns sel.slide when both the active ID and its new index exist, so with no active slide the selection is left unchanged; no test in the diff covers this case.)
Reviewed at 6163141.
Recommendation: merge, after a maintainer's decision.
Moving a section reorders the slides. The editor used to keep the old numeric slide index, which could make it jump to a different slide. Keep the active slide by ID and resolve its new index inside the same edit.
The regression checks the selected slide and slide order after moving a section, undoing it, and redoing it. The isolated Rust probe reproduced the wrong index and passed with the fix. It also checked that an empty section move leaves the fallback selection intact.
rustfmtpassed. The full engine suite was not run locally.Summary by CodeRabbit