Skip to content

Add ax_props: read rich UIA element properties before acting#416

Merged
JE-Chen merged 1 commit into
devfrom
feat/ax-props-batch
Jun 24, 2026
Merged

Add ax_props: read rich UIA element properties before acting#416
JE-Chen merged 1 commit into
devfrom
feat/ax-props-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

Why

list_accessibility_elements / AccessibilityElement carry only name / role / bounds / app / pid / automation_id. Automation routinely needs more before it acts: is the control enabled (don't click a disabled button), is it off-screen, its item_status (field validation/error text), help_text (tooltip), and accelerator_key (drive via hotkey instead of click). ax_props exposes those high-value UIA properties.

  • get_element_properties{enabled, offscreen, help_text, item_status, accelerator_key, access_key, orientation}
  • is_element_enabled — the common pre-action guard

Second feature of the ROUND-15 native-UIA depth lane (the highest-frequency property reads, per the research).

Design

  • Extends the accessibility backend ABC (base.py _unsupported default) + real reads in windows_backend.py (a _PROPERTY_READS table over CurrentIsEnabled / CurrentIsOffscreen / CurrentHelpText / CurrentItemStatus / CurrentAcceleratorKey / CurrentAccessKey / CurrentOrientation, each guarded) + a utils/ax_props/ facade dispatching get_backend() — the same fake-backend seam as control_patterns / ax_text / virtualized.
  • 5 layers wired: core → facade __all__AC_get_element_properties → read-only ac_get_element_properties MCP tool → Script Builder (Native UI). Qt-free verified.

Tests

test/unit_test/headless/test_ax_props_batch.py — fake backend covers the property dispatch, not-found → None, is_element_enabled true/false/None, the unsupported-backend error, the executor {found, properties} wrapper, and 5-layer wiring. 8 passed (15 with the virtualized sibling). Real UIA not run in CI, matching the accessibility lane.

The flat element list carries only name/role/bounds/app/id, but
automation needs more before it acts: is the control enabled (don't
click a disabled button), is it off-screen, its item_status, help_text
(tooltip), accelerator_key. get_element_properties reads those UIA
properties; is_element_enabled is the common pre-action guard. Extends
the backend ABC + Windows UIA backend via the same fake-backend seam.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 26 complexity · 0 duplication

Metric Results
Complexity 26
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 dae9081 into dev Jun 24, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/ax-props-batch branch June 24, 2026 18:49
@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