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(confirm-ui): custom image plan only triggers AI controls when upstream signals AI

hugohe3582f9da1ce7a
diff --git a/skills/ppt-master/scripts/confirm_ui/static/app.js b/skills/ppt-master/scripts/confirm_ui/static/app.js
index 58f9b47b..b6c2157b 100644
--- a/skills/ppt-master/scripts/confirm_ui/static/app.js
+++ b/skills/ppt-master/scripts/confirm_ui/static/app.js
@@ -445,6 +445,19 @@
return spec.candidates || spec.options || [];
}
+ function usesCustomImagePlanValue(value) {
+ var ids = (CAT.image_usage || []).map(function (item) { return item.id; });
+ return value && ids.indexOf(value) === -1;
+ }
+
+ function customImagePlanHasAiSignal() {
+ return imageStrategyCandidates().length > 0 || !!recId("image_ai_path");
+ }
+
+ function needsGeneratedImagesForUsage(value) {
+ return value === "ai" || (usesCustomImagePlanValue(value) && customImagePlanHasAiSignal());
+ }
+
function imageStrategySelectedIndex() {
var spec = imageStrategySpec();
var idx = spec.selected || 0;
@@ -711,11 +724,10 @@
var strategyGrid = el("div", "font-grid");
var strategyCands = imageStrategyCandidates();
function usesCustomImagePlan() {
- var ids = (CAT.image_usage || []).map(function (item) { return item.id; });
- return STATE.image_usage && ids.indexOf(STATE.image_usage) === -1;
+ return usesCustomImagePlanValue(STATE.image_usage);
}
function needsGeneratedImages() {
- return STATE.image_usage === "ai" || usesCustomImagePlan();
+ return needsGeneratedImagesForUsage(STATE.image_usage);
}
function refreshAiControls() {
var needsAiPath = needsGeneratedImages();
@@ -871,8 +883,7 @@
function confirm() {
var btn = document.getElementById("btn-confirm");
var payload = Object.assign({}, STATE);
- var imageUsageIds = (CAT.image_usage || []).map(function (item) { return item.id; });
- var customImagePlan = payload.image_usage && imageUsageIds.indexOf(payload.image_usage) === -1;
+ var customImagePlan = usesCustomImagePlanValue(payload.image_usage);
if (payload.image_usage === "custom" || (customImagePlan && !String(payload.image_usage).trim())) {
document.getElementById("confirm-status").textContent = t("image_usage_custom_required");
var customImageInput = document.querySelector(".image-usage-custom-input");
@@ -880,7 +891,7 @@
return;
}
if (customImagePlan) payload.image_usage = String(payload.image_usage).trim();
- if (payload.image_usage !== "ai" && !customImagePlan) {
+ if (!needsGeneratedImagesForUsage(payload.image_usage)) {
delete payload.image_ai_path;
delete payload.image_strategy;
}
diff --git a/skills/ppt-master/scripts/docs/confirm_ui.md b/skills/ppt-master/scripts/docs/confirm_ui.md
index 3df8d525..0831fc70 100644
--- a/skills/ppt-master/scripts/docs/confirm_ui.md
+++ b/skills/ppt-master/scripts/docs/confirm_ui.md
@@ -103,6 +103,7 @@ Both files live under `<project_path>/confirm_ui/`.
- `recommend.*` names the recommended `id` for each enumerable field (must match a `catalogs.json` id, or be a free string for a recommended custom value). The page badges and pre-selects it. **Guarantee**: if a `recommend.*` is omitted, the page falls back to the first catalog option so every enumerable field always shows one badged recommendation — but the AI should still set them for a meaningful default. Legacy aliases are accepted for old files (`line` → `tabler-outline`, `filled` → `tabler-filled`, `monochrome` → `chunk-filled`, `search` → `web`, `default` → `auto`, `builtin` → `host-native`), but new files should write canonical ids. For `recommend.image_usage`, do not write bare `"custom"`; if several image sources are mixed, write the concrete prose plan directly, such as `"封面用 AI 生成,产品页用用户素材,行业页用网络来源"` / `"AI cover + user product assets + web industry images"`.
- When `recommend.image_usage` is `ai` or a custom plan that includes AI, also set `recommend.image_ai_path` to one of `auto` / `api` / `host-native` / `manual`; the page presents these as explicit choices.
+- 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. 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 preview `font-family` stack. 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.