Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix(roundtrip): report every slide whose jumps leave the page plan at once; print the export receipt only after the package is written; name --kiosk exports

hugohe39290149473e5
diff --git a/skills/ppt-master/scripts/pptx_ooxml/clone.py b/skills/ppt-master/scripts/pptx_ooxml/clone.py
index 86e572e1..9e392bae 100644
--- a/skills/ppt-master/scripts/pptx_ooxml/clone.py
+++ b/skills/ppt-master/scripts/pptx_ooxml/clone.py
@@ -666,6 +666,73 @@ def _discard_rebuilt_shape_links(root: ET.Element, shape_ids: set[str]) -> None:
visit(root)
+def _report_all_dangling_slide_jumps(
+ entries: dict[str, bytes],
+ planned_refs: list[SlideRef],
+ *,
+ outputs_by_source_part: dict[str, list[str]],
+ source_ref_by_part: dict[str, SlideRef],
+ discarded_shape_links: dict[int, set[str]] | None = None,
+) -> None:
+ """Raise once, naming every planned slide whose jumps leave the plan.
+
+ The per-slide remap stops at the first bad relationship; a page plan that
+ drops two slides from a navigation deck would otherwise surface one
+ offending page per export attempt.
+ """
+ problems: list[str] = []
+ for output_index, source_ref in enumerate(planned_refs, start=1):
+ rels_xml = entries.get(source_ref.rels_name)
+ slide_xml = entries.get(source_ref.part_name)
+ if not rels_xml or not slide_xml:
+ continue
+ try:
+ slide_root = ET.fromstring(slide_xml)
+ rels_root = ET.fromstring(rels_xml)
+ except ET.ParseError:
+ continue
+ # A link on a shape the edited page removed leaves with the shape.
+ discarded = (discarded_shape_links or {}).get(output_index, set())
+ if discarded:
+ _discard_rebuilt_shape_links(slide_root, discarded)
+ owner_label = f"Source slide {source_ref.index}"
+ relationship_ids = _slide_jump_relationship_ids(slide_root, owner_label=owner_label)
+ relationships = {
+ rel.attrib.get("Id", ""): rel
+ for rel in rels_root.findall(_qn(REL_NS, "Relationship"))
+ }
+ omitted: dict[str, int] = {}
+ repeated: dict[str, int] = {}
+ for relationship_id in relationship_ids:
+ rel = relationships.get(relationship_id)
+ if rel is None or rel.attrib.get("Type") != SLIDE_REL_TYPE:
+ continue
+ target = rel.attrib.get("Target")
+ if not target:
+ continue
+ source_target_part = _normalize_part(target, source_ref.part_name)
+ if source_target_part == source_ref.part_name:
+ continue
+ target_ref = source_ref_by_part.get(source_target_part)
+ target_label = (
+ f"source slide {target_ref.index}" if target_ref is not None else source_target_part
+ )
+ outputs = outputs_by_source_part.get(source_target_part, [])
+ if not outputs:
+ omitted[target_label] = omitted.get(target_label, 0) + 1
+ elif len(outputs) > 1:
+ repeated[target_label] = repeated.get(target_label, 0) + 1
+ for label, count in sorted(omitted.items()):
+ problems.append(f"{owner_label} links to omitted {label} ({count} relationship(s))")
+ for label, count in sorted(repeated.items()):
+ problems.append(f"{owner_label} links to repeated {label} ({count} relationship(s))")
+ if problems:
+ raise RuntimeError(
+ f"{len(problems)} slide-jump target(s) leave the page plan; include each "
+ "target exactly once or retarget the links: " + "; ".join(problems)
+ )
+
+
def clone_presentation_slides(
source_pptx: Path,
source_slides: tuple[int, ...],
@@ -749,6 +816,13 @@ def clone_presentation_slides(
output_part
)
source_entries = dict(entries)
+ _report_all_dangling_slide_jumps(
+ source_entries,
+ [slide_refs[index] for index in source_slides],
+ outputs_by_source_part=outputs_by_source_part,
+ source_ref_by_part=source_ref_by_part,
+ discarded_shape_links=discarded_shape_links,
+ )
for output_index, source_index in enumerate(source_slides, start=1):
source_ref = slide_refs[source_index]
output_part, output_rels = output_slides[output_index - 1]
diff --git a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
index 433606ae..4ca3b066 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/pptx_package/cli.py
@@ -1964,6 +1964,7 @@ def _resolve_animation_config_source(
def main(argv: list[str] | None = None) -> int:
"""CLI entry point for the SVG to PPTX conversion tool."""
require_skill_integrity()
+ roundtrip_summary_line: str | None = None
transition_choices = [
'none',
*NATIVE_TRANSITION_KEYS,
@@ -3087,7 +3088,9 @@ Recorded narration:
file=sys.stderr,
)
return 1
- print(
+ # Printed only after the package is written: a failed export must not
+ # leave a receipt that reads like a delivery.
+ roundtrip_summary_line = (
" Round-trip export summary: "
f"output_pages={len(roundtrip_pages)} "
f"passthrough={direct_passthrough_count} "
@@ -3268,7 +3271,8 @@ Recorded narration:
# is predictable; an explicit -o keeps the caller's exact name untouched.
native_tag = "_native_charts_tables" if args.native_objects else ""
narrated_tag = "_narrated" if (args.recorded_narration or args.narration_audio_dir) else ""
- native_path = exports_dir / f"{project_name}_{timestamp}{native_tag}{narrated_tag}.pptx"
+ kiosk_tag = "_kiosk" if args.kiosk else ""
+ native_path = exports_dir / f"{project_name}_{timestamp}{native_tag}{narrated_tag}{kiosk_tag}.pptx"
# Preserve svg_output/ only when it is the actual source. A custom -s
# directory remains the caller-owned source and is not copied under a
# misleading svg_output backup name.
@@ -3833,6 +3837,8 @@ Recorded narration:
except (TemplateStructureError, ValueError) as exc:
print(f"Error: {exc}", file=sys.stderr)
return 1
+ if success and roundtrip_summary_line is not None:
+ print(roundtrip_summary_line)
# Archive svg_output/ once per default-flow export. This preserves the
# authored SVG sources under backup/<ts>/svg_output/ for inspection and