Skip to content

[Windows] Border: Add AutomationPeer support#35577

Merged
kubaflo merged 9 commits into
dotnet:inflight/currentfrom
Vignesh-SF3580:fix-27627Main
May 29, 2026
Merged

[Windows] Border: Add AutomationPeer support#35577
kubaflo merged 9 commits into
dotnet:inflight/currentfrom
Vignesh-SF3580:fix-27627Main

Conversation

@Vignesh-SF3580

@Vignesh-SF3580 Vignesh-SF3580 commented May 22, 2026

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

This PR is the first part of the split from #27713. It adds an AutomationPeer for the Windows Border (ContentPanel) so the control is properly exposed to UI Automation and accessibility tools while avoiding unnecessary noise in the screen-reader reading order.

  • Added a new internal MauiBorderAutomationPeer derived from FrameworkElementAutomationPeer.
  • Overrode ContentPanel.OnCreateAutomationPeer() to return MauiBorderAutomationPeer only when CrossPlatformLayout is IBorderView. Other ContentPanel usages continue using the default behavior.
  • This peer is needed because Panel (the base class of ContentPanel) does not provide a default AutomationPeer, so Border was previously missing or not exposed correctly in the UIA tree.
  • The peer follows an opt-in model for the screen-reader Control view, aligned with the layout AutomationPeer improvements from [Windows][net11] Make Layout AutomationPeer public + opt-in for screen reader tree #35597.

Added explicit opt-out handling so AutomationProperties.IsInAccessibleTree="False" always takes precedence over any opt-in signal, matching native WinUI Border behavior.

How It Works

On Windows, a MAUI Border is rendered using a native ContentPanel derived from Panel. UI Automation discovers elements by calling OnCreateAutomationPeer() on the native control and then querying the returned peer for details such as control type, class name, automation ID, accessible name, and Control / Content view membership.

  • Peer entry point: ContentPanel.OnCreateAutomationPeer() now returns MauiBorderAutomationPeer only when CrossPlatformLayout is IBorderView. All other ContentPanel usages continue using the default behavior, so the change is scoped only to Border.
  • What the peer provides: UI Automation queries methods like GetAutomationControlTypeCore, GetClassNameCore, IsControlElementCore, and IsContentElementCore. Existing MAUI mappings for AutomationId, SemanticProperties.Description, and Hint continue through the base peer implementation.
  • Control View vs Content View: IsControlElementCore() is opt-in. It returns true only when the developer explicitly marks the Border as meaningful to accessibility tools using SemanticProperties.Description, SemanticProperties.Hint, or AutomationProperties.IsInAccessibleTree="True". This keeps decorative or structural Borders out of the screen-reader reading order. IsContentElementCore() requires explicit IsInAccessibleTree="True". AutomationId alone is treated as a UI-testing hook and does not move the Border into the accessibility views.
  • Explicit opt-out: When AutomationProperties.IsInAccessibleTree="False" is set (AccessibilityView.Raw), both IsControlElementCore() and IsContentElementCore() immediately return false before evaluating any opt-in signals. This matches native WinUI Border behavior where an explicit opt-out always takes priority.
  • Class name: GetClassNameCore() returns the cross-platform layout type name, such as "Border" or a derived type name like "MyBorder", instead of the generic native "Panel" name.

Overridden Core Methods and Purpose

1. GetAutomationControlTypeCore()
Returns AutomationControlType.Pane, which is the most suitable type for a layout container that is not an interactive control like a button or checkbox. This allows accessibility tools to treat the element as a structural container.
2. GetClassNameCore()
Returns the cross-platform control type name (for example, "Border") using panel.CrossPlatformLayout?.GetType().Name, with a fallback to nameof(Panel). This exposes the MAUI control name instead of the generic native Panel.
3. IsControlElementCore() (opt-in + opt-out)
Returns false immediately when AccessibilityView.Raw is set (IsInAccessibleTree="False"). Otherwise, it returns true when AccessibilityView is Control or Content (IsInAccessibleTree="True"), or when AutomationProperties.Name (SemanticProperties.Description) or AutomationProperties.HelpText (SemanticProperties.Hint) is set. If none of these conditions are met, it returns false, keeping structural or decorative Borders out of the Control view.
4. IsContentElementCore() (explicit opt-in only)
Returns false when AccessibilityView.Raw is set. Otherwise, it returns true only when AccessibilityView.Content is set (IsInAccessibleTree="True"). AutomationId alone does not move the Border into the Content view.

Issues Fixed

Fixes #27627

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35577

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35577"

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label May 22, 2026
@Vignesh-SF3580 Vignesh-SF3580 added the community ✨ Community Contribution label May 22, 2026
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman added the t/a11y Relates to accessibility label May 22, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review May 22, 2026 07:30
@sheiksyedm

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@kubaflo

kubaflo commented May 22, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/regression-check

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 2 findings

See inline comments for details.

Comment thread src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs Outdated
Comment thread src/Controls/tests/TestCases.HostApp/Issues/Issue27627.cs
@MauiBot MauiBot added s/agent-review-incomplete s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels May 22, 2026
@kubaflo

kubaflo commented May 22, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/refactor-copilot-yml

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Automated review — alternative fix proposed

The expert-reviewer evaluation compared the PR fix against #1 automatically generated candidates and selected try-fix-1 as the strongest fix.

Why: try-fix-1 passed the Windows regression test and is more complete than the PR variants: it preserves Border AutomationId lookup, honors semantic descriptions, filters the decorative border Path from UIA children, and scopes peer creation to a Border-specific platform panel.

Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.

Candidate diff (`try-fix-1`)
diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue27627.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue27627.cs
new file mode 100644
index 0000000000..2411f4027b
--- /dev/null
+++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue27627.cs
@@ -0,0 +1,43 @@
+namespace Maui.Controls.Sample.Issues;
+
+[Issue(IssueTracker.Github, 27627, "[Windows] Border Automation Peer", PlatformAffected.UWP)]
+public partial class Issue27627 : ContentPage
+{
+	public Issue27627()
+	{
+		var grid = new Grid();
+
+		var border = new Border
+		{
+			AutomationId = "TestBorder",
+			VerticalOptions = LayoutOptions.Center,
+			HeightRequest = 100,
+			Padding = new Thickness(10),
+			Stroke = Colors.Red
+		};
+
+		var label = new Label
+		{
+			Text = "Welcome to Maui!",
+			AutomationId = "TestLabel",
+			HorizontalOptions = LayoutOptions.Center,
+			VerticalOptions = LayoutOptions.Center
+		};
+
+		var nestedBorder = new Border
+		{
+			Stroke = Colors.Blue,
+			AutomationId = "NestedBorder",
+			StrokeThickness = 2,
+			Padding = new Thickness(10),
+			HorizontalOptions = LayoutOptions.Center,
+			VerticalOptions = LayoutOptions.Center,
+		};
+
+		nestedBorder.Content = label;
+		border.Content = nestedBorder;
+
+		grid.Children.Add(border);
+		Content = grid;
+	}
+}
diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27627.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27627.cs
new file mode 100644
index 0000000000..7a1b68c104
--- /dev/null
+++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue27627.cs
@@ -0,0 +1,29 @@
+using NUnit.Framework;
+using UITest.Appium;
+using UITest.Core;
+
+namespace Microsoft.Maui.TestCases.Tests.Issues
+{
+	public class Issue27627 : _IssuesUITest
+	{
+		public override string Issue => "[Windows] Border Automation Peer";
+
+		public Issue27627(TestDevice device)
+		: base(device)
+		{ }
+
+		[Test]
+		[Category(UITestCategories.Border)]
+		public void VerifyBorderAutomationPeer()
+		{
+			// Check whether the parent Border is found or not
+			App.WaitForElement("TestBorder");
+
+			// Check whether the nested Border is found or not
+			App.WaitForElement("NestedBorder");
+
+			// Check whether the Label inside the nested Border is found or not
+			App.WaitForElement("TestLabel");
+		}
+	}
+}
diff --git a/src/Core/src/Handlers/Border/BorderHandler.Windows.cs b/src/Core/src/Handlers/Border/BorderHandler.Windows.cs
index d9a32ce0ca..8ac5a49c99 100644
--- a/src/Core/src/Handlers/Border/BorderHandler.Windows.cs
+++ b/src/Core/src/Handlers/Border/BorderHandler.Windows.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 
 namespace Microsoft.Maui.Handlers
 {
@@ -39,7 +39,7 @@ namespace Microsoft.Maui.Handlers
 				throw new InvalidOperationException($"{nameof(VirtualView)} must be set to create a LayoutView");
 			}
 
