Skip to content

Add selection_view: container selection + view switching#422

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

Add selection_view: container selection + view switching#422
JE-Chen merged 1 commit into
devfrom
feat/selection-view-batch

Conversation

@JE-Chen

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

Copy link
Copy Markdown
Member

Why

select_control_item (SelectionItemPattern) selects one item; the container-level SelectionPattern answers the natural follow-up — what is currently selected in a listbox / grid / tab, and may it select multiple? — the assertion target after selecting. MultipleViewPattern switches 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 view

Seventh 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 (SelectionPattern=10001 GetCurrentSelection + CanSelectMultiple/IsSelectionRequired, reusing _header_names for the selected item names; MultipleViewPattern=10008 GetCurrentSupportedViews + GetViewName + SetCurrentView, resolving the target view by name via a _view_name helper). Every method under CC 10 (radon-clean).
  • 5 layers wired: core → facade __all__AC_get_selection / AC_list_views / AC_set_viewac_* 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.

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.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 39 complexity · 0 duplication

Metric Results
Complexity 39
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 42492b7 into dev Jun 24, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/selection-view-batch branch June 24, 2026 22:24
@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