Skip to content

AT-SPI: Expose list item containers as accessible children - #21605

Merged
MrJul merged 10 commits into
masterfrom
fix/atspi-list-item-children
Jun 22, 2026
Merged

MrJul merged 10 commits into
masterfrom
fix/atspi-list-item-children

Conversation

@jmacato

@jmacato jmacato commented Jun 17, 2026

Copy link
Copy Markdown
Member

List automation peers exposed the items panel/scrollviewer as their accessible children, so the items were not direct children of the selection container. AT-SPI addresses selectable children by index on the container (SelectChild/DeselectChild), so item selection over AT-SPI could not reach the items.

Expose the realized item containers as the accessible children of SelectingItemsControl peers (ListBox, TreeView, ComboBox), matching how the selection model already resolves items via ContainerFromIndex.

Builds on #21602 (additive SelectChild). The first commit here is that change; it will drop out once #21602 merges.

jmacato added 2 commits June 17, 2026 15:55
Index selectable items directly under the selection container so the
Selection interface's SelectChild/DeselectChild address them by index.
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066589-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added os-linux area-accessibility backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch labels Jun 17, 2026
Comment thread src/Avalonia.Controls/Automation/Peers/SelectingItemsControlAutomationPeer.cs Outdated
Comment thread src/Avalonia.Controls/Automation/Peers/SelectingItemsControlAutomationPeer.cs Outdated
@jmacato
jmacato marked this pull request as draft June 17, 2026 11:55
jmacato added 2 commits June 17, 2026 20:13
ListBox used ItemsControlAutomationPeer, which is not an ISelectionProvider,
so it never exposed the Selection interface (AT-SPI) for multi-select.
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066601-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Move the GetChildrenCore container override down to ItemsControlAutomationPeer so every ItemsControl returns its containers, and return null directly when there are no items instead of calling the base algorithm.
@jmacato
jmacato marked this pull request as ready for review June 17, 2026 15:46
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066606-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066684-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066700-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066732-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

…not the shared peer

Present a SelectingItemsControl's realized item containers as its direct AT-SPI children inside AtSpiNode so SelectChild-by-index and a selectable item's parent lookup resolve to the Selection container. Doing this in the FreeDesktop AT-SPI layer keeps the macOS AX and Windows UIA peer trees intact, avoiding the item-frame and tree-collapse regressions the shared ItemsControlAutomationPeer override caused.
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0066746-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MrJul MrJul changed the title AT-SPI: expose list item containers as accessible children Expose list item containers as accessible children Jun 22, 2026
@MrJul MrJul added os-linux and removed os-linux labels Jun 22, 2026
@MrJul MrJul changed the title Expose list item containers as accessible children AT-SPI: Expose list item containers as accessible children Jun 22, 2026
@MrJul MrJul added the bug label Jun 22, 2026
@MrJul
MrJul added this pull request to the merge queue Jun 22, 2026
Merged via the queue into master with commit b25f2d9 Jun 22, 2026
12 checks passed
@MrJul
MrJul deleted the fix/atspi-list-item-children branch June 22, 2026 19:55
MrJul pushed a commit to MrJul/Avalonia that referenced this pull request Jun 23, 2026
…I#21605)

* AT-SPI: add to the selection in Selection.SelectChild instead of replacing it

* AT-SPI: expose list item containers as accessible children

Index selectable items directly under the selection container so the
Selection interface's SelectChild/DeselectChild address them by index.

* Expose ListBox selection to accessibility via a selection peer

ListBox used ItemsControlAutomationPeer, which is not an ISelectionProvider,
so it never exposed the Selection interface (AT-SPI) for multi-select.

* Address review: expose item containers from the base ItemsControl peer

Move the GetChildrenCore container override down to ItemsControlAutomationPeer so every ItemsControl returns its containers, and return null directly when there are no items instead of calling the base algorithm.

* Use file-scoped namespace in ListBoxAutomationPeer

* Fix cross-platform regression: move child flattening from the peer to the AT-SPI selection handler

* Trigger rebuild

* AT-SPI: flatten selection container item children in the node layer, not the shared peer

Present a SelectingItemsControl's realized item containers as its direct AT-SPI children inside AtSpiNode so SelectChild-by-index and a selectable item's parent lookup resolve to the Selection container. Doing this in the FreeDesktop AT-SPI layer keeps the macOS AX and Windows UIA peer trees intact, avoiding the item-frame and tree-collapse regressions the shared ItemsControlAutomationPeer override caused.
@MrJul MrJul added backported-12.0.x and removed backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants