修复:提高切换队伍时序与错误提示的可靠性 - #3395
Conversation
|
@coderabbitai full review |
Action performedFull review triggered. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughChanges队伍切换流程增强
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SwitchParty
participant GameUI
participant findTemplateWithRetry
participant Notification
SwitchParty->>GameUI: 定位并点击目标队伍
SwitchParty->>findTemplateWithRetry: 查找确认按钮
findTemplateWithRetry->>GameUI: 捕获区域模板识别
SwitchParty->>findTemplateWithRetry: 查找部署按钮
findTemplateWithRetry->>GameUI: 捕获区域模板识别
SwitchParty->>Notification: 部署成功后发送通知
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
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 `@repo/js/AcceleratedEditionSwitchParty/main.js`:
- Line 153: 将 AcceleratedEditionSwitchParty 中 notification 的 API 调用统一改为
PascalCase:把正常通知的 notification.send 替换为 notification.Send,把错误通知的
notification.error 替换为 notification.Error;检查该文件包含第 108、153、170、177
行在内的所有相关调用,确保消息内容和其余逻辑不变。
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 25b36797-8548-42cc-b76a-94f433d0fdf7
📒 Files selected for processing (3)
repo/js/AcceleratedEditionSwitchParty/main.jsrepo/js/AcceleratedEditionSwitchParty/manifest.jsonrepo/js/AcceleratedEditionSwitchParty/settings.json
|
如果要改造,不建议额外加延迟的方式,而是改成状态机,默认1500ms太长了 |
7d6e382 to
19bdb1c
Compare
|
@MualaniMarine 感谢建议,已按状态驱动的方向重构并更新分支:不再增加 原有行为仍保留:当前位置换队失败时会传送七天神像重试;最终失败会返回主界面并向上抛出。最低版本相应提升至 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
问题背景
原脚本使用固定等待时间串联打开队伍页、OCR 查找、点击确定和部署。设备较慢或界面动画尚未结束时,脚本可能在错误状态截图,进而把“部署失败”误报成“没有找到指定队伍”。
根据 review 完成的重构
sleep和operationDelayMs配置。genshin.switchParty。核心流程会识别当前界面状态、轮询下一状态并使用有限超时,不再依赖一个统一的固定延迟。false和抛出异常两种失败形式;最终失败会返回主界面并继续向上抛出,避免调用方在错误队伍下继续执行。enableDebug设置。1.8;最低 BetterGI 版本更新至0.45.1,该版本开始向 JavaScript 返回明确的换队布尔结果。验证
已完成:
node --check repo/js/AcceleratedEditionSwitchParty/main.jssettings.json和manifest.jsongit diff --check尚未完成游戏内完整实机验证,因此继续保留为 Draft PR。