docs(ai-outfit): empty-tasks prompt + keep preview on generate (§10.4 / §19.10)

After a whole sheet is 完成, clicking 开始生成 silently shows '0 待处理 /
完成 0' and also re-empties the preview sample dropdown. Document two fixes:
(1) a clear 'no pending rows' message (N done skipped / M failed retryable /
clear E column to redo), (2) _on_tasks_loaded must not reset the preview combo
(read_all_rows owns it). Add §10.4 + §19.10.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 15:14:57 +08:00
co-authored by Claude Opus 4.8
parent 1c9ee36488
commit 2643b19686
2 changed files with 22 additions and 0 deletions
+10
View File
@@ -1124,3 +1124,13 @@
- [x] `services/excel_service.py`:新增 `read_all_rows(excel)`,返回每一有效数据行(标题/货号/衣服图齐全)的 `OutfitTask`,**忽略 E 列状态**
- [x] `ai_outfit_panel._reload_sample_rows()` 改调 `read_all_rows`(预览专用);生成仍走 `load_outfit_tasks`,`_on_tasks_loaded` 仍用实际任务
- [x] 单测 `tests/test_excel_service.py`:`read_all_rows` 含「完成」「失败」行也返回、空字段行跳过(8 用例);离屏验证全表完成的 Excel 预览下拉有样本行;全套 12 文件绿
### 19.10 无待处理行提示 + 生成不清空预览样本 — docs/11 §10.4
前置阅读:`docs/11-ai-outfit.md`(§10.4、§10.3)
背景:整表都「完成」后点「开始生成」,当前只显示「已加载 0 行待处理任务 / 完成 0,失败 0」,看不懂;且 `_on_tasks_loaded([])` 会把预览样本下拉清空(破坏 §10.3)。
- [ ] 改进 1:检测 0 行待处理时弹明确提示「该表没有待处理的行:已完成 N 行会跳过;失败 M 行可勾『重试失败行』;要重做已完成行请清空对应行状态(E)列」(N/M 由 `read_all_rows` 统计);在 `tasks_loaded` 为空或 `_on_finished(total==0)` 时弹 `QMessageBox.information`
- [ ] 改进 2:`_on_tasks_loaded` 去掉 `_fill_sample_combo(tasks)`,预览样本下拉只由 `read_all_rows`/`_reload_sample_rows` 维护,与运行解耦
- [ ] 离屏验证:全表完成点生成 → 弹"无待处理行"提示、预览下拉仍有样本行;正常有待处理行时不弹该提示