From 572c2cf6dd94ea2049c8261f08803fb369e61150 Mon Sep 17 00:00:00 2001 From: ila Date: Mon, 22 Jun 2026 09:17:28 +0800 Subject: [PATCH] feat(ai-outfit): drop product_id from prompt UI + default template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Match the doc change (8a4ebe6): remove the 插入货号 button (keep only 插入标题) and drop 货号 {product_id} from DEFAULT_OUTFIT_PROMPT. product_id still drives Excel column B and the output filename, not the AI prompt. Co-Authored-By: Claude Opus 4.8 --- src/app/widgets/ai_outfit_panel.py | 8 ++++---- src/services/config_service.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/widgets/ai_outfit_panel.py b/src/app/widgets/ai_outfit_panel.py index 8c91de1..c08768d 100644 --- a/src/app/widgets/ai_outfit_panel.py +++ b/src/app/widgets/ai_outfit_panel.py @@ -258,10 +258,10 @@ class AiOutfitPanel(QWidget): self._prompt_edit.setFixedHeight(130) pv.addWidget(self._prompt_edit) prow = QHBoxLayout() - for text, ph in (("插入标题", "{title}"), ("插入货号", "{product_id}")): - b = QPushButton(text) - b.clicked.connect(lambda _=False, p=ph: self._prompt_edit.insertPlainText(p)) - prow.addWidget(b) + insert_title_btn = QPushButton("插入标题") + insert_title_btn.clicked.connect( + lambda: self._prompt_edit.insertPlainText("{title}")) + prow.addWidget(insert_title_btn) preview_btn = QPushButton("预览最终提示词") preview_btn.clicked.connect(self._preview_prompt) prow.addWidget(preview_btn) diff --git a/src/services/config_service.py b/src/services/config_service.py index cdd7739..6854a44 100644 --- a/src/services/config_service.py +++ b/src/services/config_service.py @@ -33,8 +33,8 @@ _OUTFIT_PROMPT_FILENAME = "outfit_prompt.txt" # Default outfit prompt (docs/11 §7). Persisted to outfit_prompt.txt on first save. DEFAULT_OUTFIT_PROMPT = ( - "为商品「{title}」(货号 {product_id})生成人物上身实穿效果图:真人模特正面" - "穿着这件衣服,完整保留款式、版型、颜色与印花图案,自然光、纯色棚拍背景," + "为商品「{title}」生成人物上身实穿效果图:真人模特正面穿着这件衣服," + "完整保留款式、版型、颜色与印花图案,自然光、纯色棚拍背景," "电商主图风格,不加文字与促销标签。" )