Your Name
9744b75878
refactor(gui): 抽 127 个 Var 声明到 components/config_vars 工厂 (1373 → 1110)
2026-05-30 17:14:39 +08:00
Your Name
7a840120b3
refactor(gui): 抽底部操作按钮区到 components/action_buttons (1417 → 1373)
2026-05-30 17:06:36 +08:00
Your Name
e314161b6c
refactor(gui): 抽右侧主 Notebook + 实时工具栏到 components/main_notebook (1444 → 1417)
2026-05-30 17:02:35 +08:00
Your Name
3a7a7a3b75
refactor(gui): 抽 keywords_tab UI 到 components/keywords_tab (1461 → 1444)
2026-05-30 16:58:53 +08:00
Your Name
8575f04ab9
refactor(gui): 抽截图预览 Tab 整段 UI 到 components/preview_tab (1537 → 1461)
2026-05-30 16:54:53 +08:00
Your Name
728ef3cd79
refactor(gui): 5 个简单文本 Tab 用 simple_tabs 模板复用 (1571 → 1537)
2026-05-30 16:49:01 +08:00
Your Name
32e374e2c2
refactor(gui): 抽行为日志工具栏到 components/actions_log_toolbar (1649 → 1571)
2026-05-30 16:45:02 +08:00
Your Name
aa0f4e05f2
refactor(gui): 抽中奖记录 Tab 整段 UI 到 components/win_record_tab (1739 → 1649)
2026-05-30 16:40:49 +08:00
Your Name
5e3015f59b
refactor(gui): 抽日志搜索工具栏到 components/log_search_toolbar (1813 → 1739)
2026-05-30 16:36:43 +08:00
Your Name
b686a4e3d5
refactor(gui): 抽 log_text 颜色配置到 components/log_text_colors (1878 → 1813)
2026-05-30 16:29:27 +08:00
Your Name
29cef2c578
refactor(gui): 抽 realtime_tab UI 创建到 components/realtime_tab (2037 → 1878)
2026-05-30 16:25:51 +08:00
Your Name
e784efd5f8
refactor(gui): 抽 filter_tab UI 创建到 components/filter_tab (2122 → 2037)
2026-05-30 16:18:29 +08:00
Your Name
6c7bbf0945
refactor(gui): 抽 run_tab UI 创建到 components/run_tab (2192 → 2122)
2026-05-30 16:15:24 +08:00
Your Name
fe27063913
refactor(gui): 抽 reservation_tab UI 创建到 components/reservation_tab (2334 → 2192)
2026-05-30 16:11:47 +08:00
Your Name
3f04bb23c2
refactor(gui): 抽 yanghao_tab UI 创建到 components/yanghao_tab (2456 → 2334)
2026-05-30 16:06:40 +08:00
Your Name
bcb0e363d1
refactor(gui): 抽 logging_tab UI 创建到 components/logging_tab (2656 → 2456)
2026-05-30 15:54:46 +08:00
Your Name
b447b6a6a4
refactor(gui): 抽 debug_tab UI 创建到 components/debug_tab (3052 → 2656)
2026-05-30 15:50:58 +08:00
Your Name
6bac014c3d
refactor(gui): 抽 load_config_to_ui + save_ui_to_config 到 components/config_io (3538 → 3052)
2026-05-30 15:41:27 +08:00
Your Name
f6d382b0e7
refactor(gui): 抽 get_params 到 components/run_params_builder (3563 → 3538)
2026-05-30 15:26:17 +08:00
Your Name
2a05be2319
refactor(gui): 抽 save_logging_config 到 components/logging_config_io (3590 → 3563)
2026-05-30 15:22:29 +08:00
Your Name
97935d9c48
refactor(gui): 抽 _generic_search_widget 到 components/text_search (3669 → 3590)
2026-05-30 15:16:42 +08:00
Your Name
64c210dd5a
refactor(gui): 抽 refresh_run_log 到 components/run_log_view (3715 → 3669)
2026-05-30 15:12:38 +08:00
Your Name
68d1224b53
refactor(gui): 抽 _on_scan_one_click + _handle_scan_result 到 components/wifi_adb_one_click_scan (3775 → 3715)
2026-05-30 15:08:35 +08:00
Your Name
92d524297b
refactor(gui): 抽预览 Tab 全部 8 个动作到 components/preview_view (3891 → 3775)
2026-05-30 15:03:45 +08:00
Your Name
59ebe8c1e7
refactor(gui): 抽 win_record Tab 全部 7 个动作到 components/win_record_view (4044 → 3891)
2026-05-30 14:53:11 +08:00
Your Name
a7ef92fc7c
refactor(gui): 抽 pump_logs 到 components/log_pump (4117 → 4044)
2026-05-30 14:37:03 +08:00
Your Name
c5df7a05d2
refactor(gui): 抽 update_ocr_results 到 components/ocr_results_view (4148 → 4117)
2026-05-30 14:30:42 +08:00
Your Name
b3380042b8
refactor(gui): 抽 _try_reconnect_last_wifi 到 components/wifi_adb_reconnect (4268 → 4148)
2026-05-30 14:24:19 +08:00
Your Name
4993fad004
refactor(gui): 抽 _open_scan_pick_dialog 到 components/wifi_adb_pick_dialog (4337 → 4268)
2026-05-30 14:18:19 +08:00
Your Name
44b091466d
refactor(gui): 抽 actions_log 视图相关到 components/actions_log_view (4463 → 4337)
2026-05-30 14:10:30 +08:00
Your Name
8ea676562c
refactor(gui): 抽 do_screenshot + OCR_REGIONS 到 components/screenshot_action (4635 → 4463)
2026-05-30 14:03:31 +08:00
Your Name
a07ef00b5e
refactor(gui): 抽 refresh_high_value_rooms 到 components/high_value_view (4656 → 4635)
2026-05-30 13:56:36 +08:00
Your Name
5329561b3a
refactor(gui): 抽 refresh_reservations 到 components/reservations_view (4913 → 4656)
2026-05-30 13:52:39 +08:00
Your Name
6bffcae2de
refactor(gui): 抽 open_wifi_adb_dialog 到 components/wifi_adb_dialog (5274 → 4913)
2026-05-30 13:48:22 +08:00
Your Name
ac464788e1
refactor(gui): 抽 open_scan_dialog 到 components/wifi_adb_scan_dialog (5476 → 5274)
2026-05-30 13:43:17 +08:00
Codex and Claude Opus 4.7
fe97e82104
fix(gui): 实时查看器/状态 Tab 的耗时解析支持 ms 单位
...
问题:实际 actions.log 写的是 `耗时=10.00ms`(毫秒),但 _parse_minimal
和 parse_action_duration 的正则只匹配 `s`,导致:
- 实时查看弹窗永远显示"暂无动作"
- 实时状态 Tab 同样空白
同时存在的副 bug:兜底正则在整行匹配,前缀里的 `192.168.5.2:5555` /
日志时间戳 `2026-05-21` 都可能被误识别成耗时。
修复:
- 解析窗口限定到 line.find("耗时") 之后的子串 (tail)
- 优先匹配 ms(顺序很重要:\s*s 会先吃掉 "10ms" 的 m)
- s 单位加 (?![a-zA-Z]) 负向后顾,避免匹配 "ms" / "second" 之类
- 同步修复 gui_app.py:3685 的 parse_action_duration(实时状态 Tab)
测试:
- _parse_minimal 加 4 个新测试覆盖 ms / 整数 ms / 优先级 / 前缀干扰
- 全量 1426 passed (+5)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 09:08:58 +08:00
Codex and Claude Opus 4.7
d759921442
refactor(gui): 抽 _open_realtime_viewer_impl 到 components/realtime_viewer (5539 → 5370)
...
gui_app.py 嵌套函数 _open_realtime_viewer_impl 是 170 行的"实时查看"对话框:
弹 Toplevel 显示当前 pic/screenshot.png + 列表展示 actions.log 中含"耗时"的
最近 80 行,每秒刷新。
抽到 gui/components/realtime_viewer.py:
- open_realtime_viewer(root) 主入口
- _tail_read(path, max_bytes) 末尾字节读取
- _parse_minimal(line) 提取 (动作名, 耗时) 二元组
- 全局单例 _active_win 替代原嵌套 def 的属性式 _win
gui_app.py 中嵌套 def 缩成 4 行委托。
新增 13 个单元测试覆盖 _tail_read 4 种情况 + _parse_minimal 8 种格式。
1421 passed (+13)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:47:58 +08:00
Codex and Claude Opus 4.7
fb35670032
refactor(gui): 抽 ThreadSafeLogWriter 到 components/log_writer (5649 → 5537)
...
gui_app.py 的 ThreadSafeLogWriter 类(109 行)是自包含的日志文件写入器:
threading.Lock 保护、按日期分割、配置开关、PermissionError/Exception 兜底。
抽到 gui/components/log_writer.py,原 gui_app 中的 109 行类定义 + 1 行实例化
替换为 3 行导入 + 实例化。read_config 通过 staticmethod _read_config 延迟导入,
避免循环依赖。
新增 15 个单元测试覆盖:
- __init__:默认 log_dir / 配置开关 / dated_logs / 相对路径解析 / 配置异常兜底
- write:正常写 / 禁用跳过 / 空行跳过 / 时间戳前缀 / 已格式化行原样写
- 100 线程 × 10 行的并发安全测试(确认 1000 行无丢失)
- PermissionError / 通用异常下不抛 + warn 一次
1408 passed (+15)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:29:25 +08:00
Codex and Claude Opus 4.7
230c0d4049
refactor(gui): 抽 refresh_stats 字符串格式化到 stats_formatter (6339 → 5634)
...
gui_app.py 的 refresh_stats 闭包是 705 行纯字符串构建:把 runner.get_stats()
的字典格式化成多个分段(基本信息/快速汇总/核心统计/跳过/OCR/详情/福袋查找/
性能/粉丝团/切换/预约/错误/价值/最近福袋/中奖记录)。
抽到 gui/components/stats_formatter.py:
- format_stats(stats: Dict) -> List[str] 主入口
- 14 个 _append_* 子段构建器(每段一个,按需追加)
- _section_lines(title, body) 标题包装
闭包改为 16 行委托:调 format_stats + 写入 ScrolledText。
新增 32 个单元测试覆盖:
- 空 dict / 缺字段时的兜底
- 基本运行状态(uptime / pid / exit_code 各种格式)
- 各分段的"有数据 / 无数据"条件
- 关键率计算(打开成功率/点击率/参与成功率/中奖率/跳过率/错误频率)
- 边界情况(attend_ok > clicks 检测到已参与,结果未开奖警告,wins 截断到 10 条)
1393 passed (+32)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-23 03:23:53 +08:00
Codex and Claude Opus 4.7
7fb0c3849c
P0 死代码清理:删 .backup / 空文件 / GUI 占位桩 / 占位目录 / 失效测试
...
A. 删除 3 个 .backup 文件(约 3.4K 行)
- douyin/detection/douyin_pixel.py.backup
- douyin/stage/douyin_stage_handler.py.backup
- gui/components/log_color_config.py.backup
B. 删除 0 字节文件
- douyin/other/douyin_stuck_guard.py
- docs/功能差异对比.md
- docs/archive/模块化代码对比说明.md
C. 删除 9 个 TODO + pass 占位组件(全仓零外部引用)
- gui/components/{config_manager,image_viewer,stats_display,
reservation_display,high_value_rooms_display,ocr_panel,main_window}.py
- gui/web_components/{proc_runner,http_handler}.py
D. 删除占位目录与失效测试入口
- douyin/detection/core/ 仅 re-export 占位
- douyin/fudai/finder/ 仅 re-export 占位
- tests/run_test.py 指向已删的 deleted_tests_backup/
附加:tools/diagnostics/check_web_gui_config_sync.py --help 字符串里
tools/web_gui_config_manifest.json 旧路径修正为 tools/dev/...
回归:154 → 141 个 .py,全量 compileall 通过;AST 扫描 0 处 import 残留;
gui.gui_app/web_gui/gui_core 仍可加载;fudai_analyse / should_skip_fudai_by_config
业务函数链路正常;test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 10:36:59 +08:00
zzz
6ef04c1f37
Merge branch 'main' into claude/wonderful-brattain-d1cfe0
2026-05-21 10:24:10 +08:00
Codex and Claude Opus 4.7
71f3653354
补回上次合并丢失的关键路径修复 + .gitignore 补强 + 依赖版本对齐
...
上次冲突解决时跳过了 982f57e (P0 清理) 和 b6ae970 (路径修复) 两个 commit,
本提交补回其中影响运行时正确性和文档一致性的 7 处。
E. 路径错位修复
- douyin/core/douyin_fudai.py: _reservations_state_path 与 room_pos_map
状态目录改为优先调用 path_config.get_reservations_path()
- douyin/core/path_config.py: get_reservations_path 注释明确"实际位置 + 写入方"
- gui/components/mapping_utils.py: 删除错误兜底 douyin/state/reservations.json
- gui/components/mapping_table.py: 同步删除 douyin/state/room_pos_map.json 错误兜底
- gui/web_gui.py: get_reservations() 内的兜底由 douyin/state/ 修正为 douyin/core/state/
- bin/run_cli.py: 移除对已删空文件 douyin_reservation_ops.py 的 shim 加载
- douyin/reservation/douyin_reservation_ops.py: 删除 0 字节空文件
F. .gitignore 补强
- 新增 *.bak_* 拦截带日期后缀的备份命名(修复 *.bak 命中失败的场景)
G. 依赖版本对齐
- requirements-minimal.txt: paddleocr/paddlepaddle 改为 >=3.0.0,与 requirements.txt 一致
- README.md: 安装指引中 paddlepaddle==2.5.2 改为 >=3.0.0
回归:全量 .py compileall 通过;7 项断言(path_config 路径、douyin_fudai 切换、
3 处兜底已清、shim 已移除、空文件已删、.gitignore 补强、版本对齐)全部 PASS;
test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 10:18:17 +08:00
Codex and Claude Opus 4.5
7d63a36125
chore: 删除重复的 log_color_config_fixed.py
...
log_color_config.py (540行) 与 log_color_config_fixed.py (198行) 的
get_operation_type / get_color_config / apply_operation_color 行为完全一致。
保留前者(更完整),删除后者,简化 actions_log_viewer.py 的双 try import。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-05-21 10:12:38 +08:00
Codex and Claude Opus 4.7
96f8600d42
小批量收尾:删除零引用 scrcpy_screenshot + douyin_fudai/log_viewer print→logger
...
- 删除 operations/scrcpy_screenshot.py(100 行,仅自身定义自身使用,全仓零外部引用)
- douyin/core/douyin_fudai.py:3 处兜底 print → logging.info/warning(_log_kv 失败时的兜底路径)
- gui/components/log_viewer.py:2 处错误 print → _LOGVIEW_LOGGER.exception(日志线程异常 / 刷新显示异常)
回归:149→148 .py,全量编译通过;test_filter_logging / check_web_gui_config_sync 通过;
fudai_analyse 类正常导出,log_viewer 模块加载 OK。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-21 09:40:18 +08:00
Codex and Claude Opus 4.5
8fe7ff0585
refactor: 根目录核心模块迁移到 douyin/core/ 和 douyin/logging/
...
将 4 个根目录核心模块迁移到合理位置:
- path_config.py -> douyin/core/path_config.py
- version.py -> douyin/core/version.py
- Underlying_Operations.py -> douyin/core/underlying_operations.py
- unified_logger.py -> douyin/logging/unified_logger.py
配套更新所有 import:
- path_config: 41 处 import 改为 douyin.core.path_config
- version: 4 处改为 douyin.core.version
- unified_logger: 5 处改为 douyin.logging.unified_logger
- Underlying_Operations: 14 处改为 douyin.core.underlying_operations
修复 path_config.PROJECT_ROOT 计算(向上 2 级而非当前目录)。
验证:python -m compileall 全项目通过。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-05-21 00:23:14 +08:00
Your Name
4903e50ff2
优化:调整代码格式,增强可读性
2026-01-23 15:29:09 +08:00
Your Name
0b5f150691
Refactor and clean up code across multiple scripts
...
- Removed trailing whitespace and ensured files end with a single newline in cleanup_unused_files.py.
- Added fix_trailing_whitespace.py to batch remove trailing whitespace from Python files.
- Updated install_dependencies.py to improve dependency installation prompts.
- Cleaned up pick_coords.py by removing unnecessary whitespace and improving code readability.
- Enhanced region_selector.py by disabling specific pylint checks for better compatibility with third-party libraries.
- Improved WPS流程图生成工具.py by cleaning up whitespace and enhancing readability.
- Updated __init__.py in typings to remove unnecessary lines.
- Modified app.js to adjust default configuration values and clean up unused code.
2026-01-02 23:57:03 +08:00
Your Name
9131c48633
Refactor screenshot service for improved performance and error handling; add simplified version to avoid linter issues. Update tests and documentation accordingly.
2026-01-02 02:17:33 +08:00
Your Name
a0aad21835
feat: Optimize ADB exec-out and OCR performance
...
- Introduced performance enhancements for ADB exec-out, reducing execution time by 10-20% through the use of Popen with streaming reads, increased buffer sizes, and removal of unnecessary fsync calls.
- Implemented optimizations in OCR processing, cutting recognition time by 50% by refining button recognition logic and improving image loading and preprocessing methods.
- Added detailed performance diagnostics and configuration options to facilitate further optimizations.
- Created new documentation files outlining the performance improvements and recommendations for future enhancements.
2026-01-02 02:06:01 +08:00
Your Name
c7b5d6be0f
后台保存debug图像
2026-01-01 13:25:50 +08:00