docs(ai-outfit): spec prompt templates (multi, named) — §7.2 / §19.8
Upgrade the single prompt to multiple named templates (switch/new/save-as/ rename/delete/save, remember last). Decisions: all-custom (seed one 默认), dirty-check confirm on switch, include rename. Storage: outfit_prompts.json + outfit_prompt_name in app_config, migrate the old outfit_prompt.txt. Add §7.2 design + §19.8 task (not yet implemented). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1102,3 +1102,15 @@
|
||||
- [x] 分辨率文案带 `ai_image_service.resolution_timeout` 的超时秒数(512/1K/2K/4K→180/240/360/600)+「下次生效」
|
||||
- [x] AI 模型文案带该模型 `api_type` + 计费/效果可能不同 +「下次生效」
|
||||
- [x] 离屏验证:程序化赋值(`apply_config`/`_fill_sample_combo`)不弹(0 次);用户 1K→4K 弹 1 次(含 600s)、同项重选不弹、换模型弹(含 api_type)
|
||||
|
||||
### 19.8 话术模板(多套命名话术)— docs/11 §7.2
|
||||
|
||||
前置阅读:`docs/11-ai-outfit.md`(§7.2、§7.1)、`docs/07-ui-design.md`、`src/app/widgets/template_panel.py`(范式参考)
|
||||
|
||||
需求:把单一话术升级为多套命名话术(下拉切换 / 新建 / 另存为 / 重命名 / 删除 / 保存,记住上次)。决策:**全部自定义**(不分内置,播种一套「默认」);**切换前脏数据弹窗**提醒是否保存;**含重命名**。
|
||||
|
||||
- [ ] `config_service`:`outfit_prompts.json` 读写 `load_outfit_prompts()` / `save_outfit_prompts(list)`(utf-8-sig 读 / 无 BOM 写 / 损坏回退「默认」;始终 ≥1 套);`app_config` 加 `outfit_prompt_name`(当前选中名);首次迁移旧 `outfit_prompt.txt` → 一套「默认」,否则 `DEFAULT_OUTFIT_PROMPT`
|
||||
- [ ] `ai_outfit_panel.py`:「通用话术」组加 模板下拉 + 新建 / 另存为 / 重命名 / 删除(保留 插入标题 / 保存);切换载入文本 + 刷新预览;记住上次所选并启动恢复(经 `config_changed` 回主窗口集中存)
|
||||
- [ ] 脏数据保护:编辑框与当前套已存文本不同则在切换/重命名/删除/新建/另存为前弹「保存 / 不保存 / 取消」(取消还原下拉);名字唯一;删后选邻近、不可删到 0
|
||||
- [ ] 「开始生成」前把当前编辑存回所选套;生成/预览仍走 `render_prompt`(§7.1 尾巴不变)
|
||||
- [ ] 单测 `tests/test_config_service.py`:prompts 读写、迁移(有/无旧 txt)、损坏回退、≥1 套;离屏验证切换/脏弹窗/重命名/删除
|
||||
|
||||
Reference in New Issue
Block a user