feat(ai-outfit): AI 穿搭 UI tab (§19.3) + config plumbing (§19.4)
- main_window: wrap workflow in a QStackedWidget (page 0 = print, page 1 = AI outfit); enable tab 2「AI 穿搭」, switch pages on tab change. - app/widgets/ai_outfit_panel.py: three-column page per docs/11 §10 — left settings (Excel/output/model/prompt editor+save+insert+preview dialog/batch options), center (recent-results thumbnails + detail table), right (progress/stats/start/stop/export failures/log). - Threading: QThread + _OutfitWorker(QObject) wraps OutfitBatchRunner; queued signals refresh UI, each row written back to Excel on the worker thread; finish summary + failure-list CSV export. - config_service: load_ai_models()/load_outfit_prompt()/save_outfit_prompt() + outfit_* keys in app_config; panel persists via config_changed signal. - tests/test_config_service.py: 8 cases for the new helpers. Full suite (12 files) green on Python 3.7; offscreen MainWindow smoke test passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1063,16 +1063,18 @@
|
||||
|
||||
前置阅读:`docs/11-ai-outfit.md`(§10)、`docs/07-ui-design.md`(§4.2)、`docs/ui-ai-outfit.png`
|
||||
|
||||
- [ ] 页签栏接 `QStackedWidget`(「1 添加印花」=现有工作区,「2 AI 穿搭」=新面板),启用当前禁用的页签
|
||||
- [ ] `app/widgets/ai_outfit_panel.py`:左设置(Excel/输出/模型/话术编辑+保存+插入占位符+预览弹窗/生成设置 3 列)、中(最近结果缩略图条 + 处理明细表)、右(进度环+统计+开始/停止+导出失败清单+实时日志)
|
||||
- [ ] 接线后台线程、日志、进度、结束摘要、失败清单导出
|
||||
- [x] 页签栏接 `QStackedWidget`(页 0=添加印花工作区+队列,页 1=AI 穿搭面板);启用页签 1(导出上架仍禁用)
|
||||
- [x] `app/widgets/ai_outfit_panel.py`:左设置(Excel/输出/模型/话术编辑+保存+插入占位符+预览弹窗/生成设置)、中(最近结果缩略图 + 处理明细表)、右(进度+统计+开始/停止+导出失败清单+打开输出目录+实时日志)
|
||||
- [x] 接线后台线程:`QThread` + `_OutfitWorker(QObject)` 包 `OutfitBatchRunner`,signal 回主线程刷日志/进度/明细/缩略图;每行写回 Excel;结束摘要弹窗;失败清单导出 CSV
|
||||
- [ ] GUI 实测(真机):选 Excel/模型跑通、停止生效、失败清单正确(离屏冒烟已过,待真机)
|
||||
|
||||
### 19.4 配置与提示词 — docs/11 §14 阶段 4
|
||||
|
||||
前置阅读:`docs/11-ai-outfit.md`(§7、§11)
|
||||
|
||||
- [ ] `~/.cmbot/config/ai_models.json`(密钥明文、**不入库**)、`outfit_prompt.txt`、并入 `app_config.json`(上次 Excel/输出路径、批量设置),统一经 `config_service`
|
||||
- [ ] `requirements.txt` 增 `requests>=2.31,<3`、`openpyxl>=3.1,<4`、`urllib3<2`;`docs/03` 增列依赖
|
||||
- [x] `config_service` 增 `load_ai_models()` / `load_outfit_prompt()` / `save_outfit_prompt()`;`ai_models.json`(密钥明文、**不入库**、BOM 容错)、`outfit_prompt.txt`(无 BOM)、`app_config.json` 并入 `outfit_*`(上次 Excel/输出/模型 + 批量设置),UI 经 `config_changed` 信号回主窗口集中存;`tests/test_config_service.py` 8 用例
|
||||
- [x] `requirements.txt` 已锁 `requests 2.31`/`openpyxl 3.1.3`/`urllib3 1.26`;`docs/03` 增列依赖
|
||||
- [ ] 可选:应用内 AI 模型编辑界面(当前由管理员预置 `ai_models.json`,暂不做)
|
||||
|
||||
### 19.5 真机联调 — docs/11 §14 阶段 5
|
||||
|
||||
|
||||
Reference in New Issue
Block a user