-			var view = new ContentPanel
+			var view = new BorderContentPanel
 			{
 				CrossPlatformLayout = VirtualView
 			};
diff --git a/src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs b/src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs
new file mode 100644
index 0000000000..be443d4964
--- /dev/null
+++ b/src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs
@@ -0,0 +1,86 @@
+#nullable enable
+using System.Collections.Generic;
+using Microsoft.UI.Xaml.Automation;
+using Microsoft.UI.Xaml.Automation.Peers;
+using Microsoft.UI.Xaml.Controls;
+
+namespace Microsoft.Maui.Platform
+{
+// TODO: Make this class public in .NET11.0. Issue Link: https://github.com/dotnet/maui/issues/30205
+internal partial class MauiBorderAutomationPeer : FrameworkElementAutomationPeer
+{
+internal MauiBorderAutomationPeer(ContentPanel owner) : base(owner) { }
+
+protected override AutomationControlType GetAutomationControlTypeCore()
+{
+return AutomationControlType.Pane;
+}
+
+protected override string GetClassNameCore()
+{
+if (Owner is ContentPanel panel)
+{
+return panel.CrossPlatformLayout?.GetType().Name ?? nameof(Panel);
+}
+
+return nameof(Panel);
+}
+
+protected override IList<AutomationPeer>? GetChildrenCore()
+{
+var children = base.GetChildrenCore();
+
+if (children is null || Owner is not ContentPanel contentPanel)
+{
+return children;
+}
+
+List<AutomationPeer>? filteredChildren = null;
+
+for (var i = 0; i < children.Count; i++)
+{
+var child = children[i];
+
+if (child is FrameworkElementAutomationPeer peer && peer.Owner == contentPanel.BorderPath)
+{
+filteredChildren ??= new List<AutomationPeer>(children.Count - 1);
+
+for (var j = 0; j < i; j++)
+{
+filteredChildren.Add(children[j]);
+}
+
+continue;
+}
+
+filteredChildren?.Add(child);
+}
+
+return filteredChildren ?? children;
+}
+
+protected override bool IsControlElementCore() => true;
+
+protected override bool IsContentElementCore() => HasAutomationId() || HasSemanticDescription();
+
+bool HasAutomationId()
+{
+if (Owner is not ContentPanel contentPanel)
+{
+return false;
+}
+
+return !string.IsNullOrEmpty(AutomationProperties.GetAutomationId(contentPanel));
+}
+
+bool HasSemanticDescription()
+{
+if (Owner is not ContentPanel contentPanel)
+{
+return false;
+}
+
+return !string.IsNullOrEmpty(AutomationProperties.GetName(contentPanel));
+}
+}
+}
\ No newline at end of file

@kubaflo kubaflo 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.

Could you please check the ai's suggestions?

@kubaflo

kubaflo commented May 24, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/refactor-copilot-yml

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 2 findings

See inline comments for details.

Comment thread src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs Outdated
@MauiBot MauiBot removed the s/agent-fix-win AI found a better alternative fix than the PR label May 26, 2026
@Vignesh-SF3580

Copy link
Copy Markdown
Contributor Author

🤖 AI Summary

👋 @Vignesh-SF3580 — new AI review results are available. Please review the latest session below.

📊 Review Session8368c74 · Update PR changes similar to 35597 · 2026-05-27 00:33 UTC

🚦 Gate — Test Before & After Fix

Gate Result: ❌ FAILED

Platform: WINDOWS · Base: main · Merge base: b0ea772f

🩺 Fix breaks tests — one or more tests fail with the fix applied, and none of the failures are resolved by the fix.

Test Without Fix (expect FAIL) With Fix (expect PASS)
📱 BorderTests (BorderExcludedFromControlViewByDefault, BorderOptsIntoControlViewWhenDescriptionIsSet) Category=Border ✅ FAIL — 348s ❌ FAIL — 218s
🖥️ Issue27627 Issue27627 ❌ PASS — 498s ✅ PASS — 497s
🔴 Without fix — 📱 BorderTests (BorderExcludedFromControlViewByDefault, BorderOptsIntoControlViewWhenDescriptionIsSet): FAIL ✅ · 348s

  Determining projects to restore...
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 1.66 sec).
  Restored D:\a\1\s\src\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj (in 15 ms).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 74 ms).
  Restored D:\a\1\s\src\Controls\src\Core.Design\Controls.Core.Design.csproj (in 5 ms).
  Restored D:\a\1\s\src\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj (in 922 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 99 ms).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 94 ms).
  Restored D:\a\1\s\src\TestUtils\src\DeviceTests\TestUtils.DeviceTests.csproj (in 1.95 sec).
  Restored D:\a\1\s\src\TestUtils\src\DeviceTests.Runners\TestUtils.DeviceTests.Runners.csproj (in 598 ms).
  Restored D:\a\1\s\src\TestUtils\src\DeviceTests.Runners.SourceGen\TestUtils.DeviceTests.Runners.SourceGen.csproj (in 14.26 sec).
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 61 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 13 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 29 ms).
  Restored D:\a\1\s\src\Core\tests\DeviceTests.Shared\Core.DeviceTests.Shared.csproj (in 54 ms).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 455 ms).
  Restored D:\a\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj (in 36.09 sec).
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Core -> D:\a\1\s\artifacts\bin\Core\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Release\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Maps -> D:\a\1\s\artifacts\bin\Maps\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  TestUtils.DeviceTests -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.TestUtils.DeviceTests.dll
  TestUtils.DeviceTests.Runners -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests.Runners\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.TestUtils.DeviceTests.Runners.dll
  Core.DeviceTests.Shared -> D:\a\1\s\artifacts\bin\Core.DeviceTests.Shared\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.DeviceTests.Shared.dll
  TestUtils.DeviceTests.Runners.SourceGen -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests.Runners.SourceGen\Release\netstandard2.0\Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  Controls.DeviceTests -> D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:04:59.62
