docs: align update design with non-blocking two-phase model

Launcher only applies a staged update + launches (no download at startup);
downloading happens in the app's settings dialog. docs/10 §3/§6/§8/§12/§16/§18
rewritten for the two-phase flow (installer.download_and_stage / apply_staged);
docs/07 §4.3/§4.4 cover the gear dot + "检查并更新" button; tasks 17.21.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 12:03:23 +08:00
co-authored by Claude Opus 4.8
parent 5a1a004daf
commit dc2cd123fc
3 changed files with 92 additions and 64 deletions
+21
View File
@@ -967,6 +967,27 @@
- [ ] GUI 实测:测试连接正确反馈三种结果
- [ ] GUI 实测:改完无需重启 launcher,app 内横幅按新配置刷新
### 17.21 更新改为非阻塞:app 内下载 + 启动器只应用
前置阅读:
- `docs/10-lan-update.md`(§3 两阶段架构、§6 时机、§8 流程、§12 体验)
- `docs/07-ui-design.md`(4.3 角标、4.4 设置对话框「检查并更新」)
背景:
- 原启动器在启动时下载更新、阻塞进主界面(57MB 包看着像卡死)。改为「下载在 app 内、切换在启动器」,启动永不阻塞。
任务:
- [x] `services/installer.py`:`download_and_stage()`(app 运行时下载→SHA-256→解压→`staging\app.new`)、`apply_staged()`(启动器秒切 `app/app.old`,含「不比当前新则丢弃」「移动失败回滚」)、`staged_version()`、`is_writable`
- [x] `launcher.py` 瘦身:seed + `apply_staged` + 启动,不联网;`tests/test_launcher.py` 重写
- [x] `main_window`:发现新版点亮 `⚙ 配置` 红点(删除旧阻塞横幅与「打开更新目录」)
- [x] `settings_dialog`:加「检查并更新」→ 下载暂存 → 「下次启动生效」
- [x] `tests/test_installer.py` 11 个单测 + 本地 HTTP server 真实端到端(下载暂存→app 不动→应用切换)
- [x] 文档:`docs/10` §3/§6/§8/§12/§16/§18、`docs/07` §4.3/§4.4 对齐
- [ ] GUI 实测:角标点亮 → 设置里更新 → 重启生效(真机)
## 18. 后续暂缓任务
以下任务第一阶段暂不做,后续需要时再新增设计文档: