 CodexandClaude Opus 4.7
|
053ffa3469
|
refactor(gui): 拆出 mapping_table.py 5 个 UI 辅助子函数(659→482,-177 行)
mapping_table.create_mapping_tab 是单个 632 行的 tkinter 闭包巨型函数,
把其中相对独立的 5 个块抽到 mapping_table_helpers:
- open_entry_detail_window:弹出条目详情(原代码出现 2 次)
- compute_card_layout:根据画布宽度计算列数和卡片宽度
- set_card_bg:批量切换 widget + 子 widget 背景色
- make_card_event_handlers:单卡片的 click/dbl/enter/leave 处理器工厂
- render_card_labels:渲染单卡片内的 title + meta + body label
逻辑保持等价,只是提取闭包消除重复嵌套。新增 8 个单元测试覆盖
compute_card_layout / API 表面,1026 → 1034 用例全过。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-05-22 01:51:52 +08:00 |
|
 CodexandClaude Opus 4.7
|
a6bbdcc400
|
拆分 web_gui (2251 → 5 子模块 + 2148 行原文件保留 ProcRunner/Handler/main)
把 gui/web_gui.py 中 11 个独立 helper 拆出到 gui/web_gui_pkg/ 子包,
ProcRunner 巨型类(1514 行 / 25 实例方法 / 390 处 self)+ Handler 类
(588 行)+ main 留在原文件。
新建子包:
- logger (29) _wg_log + module logger
- ansi (17) strip_ansi_escape_codes + _ANSI_ESCAPE_RE
- adb_compat (44) 5 个 thin wrapper(forward 到 gui.gui_core_pkg)
- nested (18) get_nested_value(点号路径配置读取)
- stats_helpers (71) _parse_countdown_seconds / _bucket / _inc_map(ProcRunner 3 个 @staticmethod)
策略:8 个顶层 helper 直接搬子包;ProcRunner 内 3 个 @staticmethod 也搬,
类内改成 1 行 @staticmethod forwarding 保持 ProcRunner._parse_countdown_seconds
等调用兼容。原文件 import gui.web_gui_pkg 暴露 11 个公共符号。
外部 import 路径全部不变:
- find_adb_executable / read_config / list_adb_devices 等共 70+ 处外部引用
全部不需修改(CONFIG_PATH 17 处 / read_config 17 处 / find_adb_executable
18 处 / list_adb_devices 21 处 / write_config 10 处 / 其他 1-7 处)
回归:
- 6 个新文件 + 改写后 web_gui.py compileall 通过
- pytest 353 passed / 1 skipped
- _wg_log / strip_ansi_escape_codes / get_nested_value 调用结果正确
- ProcRunner._parse_countdown_seconds('1:30') = 90 (薄壳 forwarding OK)
- ProcRunner._bucket(15, [0,10,50,100]) = '10-50'
- ProcRunner._inc_map(m, 'k', 5) -> {'k': 5}
- ProcRunner() 实例化 OK
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-21 18:57:52 +08:00 |
|
 CodexandClaude Opus 4.7
|
ef6ca4a650
|
拆分 gui_core (1594 → 4 子模块 + 1207 行原文件保留 Runner)
把 gui/gui_core.py 中 12 个独立顶层函数 + RunParams dataclass 拆出到
gui/gui_core_pkg/ 子包;Runner 巨型类(1164 行 / 13 实例方法 / 用 self
状态)原文件保留,仅做 import re-export。
新建子包:
- adb (79) find_adb_executable / list_adb_devices / resolve_adb_device
- wifi_adb (323) 7 个 WiFi-ADB 函数
- config (46) CONFIG_PATH / read_config / write_config
- run_params (45) RunParams dataclass
策略:Runner 类内部用了 find_adb_executable 等顶层函数,所以原文件
``gui/gui_core.py`` 通过 ``from gui.gui_core_pkg import *`` re-export
14 个公共符号供 Runner 内部和外部代码继续使用。
外部 import 路径全部不变:
``from gui.gui_core import find_adb_executable / RunParams / Runner`` 等
所有 14 个公共符号都保留。
- find_adb_executable 20 处外部引用 / read_config 17 处 / list_adb_devices
16 处 / 其他 1-7 处,全部不需修改
回归:
- 5 个新文件 + 改写后 gui_core.py compileall 通过
- pytest 353 passed / 1 skipped
- find_adb_executable() 调用正常返回 adb.EXE 绝对路径
- read_config() 读到 126 个 config keys
- RunParams.is_dataclass = True,28 个字段
- Runner 类正确暴露
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-21 18:49:05 +08:00 |
|
 CodexandClaude Opus 4.7
