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

feat(live-preview): clarify edit and annotation flow

hugohe35d21d4f38d3c
diff --git a/skills/ppt-master/scripts/svg_editor/server.py b/skills/ppt-master/scripts/svg_editor/server.py
index 2fc9dfcb..e4c13622 100644
--- a/skills/ppt-master/scripts/svg_editor/server.py
+++ b/skills/ppt-master/scripts/svg_editor/server.py
@@ -866,6 +866,51 @@ def _legacy_live_lock(project_path: Path) -> Optional[dict]:
return None
+def _shutdown_existing(project_path: Path) -> int:
+ """Stop a live-preview server for this project (idempotent)."""
+ lock_file = _lock_file(project_path)
+ existing = _read_lock(lock_file)
+ legacy_lock_file = project_path / LEGACY_LOCK_FILE_NAME
+ if not existing:
+ existing = _read_lock(legacy_lock_file)
+ lock_file = legacy_lock_file
+ if not existing:
+ logger.info('no live preview server running — nothing to stop')
+ return 0
+
+ pid = int(existing.get('pid', 0) or 0)
+ port = existing.get('port')
+ if not _process_alive(pid):
+ _release_lock(lock_file)
+ logger.info('live preview already stopped; cleared stale lock')
+ return 0
+
+ if port:
+ try:
+ req = urllib.request.Request(
+ f'http://127.0.0.1:{port}/api/shutdown',
+ data=b'{"reason": "cli-shutdown"}',
+ headers={'Content-Type': 'application/json'},
+ method='POST',
+ )
+ urllib.request.urlopen(req, timeout=3)
+ except OSError:
+ pass
+
+ for _ in range(20):
+ if not _process_alive(pid):
+ break
+ time.sleep(0.1)
+ if _process_alive(pid):
+ try:
+ os.kill(pid, signal.SIGTERM)
+ except OSError:
+ pass
+ _release_lock(lock_file)
+ logger.info('live preview server stopped (pid=%s)', pid)
+ return 0
+
+
def _wait_for_ready(url: str, proc: subprocess.Popen, timeout: int = 15) -> bool:
"""Wait until the server responds or the child exits."""
deadline = time.time() + timeout
@@ -920,6 +965,11 @@ def build_parser() -> argparse.ArgumentParser:
default=None,
help='Idle timeout in seconds (default: 900; live mode default: 7200; 0 = disabled)',
)
+ parser.add_argument(
+ '--shutdown',
+ action='store_true',
+ help='Stop a live-preview server left running for this project, then exit (idempotent).',
+ )
return parser
@@ -934,6 +984,9 @@ def main(argv: Optional[list[str]] = None) -> int:
)
project_path = Path(args.project_dir).resolve()
+ if args.shutdown:
+ return _shutdown_existing(project_path)
+
svg_output = project_path / 'svg_output'
if not svg_output.exists():
if args.live:
diff --git a/skills/ppt-master/scripts/svg_editor/static/app.js b/skills/ppt-master/scripts/svg_editor/static/app.js
index fa48ab75..a5c0e2a3 100644
--- a/skills/ppt-master/scripts/svg_editor/static/app.js
+++ b/skills/ppt-master/scripts/svg_editor/static/app.js
@@ -11,6 +11,7 @@
page_title: "PPT Master - Live Preview",
panel_slides: "Slides",
panel_annotations: "Annotations",
+ panel_edit_annotate: "Edit / Annotate",
placeholder_select_slide: "Select a slide on the left to begin",
label_selected_element: "Selected element",
empty_selected_element: "Click an element on the slide to select it",
@@ -22,6 +23,14 @@
section_text_style: "Text",
section_raw_attrs: "Raw attributes",
label_edit_instruction: "Edit instruction",
+ pending_none: "No pending changes",
+ pending_summary: "{edits} direct edit(s), {annotations} annotation page(s) pending",
+ pending_pages: "Pages: {pages}",
+ quick_align: "Align / move",
+ quick_resize: "Resize",
+ quick_replace_image: "Replace image",
+ quick_copy: "Revise copy",
+ quick_relayout: "Relayout area",
placeholder_annotation: "Describe how the AI should modify this element...",
placeholder_annotation_multi: "Describe how to modify all {count} elements...",
btn_add_annotation: "Add annotation",
@@ -58,8 +67,11 @@
modal_matrix_transform_note: "\n\nNote: at least one staged geometry edit uses a transform matrix. Re-export with the current PPTX exporter so the matrix is applied.",
slide_error_tooltip: "Failed to parse this slide: ",
reload_banner: "This slide was updated on disk. Click to reload.",
- modal_confirm_submit: "Apply staged attribute edits and annotations to disk?\n\nThe preview service will keep running. Click Exit preview when you want to stop it.",
- modal_success_submit: "Changes saved to svg_output.\n\nReturn to the chat to re-export the PPTX or apply AI-needed annotations. The preview service is still running.",
+ modal_confirm_submit: "Apply staged direct edits and AI annotations to disk?\n\nThe preview service will keep running. Click Exit preview when you want to stop it.",
+ modal_success_submit: "Changes saved to svg_output.\n\nThe preview service is still running.",
+ modal_success_direct_only: "Changes saved to svg_output.\n\nDirect edits are now in the SVG source. Return to the chat and ask to re-export when you want a refreshed PPTX. The preview service is still running.",
+ modal_success_annotations_only: "Annotations saved to svg_output.\n\nReturn to the chat and ask to apply annotations when you want AI to interpret them. The preview service is still running.",
+ modal_success_mixed: "Direct edits and annotations saved to svg_output.\n\nReturn to the chat to apply AI-needed annotations, then re-export the PPTX when ready. The preview service is still running.",
modal_confirm_exit: "Exit preview and stop the local server?\n\nUnapplied edits and annotations will be discarded.",
modal_success_exit: "Preview stopped.\n\nYou can close this tab and return to the chat.",
modal_stopping: "Stopping preview server...",
@@ -75,6 +87,7 @@
page_title: "PPT Master - 实时预览",
panel_slides: "幻灯片",
panel_annotations: "标注",
+ panel_edit_annotate: "编辑 / 标注",
placeholder_select_slide: "在左侧选择一张幻灯片开始",
label_selected_element: "已选元素",
empty_selected_element: "点击幻灯片中的元素进行选择",
@@ -86,6 +99,14 @@
section_text_style: "文本",
section_raw_attrs: "原始属性",
label_edit_instruction: "修改说明",
+ pending_none: "没有待应用修改",
+ pending_summary: "{edits} 条直接修改、{annotations} 个页面有 AI 标注待应用",
+ pending_pages: "页面:{pages}",
+ quick_align: "对齐/移动",
+ quick_resize: "调整大小",
+ quick_replace_image: "换图",
+ quick_copy: "改文案",
+ quick_relayout: "重排此区域",
placeholder_annotation: "描述希望 AI 如何修改该元素……",
placeholder_annotation_multi: "描述希望如何修改所选 {count} 个元素……",
btn_add_annotation: "添加标注",
@@ -122,8 +143,11 @@
modal_matrix_transform_note: "\n\n提示:至少有一条暂存几何修改使用了 transform matrix。请用当前 PPTX 导出器重新导出,确保 matrix 被应用。",
slide_error_tooltip: "该幻灯片解析失败:",
reload_banner: "当前页已在磁盘上更新,点此重新加载。",
- modal_confirm_submit: "确认将暂存属性修改和标注写入磁盘?\n\n预览服务会继续运行。需要关闭时请点击退出预览。",
- modal_success_submit: "修改已保存到 svg_output。\n\n请回到对话窗口重新导出 PPTX,或让 AI 应用需要判断的标注。预览服务仍在运行。",
+ modal_confirm_submit: "确认将暂存的直接修改和 AI 标注写入磁盘?\n\n预览服务会继续运行。需要关闭时请点击退出预览。",
+ modal_success_submit: "修改已保存到 svg_output。\n\n预览服务仍在运行。",
+ modal_success_direct_only: "修改已保存到 svg_output。\n\n直接修改已经写入 SVG 源文件;需要刷新 PPTX 时,请回到对话窗口要求重新导出。预览服务仍在运行。",
+ modal_success_annotations_only: "标注已保存到 svg_output。\n\n需要 AI 理解并执行这些标注时,请回到对话窗口要求应用标注。预览服务仍在运行。",
+ modal_success_mixed: "直接修改和标注已保存到 svg_output。\n\n请回到对话窗口先应用需要 AI 判断的标注,确认后再重新导出 PPTX。预览服务仍在运行。",
modal_confirm_exit: "退出预览并停止本地服务?\n\n未应用的属性修改和标注将被丢弃。",
modal_success_exit: "预览已停止。\n\n可以关闭本标签页并回到对话窗口。",
modal_stopping: "正在停止预览服务……",
@@ -188,6 +212,8 @@
updateSelectionPanel();
updateAnnotationList();
updateUndoButton();
+ updatePendingStatus();
+ initAnnotationQuickActions();
loadSlides();
}
@@ -197,6 +223,7 @@
var svgContent = document.getElementById("svg-content");
var selectedElementEl = document.getElementById("selected-element");
var annotationInput = document.getElementById("annotation-input");
+ var annotationQuickActions = document.getElementById("annotation-quick-actions");
var annotationText = document.getElementById("annotation-text");
var btnAddAnnotation = document.getElementById("btn-add-annotation");
var annotationsEl = document.getElementById("annotations");
@@ -208,6 +235,7 @@
var modalConfirm = document.getElementById("modal-confirm");
var modalCancel = document.getElementById("modal-cancel");
var elementPropsEl = document.getElementById("element-props");
+ var pendingStatusEl = document.getElementById("pending-status");
var navFirstBtn = document.getElementById("nav-first");
var navPrevBtn = document.getElementById("nav-prev");
@@ -231,6 +259,95 @@
var matrixHintShown = false; // show transform-matrix export hint once per session
var matrixEditSlides = {}; // {name: true} when a staged edit wrote transform=matrix(...)
var annotationsDirty = false; // unsaved annotations added/removed this session
+ var annotationEditSlides = {}; // {name: true} when annotations changed this session
+
+ function pendingDirectEditCount() {
+ return Object.keys(editStackCount).reduce(function (total, name) {
+ return total + Math.max(0, editStackCount[name] || 0);
+ }, 0);
+ }
+
+ function pendingDirectEditSlides() {
+ return Object.keys(editStackCount).filter(function (name) {
+ return (editStackCount[name] || 0) > 0;
+ });
+ }
+
+ function pendingAnnotationSlides() {
+ return Object.keys(annotationEditSlides).filter(function (name) {
+ return !!annotationEditSlides[name];
+ });
+ }
+
+ function pendingAnnotationChangeCount() {
+ return pendingAnnotationSlides().length;
+ }
+
+ function pendingSlideNames() {
+ var seen = {};
+ pendingDirectEditSlides().concat(pendingAnnotationSlides()).forEach(function (name) {
+ seen[name] = true;
+ });
+ return Object.keys(seen).sort();
+ }
+
+ function updatePendingStatus() {
+ if (!pendingStatusEl) return;
+ var edits = pendingDirectEditCount();
+ var annotations = pendingAnnotationChangeCount();
+ if (edits === 0 && annotations === 0) {
+ pendingStatusEl.className = "pending-status empty";
+ pendingStatusEl.textContent = t("pending_none");
+ return;
+ }
+ var pages = pendingSlideNames();
+ pendingStatusEl.className = "pending-status active";
+ pendingStatusEl.innerHTML =
+ '<div>' + escapeHtml(t("pending_summary", {
+ edits: edits,
+ annotations: annotations,
+ })) + '</div>' +
+ (pages.length ? '<div class="pending-pages">' + escapeHtml(t("pending_pages", {
+ pages: pages.join(", "),
+ })) + '</div>' : '');
+ }
+
+ function markAnnotationChanged(slide) {
+ if (!slide) return;
+ annotationEditSlides[slide] = true;
+ annotationsDirty = true;
+ updatePendingStatus();
+ }
+
+ function initAnnotationQuickActions() {
+ if (!annotationQuickActions) return;
+ var actions = [
+ { key: "quick_align" },
+ { key: "quick_resize" },
+ { key: "quick_replace_image" },
+ { key: "quick_copy" },
+ { key: "quick_relayout" },
+ ];
+ annotationQuickActions.innerHTML = "";
+ actions.forEach(function (action) {
+ var btn = document.createElement("button");
+ btn.type = "button";
+ btn.className = "annotation-quick-chip";
+ btn.textContent = t(action.key);
+ btn.addEventListener("click", function () {
+ var label = t(action.key);
+ var prefix = LANG === "zh" ? label + ":" : label + ": ";
+ if (!annotationText.value.trim()) {
+ annotationText.value = prefix;
+ } else if (annotationText.value.indexOf(prefix) === -1) {
+ annotationText.value = prefix + annotationText.value;
+ }
+ annotationText.focus();
+ annotationText.selectionStart = annotationText.selectionEnd = annotationText.value.length;
+ });
+ annotationQuickActions.appendChild(btn);
+ });
+ }
// Staged edits live in server memory until "Apply changes"; the server can
// still idle-timeout or be killed and drop them. Warn before the tab leaves
@@ -310,6 +427,7 @@
svgContent.style.display = "none";
}
updateNavLabel();
+ updatePendingStatus();
return;
}
@@ -362,6 +480,7 @@
showReloadBanner(currentSlide);
}
updateNavLabel();
+ updatePendingStatus();
})
.catch(function (err) {
console.error("loadSlides:", err);
@@ -474,6 +593,7 @@
refreshAnnotationVisuals();
updateAnnotationList();
updateUndoButton();
+ updatePendingStatus();
})
.catch(function (err) {
console.error("selectSlide:", err);
@@ -1259,7 +1379,7 @@
ids.forEach(function (eid) {
slideAnnotations[eid] = text;
});
- annotationsDirty = true;
+ markAnnotationChanged(currentSlide);
refreshAnnotationVisuals();
updateAnnotationList();
annotationText.value = "";
@@ -1283,7 +1403,7 @@
.then(function (res) { return res.json(); })
.then(function () {
delete slideAnnotations[elementId];
- annotationsDirty = true;
+ markAnnotationChanged(currentSlide);
refreshAnnotationVisuals();
updateAnnotationList();
loadSlides();
@@ -1409,6 +1529,8 @@
}
// Step 2: save annotations. Service lifetime is controlled only by Exit preview.
+ var hadDirectEdits = pendingDirectEditCount() > 0;
+ var hadAnnotationChanges = pendingAnnotationChangeCount() > 0;
modalConfirm.style.display = "none";
modalCancel.style.display = "none";
@@ -1421,13 +1543,23 @@
if (data.error) {
modalMessage.textContent = t("err_save") + data.error;
} else {
- modalMessage.textContent = t("modal_success_submit");
+ if (hadDirectEdits && hadAnnotationChanges) {
+ modalMessage.textContent = t("modal_success_mixed");
+ } else if (hadDirectEdits) {
+ modalMessage.textContent = t("modal_success_direct_only");
+ } else if (hadAnnotationChanges) {
+ modalMessage.textContent = t("modal_success_annotations_only");
+ } else {
+ modalMessage.textContent = t("modal_success_submit");
+ }
editStackCount = {};
matrixEditSlides = {};
matrixHintShown = false;
savedHintShown = false;
annotationsDirty = false;
+ annotationEditSlides = {};
updateUndoButton();
+ updatePendingStatus();
var activeSlide = currentSlide;
loadSlides().then(function () {
if (activeSlide) {
@@ -1572,6 +1704,7 @@
editStackCount[currentSlide] = 0;
matrixEditSlides[currentSlide] = false;
updateUndoButton();
+ updatePendingStatus();
showWarning(t("undo_empty"));
return;
}
@@ -1582,6 +1715,7 @@
// selectSlide refreshes editStackCount + the undo button.
var item = slideListEl.querySelector('.slide-item[data-name="' + cssAttr(currentSlide) + '"]');
selectSlide(currentSlide, item || undefined);
+ updatePendingStatus();
showWarning(t("undo_done"));
})
.catch(function (err) {
@@ -2266,6 +2400,7 @@
if (data && data.undo_depth !== undefined) {
editStackCount[slide] = data.undo_depth;
if (slide === currentSlide) updateUndoButton();
+ updatePendingStatus();
}
if (payloadHasMatrixTransform(payload)) {
markMatrixTransformEdit(slide);
@@ -2477,6 +2612,8 @@
// Boot
// ================================================================
applyI18n();
+ initAnnotationQuickActions();
+ updatePendingStatus();
var langToggleBtn = document.getElementById("btn-lang-toggle");
if (langToggleBtn) {
langToggleBtn.textContent = LANG === "zh" ? "EN" : "中";
diff --git a/skills/ppt-master/scripts/svg_editor/static/index.html b/skills/ppt-master/scripts/svg_editor/static/index.html
index 278c530b..f902e7eb 100644
--- a/skills/ppt-master/scripts/svg_editor/static/index.html
+++ b/skills/ppt-master/scripts/svg_editor/static/index.html
@@ -31,7 +31,8 @@
</div>
<div id="panel-right">
<button id="btn-lang-toggle" class="btn-lang-toggle" title="Switch language">中</button>
- <div class="panel-header" data-i18n="panel_annotations">Annotations</div>
+ <div class="panel-header" data-i18n="panel_edit_annotate">Edit / Annotate</div>
+ <div id="pending-status" class="pending-status"></div>
<div id="selection-info">
<div class="section-label" data-i18n="label_selected_element">Selected element</div>
<div id="selected-element" class="empty" data-i18n="empty_selected_element">Click an element on the slide to select it</div>
@@ -39,6 +40,7 @@
</div>
<div id="annotation-input" style="display:none;">
<div class="section-label" data-i18n="label_edit_instruction">Edit instruction</div>
+ <div id="annotation-quick-actions"></div>
<textarea id="annotation-text" data-i18n-placeholder="placeholder_annotation" placeholder="Describe how the AI should modify this element..."></textarea>
<button id="btn-add-annotation" data-i18n="btn_add_annotation">Add annotation</button>
</div>
diff --git a/skills/ppt-master/scripts/svg_editor/static/style.css b/skills/ppt-master/scripts/svg_editor/static/style.css
index 893a3e2e..ce66a1c1 100644
--- a/skills/ppt-master/scripts/svg_editor/static/style.css
+++ b/skills/ppt-master/scripts/svg_editor/static/style.css
@@ -330,6 +330,33 @@ body.svg-dragging * {
color: #a0a0c0;
}
+/* --- Pending status --- */
+.pending-status {
+ margin: 0 16px 10px;
+ padding: 8px 10px;
+ border: 1px solid #2a2a4a;
+ border-radius: 6px;
+ font-size: 12px;
+ line-height: 1.4;
+}
+
+.pending-status.empty {
+ color: #7a7a9a;
+ background: #18182a;
+}
+
+.pending-status.active {
+ color: #f8d46b;
+ background: rgba(245, 197, 66, 0.08);
+ border-color: rgba(245, 197, 66, 0.45);
+}
+
+.pending-pages {
+ margin-top: 3px;
+ color: #b8a866;
+ word-break: break-word;
+}
+
/* --- Annotation input --- */
#annotation-input {
padding: 12px 16px;
@@ -337,6 +364,30 @@ body.svg-dragging * {
flex-shrink: 0;
}
+#annotation-quick-actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 6px;
+ margin-bottom: 8px;
+}
+
+.annotation-quick-chip {
+ padding: 4px 8px;
+ font-size: 11.5px;
+ color: #c0c0d8;
+ background: #1e1e36;
+ border: 1px solid #3a3a5a;
+ border-radius: 999px;
+ cursor: pointer;
+ transition: background 0.15s, border-color 0.15s, color 0.15s;
+}
+
+.annotation-quick-chip:hover {
+ color: #ffffff;
+ background: #2a2a4a;
+ border-color: #4a9eff;
+}
+
#annotation-text {
width: 100%;
min-height: 80px;
diff --git a/skills/ppt-master/workflows/live-preview.md b/skills/ppt-master/workflows/live-preview.md
index 723a0b4c..e20334c7 100644
--- a/skills/ppt-master/workflows/live-preview.md
+++ b/skills/ppt-master/workflows/live-preview.md
@@ -37,8 +37,8 @@ python3 ${SKILL_DIR}/scripts/svg_editor/server.py <project_path> --daemon
The launcher binds `127.0.0.1:5050` (or the next free port), starts the server in the background, writes runtime files under `<project_path>/live_preview/`, opens the browser on a local desktop when possible, and edits `<project_path>/svg_output/` in place. After it prints the running URL, tell the user in their language, in one short message:
- editor is at the URL reported by the launcher, e.g. `http://localhost:5050`
-- **Direct edit** (deterministic tweaks — wording, color, coordinates, SVG attributes): select an element → change the controls in the right panel → preview updates immediately, but nothing is written to `svg_output/` until **Apply changes**. `Ctrl+Z` or the **Undo** button drops staged edits step by step; applied changes are logged to `<project>/live_preview/edits.jsonl`. Re-export stays chat-driven: say "re-export" / "重新导出" to refresh the PPTX.
-- **Annotate** (changes that need AI judgement / re-layout): select an element → write the instruction → click **Add annotation** to stage it → click **Apply changes** to write annotation markers → return to the chat and say `apply my annotations` (or quote the browser prompt)
+- **Direct edit** (deterministic tweaks — wording, color, coordinates, SVG attributes): select an element → change the controls in the right panel → preview updates immediately, but nothing is written to `svg_output/` until **Apply changes**. `Ctrl+Z` or the **Undo** button drops staged edits step by step; applied changes are logged to `<project>/live_preview/edits.jsonl`. Re-export stays chat-driven and separate: say "re-export" / "重新导出" to refresh the PPTX.
+- **Annotate** (changes that need AI judgement / re-layout): select an element → write the instruction, optionally starting from a quick type such as move / resize / replace image / copy / relayout → click **Add annotation** to stage it → click **Apply changes** to write annotation markers → return to the chat and say `apply my annotations` (or quote the browser prompt)
- to skip the editor, just describe the change in chat
Do not wait for confirmation before launching — the user already asked for preview, so launching is the response. If another project already holds the port, the launcher auto-advances to the next free one — report the actual URL from the launch log (`--port <other>` still forces a specific port). Remote access → see the appendix.
@@ -73,7 +73,7 @@ Triggered by the user signals listed in "When to Run".
## Notes (editor invariants — referenced from SKILL.md Step 6)
-- **UI**: bilingual (EN/中); auto-detects from `navigator.language`, persists in `localStorage`, toggled via the **中 / EN** button on the right panel. Slide navigation: first/prev/next/last buttons at the top of the center panel, plus `←` / `→` / `Home` / `End` (suppressed while typing in the annotation textarea).
+- **UI**: bilingual (EN/中); auto-detects from `navigator.language`, persists in `localStorage`, toggled via the **中 / EN** button on the right panel. The right panel is an **Edit / Annotate** surface: direct SVG edits and AI-needed annotations are visually separated, with a pending-status strip showing staged direct edits and pages with unsaved annotations. Slide navigation: first/prev/next/last buttons at the top of the center panel, plus `←` / `→` / `Home` / `End` (suppressed while typing in the annotation textarea).
- **Buttons**: `Add annotation` stages annotation text in memory; `Apply changes` writes staged direct edits plus annotation markers to disk and keeps the service running; `Exit preview` is the only UI action that stops Flask.
- **Direct edit (no AI)**: selection mode determines the right-panel surface. Single element = full object inspector (geometry, safe text content, raw SVG attributes except protected fields like `id`, UI `class`, event handlers, and hrefs). SVG `<g>` group = group-level edit surface; select via `Alt/Option` + click or **Select parent group** from a child element. Multi-select = limited batch editor over top-level selected objects only: shared x/y plus `fill` / `stroke` / `opacity`; text style fields (`font-size` / `font-family` / `font-weight` / `text-anchor`) appear only when every selected object is `text`/`tspan`. Preview updates immediately; disk writes wait for **Apply changes**.
- **Drag to move**: press and drag an already-selected element on the canvas to reposition it (selection stays a separate click, so the background is never dragged by accident); the whole selection moves together under multi-select. The pointer delta is mapped through each element's own CTM, so moves track the cursor regardless of viewport scale or group transforms. Each release stages one direct edit per moved element (the same `x`/`y`-or-`transform` write the geometry inputs produce), previewed live and written only on **Apply changes**; dragging on empty canvas is still rubber-band selection. A failed stage rolls the canvas back to the pre-drag position.
@@ -81,7 +81,7 @@ Triggered by the user signals listed in "When to Run".
- **Overlap picker**: right-click anywhere on the canvas to list every selectable element under the pointer (top→bottom), so stacked shapes can be reached without blind cycling. Left-click is unchanged (selects the topmost). Hovering a row highlights that element; clicking it selects it; `Esc` or an outside click closes the list. With exactly one element under the pointer, right-click selects it directly.
- **Undo**: `Ctrl+Z` or the **Undo** button drops the last staged direct edit on the current slide (per-slide LIFO, this session). Consecutive edits to the *same element and same field set* (e.g. nudging one color or coordinate several times) coalesce into a single undo step, keeping the original pre-edit value; switching element or field starts a new step. Applied old→new history is appended to `<project>/live_preview/edits.jsonl`; annotation save/update/remove history is appended to `<project>/live_preview/annotations.jsonl`; un-applied staged edits are in-memory only.
- **Unsaved-work guard**: staged direct edits and annotation changes (added or removed) live in server memory until **Apply changes**; closing the tab triggers the browser's native "leave site?" prompt while any are unapplied, since an idle timeout or process kill would drop them.
-- **Re-export is chat-driven**: applying changes updates `svg_output/` only. Refreshing the PPTX (finalize + svg_to_pptx) stays a chat step — the editor never runs the export pipeline.
+- **Re-export is chat-driven**: applying changes updates `svg_output/` only. Refreshing the PPTX (finalize + svg_to_pptx) stays a chat step — the editor never runs the export pipeline or presents browser-side export as part of applying edits.
- **Stop conditions**: the service stops when the user clicks **Exit preview** in the browser, asks in chat to stop it, the idle timeout fires, or the process is killed externally.
- **Port**: default `5050`, auto-advancing to the next free port when another project already holds it (report the actual URL from the launch log); force a specific port with `--port <other>`.
- **Idle timeout**: plain mode `900s`, `--live` mode `7200s`; override with `--timeout <seconds>` (`0` disables).