Test run for D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Testhost process for source(s) 'D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll' exited with error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args) in /_/src/vstest/src/testhost.x86/Program.cs:line 41
. Please check the diagnostic logs for more information.
Results File: D:\a\1\s\artifacts\log\TestResults.trx

Test Run Aborted.
  Tests completed with exit code: 1

🟢 With fix — 📱 BorderTests (BorderExcludedFromControlViewByDefault, BorderOptsIntoControlViewWhenDescriptionIsSet): FAIL ❌ · 218s

  Determining projects to restore...
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 646 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 16 ms).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 824 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 42 ms).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 107 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj (in 14 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 87 ms).
  Restored D:\a\1\s\src\Controls\src\Core.Design\Controls.Core.Design.csproj (in 3 ms).
  Restored D:\a\1\s\src\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj (in 42 ms).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 71 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 63 ms).
  5 of 16 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Core -> D:\a\1\s\artifacts\bin\Core\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Release\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  TestUtils.DeviceTests -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.TestUtils.DeviceTests.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Maps -> D:\a\1\s\artifacts\bin\Maps\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  TestUtils.DeviceTests.Runners -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests.Runners\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.TestUtils.DeviceTests.Runners.dll
  Core.DeviceTests.Shared -> D:\a\1\s\artifacts\bin\Core.DeviceTests.Shared\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.DeviceTests.Shared.dll
  TestUtils.DeviceTests.Runners.SourceGen -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests.Runners.SourceGen\Release\netstandard2.0\Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  Controls.DeviceTests -> D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:03:26.35
Test run for D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Testhost process for source(s) 'D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll' exited with error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args) in /_/src/vstest/src/testhost.x86/Program.cs:line 41
. Please check the diagnostic logs for more information.
WARNING: Overwriting results file: D:\a\1\s\artifacts\log\TestResults.trx
Results File: D:\a\1\s\artifacts\log\TestResults.trx

Test Run Aborted.
  Tests completed with exit code: 1

🔴 Without fix — 🖥️ Issue27627: PASS ❌ · 498s

  Determining projects to restore...
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 602 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 602 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 130 ms).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 266 ms).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 172 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj (in 12 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 93 ms).
  Restored D:\a\1\s\src\Controls\src\Core.Design\Controls.Core.Design.csproj (in 4 ms).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 57 ms).
  Restored D:\a\1\s\src\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj (in 27 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 61 ms).
  3 of 14 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:06:04.63
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
  Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
  Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
  UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
  UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
  VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
  UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
  VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
  Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 5/26/2026 9:38:27 PM FixtureSetup for Issue27627(Windows)
>>>>> 5/26/2026 9:38:34 PM VerifyBorderAutomationPeer Start
>>>>> 5/26/2026 9:38:35 PM VerifyBorderAutomationPeer Stop
  Passed VerifyBorderAutomationPeer [1 s]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.12]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.44]   Discovered:  Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27627.trx

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 23.2833 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27627.trx

🟢 With fix — 🖥️ Issue27627: PASS ✅ · 497s

  Determining projects to restore...
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 637 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 626 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 98 ms).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 244 ms).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 182 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj (in 11 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 78 ms).
  Restored D:\a\1\s\src\Controls\src\Core.Design\Controls.Core.Design.csproj (in 3 ms).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 50 ms).
  Restored D:\a\1\s\src\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj (in 36 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 49 ms).
  3 of 14 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
  Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:06:07.47
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
  Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
  Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14198573
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
  UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
  UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
  VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
  UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
  VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
  Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 5/26/2026 9:50:22 PM FixtureSetup for Issue27627(Windows)
>>>>> 5/26/2026 9:50:29 PM VerifyBorderAutomationPeer Start
>>>>> 5/26/2026 9:50:30 PM VerifyBorderAutomationPeer Stop
  Passed VerifyBorderAutomationPeer [1 s]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.11]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.40]   Discovered:  Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27627.trx

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 23.1730 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27627.trx

⚠️ Failure Details

  • Issue27627 PASSED without fix (should fail) — tests don't catch the bug
  • BorderTests (BorderExcludedFromControlViewByDefault, BorderOptsIntoControlViewWhenDescriptionIsSet) FAILED with fix (should pass)

📁 Fix files reverted (3 files)

  • eng/pipelines/ci-copilot.yml
  • src/Core/src/Platform/Windows/ContentPanel.cs
  • src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt

New files (not reverted):

  • src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs

🧪 UI Tests — Border,ViewBaseTests

Detected UI test categories: Border,ViewBaseTests

Deep UI tests — 155 passed, 0 failed across 2 categories on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Border 40/40 ✓ —
ViewBaseTests 115/115 ✓ —
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)
🔍 Regression Cross-Reference

🔍 Regression Cross-Reference

🟢 No regression risks detected. No labeled bug-fix PRs in the last 6 months touched the modified files.

🔍 Pre-Flight — Context & Validation

Issue: #27627 - Adding AutomationPeers to Windows Borders PR: #35577 - [Windows] Border: Add AutomationPeer support Platforms Affected: Windows Files Changed: 3 implementation, 3 test

Key Findings

  • Issue Adding AutomationPeers to Windows Borders #27627 reports Windows Border instances with semantic descriptions are not exposed/focusable/readable through Windows UI Automation like comparable Mac Catalyst scenarios.
  • PR [Windows] Border: Add AutomationPeer support #35577 adds a Windows MauiBorderAutomationPeer for ContentPanel only when the panel backs IBorderView, preserving default behavior for other ContentPanel uses.
  • The PR fix uses an opt-in model: semantic Name/HelpText or explicit accessibility view opt Borders into Control view; explicit Raw opt-out wins; Content view requires explicit IsInAccessibleTree=true.
  • Added coverage includes Windows Border device tests for AutomationId-only exclusion and semantic Description opt-in, plus a Windows UI issue test for parent/nested Border and child Label discovery.
  • Prior inline review comments focused on semantic-only accessibility coverage; the latest PR revision addresses those with peer logic and device tests.

Code Review Summary

Verdict: LGTM Confidence: high Errors: 0 | Warnings: 0 | Suggestions: 0

Key code review findings:

  • No material findings. Independent review found the implementation scoped, consistent with MAUI Windows semantics, and covered by targeted tests.

Fix Candidates

Source Approach Test Result Files Changed Notes

PR PR #35577 Add MauiBorderAutomationPeer from ContentPanel.OnCreateAutomationPeer() for IBorderView; use semantic properties and explicit accessibility view as opt-in signals. ❌ FAILED (Gate) ContentPanel.cs, MauiBorderAutomationPeer.cs, tests, PublicAPI Original PR; gate reported tests did not behave as expected in the prior phase.
🔬 Code Review — Deep Analysis

Code Review - PR #35577

Independent Assessment

What this changes: Adds a Windows-only MauiBorderAutomationPeer for ContentPanel when it backs an IBorderView, exposing Border metadata to UI Automation while keeping decorative Borders out of Control/Content views unless semantic or accessibility opt-in signals are present. Adds Windows device tests and an Appium issue test. Inferred motivation: Windows Borders previously had no useful UIA peer because ContentPanel inherits from Panel, so Borders could not be discovered/read consistently by accessibility tooling or automation.

Reconciliation with PR Narrative

Author claims: The PR adds scoped Border automation-peer support, uses opt-in Control/Content view behavior, honors explicit opt-out, preserves other ContentPanel usages, and fixes #27627. Agreement/disagreement: The code matches the claims. Prior review feedback about semantic-only Borders is addressed by IsControlElementCore() checking Name/HelpText and by added device coverage for SemanticProperties.Description.

