Skip to content

Add reactive screen observer (appear/vanish/change)#225

Merged
JE-Chen merged 1 commit into
devfrom
feat/observer-batch
Jun 19, 2026
Merged

Add reactive screen observer (appear/vanish/change)#225
JE-Chen merged 1 commit into
devfrom
feat/observer-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

Round-2 web-research follow-up, batch 7 — a non-blocking screen observer (SikuliX observe model), wired through all five layers (facade, AC_*, MCP, Script Builder) with headless tests + EN/Zh v17 docs + README sections.

Feature (utils/observer)

  • ScreenObserver — register watches that fire on appear / vanish / change of a value and run a callback; add/remove/names/poll_once/start/stop/fired. Complements the blocking wait_for_* family — react to dialogs/progress/status while the main flow continues.
  • Testable by design — detection is an injectable predicate (truthy = present); transition logic is unit-tested via poll_once() with synthetic values, no real screen. Built-in image_predicate / text_predicate / pixel_predicate wrap the existing locate/OCR/pixel helpers; errors are swallowed so the poll loop survives.
  • Executor/MCP: AC_observe_add (kind=image/text/pixel, event=appear/vanish/change, runs actions — the watchdog pattern generalised to screen content) / AC_observe_remove/list/poll/start/stop + ac_observe_*.

Verification

  • test/unit_test/headless/test_observer_batch.py — 7 tests pass (transition matrix, event filtering, error resilience, remove/names/log, full wiring).
  • ruff clean; radon no CC≥C; bandit clean; import je_auto_control PySide6-free.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 91 complexity · 4 duplication

Metric Results
Complexity 91
Duplication 4

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 27d5d0b into dev Jun 19, 2026
22 of 23 checks passed
@JE-Chen JE-Chen deleted the feat/observer-batch branch June 19, 2026 03:34
@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