Skip to content

fix(a11y): Use owning flyout name for presenter AutomationId - #25308

Open
MartinZikmund wants to merge 5 commits into
dev/mazi/dependencyobject-namefrom
dev/mazi/flyout-owner-name-automationid
Open

MartinZikmund wants to merge 5 commits into
dev/mazi/dependencyobject-namefrom
dev/mazi/flyout-owner-name-automationid

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: part of #23934

Note

Stacked on #25184 (base branch dev/mazi/dependencyobject-name, GitHub stack #24389). The diff shows only this PR's commits.

Stack, bottom to top:

  1. feat(a11y): add mobile automation support #23935 mobile automation
  2. fix: Resolve FindName through the XAML namescope #25307 FindName / XAML namescope fixes
  3. fix: Declare Name on DependencyObject like WinUI #25184 DependencyObject-owned NameProperty
  4. This PR: flyout owner-name AutomationId
  5. refactor: Register DependencyObject.Name without the holder #25214 DP storage independent of registration order

PR Type:

🐞 Bugfix

What changed? 🚀

In WinUI, the AutomationId of a FlyoutPresenter or MenuFlyoutPresenter falls back to the owning flyout's x:Name. GetOwnerName reads the flyout's DependencyObject_Name (FlyoutPresenter_partial.cpp, MenuFlyoutPresenter_Partial.cpp). Uno can only do the same once #25184 stores x:Name on non-FrameworkElement objects, so these commits were split out of #23935 and moved up here, unchanged.

  • FlyoutPresenter: FlyoutPresenterAutomationPeer.GetAutomationIdCore returns the owning Flyout's name through a new FlyoutPresenter.GetOwnerName. This replaces a Skia-only read of the presenter's own Name (and its #if __SKIA__ / TODO).
  • MenuFlyoutPresenter: GetOwnerName reads the owning MenuFlyout's DependencyObject_Name, for compiled XAML and XamlReader alike. On feat(a11y): add mobile automation support #23935 it returns null, because reading FrameworkElement.NameProperty on a MenuFlyout throws under property owner validation.

Without this PR (that is, on #23935 alone), neither Flyout nor MenuFlyout presenters get the flyout's x:Name as AutomationId, from compiled or runtime XAML. test(a11y): Cover compiled MenuFlyout presenter AutomationId (moved here from #23935) now passes through DependencyObject_Name. The workaround is to set AutomationProperties.AutomationId in the presenter style.

Validation

  • Compile (strict, no fast-dev flag, net10.0): Uno.UI builds with 0 errors at this head.
  • Runtime (Skia Desktop, net10.0-desktop): at this head, 80/80 passed: the 3 Given_Flyout presenter AutomationId tests, Given_MenuFlyout (14, including both presenter AutomationId tests), Given_FindName_NonFrameworkElement (18), Given_DependencyObject_Name (24) and Given_VisualStateManager* (21).

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa

Copilot AI balanced review requested due to automatic review settings October 11, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Oct 11, 2026
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 16s —— View job


Review of the flyout owner-name AutomationId commits

I reviewed only the four commits after 1b927f96. They touch 10 files: 25 lines removed and 151 added, most of them tests. I did not build or run anything. This is a read-through of the diff.

Verdict: ship. I found 0 blocking issues and posted no inline comments.

  • FlyoutPresenter: GetOwnerName reads DependencyObject.NameProperty on the owning flyout. That matches the WinUI GetOwnerName the PR cites. It also removes the #if __SKIA__ / TODO branch in FlyoutPresenterAutomationPeer, so all targets now use the same code.
  • MenuFlyoutPresenter: it now reads the same NameProperty. The __UnoXamlName attached value is gone from the generator. So are MarkupHelper.GetXamlName, the MenuFlyoutSymbol lazy and the XamlConstants.Types.MenuFlyout constant. I found no leftover references in the diff.
  • Tests: there are runtime tests for the Flyout presenter and for a runtime-XAML MenuFlyout presenter. That covers the case the generator-only stand-in could not.

Minor, non-blocking:

  • FlyoutPresenter.GetOwnerName and GetOwnerFlyout return string / FlyoutBase that can be null. Check that the file's nullable context matches the other members.
  • The generator snapshot expectations in Out/XName came from the lower PR (fix: Declare Name on DependencyObject like WinUI #25184). Make sure they still match once the stack merges.

Process:

  • The description says to review only the commits after 1b927f961e4. The branch diff is about 100 files and 30k lines until the lower PRs in the stack merge, so I did not review the stacked content.
  • The doc checklist item is unchecked. That looks fine for an internal a11y fix.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 20:49
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/flyout-owner-name-automationid branch from edbc0f4 to 3c58139 Compare October 11, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI balanced review requested due to automatic review settings October 11, 2026 21:01
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/flyout-owner-name-automationid branch from 3c58139 to c6e8d1f Compare October 11, 2026 21:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 27s —— View job


Review: flyout owner-name AutomationId

I reviewed only the five commits on top of 4530b432. They are the fix(a11y) and test(a11y) commits for the Flyout and MenuFlyout presenters. I read the diff and did not build or run anything.

Verdict: ship. I found no blocking issues and posted no inline comments.

Severity Count
Blocking 0
Minor 1
  • Code: the new FlyoutPresenter.GetOwnerName and the filled-in MenuFlyoutPresenter.GetOwnerName both read DependencyObject.NameProperty from the owning flyout. That matches the WinUI source the PR cites. The #if __SKIA__ / TODO branch is gone, so every target now takes one path.
  • Tests: there are runtime tests for compiled and runtime-XAML MenuFlyout and for Flyout presenters. The [Sample] page is NamedMenuFlyoutPage.
  • Minor, non-blocking: GetOwnerName returns a nullable string while FlyoutPresenter.cs has no #nullable enable. That matches the file's existing style, so no change is needed.

Cross-cutting, from the lower PRs in the stack (not this PR's commits):

  • The code-quality bot flagged GC.Collect() calls in Given_MobileAccessibilityPerformance, Given_MobileAccessibilityLifecycle_US7 and Given_SkiaAndroidAccessibilityNode. These belong to feat(a11y): add mobile automation support #23935. They should be fixed there, for example by polling with WaitFor instead of forcing a GC.
  • The doc checklist item is unchecked. That looks fine for an internal a11y fix.

@MartinZikmund
MartinZikmund changed the base branch from master to dev/mazi/dependencyobject-name October 11, 2026 21:01
@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI balanced review requested due to automatic review settings October 12, 2026 06:30
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/flyout-owner-name-automationid branch from c6e8d1f to c7ea227 Compare October 12, 2026 06:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 12s —— View job


Review: flyout owner-name AutomationId

You mentioned @claude without a specific request, so I treated this as a review. I read the src/Uno.UI diff against origin/dev/mazi/dependencyobject-name. I did not build or run anything.

Verdict: ship. I found no blocking issues and posted no inline comments.

Severity Count
Blocking 0
Minor 1
  • FlyoutPresenter.GetOwnerName (FlyoutPresenter.cs) reads DependencyObject.NameProperty from the owning flyout. This matches the WinUI GetOwnerName. It also removes the #if __SKIA__ / TODO branch in FlyoutPresenterAutomationPeer.GetAutomationIdCore, so every target takes one path.
  • MenuFlyoutPresenter.GetOwnerName (MenuFlyoutPresenter.partial.mux.cs) reads the same property from GetParentMenuFlyout(), with a null guard.
  • Tests: there are runtime tests for the Flyout presenter and for compiled and runtime-XAML MenuFlyout presenters. The NamedMenuFlyoutPage sample supports them.

Minor, non-blocking:

  • GetOwnerName returns a nullable string, but the file has no #nullable enable. This matches the file's existing style, so no change is needed.

Cross-cutting:

@morning4coffe-dev morning4coffe-dev 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.

Verified against WinUI. FlyoutPresenter_partial.cpp GetOwnerName (line 165) reads the owning flyout's DependencyObject_Name. MenuFlyoutPresenter_Partial.cpp (line 502) does the same for the parent MenuFlyout. FlyoutPresenterAutomationPeer_Partial.cpp and MenuFlyoutPresenterAutomationPeer_Partial.cpp fall back to the owner name only when the base AutomationId is empty. The Uno code matches all three. Removing the #if SKIA gate is correct once DependencyObject.Name exists, which #25184 provides (this PR's base). The test page members used (CompiledFlyoutElement, FlyoutButtonElement, TargetButton, SecondTargetButton, NamedMenuFlyout) all exist. Code review only; the PR body reports 80/80 on Skia Desktop. I did not run them.

Notes:

  • This PR is stacked. It compiles only with #25184 (itself stacked on #25307 and #23935, per the PR body) in place. Merge order matters.
  • Behaviour change on native targets (Android, iOS, WASM): FlyoutPresenter AutomationId now falls back to the flyout name on every platform, not only Skia. That matches WinUI, and the new tests run on all platforms, but it is a visible change on maintenance-only targets. One line in the PR description would cover it.
  • Minor: the new tests wait with WaitForIdle after ShowAt before reading the presenter. Waiting for the Opened event, as the helper in #25085 does, would be less timing-sensitive.

MartinZikmund and others added 5 commits November 10, 2026 10:42
MenuFlyoutPresenter.GetOwnerName now reads the owning MenuFlyout's
DependencyObject_Name, as WinUI does. x:Name already lands there for
non-FrameworkElement objects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
Port FlyoutPresenter::GetOwnerName: the presenter peer falls back to the
owning Flyout's x:Name rather than the presenter's own Name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017TzDba3gSK3uYpvLmmBmaa
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/flyout-owner-name-automationid branch from c7ea227 to 4496cd8 Compare November 10, 2026 10:00
Copilot AI balanced review requested due to automatic review settings November 10, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 12s —— View job


Review: flyout owner-name AutomationId

I read the src/Uno.UI diff against origin/dev/mazi/dependencyobject-name. I did not build or run anything. I did not read the test files in this pass.

Verdict: ship. I found 0 blocking issues. I posted no inline comments.

Severity Count
Blocking 0
Minor 2
  • FlyoutPresenter.GetOwnerName reads DependencyObject.NameProperty from the owning flyout. FlyoutPresenterAutomationPeer.GetAutomationIdCore falls back to it only when the base AutomationId is empty. Both match the WinUI behavior the PR cites. The #if __SKIA__ / TODO branch is gone, so every target takes the same path.
  • MenuFlyoutPresenter.GetOwnerName reads the same property from GetParentMenuFlyout(), with a null guard.

Minor, non-blocking:

  • As the approving review noted, the fallback now applies on every target, not only Skia. One line in the PR description would document that.
  • The new tests wait with WaitForIdle after ShowAt. Waiting for the Opened event would be less timing-sensitive.

Cross-cutting:

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 12s —— View job


Review: flyout owner-name AutomationId

I read the src/Uno.UI diff against origin/dev/mazi/dependencyobject-name. I did not build or run anything.

Verdict: ship. I found no blocking issues and posted no inline comments.

Severity Count
Blocking 0
Minor 1
  • FlyoutPresenter.GetOwnerName reads DependencyObject.NameProperty from the owning flyout. This matches WinUI's GetOwnerName. It also removes the #if __SKIA__ / TODO branch in FlyoutPresenterAutomationPeer.GetAutomationIdCore, so every target takes one path.
  • MenuFlyoutPresenter.GetOwnerName reads the same property from GetParentMenuFlyout(), with a null guard.
  • Tests: there are runtime tests for the Flyout presenter and for compiled and runtime-XAML MenuFlyout presenters.

Minor, non-blocking:

  • The new tests wait with WaitForIdle after ShowAt. Waiting for the Opened event would be less timing-sensitive.

Cross-cutting:

@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@morning4coffe-dev morning4coffe-dev 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.

Re-checked after the rebase: git range-diff against the head I approved shows all five commits unchanged, so my approval stands. Parity still holds: FlyoutPresenter::GetOwnerName and MenuFlyoutPresenter::GetOwnerName read DependencyObject_Name, and both automation peers only fall back to the owner name when the base AutomationId is empty, same as here. It's still stacked on #25184, so that one needs to go in first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation area/skia ✏️ Categorizes an issue or PR as relevant to Skia kind/documentation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants