Skip to content

Native UI control driver (object-level desktop automation)#214

Merged
JE-Chen merged 2 commits into
devfrom
feat/native-ui-control
Jun 18, 2026
Merged

Native UI control driver (object-level desktop automation)#214
JE-Chen merged 2 commits into
devfrom
feat/native-ui-control

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

Summary

Found via the multi-agent web research ("再想想"): the accessibility layer
could only list / find / click elements — it could not read or set a
control's value, invoke it, or toggle it. That object-level control is the
core of every object-aware desktop tool (pywinauto / FlaUI / WinAppDriver /
UiPath) and was AutoControl's single biggest gap vs them (cross-validated by
competitor analysis and practitioner pain-point research). It's far more
reliable than pixel/OCR/VLM for native apps.

What's added (full five-layer wiring)

  • Backend interface: get_value / set_value / invoke / toggle,
    with a clear AccessibilityNotAvailableError for backends that can't act.
  • Windows UIAutomation backend: implements all four via the Value /
    Invoke / Toggle control patterns (comtypes), degrading gracefully on COM
    errors; targets a control by name / role / app_name / automation_id
    (the stable Windows identifier).
  • Facade: control_get_value / control_set_value / control_invoke /
    control_toggle.
  • Executor: AC_control_get_value / AC_control_set_value /
    AC_control_invoke / AC_control_toggle.
  • MCP tools: ac_control_*. Script Builder: "Native UI" entries.
  • Docs: v7 reference page (EN + Traditional Chinese) + README sections.

Testing

  • Headless tests inject a fake backend (no GUI/comtypes) and verify the API,
    executor commands, MCP registry and graceful degradation on the null
    backend. The Windows UIA path is platform code (validated like the rest of
    the backend, which CI can't exercise headlessly).
  • ruff / radon / bandit clean; import je_auto_control stays Qt-free;
    no orphan Script Builder commands.

The accessibility layer could only list/find/click elements. Add
control-pattern actions so it can read and drive native controls by
name/role/app/AutomationId — far more reliable than pixel/OCR for native
apps and the #1 gap vs object-aware desktop tools (pywinauto / FlaUI /
WinAppDriver / UiPath), surfaced by web research of competitors and
practitioner pain points.

- Backend interface: get_value / set_value / invoke / toggle, with a
  clear AccessibilityNotAvailableError for backends that can't act.
- Windows UIAutomation backend implements all four via the Value /
  Invoke / Toggle control patterns (comtypes), degrading gracefully on
  COM errors.
- Facade re-exports control_get_value / control_set_value /
  control_invoke / control_toggle; AC_control_* executor commands;
  ac_control_* MCP tools; Script Builder "Native UI" entries.
- Headless tests inject a fake backend (no GUI/comtypes needed) and
  verify the API, executor, MCP wiring and graceful degradation.
- v7 reference page (EN + Traditional Chinese) + README sections.
@codacy-production

codacy-production Bot commented Jun 18, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 88 complexity · 2 duplication

Metric Results
Complexity 88
Duplication 2

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.

Complete the native control driver with table reading — the agent
research's other top desktop gap (data scraping). Adds read_table to the
backend interface, a Windows UIAutomation Grid-pattern implementation,
read_control_table in the facade, the AC_read_table executor command, the
ac_read_table MCP tool, a Script Builder entry, fake-backend tests, and
the v7 docs / README sections.
@JE-Chen JE-Chen merged commit 4990504 into dev Jun 18, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/native-ui-control branch June 18, 2026 22:08
@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