Skip to content

Play the new slide range after a custom show - #2300

Open
MMexicann wants to merge 1 commit into
storytold:mainfrom
MMexicann:patch-31
Open

MMexicann wants to merge 1 commit into
storytold:mainfrom
MMexicann:patch-31

Conversation

@MMexicann

@MMexicann MMexicann commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

DeckCraft plays the newly selected slide range after a custom show was selected earlier.

The setup command stored the new range but left the old custom-show name in place. Playback gives a custom show precedence, so it ignored the range. A complete range now clears the previous custom show. A named custom show in the same request still takes precedence, and incomplete ranges keep their existing behavior.

setting_a_show_range_replaces_an_active_custom_show checks the actual playback order and both precedence cases. An isolated check using the exact setup code and playback-order helper reproduced playback of the old selection on main; all three focused tests passed with the fix. Rustfmt passed. I did not run the full workspace suite locally.

Summary by CodeRabbit

  • Bug Fixes
    • Specifying both endpoints of a slide range now selects that range and clears any active custom show. Custom shows still take precedence when specified in the same request, and specifying only one endpoint preserves the existing range.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When show.setup receives both from and to as unsigned integers, it sets the slide range and clears the active custom show. A new test covers complete and partial ranges with custom shows.

Changes: Show range selection

Layer / File(s) Summary
Range and custom show behavior
crates/engine/src/cmd/review.rs
When both range endpoints are supplied, show.setup clears the active custom show. Tests cover custom show precedence, partial ranges, and complete ranges without a custom show.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: echelon

Merge Risk: Minimal · up to db439

Selecting a complete slide range now plays that range instead of a previously selected custom show. The change is narrow and tested, and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Play the new slide range after a custom show" matches the main change. When show.setup receives both from and to as unsigned integers, the change sets the slide range and clears the active …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Play the new slide range after a custom show" matches the main change. When show.setup receives both from and to as unsigned integers, the change sets the slide range and clears the active custom show, so the new range plays. The title names the behavior and the custom-show context, and it does not describe anything outside the changeset.

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.1)

Clippy execution timed out
Clippy (1.99.1) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0ccc68f and db439da.

Files selected for processing: 1

  • crates/engine/src/cmd/review.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@autocraft-bot autocraft-bot Bot added the bugfix Fixes something that is broken: wrong result, crash, data loss label Nov 21, 2026

@autocraft-bot autocraft-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-generated review (Claude Opus 5.5). Not a maintainer decision.

No blocking problems found (not certain).

A complete from/to range in show.setup now clears a previously selected custom show, so playback uses the new range; a custom show named in the same request still wins.

  • crates/engine/src/cmd/review.rs:608-611: clearing custom_show only when both endpoints are present keeps one-endpoint requests unchanged, matching the description.
  • crates/engine/src/cmd/review.rs:612: the 'all' branch resets the range but leaves custom_show in place; if selecting all slides should also replace an active custom show, it needs the same clear.
  • crates/engine/src/cmd/review.rs:941-959: the test checks actual playback order for the precedence case, the single-endpoint cases and the replacement case.

Claims checked:

  • verified: A complete slide range now clears the previous custom show, so playback uses the new range. (crates/engine/src/cmd/review.rs:608-611 sets sh.range and then sh.custom_show = None in the (Some(a), Some(b)) arm; the test at crates/engine/src/cmd/review.rs:956-958 asserts order [1, 2] and custom_show…
  • unverified: A named custom show in the same request still takes precedence over the range. (The code that applies the 'custom' parameter in setup is not in the diff; the test at crates/engine/src/cmd/review.rs:949-950 asserts order [0, 1] for {from, to, custom}.)
  • verified: Incomplete ranges (only one endpoint) keep their existing behaviour. (crates/engine/src/cmd/review.rs:613 keeps the _ => {} arm unchanged; the test at crates/engine/src/cmd/review.rs:951-954 checks {from} and {to} alone keep the custom show.)

Reviewed at db439da.

Recommendation: merge, after a maintainer's decision.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes something that is broken: wrong result, crash, data loss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant