Skip to content

fix: skip_dialogs 加载帧误点右上角导致推图结算卡死#60

Open
Ranch007 wants to merge 1 commit into
AliceJump:masterfrom
Ranch007:pr/loading-frame
Open

fix: skip_dialogs 加载帧误点右上角导致推图结算卡死#60
Ranch007 wants to merge 1 commit into
AliceJump:masterfrom
Ranch007:pr/loading-frame

Conversation

@Ranch007

@Ranch007 Ranch007 commented Jun 29, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Bug Fixes
    • Improved dialog handling so the app no longer triggers a close/continue action while a loading screen is still visible.
    • Loading states are now recognized more reliably, including empty screens and common loading indicators.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

In BaseGfTask.skip_dialogs, the dialog-skip click is now guarded against loading screens. A new _is_loading_frame(boxes) helper detects loading states via empty OCR, the string "资源加载中", or percentage-like text (\d{1,3}%), and prevents the click from firing during those states.

Changes

Loading Screen Guard in skip_dialogs

Layer / File(s) Summary
_is_loading_frame helper and skip_dialogs guard
src/tasks/BaseGfTask.py
New _is_loading_frame(boxes) method returns True for empty OCR or frames containing "资源加载中" or percentage text. The click_relative call in skip_dialogs is now skipped when this method returns True.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

A loading bar spins, the rabbit waits near,
No clicking on dialogs while progress appears!
_is_loading_frame sniffs the percent in the air,
If 资源加载中 shows — the click isn't there.
Patient paws pause, then proceed with great care. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the core fix: preventing skip_dialogs from misclicking during loading frames and causing hangs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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.

@Ranch007 Ranch007 changed the title fix: skip_dialogs 加载帧误点右上角导致推图结算卡死 #59 fix: skip_dialogs 加载帧误点右上角导致推图结算卡死 Jun 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/tasks/BaseGfTask.py`:
- Around line 114-115: The empty OCR fallback in skip_dialogs() is too
aggressive because it treats a single no-box frame as loading, which blocks the
top-right dismissal path. Update BaseGfTask.skip_dialogs() so that one empty OCR
pass does not immediately return True; instead, only classify loading after
consecutive empty frames or when an explicit loading token is detected. Keep the
change localized to the skip_dialogs logic so callers like
ClearMapTask.skip_dialogs() and DailyTask.skip_dialogs() continue to dismiss
dialogs on transient OCR misses.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e07251ed-b6f5-4198-9b8b-f11fadbc4cef

📥 Commits

Reviewing files that changed from the base of the PR and between 16a7bbf and a624ec4.

📒 Files selected for processing (1)
  • src/tasks/BaseGfTask.py

Comment thread src/tasks/BaseGfTask.py
Comment on lines +114 to +115
if not boxes:
return True

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Don't classify a single empty OCR pass as a loading frame.

skip_dialogs() uses the top-right fallback precisely when OCR found nothing actionable. Returning True on Line 114 turns every OCR miss into "loading", so the new guard at Lines 101-103 just sleeps and retries until timeout instead of dismissing the dialog. That can stall real flows such as ClearMapTask.skip_dialogs(...) and DailyTask.skip_dialogs(...) on transient OCR misses. Please gate empty OCR on consecutive frames or an adjacent explicit loading token instead.

🤖 Prompt for 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.

In `@src/tasks/BaseGfTask.py` around lines 114 - 115, The empty OCR fallback in
skip_dialogs() is too aggressive because it treats a single no-box frame as
loading, which blocks the top-right dismissal path. Update
BaseGfTask.skip_dialogs() so that one empty OCR pass does not immediately return
True; instead, only classify loading after consecutive empty frames or when an
explicit loading token is detected. Keep the change localized to the
skip_dialogs logic so callers like ClearMapTask.skip_dialogs() and
DailyTask.skip_dialogs() continue to dismiss dialogs on transient OCR misses.

@Ranch007

Copy link
Copy Markdown
Author

Closes #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant