From f9839f3deee158f639c8ccb1990bd9f35a4a32c0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 30 May 2026 15:18:13 +0800 Subject: [PATCH] =?UTF-8?q?docs(specs):=20=E8=A1=A5=E5=85=85=20gui=5Fapp?= =?UTF-8?q?=20=E6=8B=86=E5=88=86=E5=AE=9E=E9=99=85=E6=88=90=E6=9E=9C(5476?= =?UTF-8?q?=20=E2=86=92=203590,=20-34%)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../specs/2026-05-30-split-gui-app-design.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/docs/superpowers/specs/2026-05-30-split-gui-app-design.md b/docs/superpowers/specs/2026-05-30-split-gui-app-design.md index 913d722..2abf90f 100644 --- a/docs/superpowers/specs/2026-05-30-split-gui-app-design.md +++ b/docs/superpowers/specs/2026-05-30-split-gui-app-design.md @@ -144,3 +144,53 @@ P2 视 P1 完成后情况评估(如果 P1 已经把主文件压到很小,P2 - `douyin/core/*` 几个 1000+ 行业务文件 —— 下一轮独立 spec - 引入新的 GUI 框架或异步模式 - 单元测试覆盖率提升 + +## Outcome(2026-05-30 实施完成) + +**起始**:5476 行 +**结束**:3590 行 +**降幅**:1886 行(-34%) + +### 抽出的模块(13 个新文件,按抽取顺序) + +| # | commit | 模块 | 主文件行数变化 | +|---|---|---|---| +| 1 | `ac46478` | `components/wifi_adb_scan_dialog.py` | 5476 → 5274 (-202) | +| 2 | `6bffcae` | `components/wifi_adb_dialog.py` | 5274 → 4913 (-361) | +| 3 | `5329561` | `components/reservations_view.py` | 4913 → 4656 (-257) | +| 4 | `a07ef00` | `components/high_value_view.py` | 4656 → 4635 (-21) | +| 5 | `8ea6765` | `components/screenshot_action.py` | 4635 → 4463 (-172) | +| 6 | `44b0914` | `components/actions_log_view.py` | 4463 → 4337 (-126) | +| 7 | `4993fad` | `components/wifi_adb_pick_dialog.py` | 4337 → 4268 (-69) | +| 8 | `b338004` | `components/wifi_adb_reconnect.py` | 4268 → 4148 (-120) | +| 9 | `c5df7a0` | `components/ocr_results_view.py` | 4148 → 4117 (-31) | +| 10 | `a7ef92f` | `components/log_pump.py` | 4117 → 4044 (-73) | +| 11 | `59ebe8c` | `components/win_record_view.py` | 4044 → 3891 (-153) | +| 12 | `92d5242` | `components/preview_view.py` | 3891 → 3775 (-116) | +| 13 | `68d1224` | `components/wifi_adb_one_click_scan.py` | 3775 → 3715 (-60) | +| 14 | `64c210d` | `components/run_log_view.py` | 3715 → 3669 (-46) | +| 15 | `97935d9` | `components/text_search.py` | 3669 → 3590 (-79) | + +### 跳过的候选 + +- **P2 配置序列化**(`load_config_to_ui` + `save_ui_to_config`,640 行):依赖 141 个 + tkinter Var,触发停止条件第 2 条「下一个候选段需要传 ≥ 50 个独立依赖」。需要先把 + widgets 聚成一个 `UiState` 抽象,是独立 spec。 +- `get_params`(57 行):同上,依赖 30+ Var。 +- `save_logging_config`(57 行):依赖 18 个 logging 相关 Var,性价比低。 + +### 验证 + +- 每轮抽取后 `pytest` 全绿(1374 passed),包括 `test_gui_app_smoke.py` 启动 smoke。 +- 一轮抽取(preview_view)首次跑 pytest 失败(`_preview_view` 在 `update_image_list` + 之前被引用),定位后调整 `_preview_view` 创建位置即修复,未扩散到其他文件。 +- 未做手工 GUI smoke(建议用户启动一次 GUI 走一遍 WiFi 对话框 / 预约 Tab / 截图按钮 + / 操作日志 / 中奖记录 Tab,确认无回归)。 + +### 停止原因 + +满足停止条件第 3 条:再抽下一个候选段(≤ 57 行)边际收益 < 50 行;且最大候选 +(`load_config_to_ui` / `save_ui_to_config`)触发停止条件第 2 条。 + +继续推进需要先做「Var 聚合」spec(独立项目)。 +