Findings

No material findings.

Devil's Advocate

I checked whether the peer could affect non-Border ContentPanel users, whether AutomationId alone unintentionally opts into screen-reader views, and whether semantic-only Borders remain excluded. The IBorderView guard, ReadLocalValue opt-out handling, and device tests cover those risks. The only remaining blind spot is platform behavioral nuance in WinUI UIA child enumeration, but I did not find evidence of a merge-blocking defect.

Verdict: LGTM

Confidence: high Summary: The implementation is scoped, consistent with MAUI Windows semantics mapping, and covered by targeted tests. CI check runs visible for the PR are green, and I found no issues requiring changes.

🔧 Fix — Analysis & Comparison

Fix Candidates

Source Approach Test Result Files Changed Notes

1 try-fix Handler-layer AccessibilityView mapping with a plain FrameworkElementAutomationPeer for Border-backed ContentPanel. ⚠️ BLOCKED 4 files Build succeeded, but Windows VSTest crashed before executing tests with missing Microsoft.TestPlatform.CoreUtilities. Approach is distinct from PR but not empirically validated.
2 try-fix Always install a MauiContentPanelAutomationPeer and gate Border-specific UIA behavior inside the peer. ⚠️ BLOCKED 4 files Build succeeded, but Windows VSTest crashed before executing tests with the same missing Microsoft.TestPlatform.CoreUtilities. Avoids mapper ordering risk but broadens ContentPanel peer surface.
3 try-fix Replace the MAUI peer strategy with a native WinUI Border automation host and mirror automation properties to it. ❌ FAIL 5 files Build succeeded, but Windows VSTest aborted before executing tests with the same missing Microsoft.TestPlatform.CoreUtilities; no behavioral result available.
4 try-fix Move the Border peer into a private nested ContentPanel peer/helper and delete the separate peer file. ❌ FAIL 3 files Build succeeded, then VSTest aborted with missing Microsoft.TestPlatform.CoreUtilities. This is a smaller-file variant of the PR peer approach, not demonstrably better.
5 try-fix Switch Windows BorderHandler platform view to a real WinUI Border with an inner ContentPanel, relying on native BorderAutomationPeer. ❌ FAIL 5 files WinUI Border is sealed, so deriving a wrapper cannot compile; direct platform-view swap changes shipped handler API surface and is too invasive. Final test run still hit the VSTest dependency failure.
6 try-fix Propagate Border semantics to the child content element and keep ContentPanel decorative/raw, avoiding custom peers. ⚠️ BLOCKED 2 files Self-review found fundamental accessibility flaws: Border loses its own identity, child semantics are overwritten, and empty Borders lose semantics. Test execution was also blocked by the VSTest dependency failure.
PR PR #35577 Dedicated MauiBorderAutomationPeer returned by ContentPanel.OnCreateAutomationPeer() for IBorderView. ❌ FAILED (Gate) 6 files Gate failed because Windows device-test execution crashed; UI issue test passed both without and with fix.

Cross-Pollination

Model Round New Ideas? Details
claude-opus-4.6 1 Yes Candidate 1 explored handler-layer mapping instead of a dedicated Border peer.
claude-opus-4.7 1 Yes Candidate 2 explored an always-installed ContentPanel-level peer with Border behavior gated inside.
gpt-5.3-codex 1 Yes Candidate 3 explored changing native element composition by adding a WinUI Border automation host.
gpt-5.5 1 Yes Candidate 4 explored a smaller private nested peer/helper rather than a separate MauiBorderAutomationPeer file.
claude-opus-4.6 2 No No remaining non-trivial variants beyond peer/host/property-mirroring strategies.
claude-opus-4.7 2 Yes Suggested routing semantics to a real WinUI Border host and hiding ContentPanel; covered by candidate 5 / candidate 3 family.
gpt-5.3-codex 2 Yes Suggested switching BorderHandler platform view to real WinUI Border; covered by candidate 5.
gpt-5.5 2 No Remaining ideas are trivial rearrangements of custom peer/property/native-host strategies.
claude-opus-4.6 3 Yes Suggested propagating Border semantics to child content; covered by candidate 6 and rejected by self-review.
claude-opus-4.7 3 No Peer via current platform root, broad peer, native host, and platform-view swap are exhausted.
gpt-5.3-codex 3 No Current PR peer approach matches standard WinUI pattern; other structural alternatives were covered.
gpt-5.5 3 No WinUI requires an AutomationPeer owner for Panel-derived ContentPanel; remaining options are non-viable or trivial.
Exhausted: Yes Selected Fix: PR #35577's dedicated MauiBorderAutomationPeer — no alternative candidate passed tests or proved better. Candidate 6 established that avoiding a custom peer by pushing semantics to children is architecturally wrong, candidate 5 is too invasive and changes handler API surface, and candidates 1-4 are either riskier variants or not demonstrably better. Empirical validation is blocked by the Windows VSTest Microsoft.TestPlatform.CoreUtilities dependency failure.

📋 Report — Final Recommendation

Comparative Report: PR #35577

Candidates compared

Rank Candidate Regression result Assessment
1 pr-plus-reviewer Not rerun; based on PR plus reviewer-applied test fixes Same production fix as PR, with stronger tests that remove the false-positive explicit accessibility opt-in and assert the new peer behavior. Best overall candidate.
2 pr Gate failed Production approach is sound, but gate reported that the UI issue test passed without the fix and the device test run failed. Expert review found the UI test could pass via IsInAccessibleTree=true, so raw PR coverage is weaker.
3 try-fix-2 Blocked Always-installed ContentPanel peer with Border behavior gated internally. Plausible but broadens peer behavior for all ContentPanel uses and is not demonstrably better than the scoped PR peer.
4 try-fix-1 Blocked Handler-layer accessibility mapping with a plain FrameworkElementAutomationPeer. Build succeeded, but validation was blocked. It adds mapper-order risk and is less direct than the peer-based PR fix.
5 try-fix-4 Failed Private nested peer/helper variant. Similar to the PR but less maintainable because automation logic is folded into ContentPanel; test execution still failed.
6 try-fix-3 Failed Native WinUI Border automation host and property mirroring. More invasive composition change with additional synchronization risk; not better than a focused automation peer.
7 try-fix-6 Blocked with self-review critical flaws Propagates Border semantics to child content. Rejected because it loses the Border's own accessibility identity, overwrites child semantics, and fails for empty Borders.
8 try-fix-5 Failed Switches Windows BorderHandler platform view to WinUI Border. Too invasive, changes shipped handler API surface, and initially hit WinUI sealed-type constraints.

Key comparison points

The candidate family divides into three strategies: a custom peer on the existing ContentPanel, handler/property mapping, or native-host/platform-view restructuring. The custom peer is the narrowest production change because it keeps the existing rendering and handler platform view intact while giving meaningful Border containers their own UIA identity. The handler/property and child-propagation approaches either depend on mapper ordering or conflate parent and child semantics. The native-host/platform-view approaches are too invasive for this bug fix.

Regression evidence is imperfect because Windows device-test execution repeatedly hit the Microsoft.TestPlatform.CoreUtilities VSTest dependency failure. The supplied gate result must still be respected: candidates with failed regression outcomes rank below candidates that did not introduce those failures. The expert review identified that the raw PR's UI test did not reliably catch the bug, and pr-plus-reviewer directly addresses that weakness without changing the production fix.

Winner

Winner: pr-plus-reviewer

pr-plus-reviewer keeps the PR's focused MauiBorderAutomationPeer implementation and applies the expert reviewer's actionable test feedback. It is the strongest candidate because it preserves the best production architecture while making the regression tests target semantic-description opt-in and PR-specific peer behavior.

📊 Review Session2db6873 · Update MauiBorderAutomationPeer.cs · 2026-05-22 14:18 UTC

  • Peer predicate: MauiBorderAutomationPeer now opts in through Name, HelpText, or IsInAccessibleTree (aligned with PR 35597), so semantic-only Borders are exposed correctly.
  • UI test scenario: Yes, the UI test passes without the fix, and that is expected. This PR mainly targets screen-reader announcement behavior through the Control view, while Appium uses the Content view. The UI test is retained to ensure the existing detection path (Description + IsInAccessibleTree=True) continues working and is not broken by the new peer.
  • Device-test regression coverage: Added stronger assertions (GetClassName == "Border" and GetAutomationControlType == Pane) so the tests directly validate that the new MauiBorderAutomationPeer is being used, not just the final IsControlElement result.
  • BorderTests failed with fix: Ensured the tests passed locally. The errors shared here appear to be environmental issues rather than actual test failures.

@kubaflo

kubaflo commented May 27, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/refactor-copilot-yml -p windows

@MauiBot MauiBot added s/agent-fix-win AI found a better alternative fix than the PR and removed s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates labels May 27, 2026
@MauiBot

MauiBot commented May 27, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI Summary

👋 @Vignesh-SF3580 — new AI review results are available. Please review the latest session below.

📊 Review Sessione797896 · Update BorderTests.Windows.cs · 2026-05-27 13:41 UTC
🚦 Gate — Test Before & After Fix

Gate Result: ❌ FAILED

Platform: WINDOWS · Base: main · Merge base: b0ea772f

🩺 Fix breaks tests — one or more tests fail with the fix applied, and none of the failures are resolved by the fix.

Test Without Fix (expect FAIL) With Fix (expect PASS)
📱 BorderTests (BorderExcludedFromControlViewByDefault, BorderOptsIntoControlViewWhenDescriptionIsSet) Category=Border ✅ FAIL — 335s ❌ FAIL — 209s
🖥️ Issue27627 Issue27627 ❌ PASS — 478s ✅ PASS — 467s
🔴 Without fix — 📱 BorderTests (BorderExcludedFromControlViewByDefault, BorderOptsIntoControlViewWhenDescriptionIsSet): FAIL ✅ · 335s
  Determining projects to restore...
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 1.93 sec).
  Restored D:\a\1\s\src\TestUtils\src\DeviceTests.Runners\TestUtils.DeviceTests.Runners.csproj (in 2.23 sec).
  Restored D:\a\1\s\src\TestUtils\src\DeviceTests\TestUtils.DeviceTests.csproj (in 4.27 sec).
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 39 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 11 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 23 ms).
  Restored D:\a\1\s\src\Core\tests\DeviceTests.Shared\Core.DeviceTests.Shared.csproj (in 40 ms).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 79 ms).
  Restored D:\a\1\s\src\TestUtils\src\DeviceTests.Runners.SourceGen\TestUtils.DeviceTests.Runners.SourceGen.csproj (in 4.01 sec).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 48 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj (in 10 ms).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 50 ms).
  Restored D:\a\1\s\src\Controls\src\Core.Design\Controls.Core.Design.csproj (in 3 ms).
  Restored D:\a\1\s\src\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj (in 90 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 43 ms).
  Restored D:\a\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj (in 31.85 sec).
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Core -> D:\a\1\s\artifacts\bin\Core\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Release\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  TestUtils.DeviceTests -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.TestUtils.DeviceTests.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Maps -> D:\a\1\s\artifacts\bin\Maps\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  TestUtils.DeviceTests.Runners -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests.Runners\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.TestUtils.DeviceTests.Runners.dll
  Core.DeviceTests.Shared -> D:\a\1\s\artifacts\bin\Core.DeviceTests.Shared\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.DeviceTests.Shared.dll
  TestUtils.DeviceTests.Runners.SourceGen -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests.Runners.SourceGen\Release\netstandard2.0\Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  Controls.DeviceTests -> D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:04:46.42
Test run for D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Testhost process for source(s) 'D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll' exited with error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args) in /_/src/vstest/src/testhost.x86/Program.cs:line 41
. Please check the diagnostic logs for more information.
Results File: D:\a\1\s\artifacts\log\TestResults.trx

Test Run Aborted.
  Tests completed with exit code: 1

🟢 With fix — 📱 BorderTests (BorderExcludedFromControlViewByDefault, BorderOptsIntoControlViewWhenDescriptionIsSet): FAIL ❌ · 209s
  Determining projects to restore...
  Restored D:\a\1\s\src\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj (in 544 ms).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 174 ms).
  Restored D:\a\1\s\src\Controls\src\Core.Design\Controls.Core.Design.csproj (in 4 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 887 ms).
  Restored D:\a\1\s\src\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj (in 28 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 77 ms).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 68 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 31 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 41 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 36 ms).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 80 ms).
  5 of 16 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Core -> D:\a\1\s\artifacts\bin\Core\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Release\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  TestUtils.DeviceTests -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.TestUtils.DeviceTests.dll
  Maps -> D:\a\1\s\artifacts\bin\Maps\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  TestUtils.DeviceTests.Runners -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests.Runners\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.TestUtils.DeviceTests.Runners.dll
  Core.DeviceTests.Shared -> D:\a\1\s\artifacts\bin\Core.DeviceTests.Shared\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.DeviceTests.Shared.dll
  TestUtils.DeviceTests.Runners.SourceGen -> D:\a\1\s\artifacts\bin\TestUtils.DeviceTests.Runners.SourceGen\Release\netstandard2.0\Microsoft.Maui.TestUtils.DeviceTests.Runners.SourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Release\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  Controls.DeviceTests -> D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:03:18.15
Test run for D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Testhost process for source(s) 'D:\a\1\s\artifacts\bin\Controls.DeviceTests\Release\net10.0-windows10.0.19041.0\win-x64\Microsoft.Maui.Controls.DeviceTests.dll' exited with error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args) in /_/src/vstest/src/testhost.x86/Program.cs:line 41
. Please check the diagnostic logs for more information.
WARNING: Overwriting results file: D:\a\1\s\artifacts\log\TestResults.trx
Results File: D:\a\1\s\artifacts\log\TestResults.trx

Test Run Aborted.
  Tests completed with exit code: 1

🔴 Without fix — 🖥️ Issue27627: PASS ❌ · 478s
  Determining projects to restore...
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 632 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 632 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 112 ms).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 263 ms).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 179 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj (in 11 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 65 ms).
  Restored D:\a\1\s\src\Controls\src\Core.Design\Controls.Core.Design.csproj (in 4 ms).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 62 ms).
  Restored D:\a\1\s\src\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj (in 30 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 71 ms).
  3 of 14 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:05:50.63
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
  Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
  UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
  UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
  VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
  UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
  VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
  Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 5/27/2026 11:40:45 AM FixtureSetup for Issue27627(Windows)
