Add selection_view: container selection + view switching#422
Merged
Conversation
select_control_item selects one item, but the container-level SelectionPattern answers what is currently selected and whether multiple selection is allowed - the assertion target after selecting. MultipleViewPattern switches a control between its views (Explorer list/details/tile). get_selection / list_views / set_view extend the backend ABC + Windows UIA backend via the same fake-backend seam.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 39 |
| 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
select_control_item(SelectionItemPattern) selects one item; the container-levelSelectionPatternanswers the natural follow-up — what is currently selected in a listbox / grid / tab, and may it select multiple? — the assertion target after selecting.MultipleViewPatternswitches a control between its views (Explorer's list / details / tile / thumbnail), a precondition that otherwise needs fragile menu clicking.get_selection—{items, can_select_multiple, is_required}list_views—{current, views: [...]}set_view— switch to a named viewSeventh feature of the ROUND-15 native-UIA depth lane.
Design
base.py_unsupporteddefaults) + real UIA inwindows_backend.py(SelectionPattern=10001GetCurrentSelection+ CanSelectMultiple/IsSelectionRequired, reusing_header_namesfor the selected item names; MultipleViewPattern=10008GetCurrentSupportedViews+GetViewName+SetCurrentView, resolving the target view by name via a_view_namehelper). Every method under CC 10 (radon-clean).__all__→AC_get_selection/AC_list_views/AC_set_view→ac_*MCP tools (reads read-only, set_view destructive) → Script Builder (Native UI). Qt-free verified.Tests
test/unit_test/headless/test_selection_view_batch.py— fake backend covers selection, list-views, set-view known/unknown, the unsupported-backend error, the executor adapters, and 5-layer wiring. 17 passed with the ax_text sibling. Real UIA not run in CI.