T-571 降低更新前台抢焦点
This commit is contained in:
+9
-2
@@ -3,7 +3,7 @@ id: T-571
|
||||
title: ③更新抢前台降频:每账号只提一次 Chrome 前台 + 拖拽/上传失败安全升级前台恢复
|
||||
phase: 7
|
||||
deps: [T-402, T-562]
|
||||
status: TODO
|
||||
status: DONE
|
||||
created: 2026-07-09
|
||||
---
|
||||
|
||||
@@ -85,4 +85,11 @@ created: 2026-07-09
|
||||
|
||||
## 执行记录
|
||||
|
||||
(做完在这里写:改了什么文件、跑了什么验证命令及结果、遇到的阻塞、关键决策。)
|
||||
- 2026-07-09:完成 T-571。
|
||||
- `app/gui/workers.py`:`ApplyWorker` 增加线程安全的本轮账号前台集合,同一账号本轮首条更新传 `bring_to_front=True`,后续同账号任务传 `False`;分批更新跨批次保持该集合,多账号并行下用锁保护。
|
||||
- `app/editor.py`:`apply_task()` 增加 `bring_to_front` 参数并透传 `open_product()`;后台态封面替换遇到 `UPLOAD_STILL_PROCESSING` / `UPLOAD_TIMEOUT` / `DRAG_NOT_FIRST` / `NEW_IMAGE_NOT_FOUND` 时,只将当前 tab 提前台做一次非破坏性安全恢复,不完整重跑 `replace_cover()`。
|
||||
- `app/editor.py`:`UPLOAD_*` 失败返回新增 `before_srcs` 上传前快照;恢复上传时用 `before_srcs` 识别本次新图,固定恢复等待预算 120 秒;拖拽恢复只基于已有 `new_src` 重读图片列表并重拖。
|
||||
- `tests/test_editor_login.py`:覆盖 `before_srcs` 字段、后台拖拽失败前台重拖、后台上传处理中前台续等、缺少 `before_srcs` 时不猜测恢复且不点击更新。
|
||||
- `tests/test_gui.py`:覆盖同账号跨分批只首条前台、不同账号并行各自首条前台,并更新 fake `apply_task` 签名兼容 `bring_to_front`。
|
||||
- 文档:同步 `docs/04-architecture.md` 与 `docs/routes.md` 的③更新前台策略。
|
||||
- 验证通过:`py -3.10 -m unittest tests.test_editor_login`、`py -3.10 -m unittest tests.test_gui`、`python -m ruff check app tests main.py`、`py -3.10 -m compileall app main.py`、`py -3.10 -m unittest discover -s tests`、`git diff --check`。
|
||||
|
||||
Reference in New Issue
Block a user