Skip to content

Add app_idle: wait until the app's busy signal settles before acting#440

Merged
JE-Chen merged 1 commit into
devfrom
feat/app-idle-batch
Jun 25, 2026
Merged

Add app_idle: wait until the app's busy signal settles before acting#440
JE-Chen merged 1 commit into
devfrom
feat/app-idle-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Fifth feature of the ROUND-15 input-fidelity lane. A click fired while the app is still churning (busy cursor up, dialog mid-paint, long handler running) is dropped or mis-targeted. smart_waits watches pixels settle; this watches the app's busy signal settle — cheaper, and survives animated-but-idle UI.

  • Headless core utils/app_idle/: wait_until_app_idle (poll an injectable busy_probe until the app reads idle for quiet_samples polls in a row, or timeout; injectable clock/sleep), idle_point (pure analyser over a recorded busy/idle trace). Reuses settle_detector.SettleTracker — feeds 1.0 when busy / 0.0 when idle, a busy spike resets the quiet run. Default probe = Windows busy/app-starting cursor (GetCursorInfo vs IDC_WAIT/IDC_APPSTARTING).
  • 5 layers wired: facade __all__; AC_wait_until_app_idle / AC_idle_point executor commands; matching read-only ac_* MCP tools; Script Builder under Flow.
  • Docs: EN + Zh v213_features_doc.rst + WHATS_NEW.md.

Test

test/unit_test/headless/test_app_idle_batch.py — pure idle_point (settles after busy run / resets on spike / never settles / immediate), wait_until_app_idle settles + times-out with injected probe+clock+sleep, JSON-list executor coercion, plus facade + executor/MCP/builder wiring. All 9 green; ruff + bandit + radon clean; no float ==; package stays Qt-free.

A click fired while the app is still churning (busy cursor up, dialog
mid-paint, long handler running) is dropped or mis-targeted. smart_waits
watches pixels settle; this watches the busy signal settle, reusing
settle_detector.SettleTracker over a 1.0-busy/0.0-idle series. The busy
probe (default Windows busy cursor) and clock/sleep are injectable, so
the settle gate is fully testable without an app.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 28 complexity · 0 duplication

Metric Results
Complexity 28
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 1d51f60 into dev Jun 25, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/app-idle-batch branch June 25, 2026 23:13
@sonarqubecloud

Copy link
Copy Markdown

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