T-582 延迟导入失败通知弹窗

This commit is contained in:
chengma
2026-07-10 11:30:19 +08:00
parent 5fa3b921bb
commit f8c3597f47
3 changed files with 56 additions and 5 deletions
+10 -2
View File
@@ -3,7 +3,7 @@ id: T-582
title: 修复①导入 Excel 失败通知弹窗偶发只显示一半(延迟一拍弹窗)
phase: 7
deps: []
status: TODO
status: DONE
created: 2026-07-10
---
@@ -55,4 +55,12 @@ created: 2026-07-10
## 执行记录
(做完在这里写:改了什么文件、跑了什么验证命令及结果、遇到的阻塞、关键决策。)
- 2026-07-10:已实现 `_show_error()` 延迟弹出导入失败通知:状态栏仍同步显示错误,`QMessageBox.warning(self, "导入采集", text)` 改为经 `QTimer.singleShot(0, ...)` 下一拍执行,降低刷新/绘制同栈内立即弹模态框导致首帧显示不完整的概率。
- 2026-07-10:未改导入成功路径;成功导入仍只刷新列表、更新 summary、状态栏显示“导入完成...”,不新增成功弹窗。未改 `_show_account_guide()`、删除批次确认框、HiDPI 全局设置、导入解析入库逻辑。
- 2026-07-10:补 `tests/test_gui.py`:成功导入断言不会调用 `QTimer.singleShot` 和弹窗;导入异常时断言 `QTimer.singleShot(0, callback)` 被调用、回调执行前不直接弹窗、run log/脱敏错误/弹窗标题正文不回归。
- 当前工作区验证通过:
- `py -3.10 -m unittest tests.test_gui.GuiTests.test_collect_tab_import_button_imports_excel_and_refreshes_tasks tests.test_gui.GuiTests.test_collect_tab_import_error_dialog_is_delayed_one_event_loop tests.test_gui.GuiTests.test_collect_tab_import_excel_writes_diagnostic_run_log`
- `python -m ruff check app tests main.py`
- `py -3.10 -m compileall app main.py`
- `git diff --check`(仅输出当前工作区既有 CRLF 提示,无空白错误)
- 当前工作区直接运行 `py -3.10 -m unittest tests.test_gui` 失败 2 项,原因是本任务开始前已有未提交改动把默认封面提示词从 `papa1` 改成「默认」,导致两个旧断言仍期望 `papa1`;该提示词改名不属于 T-582,本次未处理、未提交。提交后需用干净 worktree 验证本次提交本身。