Merge PR #520 from NikitkaRa: Insert: Summary, Section and Slide Zoom with Return to Zoom

Fix-ups in the merge (review): zoom targets, sections and titles are looked up with get()
instead of indexing; Hyperlink literals carry both main's sound fields and zoom_return;
duplicated test statements left by the test-file union are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-14 15:58:31 -04:00
co-authored by Claude Opus 5.5
20 changed files with 458 additions and 18 deletions
+9 -2
View File
@@ -171,6 +171,7 @@ fn hyperlinked_runs_take_the_theme_hyperlink_look() {
highlight_click: false,
sound: None,
stop_sound: false,
zoom_return: None,
});
let hlink = Some(Fill::solid(ColorRef::scheme(SchemeSlot::Hlink)));
// The title's master style colours its text tx1; a link is hlink and underlined instead.
@@ -179,8 +180,14 @@ fn hyperlinked_runs_take_the_theme_hyperlink_look() {
assert_eq!((r.fill, r.underline.as_deref()), (hlink.clone(), Some("sng")));
assert_eq!(ctx.color(&ColorRef::scheme(SchemeSlot::Hlink), None), p.masters[0].theme.colors.get(SchemeSlot::Hlink));
// A slide link looks the same.
let slide =
Some(Hyperlink { action: Action::Slide { slide: s.id }, tooltip: String::new(), highlight_click: false, sound: None, stop_sound: false });
let slide = Some(Hyperlink {
action: Action::Slide { slide: s.id },
tooltip: String::new(),
highlight_click: false,
sound: None,
stop_sound: false,
zoom_return: None,
});
assert_eq!(resolve::run(&ctx, title, &para, &RunProps { link: slide, ..Default::default() }).fill, hlink);
// The run's own colour and underline win; u="none" removes the underline.
let red = Some(Fill::solid(ColorRef::rgb(deckcraft_color::Rgba::rgb(255, 0, 0))));
+4
View File
@@ -344,6 +344,10 @@ pub struct Hyperlink {
/// `endSnd`: stop the sound that is already playing.
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub stop_sound: bool,
/// Zoom (Insert ▸ Zoom) with Return to Zoom: in the show, after this slide is shown and
/// advanced past, go back to the slide with the zoom. Saved to .pptx as a plain slide link.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub zoom_return: Option<crate::SlideId>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]