feat: default workflow batch filters to latest batch

This commit is contained in:
chengma
2026-07-08 10:30:30 +08:00
parent c64f947f2f
commit 530ef2009f
6 changed files with 108 additions and 12 deletions
+5 -2
View File
@@ -3,7 +3,7 @@ id: T-550
title: ①②③ 批次下拉默认选中最新批次
phase: 7
deps: [T-523, T-206]
status: TODO
status: DONE
created: 2026-07-08
---
@@ -41,4 +41,7 @@ created: 2026-07-08
## 执行记录
(做完在此记录:改了哪些文件、跑的验证命令与结果、决策)
- 2026-07-08:完成 T-550。
- 代码:`app/gui/widgets.py` 新增批次下拉默认索引 helper;①`CollectTab`、②`GenerateTab`、③`ApplyTab` 的 `_populate_batch_filter` 改为“有效已选批次优先;用户手动选过全部批次则保留;无有效已记住选择且存在批次时默认选 index 1 最新批次;无批次回退 index 0”。
- 测试:`tests/test_gui.py` 新增 ①②③ 批次下拉默认最新批次、无批次回退、已记住批次优先、手动全部批次保留的覆盖;导入测试补充断言 ① 导入后仍自动选中新批次;原②③列表筛选测试显式手动选择「全部批次」,保持原测试目标。
- 验证:`py -3.10 -m unittest discover -s tests -p "test_gui.py"` 通过(103 tests);`python -m ruff check app tests main.py` 通过;`py -3.10 -m compileall app main.py` 通过;`git diff --check` 通过;`py -3.10 -m unittest discover -s tests` 通过(253 tests)。