Skip to content

Add transform_window: move/resize UIA elements + window state#419

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

Add transform_window: move/resize UIA elements + window state#419
JE-Chen merged 1 commit into
devfrom
feat/transform-window-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

Why

This is UIA-element-level, not the HWND/title-level geometry in window_layout / window_geometry. TransformPattern moves and resizes a specific control or floating panel (dockable toolbars, MDI children, splitters) that has no top-level window of its own; WindowPattern minimizes/maximizes a window and — most usefully — reports its interaction state, a reliable "is this window ready or modal-blocked?" signal pixel/title polling can't give.

  • move_element / resize_element — TransformPattern Move/Resize
  • set_window_statenormal / maximized / minimized (WindowPattern)
  • window_interaction_stateready / blocked_by_modal / not_responding / running / closing

Fourth feature of the ROUND-15 native-UIA depth lane.

Design

  • Extends the accessibility backend ABC (base.py _unsupported defaults) + real UIA in windows_backend.py (TransformPattern=10016 Move/Resize; WindowPattern=10009 SetWindowVisualState + CurrentWindowInteractionState; _WINDOW_VISUAL_STATES / _WINDOW_INTERACTION_STATES maps), reusing the existing _invoke_pattern_method helper for the actions.
  • 5 layers wired: core → facade __all__AC_move_element / AC_resize_element / AC_set_window_state / AC_window_interaction_stateac_* MCP tools (actions destructive, the read read-only) → Script Builder (Native UI). Qt-free verified.

Tests

test/unit_test/headless/test_transform_window_batch.py — fake backend covers move/resize/set-state dispatch, the interaction-state read, the unsupported-backend error, the real Windows backend's invalid-state guard (returns False without comtypes), the executor adapters, and 5-layer wiring. 17 passed with the table_pattern sibling. Real UIA not run in CI.

UIA element-level Transform/Window patterns, distinct from the HWND/
title-level window_layout. TransformPattern moves/resizes a control or
floating panel with no top-level window of its own; WindowPattern
minimizes/maximizes and reports interaction state (ready/blocked_by_modal/
not_responding) - a reliable 'is this window ready or modal-blocked?'
signal pixel/title polling can't give. Extends the backend ABC + Windows
UIA backend, reusing _invoke_pattern_method.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 37 complexity · 0 duplication

Metric Results
Complexity 37
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 194ff16 into dev Jun 24, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/transform-window-batch branch June 24, 2026 19:16
@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