>>>>> 5/27/2026 11:40:51 AM VerifyBorderAutomationPeer Start
>>>>> 5/27/2026 11:40:53 AM VerifyBorderAutomationPeer Stop
  Passed VerifyBorderAutomationPeer [1 s]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.16]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.39]   Discovered:  Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27627.trx

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 23.3180 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27627.trx

🟢 With fix — 🖥️ Issue27627: PASS ✅ · 467s
  Determining projects to restore...
  Restored D:\a\1\s\src\Controls\src\Xaml.Design\Controls.Xaml.Design.csproj (in 733 ms).
  Restored D:\a\1\s\src\Controls\src\Core.Design\Controls.Core.Design.csproj (in 4 ms).
  Restored D:\a\1\s\src\Controls\src\BindingSourceGen\Controls.BindingSourceGen.csproj (in 22 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 98 ms).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 951 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 35 ms).
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 36 ms).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 29 ms).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 83 ms).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 55 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 44 ms).
  3 of 14 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:05:48.22
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
  Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
  Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.80-ci+azdo.14205949
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
  UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
  UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
  UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
  VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
  VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
  Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 1 of 1 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 5/27/2026 11:52:02 AM FixtureSetup for Issue27627(Windows)
>>>>> 5/27/2026 11:52:09 AM VerifyBorderAutomationPeer Start
>>>>> 5/27/2026 11:52:10 AM VerifyBorderAutomationPeer Stop
  Passed VerifyBorderAutomationPeer [1 s]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.11]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.31]   Discovered:  Controls.TestCases.WinUI.Tests
Results File: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27627.trx

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 21.1433 Seconds
>>> TRX_RESULT_FILE: D:\a\1\s\CustomAgentLogsTmp\UITests\TestResults\Issue27627.trx

⚠️ Failure Details

  • Issue27627 PASSED without fix (should fail) — tests don't catch the bug
  • BorderTests (BorderExcludedFromControlViewByDefault, BorderOptsIntoControlViewWhenDescriptionIsSet) FAILED with fix (should pass)
📁 Fix files reverted (3 files)
  • eng/pipelines/ci-copilot.yml
  • src/Core/src/Platform/Windows/ContentPanel.cs
  • src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt

New files (not reverted):

  • src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs

🧪 UI Tests — Border,ViewBaseTests

Detected UI test categories: Border,ViewBaseTests

Deep UI tests — 154 passed, 1 failed across 2 categories on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
Border 39/40 (1 ❌)
ViewBaseTests 115/115 ✓
Border — 1 failed test
ExceptionShouldNotOccurWhenIsClippedToBoundsIsTrue
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.Issues.Issue18937.ExceptionShouldNotOccurWhenIsClippedToBoundsIsTrue() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18937.cs:line 17
   at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** argument
...

📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)


🔍 Regression Cross-Reference

🔍 Regression Cross-Reference

🟢 No regression risks detected. No labeled bug-fix PRs in the last 6 months touched the modified files.


🔍 Pre-Flight — Context & Validation

Issue: #27627 - Adding AutomationPeers to Windows Borders
PR: #35577 - [Windows] Border: Add AutomationPeer support
Platforms Affected: Windows
Files Changed: 3 implementation, 3 test

Key Findings

  • The PR adds a Windows MauiBorderAutomationPeer for ContentPanel instances whose CrossPlatformLayout is IBorderView, addressing Borders missing from the UI Automation tree.
  • The implementation follows an opt-in Control view model: explicit accessibility view, semantic description, or semantic hint expose Border to Control view; explicit IsInAccessibleTree=False wins as opt-out.
  • Gate output already exists and failed: the new Windows device tests failed both with and without the fix due Microsoft.TestPlatform.CoreUtilities testhost load failure, while the UI issue test unexpectedly passed without the fix.
  • Prior review comments focused on ensuring semantic-only Borders are covered and proving the new peer is used (GetClassName() == "Border", AutomationControlType.Pane).

Code Review Summary

Verdict: LGTM
Confidence: high
Errors: 0 | Warnings: 0 | Suggestions: 2

Key code review findings:

  • 💡 src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs: comment references MauiLayoutAutomationPeer, which does not exist on main; drop or inline the rationale.
  • 💡 src/Controls/tests/TestCases.HostApp/Issues/Issue27627.cs: host app sets both semantic descriptions and IsInAccessibleTree=True, so it does not isolate the description-only path; device tests are the authoritative semantic coverage.

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #35577 Override ContentPanel.OnCreateAutomationPeer() for IBorderView and add MauiBorderAutomationPeer with opt-in Control/Content view behavior plus Windows UI/device coverage. ❌ FAILED (Gate) ContentPanel.cs, MauiBorderAutomationPeer.cs, PublicAPI.Unshipped.txt, BorderTests.Windows.cs, Issue27627.cs test files Original PR; gate failure appears partly environmental for device tests and test-adequacy related for UI test.

🔬 Code Review — Deep Analysis

Code Review — PR #35577

Independent Assessment

What this changes: Adds a new MauiBorderAutomationPeer (internal, Windows-only) that ContentPanel.OnCreateAutomationPeer() returns when its cross-platform layout is an IBorderView. The peer provides correct UIA metadata (Pane control type, "Border" class name) and implements an opt-in model for the UIA Control and Content views — so decorative/structural Borders stay invisible to screen readers unless the developer explicitly annotates them with SemanticProperties.Description, SemanticProperties.Hint, or AutomationProperties.IsInAccessibleTree.

Inferred motivation: Panel (base of ContentPanel) has no OnCreateAutomationPeer override, so Borders were previously either absent from the UIA tree or exposed through the platform default with incorrect metadata, making them impossible to discover or describe with accessibility tools.


Reconciliation with PR Narrative

Author claims: Peer follows the opt-in model from PR #35597. Explicit opt-out (IsInAccessibleTree=False) takes precedence. AutomationId is UI-testing only and does not opt the Border into the Control view.

Agreement/disagreement: Code matches the description precisely. The platform mapping chain is correct: SemanticProperties.SetDescriptionAutomationProperties.SetNameIsControlElementCore() = true. The ReadLocalValue call is the right API (returns DependencyProperty.UnsetValue when not locally set, so the enum comparisons are safe). No disagreement with the PR narrative.


Findings

💡 Suggestion — Dangling MauiLayoutAutomationPeer reference in comment

src/Core/src/Platform/Windows/MauiBorderAutomationPeer.cs, line 29:

// ... See MauiLayoutAutomationPeer for rationale.

MauiLayoutAutomationPeer does not exist on main. It lives in PR #35597 targeting inflight/current. After this PR merges, readers following the reference will find nothing. Either drop the reference or inline the key rationale.

💡 Suggestion — Host app's redundant IsInAccessibleTree=True masks the Description-only path

src/Controls/tests/TestCases.HostApp/Issues/Issue27627.cs, line 19. Both borders set SemanticProperties.SetDescription and AutomationProperties.SetIsInAccessibleTree(border, true). The WaitForElement call will succeed even if the AutomationProperties.Name-check path in IsControlElementCore is broken, because AccessibilityView.Content alone satisfies it. The device tests in BorderTests.Windows.cs are the authoritative coverage; a comment here noting that would prevent future confusion.


