Skip to content

fix: 委托助手: 当点击间隔设置过快时, 右侧选项会只识别到另一个的bug - #2374

Merged
ShadowLemoon merged 1 commit into
OneDragon-Anything:mainfrom
JoshCai233:委托助手
Jun 25, 2026

Hidden character warning

The head ref may contain hidden characters: "\u59d4\u6258\u52a9\u624b"
Merged

fix: 委托助手: 当点击间隔设置过快时, 右侧选项会只识别到另一个的bug#2374
ShadowLemoon merged 1 commit into
OneDragon-Anything:mainfrom
JoshCai233:委托助手

Conversation

@JoshCai233

@JoshCai233 JoshCai233 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

版本发布说明

  • 优化功能
    • 改进对话选项点击的时序控制,引入分层保护与容忍时长机制,提升点击可靠性与交互一致性
    • 优化连续对话选项的点击判断,更准确地选择“点击/跳过”的时机
  • 配置改进
    • 调整最小点击间隔的初始化方式,保持配置更灵活、行为更稳定

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a1cd310b-28db-4254-b889-582c144c4765

📥 Commits

Reviewing files that changed from the base of the PR and between 9940c85 and b6822ed.

📒 Files selected for processing (2)
  • src/zzz_od/application/commission_assistant/commission_assistant_app.py
  • src/zzz_od/application/commission_assistant/commission_assistant_config.py
💤 Files with no reviewable changes (1)
  • src/zzz_od/application/commission_assistant/commission_assistant_config.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/zzz_od/application/commission_assistant/commission_assistant_app.py

📝 Walkthrough

代码变更摘要

将对话选项点击的时长控制从单一常量拆分为两个新常量(保护期与最大容忍时长),并更新 _click_dialog_options 中的点击决策分支,同时移除配置中对最小点击间隔的硬编码初始化。

变更详情

对话选项点击时序控制重构

层级 / 文件 摘要
导入替换、常量拆分与点击逻辑更新
src/zzz_od/application/commission_assistant/commission_assistant_app.pysrc/zzz_od/application/commission_assistant/commission_assistant_config.py
顶部将 from collections import deque 替换为 import time__init__ 中新增 CHOSEN_OPT_HOLD_SEC(右侧选项点击后的保护时间)与 CHOSEN_OPT_MAX_SEC(单按钮最大连续存在容忍时长)替代旧的 chosen_opt_max_sec_click_dialog_options 中提前获取当前时间,新增保护期到期立即点击的提前返回分支,并将遍历选项时的超时阈值改为 CHOSEN_OPT_MAX_SEC + option_click_interval_min;配置初始化中删除 OPTION_CLICK_INTERVAL_MIN 的赋值。

预估代码审查工作量

🎯 2 (Simple) | ⏱️ ~8 minutes

小诗

🐇 两只时钟轻轻转,
保护期里先点按。
超时阈值换新装,
兔耳一抖更果断。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了委托助手在点击间隔过快时右侧选项误识别的问题修复。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/zzz_od/application/commission_assistant/commission_assistant_app.py`:
- Around line 219-231: The protection period logic has a flaw where re-selection
can still occur during the protection period when option_click_interval_min is
less than CHOSEN_OPT_HOLD_SEC, which can cause incorrect option selection in
fast click scenarios. Modify the condition in the loop that checks whether to
re-select an option (around the check for chosen_opt_last_time and
CHOSEN_OPT_MAX_SEC) to also verify that the protection period has fully elapsed
before allowing re-selection. Specifically, add an additional condition to
ensure that the system prioritizes re-clicking without re-selecting while still
within the protection period (when now - chosen_opt_last_time is less than
CHOSEN_OPT_HOLD_SEC).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b3517b38-ef91-4e44-b024-ec5a507e8df0

📥 Commits

Reviewing files that changed from the base of the PR and between edb1e8c and 9940c85.

📒 Files selected for processing (1)
  • src/zzz_od/application/commission_assistant/commission_assistant_app.py

Comment thread src/zzz_od/application/commission_assistant/commission_assistant_app.py Outdated
@ShadowLemoon
ShadowLemoon merged commit 1e33087 into OneDragon-Anything:main Jun 25, 2026
8 checks passed
@JoshCai233
JoshCai233 deleted the 委托助手 branch June 25, 2026 14:17
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants