Fix up merged PRs: custom-show links carry 'returns'; prefetch follows the show's own order

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-14 13:49:36 -04:00
co-authored by Claude Opus 5.5
parent e74015490b
commit b61cf33836
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -347,7 +347,7 @@ impl ShowState {
Action::FirstSlide => self.visit(pres).first().copied(),
Action::LastSlide => self.visit(pres).last().copied(),
Action::LastViewed => last_viewed,
Action::CustomShow { name } => {
Action::CustomShow { name, .. } => {
let Some(order) = custom_indices(pres, name) else { return LinkJump::None };
let Some(&i) = order.first() else { return LinkJump::None };
self.order = Some(order);
+2 -2
View File
@@ -726,10 +726,10 @@ fn playing_a_custom_show_stays_on_its_slides() {
let mut s = ShowState::new(&p);
p.slides[4] = Arc::new(Slide { id: SlideId(1004), ..Default::default() });
assert_eq!(s.follow(&p, &Action::CustomShow { name: "Ends".into() }, None), LinkJump::Show(ShowAction::Slide(0)));
assert_eq!(s.follow(&p, &Action::CustomShow { name: "Ends".into(), returns: true }, None), LinkJump::Show(ShowAction::Slide(0)));
assert_eq!(s.custom_name(), Some("Ends"));
assert_eq!(s.next(&p), ShowAction::Slide(4));
assert_eq!(s.follow(&p, &Action::CustomShow { name: "Missing".into() }, None), LinkJump::None);
assert_eq!(s.follow(&p, &Action::CustomShow { name: "Missing".into(), returns: true }, None), LinkJump::None);
assert_eq!(s.slide, 4, "an unknown custom show leaves the current slide");
}
+1 -1
View File
@@ -693,7 +693,7 @@ pub fn ui(app: &mut SlideApp, ui: &mut Ui) {
// While this slide rests, render the next one's first frame (not one with GIFs, whose
// frame depends on when it is entered).
if !animating && show.trans.is_none() && !show.preview_only {
let next = deckcraft_anim::show_order(&doc).into_iter().find(|i| *i > idx);
let next = show.state.peek_next(&doc);
let wanted = next.filter(|n| app.media.gifs(doc_uid, &doc, *n, now, &app.session.gif_paused).is_empty());
if let Some(n) = wanted
&& show.prefetch.as_ref().is_none_or(|p| p.key.slide != n || p.key.size != size || p.key.doc != std::sync::Arc::as_ptr(&doc) as usize)