Add transform_window: move/resize UIA elements + window state#419
Merged
Conversation
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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 37 |
| Duplication | 0 |
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Why
This is UIA-element-level, not the HWND/title-level geometry in
window_layout/window_geometry.TransformPatternmoves and resizes a specific control or floating panel (dockable toolbars, MDI children, splitters) that has no top-level window of its own;WindowPatternminimizes/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/Resizeset_window_state—normal/maximized/minimized(WindowPattern)window_interaction_state—ready/blocked_by_modal/not_responding/running/closingFourth feature of the ROUND-15 native-UIA depth lane.
Design
base.py_unsupporteddefaults) + real UIA inwindows_backend.py(TransformPattern=10016 Move/Resize; WindowPattern=10009 SetWindowVisualState + CurrentWindowInteractionState;_WINDOW_VISUAL_STATES/_WINDOW_INTERACTION_STATESmaps), reusing the existing_invoke_pattern_methodhelper for the actions.__all__→AC_move_element/AC_resize_element/AC_set_window_state/AC_window_interaction_state→ac_*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.