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

refactor(confirm-ui): make combined style preview a sticky strip above color

hugohe3013ee10c45fa
diff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.js
index 83738eb6..6b8b39b3 100644
--- a/skills/ppt-master/scripts/confirm_ui/static/app.js
+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js
@@ -65,7 +65,7 @@
sample_cjk: "数字化转型战略",
sample_latin: "Digital Transformation",
style_preview_label: "Overall impression (color + typography)",
- style_preview_body: "Background, primary and body-text colors shown together with the chosen heading and body fonts — a rough feel, not a slide layout.",
+ style_preview_body: "· rough feel only, not the actual slide layout",
mode_continuous_desc: "Generate the whole deck in one pass.",
mode_split_desc: "Stop after the spec; resume SVG generation in a fresh window.",
refine_off_desc: "Spec is written in one go; the pipeline auto-proceeds.",
@@ -130,7 +130,7 @@
sample_cjk: "数字化转型战略",
sample_latin: "Digital Transformation",
style_preview_label: "整体形象(配色 + 字体)",
- style_preview_body: "背景色、主色与正文色,搭配所选标题与正文字体的整体感觉——只是大致形象,不代表实际版式。",
+ style_preview_body: "· 仅大致形象,非实际版式",
mode_continuous_desc: "一次性连续生成整份演示文稿。",
mode_split_desc: "写完设计规范后停止,另开窗口继续生成页面。",
refine_off_desc: "设计规范一次写完,流程自动继续。",
@@ -749,8 +749,15 @@
// preview is the live-preview server's job (Step 6).
function renderStylePreview(host) {
var wrap = el("div", "style-preview");
- wrap.appendChild(el("div", "style-preview-label", t("style_preview_label")));
+ var label = el("div", "style-preview-label");
+ label.appendChild(el("span", "spl-title", t("style_preview_label")));
+ // The "rough feel, not a slide layout" caveat sits in the label in the
+ // UI font — never rendered in the candidate's body font, so it cannot
+ // pose as sample content.
+ label.appendChild(el("span", "spl-note", t("style_preview_body")));
+ wrap.appendChild(label);
var card = el("div", "style-preview-card");
+ var textcol = el("div", "sp-textcol");
var title = el("div", "sp-title");
var titleCjk = el("span", "sp-title-cjk");
var titleLat = el("span", "sp-title-lat");
@@ -762,17 +769,18 @@
var bodyLat = el("span", "sp-body-lat");
bodyWrap.appendChild(bodyCjk); bodyWrap.appendChild(bodyLat);
bodyRow.appendChild(accentBar); bodyRow.appendChild(bodyWrap);
+ textcol.appendChild(title); textcol.appendChild(bodyRow);
var chip = el("div", "sp-chip");
var chipDot = el("span", "sp-chip-dot");
var chipLabel = el("span", "sp-chip-label");
chip.appendChild(chipDot); chip.appendChild(chipLabel);
- card.appendChild(title); card.appendChild(bodyRow); card.appendChild(chip);
+ card.appendChild(textcol); card.appendChild(chip);
wrap.appendChild(card);
- // The "rough feel, not a slide layout" caveat is a caption in the UI
- // font — not rendered in the candidate's body font, so it never poses
- // as sample content.
- wrap.appendChild(el("div", "sp-caption", t("style_preview_body")));
host.appendChild(wrap);
+ // Pin the strip just under the sticky topbar so it stays visible while
+ // the user scrolls through the color / icon / typography sections.
+ var topbar = document.getElementById("topbar");
+ if (topbar) wrap.style.top = topbar.offsetHeight + "px";
function paint() {
var pal = (STATE.color && STATE.color.palette) || {};
@@ -926,10 +934,15 @@
renderPages(host);
renderAudience(host);
renderStyle(host);
- renderColor(host);
- renderIcons(host);
- renderTypography(host);
- renderStylePreview(host);
+ // Group the preview with the three sections it reflects so its sticky
+ // scope ends when typography scrolls past — it does not linger over the
+ // image / mode / refine sections below.
+ var styleGroup = el("div", "style-group");
+ renderStylePreview(styleGroup);
+ renderColor(styleGroup);
+ renderIcons(styleGroup);
+ renderTypography(styleGroup);
+ host.appendChild(styleGroup);
renderImages(host);
renderMode(host);
renderRefine(host);
diff --git a/skills/ppt-master/scripts/confirm_ui/static/style.css b/skills/ppt-master/scripts/confirm_ui/static/style.css
index b0b7f12a..b06b7768 100644
--- a/skills/ppt-master/scripts/confirm_ui/static/style.css
+++ b/skills/ppt-master/scripts/confirm_ui/static/style.css
@@ -299,33 +299,59 @@ body {
.cf-title { font-size: 22px; font-weight: 700; color: #067647; }
.cf-hint { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
-/* Combined color + typography "overall impression" preview */
-.style-preview { margin: 4px 0 18px; }
-.style-preview-label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
+/* Combined color + typography "overall impression" preview — sticky strip
+ that rides along the color / icon / typography picking sections. */
+.style-preview {
+ position: sticky;
+ z-index: 5;
+ background: var(--bg);
+ padding: 8px 0;
+ margin-bottom: 16px;
+}
+.style-preview-label {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: baseline;
+ gap: 8px;
+ margin-bottom: 6px;
+}
+.spl-title { font-size: 12.5px; font-weight: 600; color: var(--muted); }
+.spl-note { font-size: 11.5px; color: var(--muted); }
.style-preview-card {
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
- padding: 22px 24px;
+ padding: 14px 18px;
+ display: flex;
+ align-items: center;
+ gap: 16px;
overflow: hidden;
}
+.sp-textcol { flex: 1; min-width: 0; }
.sp-title {
font-weight: 700;
- line-height: 1.3;
- margin-bottom: 12px;
- word-break: break-word;
+ line-height: 1.25;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
.sp-title-lat { margin-left: 10px; opacity: 0.92; }
-.sp-body { display: flex; align-items: stretch; gap: 12px; }
+.sp-body { display: flex; align-items: stretch; gap: 10px; margin-top: 6px; }
.sp-accent-bar { flex: 0 0 4px; border-radius: 2px; }
-.sp-body-wrap { line-height: 1.6; word-break: break-word; }
+.sp-body-wrap {
+ flex: 1;
+ min-width: 0;
+ line-height: 1.5;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
.sp-body-lat { margin-left: 10px; opacity: 0.92; }
-.sp-caption { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.sp-chip {
+ flex: none;
display: inline-flex;
align-items: center;
gap: 8px;
- margin-top: 16px;
padding: 7px 12px;
border-radius: 8px;
border: 1px solid rgba(0, 0, 0, 0.06);
diff --git a/skills/ppt-master/scripts/docs/confirm_ui.md b/skills/ppt-master/scripts/docs/confirm_ui.md
index 32c969f4..77c8528f 100644
--- a/skills/ppt-master/scripts/docs/confirm_ui.md
+++ b/skills/ppt-master/scripts/docs/confirm_ui.md
@@ -107,7 +107,7 @@ Both files live under `<project_path>/confirm_ui/`.
- **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. 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; common values are 18 and 24, but any reasonable integer is valid). The page exposes `body_size` as an editable numeric field, and also offers a custom typography text box so the user is not limited to the proposed candidates.
-- **Combined style preview** — below the typography section the page renders one live "overall impression" block that applies the currently selected color palette **and** typography together (heading sample in `primary` over `background`, body sample in `body_text`, an `accent` bar, a `secondary_bg` chip). It updates 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.
+- **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.
- **Generated image style candidates** live in `image_strategy.candidates` and are shown only when `image_usage` is `ai` or a custom image plan may include generated images. Each candidate records `rendering`, `palette`, and short `visual` / `color` / `mood` lines from Strategist h.5. The chosen value is written to `result.json.image_strategy`; it is omitted when generated images are not part of the plan.
- `recommend.generation_mode` and `refine_spec` mirror the two mandatory notes in SKILL.md Step 4. Confirmed `generation_mode: "split"` / `refine_spec: true` are explicit user choices, equivalent to opting in through chat.
- `lang` is a soft default; an explicit user language choice in the page (persisted to `localStorage`) wins.