Skip to content

Add missing AutomationPeers from built-in Controls. - #21322

Merged
MrJul merged 10 commits into
masterfrom
features/more-autopeers
May 20, 2026
Merged

Add missing AutomationPeers from built-in Controls.#21322
MrJul merged 10 commits into
masterfrom
features/more-autopeers

Conversation

@jmacato

@jmacato jmacato commented May 7, 2026

Copy link
Copy Markdown
Member

What does the pull request do?

Adds automation peers for several controls that previously used the default or is missing peer behavior:

  • AutoCompleteBox
  • Calendar
  • CalendarDatePicker
  • NumericUpDown
  • SplitButton
  • ToggleSplitButton
  • ToolTip
  • ColorSpectrum

What is the current behavior?

These controls either do not create a control-specific automation peer or do not expose the expected automation patterns, so accessibility/UI automation clients see incomplete or generic behavior.

What is the updated/expected behavior with this PR?

The affected controls now create dedicated automation peers and expose more accurate automation metadata and provider contracts behavior where applicable.

Checklist

  • Added unit tests (if possible)?

Comment thread src/Avalonia.Controls/Automation/Peers/NativeMenuBarAutomationPeer.cs Outdated
@MrJul MrJul added enhancement area-accessibility backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch labels May 7, 2026
Comment thread src/Avalonia.Controls.ColorPicker/Automation/Peers/ColorSpectrumAutomationPeer.cs Outdated
jmacato added 3 commits May 9, 2026 02:09
Flatten MenuItem children under NativeMenuBarAutomationPeer and raise ColorChanged when Color is set directly so ColorSpectrumAutomationPeer notifies AT clients.
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0065585-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-cibuild0065589-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-cibuild0065595-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@jmacato
jmacato force-pushed the features/more-autopeers branch from 626821c to 5eae2dc Compare May 19, 2026 17:24
Bisect confirmed this override caused 5 Windows IT tests (Slider, Screen, DragDrop) to fail by producing an inconsistent UIA tree where MenuItem peers list NativeMenuBar as parent while their visual parent is the inner Menu. Reverted to the thin peer that only reports ControlType=MenuBar, and dropped the now-irrelevant children assertion test.
@jmacato
jmacato force-pushed the features/more-autopeers branch from 30f8afd to a9989bc Compare May 19, 2026 18:14
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0065605-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 added this pull request to the merge queue May 19, 2026
Merged via the queue into master with commit 29cb98d May 20, 2026
12 checks passed
@MrJul
MrJul deleted the features/more-autopeers branch May 20, 2026 00:15
MrJul pushed a commit to MrJul/Avalonia that referenced this pull request May 28, 2026
* Add missing AutomationPeers from built-in Controls.

* revert native menu bar peers

* Add back a thin automation peer for native menu bar.

* Use ColorChanged for ColorSpectrumAutomationPeer

* Fix NativeMenuBar/ColorSpectrum automation peer regressions

Flatten MenuItem children under NativeMenuBarAutomationPeer and raise ColorChanged when Color is set directly so ColorSpectrumAutomationPeer notifies AT clients.

* Drop NativeMenuBarAutomationPeer.GetChildrenCore override

Bisect confirmed this override caused 5 Windows IT tests (Slider, Screen, DragDrop) to fail by producing an inconsistent UIA tree where MenuItem peers list NativeMenuBar as parent while their visual parent is the inner Menu. Reverted to the thin peer that only reports ControlType=MenuBar, and dropped the now-irrelevant children assertion test.
@MrJul MrJul added backported-12.0.x and removed backport-candidate-12.0.x Consider this PR for backporting to 12.0 branch labels May 28, 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.

5 participants