|
0d01dabb69
|
P2 §5.3: 23 处 importlib.import_module → 静态 from import
把剩余 5 个文件里所有动态导入 douyin_screenshot_manager 的 importlib 调用
替换为顶部静态 from import 模式:
- douyin/detection/douyin_pixel.py 7 处
- douyin/detection/douyin_detection.py 8 处
- douyin/fudai/douyin_fudai_finder.py 4 处
- douyin/fudai/core/fudai_attend.py 2 处
- gui/gui_app.py 2 处
douyin_screenshot_manager 只引用 douyin.core.path_config,与上述 5 个文件
无循环依赖。bin/run_cli.py 的剩余 1 处 importlib 是有意为之
(绕过 package __init__ 遮蔽),保留。
收益:
- 可读性 + IDE 跳转/类型提示
- 每次调用省去 ~100µs 的 import_module 开销(detection 模块在热路径上调用密集)
- 死代码减少 ~92 行(5 个文件合计 -115 / +23)
回归:140 .py 编译通过;importlib 残留只剩 bin/run_cli 故意 1 处;
5 个模块导入 + 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 12:06:23 +08:00 |
|
 CodexandClaude Opus 4.7
|
d5c9936c88
|
gui_app + base_interface: 内部错误 print → logger
gui/gui_app.py(8 处 sys.stderr print → _LOGGER):
- 配置读取失败、日志文件权限/写入错误(warning/error 级)
- pump_logs 内日志插入失败、循环异常、调度下次更新失败(error/warning 级)
- 顶部 import logging + 模块级 _LOGGER
douyin/core/fudai_modules/base_interface.py(2 处 print → _LOGGER):
- BaseFudaiMixin._safe_log 在主类无 _enhanced_log_kv 时的兜底改为 logger.info
- 顶部 import logging + 模块级 _LOGGER
保留为 stdout 的合理场景:
- bin/run_cli.py 的 [TEST]/[YANGHAO-ONLY] CLI 输出
- bin/manage_logs.py 的 CLI 工具输出
- gui/webgui_launcher.py: GUI 同时把 log 输出到控制台
- douyin/logging/internal_loggers.py: logger 模块自身的初始化失败兜底
- douyin/logging/douyin_logging{,_wrapper}.py: 日志系统内部的格式化输出
回归:140 .py 编译通过;test_filter_logging / check_web_gui_config_sync 通过;
gui.gui_app/web_gui/gui_core/base_interface 全部可加载,_LOGGER 名称正确。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-21 11:43:44 +08:00 |
|
 CodexandClaude 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 |
|
 CodexandClaude 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 |
|
 CodexandClaude Opus 4.5
|
b96a67b6b8
|
refactor: web_gui 中 5 个 ADB/config 函数改为薄包装
find_adb_executable / list_adb_devices / resolve_adb_device /
read_config / write_config 在 gui_core.py 中已有完全相同的实现。
web_gui.py 中改为薄包装,所有外部使用保持兼容。
注:get_nested_value 是 web_gui 独有,保留。
文件行数:gui/web_gui.py 原 2253 行减至 2210 行(约减 43 行)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-05-21 10:12:38 +08:00 |
|
 CodexandClaude 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 |
|
zzz
|
2e811e71b3
|
Merge branch 'main' into claude/wonderful-brattain-d1cfe0
|
2026-05-21 09:58:24 +08:00 |
|
 CodexandClaude Opus 4.5
|
ba4c131b2d
|
refactor: 简化 gui_app.format_gui_log_line 为薄包装
原本 64 行的 fallback 实现实际上是死代码——
gui.components.log_viewer.format_gui_log_line 一直存在,
import 失败几乎不可能发生。
简化为薄包装函数,import 失败时返回原字符串。
文件行数:5857 -> 5804(减 53 行)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-05-21 09:42:27 +08:00 |
|
 CodexandClaude 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 |
|
 CodexandClaude Opus 4.7
|
a876d9ebb0
|
gui/web_gui: 内部错误 print → _wg_log,保留启动横幅
- 新增模块级 _wg_log(msg, level):与 yanghao/screenshot 同模式
- 内部错误(日志写权限/失败、静态文件、logs search/get_logs_since)
6 处 print → _wg_log,分级 WARNING/ERROR
- main() 内的 7 处 print 保留为 stdout:启动端口/URL/中断退出/帮助提示
属于交互/CLI 输出而非日志事件,走 stdout 更直观
回归:149 .py 编译通过;test_filter_logging / check_web_gui_config_sync 通过。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-05-21 09:38:47 +08:00 |
|
Codex
|
f16eadbd75
|
精修 WebUI 第十八轮:后端 /api/version + 预约卡 hover accent
- 后端 gui/web_gui.py 新增 GET /api/version:返回 {name, version, build},前端 footer 自动从 cache-bust fallback 切换为真实版本号
- 预约卡 .reservationItem hover 时左侧浮现 2px primary accent 条;isImminent / isDue 状态下不显示(避免与 warning/danger 边框冲突)
- 高价值直播间共用 reservationItem 视觉,自动获得相同 hover accent
- cache-bust v20 → v21
|
2026-05-21 09:29:38 +08:00 |
|
 CodexandClaude 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 |
|
 CodexandClaude Opus 4.5