Devil's Advocate

  • Is the CrossPlatformLayout is IBorderView check safe? Yes — ContentPanel is used for RefreshView (sets CrossPlatformLayout to an IRefreshView) and standard content hosts. Since IBorderView is a distinct interface from IContentView/IRefreshView, the guard is narrowly scoped and won't fire for non-Border usages.
  • Is ReadLocalValue vs GetValue correct? Yes. GetValue would return the inherited or default AccessibilityView (which could be Content if a parent set it), giving wrong results. ReadLocalValue returns only what was explicitly set on this element.
  • Is the IsContentElementCore asymmetry intentional? Yes. Semantic name/hint makes a Border announced by screen readers (IsControlElement=true) but not necessarily focused on in the "content view" traversal. Only an explicit IsInAccessibleTree=True (→ AccessibilityView.Content) elevates it to content view. This mirrors WinUI's own design philosophy.
  • CI failures: Pack macOS and the overall maui-pr rollup failed. The macOS failure is in a packaging job on a platform entirely unrelated to this Windows-only change. The Windows build, debug, release, and Helix unit tests all pass. This failure is almost certainly pre-existing.

Verdict: LGTM

Confidence: high
Summary: The implementation is architecturally sound, correctly scoped to Border (IBorderView guard), and uses the right WinUI APIs (ReadLocalValue, AutomationPeer override). The opt-in/opt-out logic maps correctly onto the MAUI → WinUI property translation chain. The two findings are minor documentation issues that do not affect correctness. The failing CI job is macOS packaging — unrelated to this Windows-only change.


🔧 Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix Handler mapper pushes AccessibilityView from Border semantics; peer is structural. FAIL 6 files UI issue test passed after removing masking IsInAccessibleTree=True; device tests blocked by VSTest assembly-load failure; adds mapper complexity.
2 try-fix BorderContentPanel subclass returns MauiBorderAutomationPeer; BorderHandler creates the subclass. FAIL 3 files UI issue test passed after removing masking IsInAccessibleTree=True; device tests blocked by same VSTest failure; strongest alternative.
PR PR #35577 Shared ContentPanel.OnCreateAutomationPeer() override with CrossPlatformLayout is IBorderView guard and peer-pull semantics. FAILED (Gate) 6 files Original PR; gate failed before this loop.

Cross-Pollination

Model/Reviewer Round New Ideas? Details
MAUI expert reviewer 1 Yes Suggested handler-push model for AccessibilityView decisions. Tested as try-fix-1.
MAUI expert reviewer 2 Yes Suggested BorderContentPanel platform-view specialization. Tested as try-fix-2.
MAUI expert reviewer 3 No Concluded no meaningfully different third approach: WinUI requires an OnCreateAutomationPeer() override, and viable locations were already covered by shared ContentPanel override and Border-only subclass.

Exhausted: Yes
Selected Fix: Candidate #2 is the best alternative, but no candidate can be marked fully passing because the Windows device-test leg aborts with the existing VSTest Microsoft.TestPlatform.CoreUtilities load failure. Candidate #2 is demonstrably cleaner than the PR architecturally because it scopes the automation peer to a Border-only platform view and avoids public ContentPanel API surface.


📋 Report — Final Recommendation

Comparative Report — PR #35577

Candidates

Candidate Approach Regression status Assessment
pr Submitted PR: shared ContentPanel.OnCreateAutomationPeer() override guarded by CrossPlatformLayout is IBorderView, plus MauiBorderAutomationPeer and Windows UI/device tests. Failed gate. Gate reported that tests did not behave as expected; Windows device tests were blocked by Microsoft.TestPlatform.CoreUtilities load failure and the UI issue test unexpectedly passed without the fix. Expert reviewer verdict is LGTM with high confidence and no actionable findings.
pr-plus-reviewer PR fix plus expert reviewer feedback. Same as pr; no reviewer change was applied. Functionally identical to pr.
try-fix-1 Windows Border handler semantics mapper pushes AutomationProperties.AccessibilityView; peer only supplies structural metadata. Failed full gate. Issue UI scenario passed after removing explicit IsInAccessibleTree=True, but Windows device tests aborted with the same VSTest load failure. Lower-ranked because it adds mapper-ordering complexity and splits UIA visibility behavior between the handler mapper and peer.
try-fix-2 Border-only BorderContentPanel : ContentPanel creates MauiBorderAutomationPeer; BorderHandler.Windows instantiates the subclass. Failed full gate. Candidate built and Issue27627 passed after removing explicit IsInAccessibleTree=True, but Windows device tests aborted with the same VSTest load failure. Architecturally cleanest alternative because it scopes the peer to Border platform views and avoids a ContentPanel public API entry, but it does not have a full-regression advantage over the PR fix.

Ranking

  1. pr — winning candidate.
  2. pr-plus-reviewer — equivalent to pr, but no actual reviewer-applied delta exists.
  3. try-fix-2 — strongest alternative, but still failed the full regression gate and would replace an expert-reviewed LGTM PR implementation without empirical advantage.
  4. try-fix-1 — failed the full regression gate and has extra mapper complexity.

Winner

pr is the winning candidate. All candidates failed the full regression gate, so no failed candidate can be promoted over a passing one; among the failed candidates, the submitted PR has the strongest review signal because the expert reviewer found no actionable code issues. try-fix-2 is a credible architectural alternative, but its gate status is not better than the PR and the reviewer did not require switching away from the current guarded ContentPanel implementation.


@kubaflo kubaflo changed the base branch from main to inflight/current May 28, 2026 08:56

@kubaflo kubaflo 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.

Can you please resolve conflicts?

@Vignesh-SF3580

Copy link
Copy Markdown
Contributor Author

Can you please resolve conflicts?

@kubaflo I have resolved the conflicts.

@kubaflo kubaflo merged commit 776f9cd into dotnet:inflight/current May 29, 2026
24 of 36 checks passed
@github-actions github-actions Bot added this to the .NET 10.0 SR8 milestone May 29, 2026
PureWeen pushed a commit that referenced this pull request Jun 2, 2026
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change
This PR is the first part of the split from #27713. It adds an
AutomationPeer for the Windows Border (ContentPanel) so the control is
properly exposed to UI Automation and accessibility tools while avoiding
unnecessary noise in the screen-reader reading order.

- Added a new internal MauiBorderAutomationPeer derived from
FrameworkElementAutomationPeer.
- Overrode ContentPanel.OnCreateAutomationPeer() to return
MauiBorderAutomationPeer only when CrossPlatformLayout is IBorderView.
Other ContentPanel usages continue using the default behavior.
- This peer is needed because Panel (the base class of ContentPanel)
does not provide a default AutomationPeer, so Border was previously
missing or not exposed correctly in the UIA tree.
- The peer follows an opt-in model for the screen-reader Control view,
aligned with the layout AutomationPeer improvements from #35597.

Added explicit opt-out handling so
AutomationProperties.IsInAccessibleTree="False" always takes precedence
over any opt-in signal, matching native WinUI Border behavior.

### How It Works

On Windows, a MAUI Border is rendered using a native ContentPanel
derived from Panel. UI Automation discovers elements by calling
OnCreateAutomationPeer() on the native control and then querying the
returned peer for details such as control type, class name, automation
ID, accessible name, and Control / Content view membership.

