Add virtualized: realize off-screen items in virtualized lists/grids#415
Merged
Conversation
Long lists/grids/trees only materialize visible rows, so an off-screen row has no accessibility element at all - list/read_table/select can't see it and scroll_control_into_view can't help because it doesn't exist yet. realize_item locates the item by property (ItemContainerPattern) and realizes it (VirtualizedItemPattern) so it becomes a real element. Extends the backend ABC + Windows UIA backend via the same fake-backend seam as control_patterns.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 23 |
| Duplication | 2 |
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
Long lists, data grids and trees (WPF / WinUI / File Explorer / virtual treeviews) only materialize the rows scrolled into view — an off-screen row has no accessibility element at all. So
list_accessibility_elements/read_control_table/select_control_itemsimply cannot see it, andscroll_control_into_viewcan't help because the target element doesn't exist yet. This is the classic "element not found in a long list" wall — and the highest-leverage UIA gap (per ROUND-15 research).realize_itemlocates the item inside its container by property (UIAItemContainerPattern.FindItemByProperty) and realizes it (VirtualizedItemPattern.Realize) so it materializes as a real, clickable element.Design
base.pywith an_unsupporteddefault) + real UIA inwindows_backend.py(pattern IDs ItemContainer=10019 / VirtualizedItem=10020;FindItemByPropertyby Name=30005 or AutomationId=30011, thenRealize) + autils/virtualized/facade dispatchingget_backend()— the same fake-backend seam ascontrol_patterns/ax_text.__all__→AC_realize_item→ read-onlyac_realize_itemMCP tool → Script Builder (Native UI). Qt-free verified.Tests
test/unit_test/headless/test_virtualized_batch.py— fake backend (matching the ABC signature) covers realize-returns-element, not-found → None,by="automation_id", the unsupported-backend error, the executor{found, element}wrapper, and 5-layer wiring. 22 passed with the control_patterns / ax_text siblings. Real UIA not executed in CI (no Windows backend), matching the rest of the accessibility lane.