|
84e8d0c46d
|
fix: Web GUI 安全加固
1. PID 操作添加专用锁保护,防止 force_stop 并发问题
2. POST 接口添加 CSRF token 验证
3. 新增 /api/csrf-token 接口供前端获取 token
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-05-20 22:39:47 +08:00 |
|
Codex
|
caa24ea8ca
|
保持Web端和桌面端参数同步
|
2026-05-20 20:32:23 +08:00 |
|
Codex
|
13b1f2150c
|
Fix launcher paths and remove local hardcoding
|
2026-05-20 19:18:34 +08:00 |
|
Codex
|
e7a7d3f888
|
Fix device selection and adb command safety
|
2026-05-20 18:43:58 +08:00 |
|
Your Name
|
89128deb0f
|
Complete missing Web GUI controls
|
2026-05-20 17:54:40 +08:00 |
|
Your Name
|
7eb72bd00e
|
Update config, web GUI, and add debug features
|
2026-05-20 08:12:06 +08:00 |
|
Your Name
|
6933c0b4fe
|
优化:调整参与按钮区域坐标,修正按钮覆盖范围
|
2026-01-25 20:50:16 +08:00 |
|
Your Name
|
272dcab91d
|
优化:调整参与按钮区域坐标,增强对部分机型底部按钮的覆盖;更新调试截图逻辑以使用新坐标
|
2026-01-25 16:58:15 +08:00 |
|
Your Name
|
d057c1d84e
|
优化:调整WiFi ADB连接逻辑,支持ip:port格式;改进USB设备选择逻辑,增强连接稳定性
|
2026-01-25 15:33:32 +08:00 |
|
Your Name
|
4903e50ff2
|
优化:调整代码格式,增强可读性
|
2026-01-23 15:29:09 +08:00 |
|
Your Name
|
c79c50ffe4
|
优化:添加购物红包背景红色占比阈值配置,增强红包弹窗检测功能
|
2026-01-18 14:38:38 +08:00 |
|
Your Name
|
96c5cd50ec
|
优化:调整_mapping_tree_columns函数的格式,提升代码可读性
|
2026-01-18 13:42:20 +08:00 |
|
Your Name
|
eb23d2d8e6
|
GUI: 自动调整映射表列宽以适配内容
|
2026-01-17 22:00:14 +08:00 |
|
Your Name
|
272f3ddae0
|
GUI: 修复映射表容器,避免列挤压并修复滚动条问题
|
2026-01-17 21:40:20 +08:00 |
|
Your Name
|
3ce0aa73dd
|
feat: 优化当前直播间标题获取逻辑,提升匹配准确性
|
2026-01-17 19:34:57 +08:00 |
|
Your Name
|
3488624b8f
|
feat: 优化预约逻辑,增强映射表记录功能,提升用户体验
|
2026-01-17 18:46:13 +08:00 |
|
Your Name
|
db75248b98
|
feat: 优化滑动重置回退延迟,从2秒减少到0.1秒;完善预约系统二次回退机制
|
2026-01-16 21:54:09 +08:00 |
|
Your Name
|
54f9b39d2e
|
feat: 优化滑动重置和返回键回退逻辑,完善预约系统二次回退机制
|
2026-01-16 21:53:05 +08:00 |
|
Your Name
|
ca77862a86
|
feat: 添加滑动坐标配置功能,优化滑动操作的灵活性
|
2026-01-16 19:18:37 +08:00 |
|
Your Name
|
7c839c5d39
|
feat: 优化直播间标题识别逻辑,增强缓存管理和错误处理
|
2026-01-16 16:15:40 +08:00 |
|
Your Name
|
3723c39a58
|
feat: 优化福袋详情记录逻辑,提升代码可读性
|
2026-01-16 03:44:53 +08:00 |
|
Your Name
|
df65adfe4e
|
feat: 更新配置文件以启用调试捕获,调整福袋相关坐标,优化预约处理逻辑,增强界面显示信息
|
2026-01-16 03:04:11 +08:00 |
|
Your Name
|
362b7c841c
|
fix: 修复代码格式问题,提升可读性
|
2026-01-16 02:31:34 +08:00 |
|
Your Name
|
0862a92dc5
|
feat: 优化 diagnose_stage_from_current_screen 函数的调用格式,提升代码可读性
|
2026-01-15 23:04:53 +08:00 |
|
Your Name
|
d2c5ca57e8
|
feat: 更新房间状态管理,优化直播间标题记录逻辑,移除过时的房间位置映射文件
|
2026-01-15 23:03:56 +08:00 |
|
Your Name
|
d1f675073f
|
feat: 更新房间位置映射表,修改标题为海宁齐总
|
2026-01-15 16:19:08 +08:00 |
|
Your Name
|
504410f7b9
|
feat: 优化映射表加载与导出功能,确保数据一致性与可视化更新
|
2026-01-15 16:18:10 +08:00 |
|
Your Name
|
2358682216
|
feat: 添加持久化映射加载和状态文件序列化功能,优化 GUI 显示
|
2026-01-15 14:25:54 +08:00 |
|
Your Name
|
a84836a6c7
|
refactor: 优化代码格式,提升可读性
|
2026-01-15 01:12:20 +08:00 |
|
Your Name
|
df96e5fc83
|
feat: 添加确保输入框获得焦点的选项,优化文本粘贴功能
|
2026-01-15 01:10:54 +08:00 |
|
Your Name
|
54f3b35a26
|
Refactor code structure for improved readability and maintainability
|
2026-01-11 23:31:38 +08:00 |
|
Your Name
|
2f01200887
|
feat: 更新高价值房间数据,调整房间信息和时间戳;优化红包弹窗检测函数,增加返回详细信息参数
|
2026-01-09 16:35:23 +08:00 |
|
Your Name
|
0830c08fca
|
feat: 更新高价值房间数据,调整房间信息和检测耗时
|
2026-01-09 15:09:06 +08:00 |
|
Your Name
|
6ecd9fa1ae
|
refactor: 优化代码格式,提升可读性
|
2026-01-08 20:39:04 +08:00 |
|