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(confirm-ui): align canvas labels and preview samples
hugohe3715fbf4d0c57
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.mdindex c59b59b7..2883af41 100644--- a/skills/ppt-master/SKILL.md+++ b/skills/ppt-master/SKILL.md@@ -377,7 +377,7 @@ Steps:python3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --daemon --wait```Page opens at `http://localhost:5050` — the **same port as the Step 6 live preview** (they never run at once: this page shuts down at the end of Step 4). If 5050 is held, the launcher **auto-advances** (5051, …) — read the actual URL from the launch log and report it. The page does **not** close after Tier 1: it shows a "deriving…" state and polls for Tier 2. **Launch or wait failure is non-fatal**: if it fails or times out (flask missing, port blocked, no GUI / remote / web host), do **NOT** troubleshoot — **on any non-zero exit, re-check `result.json` once** (a fresh `status: tier1-confirmed`) before dropping to the chat fallback. **On success (exit 0 with a tier-1 result), do not pause or report — go straight to step 3 in the same turn.**-3. **Re-derive Tier 2 from the confirmed anchors, then write it — immediately, same turn (the page is polling for it).** Read the tier-1 `result.json` (`status: tier1-confirmed`). Using the user's **actual** confirmed anchors (not your originals), author the realization candidates and **overwrite** `recommendations.json` with `"tier": 2`: page count (content volume × `delivery_purpose`); color, typography, and generated-image style as **generative ≥3-candidate** fields (creative recommendations always offer real choice — same rule as h.5; fewer than 3 only on the honest-shortfall exception, with a stated reason; color: core `palette` with background/secondary_bg/primary/accent/secondary_accent/body_text; typography: CJK + Latin for `heading` and `body` with `css` preview stacks + `body_size` as the body baseline in **px** (every canvas) — **one fixed value per confirmed `delivery_purpose`** (`text` 20 / `balanced` 24 / `presentation` 32), not a range; images: `image_strategy.candidates` rendering × palette from h.5); enumerable `icons` / `formula_policy` / `generation_mode` (recommended `id`); `image_usage` (`ai` / `web` / `provided` / `placeholder` / `none`, or a custom prose plan when several sources mix — never bare `"custom"`; write `image_ai_path` only when the plan includes AI). The still-open page polls, renders Tier 2, and preserves the user's Tier 1 picks. Closed fields (`image_ai_path`, `formula_policy`, `generation_mode`, `refine_spec`) stay finite; open fields (`icons`, `image_usage`, typography custom text) show a Custom box.+3. **Re-derive Tier 2 from the confirmed anchors, then write it — immediately, same turn (the page is polling for it).** Read the tier-1 `result.json` (`status: tier1-confirmed`). Using the user's **actual** confirmed anchors (not your originals), author the realization candidates and **overwrite** `recommendations.json` with `"tier": 2`: page count (content volume × `delivery_purpose`); color, typography, and generated-image style as **generative ≥3-candidate** fields (creative recommendations always offer real choice — same rule as h.5; fewer than 3 only on the honest-shortfall exception, with a stated reason; color: core `palette` with background/secondary_bg/primary/accent/secondary_accent/body_text; typography: CJK + Latin for `heading` and `body` with `css` preview stacks + `body_size` as the body baseline in **px** (every canvas) — **one fixed value per confirmed `delivery_purpose`** (`text` 20 / `balanced` 24 / `presentation` 32), not a range; each typography candidate must include topic-matched `sample_heading` / `sample_heading_latin` / `sample_body` / `sample_body_latin` preview text, never a fixed unrelated industry sample; images: `image_strategy.candidates` rendering × palette from h.5); enumerable `icons` / `formula_policy` / `generation_mode` (recommended `id`); `image_usage` (`ai` / `web` / `provided` / `placeholder` / `none`, or a custom prose plan when several sources mix — never bare `"custom"`; write `image_ai_path` only when the plan includes AI). The still-open page polls, renders Tier 2, and preserves the user's Tier 1 picks. Closed fields (`image_ai_path`, `formula_policy`, `generation_mode`, `refine_spec`) stay finite; open fields (`icons`, `image_usage`, typography custom text) show a Custom box.4. **Wait for the final confirmation** — attach to the already-running page, do **not** relaunch (same 600000 ms budget):```bashpython3 ${SKILL_DIR}/scripts/confirm_ui/server.py <project_path> --wait-onlydiff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.jsindex f5914859..bdd65932 100644--- a/skills/ppt-master/scripts/confirm_ui/static/app.js+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js@@ -77,8 +77,10 @@role_body_text: "body text",cjk: "CJK",latin: "Latin",- sample_cjk: "数字化转型战略",- sample_latin: "Digital Transformation",+ sample_heading_cjk: "主题方案标题",+ sample_heading_latin: "Presentation Title",+ sample_body_cjk: "关键信息摘要",+ sample_body_latin: "Key message summary",style_preview_label: "Overall impression (color + typography)",style_preview_body: "· rough feel only, not the actual slide layout",mode_continuous_desc: "Generate the whole deck in one pass.",@@ -157,8 +159,10 @@role_body_text: "正文文字",cjk: "中文",latin: "西文",- sample_cjk: "数字化转型战略",- sample_latin: "Digital Transformation",+ sample_heading_cjk: "主题方案标题",+ sample_heading_latin: "Presentation Title",+ sample_body_cjk: "关键信息摘要",+ sample_body_latin: "Key message summary",style_preview_label: "整体形象(配色 + 字体)",style_preview_body: "· 仅大致形象,非实际版式",mode_continuous_desc: "一次性连续生成整份演示文稿。",@@ -350,7 +354,7 @@var spec = specById[o.id];var chip = el("div", "chip");if (o.viewbox) {- label = o.id + (o.dim ? " · " + o.dim : "");+ label = label + (o.dim ? " · " + o.dim : "");} else {if (o.dim) label += " · " + o.dim;if (desc) label += (LANG === "zh" ? ":" : " — ") + desc;@@ -457,7 +461,17 @@function normTypography(c) {c = c || {};if (c.heading && typeof c.heading === "object" && c.body && typeof c.body === "object") {- return Object.assign({}, c, { body_size: typographyBodySize(c) });+ return Object.assign({}, c, {+ body_size: typographyBodySize(c),+ heading: Object.assign({}, c.heading, {+ sample_cjk: c.heading.sample_cjk || c.sample_heading || "",+ sample_latin: c.heading.sample_latin || c.sample_heading_latin || ""+ }),+ body: Object.assign({}, c.body, {+ sample_cjk: c.body.sample_cjk || c.sample_body || "",+ sample_latin: c.body.sample_latin || c.sample_body_latin || ""+ })+ });}return {name: c.name || "",@@ -845,10 +859,35 @@return primary + ", " + fallback;}- function fontSample(box, slot, css) {+ function sampleCandidate(role, script) {+ var sample = (REC && REC.sample_text) || (REC && REC.samples) || {};+ var isHeading = role === "heading";+ var isLatin = script === "latin";+ var keys = isHeading+ ? (isLatin ? ["heading_latin", "sample_heading_latin", "title_latin", "title_en"] : ["heading_cjk", "sample_heading", "sample_heading_cjk", "title_zh", "title"])+ : (isLatin ? ["body_latin", "sample_body_latin", "summary_latin", "summary_en"] : ["body_cjk", "sample_body", "sample_body_cjk", "summary_zh", "summary"]);+ for (var i = 0; i < keys.length; i += 1) {+ if (sample[keys[i]]) return sample[keys[i]];+ if (REC && REC[keys[i]]) {+ if (typeof REC[keys[i]] === "object" && REC[keys[i]].value) return REC[keys[i]].value;+ if (typeof REC[keys[i]] === "string") return REC[keys[i]];+ }+ }+ return "";+ }++ function sampleText(role, script, explicit) {+ if (explicit) return explicit;+ var fromRec = sampleCandidate(role, script);+ if (fromRec) return fromRec;+ if (role === "heading") return t(script === "latin" ? "sample_heading_latin" : "sample_heading_cjk");+ return t(script === "latin" ? "sample_body_latin" : "sample_body_cjk");+ }++ function fontSample(box, slot, css, role) {var line = el("div", "font-sample-line");- var cjk = el("span", "fs-cjk", slot.sample_cjk || t("sample_cjk"));- var lat = el("span", "fs-latin", slot.sample_latin || t("sample_latin"));+ var cjk = el("span", "fs-cjk", sampleText(role, "cjk", slot.sample_cjk));+ var lat = el("span", "fs-latin", sampleText(role, "latin", slot.sample_latin));var cjkStack = previewFontStack(slot.cjk, css);var latinStack = previewFontStack(slot.latin, css);if (cjkStack) cjk.style.fontFamily = cjkStack;@@ -914,8 +953,8 @@if (c.body_size) meta += " · " + t("font_body_size") + ":" + c.body_size + "px";top.appendChild(el("span", "font-card-meta", meta));card.appendChild(top);- var hbox = el("div", "font-sample-heading-box"); fontSample(hbox, head, head.css); card.appendChild(hbox);- var bbox = el("div", "font-sample-body-box"); fontSample(bbox, body, body.css); card.appendChild(bbox);+ var hbox = el("div", "font-sample-heading-box"); fontSample(hbox, head, head.css, "heading"); card.appendChild(hbox);+ var bbox = el("div", "font-sample-body-box"); fontSample(bbox, body, body.css, "body"); card.appendChild(bbox);if (localized(c, "note")) card.appendChild(el("div", "color-note", localized(c, "note")));card.addEventListener("click", function () { selectFont(idx); });grid.appendChild(card);@@ -1110,16 +1149,16 @@var bodyLatStack = previewFontStack(body.latin, body.css);card.style.background = bg;- titleCjk.textContent = head.sample_cjk || t("sample_cjk");- titleLat.textContent = head.sample_latin || t("sample_latin");+ titleCjk.textContent = sampleText("heading", "cjk", head.sample_cjk);+ titleLat.textContent = sampleText("heading", "latin", head.sample_latin);title.style.color = pri;title.style.fontSize = Math.round(bodyPx * 1.7) + "px";titleCjk.style.fontFamily = headStack || "";titleLat.style.fontFamily = headLatStack || "";// CJK and Latin previewed with their own stacks (mirrors the title// and the per-card font samples) so each script's font is visible.- bodyCjk.textContent = body.sample_cjk || t("sample_cjk");- bodyLat.textContent = body.sample_latin || t("sample_latin");+ bodyCjk.textContent = sampleText("body", "cjk", body.sample_cjk);+ bodyLat.textContent = sampleText("body", "latin", body.sample_latin);bodyWrap.style.color = txt;bodyWrap.style.fontSize = bodyPx + "px";bodyCjk.style.fontFamily = bodyStack || "";diff --git a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json b/skills/ppt-master/scripts/confirm_ui/static/catalogs.jsonindex 6d40d435..6db5eb77 100644--- a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json+++ b/skills/ppt-master/scripts/confirm_ui/static/catalogs.json@@ -4,7 +4,7 @@{"id": "ppt169","label": "PPT 16:9",- "label_zh": "宽屏演示 16:9",+ "label_zh": "PPT 16:9","label_en": "PPT 16:9","dim": "1280×720","viewbox": "0 0 1280 720",@@ -14,7 +14,7 @@{"id": "ppt43","label": "PPT 4:3",- "label_zh": "传统演示 4:3",+ "label_zh": "PPT 4:3","label_en": "PPT 4:3","dim": "1024×768","viewbox": "0 0 1024 768",@@ -23,9 +23,9 @@},{"id": "wechat",- "label": "WeChat Article Header",- "label_zh": "微信公众号头图",- "label_en": "WeChat Article Header",+ "label": "公众号头图 2.35:1",+ "label_zh": "公众号头图 2.35:1",+ "label_en": "WeChat Header 2.35:1","dim": "900×383","viewbox": "0 0 900 383","use_zh": "微信公众号文章封面",@@ -33,9 +33,9 @@},{"id": "xiaohongshu",- "label": "Xiaohongshu (RED)",- "label_zh": "小红书图文",- "label_en": "Xiaohongshu (RED)",+ "label": "小红书 3:4",+ "label_zh": "小红书 3:4",+ "label_en": "RED 3:4","dim": "1242×1660","viewbox": "0 0 1242 1660","use_zh": "知识分享 / 种草封面",@@ -43,9 +43,9 @@},{"id": "moments",- "label": "WeChat Moments / IG",- "label_zh": "社交方图",- "label_en": "WeChat Moments / IG",+ "label": "社交方图 1:1",+ "label_zh": "社交方图 1:1",+ "label_en": "Social Square 1:1","dim": "1080×1080","viewbox": "0 0 1080 1080","use_zh": "社交媒体方图",@@ -53,9 +53,9 @@},{"id": "story",- "label": "Story / TikTok",- "label_zh": "竖屏短视频",- "label_en": "Story / TikTok",+ "label": "竖屏 9:16",+ "label_zh": "竖屏 9:16",+ "label_en": "Vertical 9:16","dim": "1080×1920","viewbox": "0 0 1080 1920","use_zh": "短视频 / 竖屏封面",@@ -63,9 +63,9 @@},{"id": "banner",- "label": "Landscape Banner",- "label_zh": "横幅",- "label_en": "Landscape Banner",+ "label": "横幅 16:9",+ "label_zh": "横幅 16:9",+ "label_en": "Banner 16:9","dim": "1920×1080","viewbox": "0 0 1920 1080","use_zh": "网页横幅 / 大屏",@@ -73,9 +73,9 @@},{"id": "a4",- "label": "A4 Print",- "label_zh": "A4 打印",- "label_en": "A4 Print",+ "label": "A4 1:1.41",+ "label_zh": "A4 1:1.41",+ "label_en": "A4 1:1.41","dim": "1240×1754","viewbox": "0 0 1240 1754","use_zh": "打印 / 文档导出",diff --git a/skills/ppt-master/scripts/docs/confirm_ui.md b/skills/ppt-master/scripts/docs/confirm_ui.mdindex a5c7ee5d..dec4a772 100644--- a/skills/ppt-master/scripts/docs/confirm_ui.md+++ b/skills/ppt-master/scripts/docs/confirm_ui.md@@ -96,8 +96,10 @@ The AI launches Tier 1 (`--daemon --wait`), reads the tier-1 result, **re-derive"selected": 0,"candidates": [{ "name": "...", "note": "...",- "heading": { "cjk": "思源黑体", "latin": "Inter", "css": "'Source Han Sans SC','Inter',sans-serif", "sample_cjk": "标题示例", "sample_latin": "Heading Sample" },- "body": { "cjk": "思源黑体", "latin": "Inter", "css": "...", "sample_cjk": "正文示例", "sample_latin": "Body sample" },+ "sample_heading": "主题标题示例", "sample_heading_latin": "Topic Title",+ "sample_body": "关键信息摘要", "sample_body_latin": "Key message summary",+ "heading": { "cjk": "思源黑体", "latin": "Inter", "css": "'Source Han Sans SC','Inter',sans-serif" },+ "body": { "cjk": "思源黑体", "latin": "Inter", "css": "..." },"body_size": 20 }]},@@ -130,7 +132,7 @@ The AI launches Tier 1 (`--daemon --wait`), reads the tier-1 result, **re-derive- For a custom image plan, the page treats "may include AI" as true only when the recommendation includes `recommend.image_ai_path` or `image_strategy.candidates`; a custom plan without those signals is handled as non-AI and omits AI controls / fields.- **Color candidates carry the user-facing core `palette`**: `background`, `secondary_bg`, `primary`, `accent`, `secondary_accent`, and `body_text`. The page renders labelled swatches and offers per-role override inputs for precise single-role edits, plus a **Custom color card with a free-text box** (parallel to the custom typography box) — the user can describe the palette in words or paste HEX values instead of filling each role; this writes `color: { "name": "custom", "custom": "<text>" }` to `result.json` for the AI to interpret. Legacy `text` is accepted as an alias for `body_text`, but new files should write `body_text`. Strategist derives secondary text, borders, state colors, and visual-style neutral tiers later when writing `design_spec.md` / `spec_lock.md`; those are not user-facing confirmation choices.- **Candidate display text may be bilingual**: color / typography candidates can provide `name_zh` / `name_en` and `note_zh` / `note_en`; the page falls back to legacy `name` / `note`.-- **Typography candidates split CJK and Latin** for both `heading` and `body`; `css` is the fallback preview `font-family` stack. The page previews CJK sample text with `cjk + css` and Latin sample text with `latin + css`, so the two script choices are visible independently. Each candidate should also include `body_size` — the body baseline in **px** (the system's only unit, every canvas). The initial value comes from the candidate's `body_size`, sized for the recommended delivery purpose: `text` ~20 · `balanced` ~24 · `presentation` ~32. On submit the page writes `typography.body_size` as px directly — no pt conversion, no `body_size_pt` provenance. The page exposes `body_size` as an editable numeric field whose hint shows the recommended size — **one fixed px per delivery purpose on PPT (`text` 20 · `balanced` 24 · `presentation` 32), not a range** (non-PPT ≈2.5–3.3% of height in px). The user may still edit it; an out-of-range flag only warns if the value strays far (e.g. a unit mistake). **Inputs are independent — the hint updates with canvas / delivery purpose but never rewrites a value the user can see.** It also offers a custom typography text box so the user is not limited to the proposed candidates.+- **Typography candidates split CJK and Latin** for both `heading` and `body`; `css` is the fallback preview `font-family` stack. The page previews CJK sample text with `cjk + css` and Latin sample text with `latin + css`, so the two script choices are visible independently. Each candidate should include topic-matched `sample_heading`, `sample_heading_latin`, `sample_body`, and `sample_body_latin`; do not reuse unrelated fixed examples such as a digital-transformation headline for a travel, education, product, or brand deck. Each candidate should also include `body_size` — the body baseline in **px** (the system's only unit, every canvas). The initial value comes from the candidate's `body_size`, sized for the recommended delivery purpose: `text` ~20 · `balanced` ~24 · `presentation` ~32. On submit the page writes `typography.body_size` as px directly — no pt conversion, no `body_size_pt` provenance. The page exposes `body_size` as an editable numeric field whose hint shows the recommended size — **one fixed px per delivery purpose on PPT (`text` 20 · `balanced` 24 · `presentation` 32), not a range** (non-PPT ≈2.5–3.3% of height in px). The user may still edit it; an out-of-range flag only warns if the value strays far (e.g. a unit mistake). **Inputs are independent — the hint updates with canvas / delivery purpose but never rewrites a value the user can see.** It also offers a custom typography text box so the user is not limited to the proposed candidates.- **Per-role size override** (parallel to color's per-role HEX override): besides `body_size`, the page exposes **independent** editable inputs for `title` / `subtitle` / `annotation`. Each role is pre-filled **once** with a starting value — the candidate's `typography.sizes[role]` if provided, otherwise a one-time ramp suggestion (`body × ` mid-band ratio) — and then holds its own value. **There is no cross-field cascade**: changing `body_size`, `delivery_purpose`, or canvas updates only the recommended-value hint, never the role values; a re-render preserves exactly what the user sees. The final values are written to `result.json` as `typography.sizes: { "title", "subtitle", "annotation" }` in **px** — every canvas, no pt and no `sizes_pt` provenance. Seeding `sizes` in a candidate is optional — omit it and each role gets its one-time ramp suggestion.- **`delivery_purpose`** (enumerable, PPT only) is the primary driver of the body baseline: `text` (read-close), `balanced` (business, the default), `presentation`. It is surfaced in the **§c key-information area** (beside audience, Tier 1) as a consumption-mode choice; the Tier-2 typography section then reads the confirmed value for the recommended body px — the pick itself does not rewrite the body field (inputs are independent). `recommend.delivery_purpose` pre-selects one (default `balanced`); the user's pick writes back to `result.json.delivery_purpose` as a plain id. Strategist uses it to set the px body baseline — **one fixed px per purpose (`text` 20 · `balanced` 24 · `presentation` 32), not a range** (see [strategist.md §g](../../references/strategist.md)). Non-PPT canvases omit it.- **Combined style preview** — a compact live "overall impression" strip sits just above the color section and is **sticky**: it pins under the topbar so it stays visible while the user scrolls through the color / icon / typography sections, keeping the picking controls and their combined effect on screen together. It applies the currently selected color palette **and** typography (heading sample in `primary` over `background`, body sample in `body_text`, an `accent` bar, a `secondary_bg` chip) and repaints on every color / HEX-override / font / `body_size` change. It does not replace the per-candidate swatches or font samples (those stay for picking); it is deliberately an abstract style chip, **not** a slide-layout preview — page layout preview remains the live-preview server's job (Step 6). No schema field; it derives entirely from the existing color + typography selections.