- **Peer entry point:** ContentPanel.OnCreateAutomationPeer() now
returns MauiBorderAutomationPeer only when CrossPlatformLayout is
IBorderView. All other ContentPanel usages continue using the default
behavior, so the change is scoped only to Border.
- **What the peer provides:** UI Automation queries methods like
GetAutomationControlTypeCore, GetClassNameCore, IsControlElementCore,
and IsContentElementCore. Existing MAUI mappings for AutomationId,
SemanticProperties.Description, and Hint continue through the base peer
implementation.
- **Control View vs Content View:** IsControlElementCore() is opt-in. It
returns true only when the developer explicitly marks the Border as
meaningful to accessibility tools using SemanticProperties.Description,
SemanticProperties.Hint, or
AutomationProperties.IsInAccessibleTree="True". This keeps decorative or
structural Borders out of the screen-reader reading order.
IsContentElementCore() requires explicit IsInAccessibleTree="True".
AutomationId alone is treated as a UI-testing hook and does not move the
Border into the accessibility views.
- **Explicit opt-out:** When
AutomationProperties.IsInAccessibleTree="False" is set
(AccessibilityView.Raw), both IsControlElementCore() and
IsContentElementCore() immediately return false before evaluating any
opt-in signals. This matches native WinUI Border behavior where an
explicit opt-out always takes priority.
- **Class name:** GetClassNameCore() returns the cross-platform layout
type name, such as "Border" or a derived type name like "MyBorder",
instead of the generic native "Panel" name.


### Overridden Core Methods and Purpose

**1. GetAutomationControlTypeCore()**
Returns AutomationControlType.Pane, which is the most suitable type for
a layout container that is not an interactive control like a button or
checkbox. This allows accessibility tools to treat the element as a
structural container.
**2. GetClassNameCore()**
Returns the cross-platform control type name (for example, "Border")
using panel.CrossPlatformLayout?.GetType().Name, with a fallback to
nameof(Panel). This exposes the MAUI control name instead of the generic
native Panel.
**3. IsControlElementCore() (opt-in + opt-out)**
Returns false immediately when AccessibilityView.Raw is set
(IsInAccessibleTree="False"). Otherwise, it returns true when
AccessibilityView is Control or Content (IsInAccessibleTree="True"), or
when AutomationProperties.Name (SemanticProperties.Description) or
AutomationProperties.HelpText (SemanticProperties.Hint) is set. If none
of these conditions are met, it returns false, keeping structural or
decorative Borders out of the Control view.
**4. IsContentElementCore() (explicit opt-in only)**
Returns false when AccessibilityView.Raw is set. Otherwise, it returns
true only when AccessibilityView.Content is set
(IsInAccessibleTree="True"). AutomationId alone does not move the Border
into the Content view.

### Issues Fixed

Fixes #27627

---------

Co-authored-by: Tamilarasan Paranthaman <tamilarasan.paranthaman@syncfusion.com>
Co-authored-by: Tamilarasan Paranthaman <93904422+Tamilarasan-Paranthaman@users.noreply.github.com>
PureWeen pushed a commit that referenced this pull request Jun 11, 2026
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change
This PR is the first part of the split from #27713. It adds an
AutomationPeer for the Windows Border (ContentPanel) so the control is
properly exposed to UI Automation and accessibility tools while avoiding
unnecessary noise in the screen-reader reading order.

- Added a new internal MauiBorderAutomationPeer derived from
FrameworkElementAutomationPeer.
- Overrode ContentPanel.OnCreateAutomationPeer() to return
MauiBorderAutomationPeer only when CrossPlatformLayout is IBorderView.
Other ContentPanel usages continue using the default behavior.
- This peer is needed because Panel (the base class of ContentPanel)
does not provide a default AutomationPeer, so Border was previously
missing or not exposed correctly in the UIA tree.
- The peer follows an opt-in model for the screen-reader Control view,
aligned with the layout AutomationPeer improvements from #35597.

Added explicit opt-out handling so
AutomationProperties.IsInAccessibleTree="False" always takes precedence
over any opt-in signal, matching native WinUI Border behavior.

### How It Works

On Windows, a MAUI Border is rendered using a native ContentPanel
derived from Panel. UI Automation discovers elements by calling
OnCreateAutomationPeer() on the native control and then querying the
returned peer for details such as control type, class name, automation
ID, accessible name, and Control / Content view membership.

- **Peer entry point:** ContentPanel.OnCreateAutomationPeer() now
returns MauiBorderAutomationPeer only when CrossPlatformLayout is
IBorderView. All other ContentPanel usages continue using the default
behavior, so the change is scoped only to Border.
- **What the peer provides:** UI Automation queries methods like
GetAutomationControlTypeCore, GetClassNameCore, IsControlElementCore,
and IsContentElementCore. Existing MAUI mappings for AutomationId,
SemanticProperties.Description, and Hint continue through the base peer
implementation.
- **Control View vs Content View:** IsControlElementCore() is opt-in. It
returns true only when the developer explicitly marks the Border as
meaningful to accessibility tools using SemanticProperties.Description,
SemanticProperties.Hint, or
AutomationProperties.IsInAccessibleTree="True". This keeps decorative or
structural Borders out of the screen-reader reading order.
IsContentElementCore() requires explicit IsInAccessibleTree="True".
AutomationId alone is treated as a UI-testing hook and does not move the
Border into the accessibility views.
- **Explicit opt-out:** When
AutomationProperties.IsInAccessibleTree="False" is set
(AccessibilityView.Raw), both IsControlElementCore() and
IsContentElementCore() immediately return false before evaluating any
opt-in signals. This matches native WinUI Border behavior where an
explicit opt-out always takes priority.
- **Class name:** GetClassNameCore() returns the cross-platform layout
type name, such as "Border" or a derived type name like "MyBorder",
instead of the generic native "Panel" name.


### Overridden Core Methods and Purpose

**1. GetAutomationControlTypeCore()**
Returns AutomationControlType.Pane, which is the most suitable type for
a layout container that is not an interactive control like a button or
checkbox. This allows accessibility tools to treat the element as a
structural container.
**2. GetClassNameCore()**
Returns the cross-platform control type name (for example, "Border")
using panel.CrossPlatformLayout?.GetType().Name, with a fallback to
nameof(Panel). This exposes the MAUI control name instead of the generic
native Panel.
**3. IsControlElementCore() (opt-in + opt-out)**
Returns false immediately when AccessibilityView.Raw is set
(IsInAccessibleTree="False"). Otherwise, it returns true when
AccessibilityView is Control or Content (IsInAccessibleTree="True"), or
when AutomationProperties.Name (SemanticProperties.Description) or
AutomationProperties.HelpText (SemanticProperties.Hint) is set. If none
of these conditions are met, it returns false, keeping structural or
decorative Borders out of the Control view.
**4. IsContentElementCore() (explicit opt-in only)**
Returns false when AccessibilityView.Raw is set. Otherwise, it returns
true only when AccessibilityView.Content is set
(IsInAccessibleTree="True"). AutomationId alone does not move the Border
into the Content view.

### Issues Fixed

Fixes #27627

---------

Co-authored-by: Tamilarasan Paranthaman <tamilarasan.paranthaman@syncfusion.com>
Co-authored-by: Tamilarasan Paranthaman <93904422+Tamilarasan-Paranthaman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-border Border community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) t/a11y Relates to accessibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding AutomationPeers to Windows Borders

6 participants