Skip to content

[Validation only - do not merge] #33561 + #40666 - #40667

Closed
simonrozsival wants to merge 36 commits into
mainfrom
simonrozsival-validation-pr-33561-40666
Closed

simonrozsival wants to merge 36 commits into
mainfrom
simonrozsival-validation-pr-33561-40666

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

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!

Caution

Validation only. Do not merge. This PR will be closed once CI results are collected.

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

For .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into net11; agents must not retarget or merge.

Description of Change

This PR exists only to run full CI, including maui-pr-uitests and maui-pr-devicetests, on #33561 ([XSG] Trimmable Styles) together with the build fixes from #40666.

main currently has four build breaks (RS1038, CS0260, IL2121 and Essentials Windows CS0117) that stop CI from building the UI tests on every PR. #40666 fixes them, but until it merges, #33561's UI tests cannot run. This branch is #33561's branch (dev/simonrozsival/trimmable-styles) with #40666's branch (simonrozsival-fix-main-ci-build-breaks) merged in with a regular merge commit. It has no other changes.

Fixes for any failures go to #33561 or #40666, and this branch is re-merged from them. Neither PR's branch is modified from here.

Issues Fixed

None. Validation only, related to #33561 and #40666.

simonrozsival and others added 26 commits November 26, 2026 14:37
Squashed for clean rebase.
- Inline the lazy initialization lock+check directly into IStyle.Apply
- Remove the internal InitializeIfNeeded method (was only needed for tests)
- Update tests to use ((IStyle)style).Apply() instead of InitializeIfNeeded

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- CanBeAppliedTo: add null check after BaseType walk (reaches null at
  top of hierarchy before hitting Element)
- TargetTypeFullName: guard against Type.FullName being null for
  generic/special types; fall through to AQN parsing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- PublicAPI net-ios/net-maccatalyst: remove duplicate ShellFlyoutRenderer entry
- Revert whitespace-only changes in 3 SourceGen test snapshot files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace 6 occurrences of ((IStyle)style).Apply(target, new SetterSpecificity())
with style.ForceInitialize(target) extension method.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- SetPropertiesVisitor: remove duplicate variable declarations and
  duplicate getNodeValue delegate from rebase conflict
- SetNamescopesAndRegisterNames: remove duplicate if-statement, keep
  TryGetValue guard for nodes not in Variables
- Style.CanBeAppliedTo: guard against null Type.FullName

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change TargetTypeFullName from ReadOnlySpan<char> to string, removing
  #if NETSTANDARD branching and Span-based comparisons
- Use plain string equality in CanBeAppliedTo instead of SequenceEqual
- Remove redundant .ToString() call in ResourceDictionary.Add
- Revert unrelated maps PublicAPI.Unshipped.txt changes from rebase

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename parentVar in nested scope to avoid CS0136.
Add StringComparison.Ordinal to IndexOf call to satisfy CA1307.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- SetPropertiesVisitor.cs: Use Context property (not primary ctor param)
  since this class uses a regular constructor
- Style.cs: Remove StringComparison.Ordinal from char IndexOf overload
  for netstandard2.0 compatibility

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- StyleSourceGenTests: Reorder __root before style in snapshots to match
  upstream SourceGen visit order change
- SetterCompiledConverters, SimplifyOnPlatform, Maui32879: Convert
  fragile full-snapshot tests to assertion-based tests validating the
  trimmable style pattern (string ctor, LazyInitialization, setters)
- LazyStyleTestHelper: Call LazyInitialization directly instead of
  IStyle.Apply to avoid InvalidCastException when style target type
  differs from the test element type

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Implement the style visitor contract on the OnIdiom inference pass added on net11.0, keeping its traversal of style content unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fix correctness issues found in review:

- Defer style content with a top-down pre-pass
  (MarkDeferredStyleContentVisitor). Visitors skip only the content
  properties of deferred styles, so the style's own properties,
  diagnostics and Hot Reload registration still run. Inline BasedOn
  styles get their own lazy initializer.
- Fall back to an eager Style(Type) for runtime TargetType values
  such as {x:Static}.
- Only apply a SourceGen-built style to instances of its TargetType.
  A mismatched element gets nothing and the mismatch is logged
  (element logger, app logger, then Trace). Rejected targets are not
  tracked, re-entrant applies during initialization are queued, and
  XAML setters keep precedence over setters added from code.
- Report MAUIX2024 when a same-file {StaticResource} style's
  TargetType does not match the element.
- Generate the initializer as a local function wrapped in an explicit
  delegate. A non-capturing lambda adds a cached-delegate field, which
  later Hot Reload updates cannot add.
- Add MauiXamlTrimmableStyles (and per-file TrimmableStyles metadata)
  to restore eager styles.

Document the behavior in docs/trimmable-styles-spec.md.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The Docs: Spellcheck job runs when a PR changes docs/. It flagged
"Trimmable" in docs/trimmable-styles-spec.md and "Emscripten" in
docs/DevelopmentTips.md, which reached main in #40122 without the
check running.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Only NativeAOT removes the setters behind the generated `is T` check.
ILLink keeps them: a trimmed (non-AOT) publish kept the unused style's
control and payload, just like an eager style. So
MauiXamlTrimmableStyles now defaults to $(PublishAot), and the
generator creates eager styles when the property is not set.

Generated styles now use `new Style(typeof(T))`. With NativeAOT,
typeof(T) keeps only T's type descriptor (316 bytes in the sample app)
and the guarded setters are still removed. This drops the
Style(string) constructor, Type.GetType and its IL2057 suppression,
the nullable TargetType and name-based matching. Implicit-style keys
stay strings.

Fix Hot Reload replacing the setters of a lazy style that has not been
applied yet: its first apply added the stale XAML setters back. The
initializer's setters are now discarded in that case; its triggers and
behaviors are kept.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…spec

Setting PublishAot for only some configurations is an app configuration
choice, not something this feature needs to document.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Microsoft.CodeAnalysis.Analyzers 5.12.0 (#40641) adds RS1038, which
fails every UI test build because UITest.Analyzers references
Microsoft.CodeAnalysis.CSharp.Workspaces for its code fix providers.

The analyzer types don't use Workspaces APIs, so the compiler can load
and run them without Workspaces; the code fixes are only loaded by IDEs,
which provide it. The assembly is test-only and isn't shipped.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#40387 made the nested _17521CatDetailsPage and _33356CatDetailsPage
partial but not their containing Shell types. The QueryProperty
generator skips such types, so navigating to them throws at runtime on
every platform. On Windows the build also fails with CS0260: the
CsWinRT 2.1.2 AOT generator in the pinned Windows SDK projection
(10.0.19041.44) emits a partial declaration of the containing type for
nested partial classes that implement INotifyPropertyChanged. Newer
CsWinRT versions skip types with non-partial containers.

ShellSearchControlPage.SearchDetailPage wasn't partial either, so its
query property throws at runtime in the same way.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
No call in ApplyLegacyQueryProperties or ValidateGeneratedQueryProperties
requires unreferenced code, so ILLink reports IL2121 for the IL2026
suppressions. iOS trimmed builds report IL2121, which fails the
RunOniOS_MauiReleaseTrimFull_CoreCLR integration test. The IL2067 and
IL2072 suppressions are still used.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#36581 replaced the Windows ImageProcessor.RotateImageAsync with the
shared Graphics-based ImageProcessor, breaking the Windows Essentials
device test build (CS0117, followed by WMC0001 because the XAML
compiler can't resolve MiddleApp without the C# compile).

The Issue38570 test now processes the image through
ProcessImageToCacheFileAsync with the options MediaPicker uses for
RotateImage = true, and still checks that the stored pixels are rotated
exactly once and that the preserved metadata doesn't rotate them again.
Processing always writes a new file now, so the unchanged-stream check
for orientation 1 no longer applies.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Don't assign fields for x:Name inside a Style. Code-behind declares
  no field for them, so SetFieldsForXNamesVisitor emitted an
  assignment to a missing field (CS1061) for eager styles. With
  trimmable styles the generator crashed instead, because the style
  content is created later inside the lazy initializer.
- Roll back setters, triggers and behaviors added by an initializer
  that throws, so a later apply doesn't duplicate them.
- Keep XAML-declared triggers and behaviors ahead of ones added from
  code, as already done for setters.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@simonrozsival

This comment has been minimized.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

ReparentingChildDuringHandlerCreationKeepsItInNewParent failed on
Windows because its GetPlatformParent helper used
VisualTreeHelper.GetParent. WinUI's public GetParent returns null for any
element that is not in the live visual tree, and the test creates its
handlers without adding them to a window. The original label's TextBlock
is a child of the destination ContentPanel, but the helper could not see
it.

Read FrameworkElement.Parent instead. For a panel child it is the panel,
whether or not the panel is loaded, and the helper still confirms that
the panel's CachedChildren contains the element.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
simonrozsival and others added 2 commits November 27, 2026 07:59
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 06:59
@simonrozsival

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Missing cross-platform UI/device CI results prevent this source-only review from establishing compatibility for globally enabled deferred styles and the revised Windows image and detached-tree parent assertions.

3 open issues

Review effort: Balanced

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot 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.

Expert Review — 1 finding

Reviewed commit 6284ba7.

See inline comments for details.


[QueryProperty(nameof(ItemName), nameof(ItemName))]
internal sealed class SearchDetailPage : ContentPage
internal sealed partial class SearchDetailPage : ContentPage

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.

[moderate] Regression Prevention and Test Coverage - No active test exercises the detail page fixed here. VerifyShellSearch_SelectedItem and the other search-result navigation tests are ignored for #35767, while the Issue17521/Issue33356 tests navigate different types. Removing this partial declaration would therefore restore the missing generated query-property implementation and make navigation to searchdetail fail without an active regression test detecting it. Add a focused test that navigates directly with ItemName and asserts DetailName, bypassing the unrelated search-result automation failure.

@simonrozsival

Copy link
Copy Markdown
Member Author

Validation findings extracted so far; keeping this PR open until its current full UI run finishes.

  • The explicitly enabled lazy-style HostApp completed full UI build 1701798: 131 of 134 jobs passed. The three failures were Mac Catalyst DragAndDropWithAnElementThatIsRemoved, Windows SharedElementLandsAndSourceIsRestoredAfterPop, and latest-iOS NavigationPageChildContentExtendsUnderFloatingTabBar.
  • The Mac drag-and-drop test passes in the latest lazy-style run 1702158 (run 47537334, result 100003). The Windows page-transition test also fails in the eager control 1701814, with the same timeout.
  • The iOS screenshot test fails twice with a 1.66% difference while the eager control passes it. This is a possible lazy-style regression, not proven causal because the control is a different source snapshot. The evidence is being preserved on [XSG] Trimmable Styles #33561.
  • Selected Windows build 1702160 is complete and failed. Actual Helix XML gives 26 passed / 1 failed in each packaged/unpackaged Button suite. The ContentButton reparenting assertion still fails despite Check panel membership in Windows ContentButton reparenting device test #40692's fix being present in the tested source; the evidence is being preserved on Check panel membership in Windows ContentButton reparenting device test #40692. The AzDO summary alone did not reveal these results.

Current full UI build 1702158 is still in progress. Closure is deferred so its remaining evidence is not lost. This validation PR must not be merged, and none of these findings is a merge-readiness approval for #33561, #40666, or #40692.

@simonrozsival simonrozsival mentioned this pull request Nov 27, 2026
1 of 4 tasks
simonrozsival and others added 2 commits November 27, 2026 10:42
CI showed that the previous FrameworkElement.Parent-based helper still
returned null on Windows. These handlers are never added to a window,
and WinUI parent queries do not reliably report parents outside the live
tree, so they cannot tell a reporting gap from a real product bug.

On Windows, assert the invariant directly: the original label keeps the
platform view it had when it moved, the destination ContentPanel's
children contain that view, and the button's ContentPanel does not. Each
assertion message records the view's Parent, its VisualTreeHelper parent,
and both panels' Content and children, both right after the move and at
the end, so a failure identifies where the view went.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…idation

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 09:46
@simonrozsival

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The validation-only branch cannot be cleared for merging without cross-platform CI results covering Windows codec/EXIF behavior, detached WinUI reparenting, and globally enabled lazy styles.

3 open issues

Review effort: Balanced

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Selected Tests

@kubaflo — AI-selected UI tests and device tests (GPT-6.2 Sol + MAI Code 2) for commit 87619197.

Result FAILED Platforms Android, iOS, MacCatalyst, Windows Tests all UI, 3 device Commit 87619197


🧪 Test selection — click to expand
Suite Result Selected Build
UI tests ❌ failed all 77 categories maui-pr-uitests #1702366
Device tests ✅ passed 3 of 105 units maui-pr-devicetests #1702367
🧪 UI tests — the full suite on every platform

❌ maui-pr-uitests #1702366 failed — 3 tests failed on iOS, MacCatalyst, Windows. See Failed tests below.

GPT-6.2 Sol: Run the full UI suite on all four platforms because the shared HostApp now builds with trimmable XAML styles.
MAI Code 2: Trimmable/lazy styles are enabled across the UI test host, so the UI suite runs on all platforms; device coverage is limited to Windows Button and Essentials tests changed by this PR.

🧪 Ran — 77 categories on Android, iOS, MacCatalyst, Windows

The complete maui-pr-uitests suite runs on every platform (same as /azp run).

📊 Results — failed: 131 passed, 3 failed of 134 jobs

❌ Failed tests (3)

Test Failed on Error
Issue29516.TitleBarTrailingContentShouldRenderProperly MacCatalyst VisualTestUtils.VisualTestFailedException :
Issue35490.NavigationPageChildContentExtendsUnderFloatingTabBar iOS VisualTestUtils.VisualTestFailedException :
Issue6.SharedElementLandsAndSourceIsRestoredAfterPop Windows System.TimeoutException : Timed out waiting for element...

🔗 All test results · Build logs

Job Result
iOS UITests CoreCLR Controls (vlatest) TabbedPage,TableView,TimePicker,TitleView,ToolbarItem,Triggers ❌ failed
MacCatalyst UITests CoreCLR Controls ViewBaseTests,VisualStateManager,Window ❌ failed
WinUI UITests Controls Navigation ❌ failed
Android UITests CoreClr Controls (API 30) Accessibility,ActionSheet,ActivityIndicator,Animation,AppLinks ✅ succeeded
Android UITests CoreClr Controls (API 30) Border,BoxView,Brush,Button ✅ succeeded
Android UITests CoreClr Controls (API 30) CarouselView ✅ succeeded
Android UITests CoreClr Controls (API 30) Cells,CheckBox,ContextActions,CustomRenderers,DatePicker,Dispatcher,DisplayAlert,DisplayPrompt,DragAndDrop ✅ succeeded
Android UITests CoreClr Controls (API 30) CollectionView1 ✅ succeeded
Android UITests CoreClr Controls (API 30) CollectionView2 ✅ succeeded
Android UITests CoreClr Controls (API 30) CollectionView3 ✅ succeeded
Android UITests CoreClr Controls (API 30) CollectionView4 ✅ succeeded
Android UITests CoreClr Controls (API 30) CollectionView5 ✅ succeeded
Android UITests CoreClr Controls (API 30) CollectionView6 ✅ succeeded
Android UITests CoreClr Controls (API 30) CollectionView7 ✅ succeeded
Android UITests CoreClr Controls (API 30) Editor,Effects,Essentials,FlyoutPage,Focus,Fonts,Frame,Gestures,GraphicsView ✅ succeeded
Android UITests CoreClr Controls (API 30) Entry ✅ succeeded
Android UITests CoreClr Controls (API 30) Image,ImageButton,IndicatorView,InputTransparent,IsEnabled,IsVisible ✅ succeeded
Android UITests CoreClr Controls (API 30) Label ✅ succeeded
Android UITests CoreClr Controls (API 30) Layout ✅ succeeded
Android UITests CoreClr Controls (API 30) Lifecycle,ManualReview,Maps ✅ succeeded
Android UITests CoreClr Controls (API 30) Navigation ✅ succeeded
Android UITests CoreClr Controls (API 30) Page,Performance,Picker,ProgressBar ✅ succeeded
Android UITests CoreClr Controls (API 30) RadioButton,RefreshView ✅ succeeded
Android UITests CoreClr Controls (API 30) ScrollView ✅ succeeded
Android UITests CoreClr Controls (API 30) SearchBar,Shape,Slider ✅ succeeded
Android UITests CoreClr Controls (API 30) Shadow ✅ succeeded
Android UITests CoreClr Controls (API 30) Shell1 ✅ succeeded
Android UITests CoreClr Controls (API 30) Shell2 ✅ succeeded
Android UITests CoreClr Controls (API 30) SoftInput,Stepper,Switch,SwipeView ✅ succeeded
Android UITests CoreClr Controls (API 30) TabbedPage,TableView,TimePicker,TitleView,ToolbarItem,Triggers ✅ succeeded
Android UITests CoreClr Controls (API 30) ViewBaseTests,VisualStateManager,Window ✅ succeeded
Android UITests CoreClr Controls (API 30) WebView ✅ succeeded
Android UITests Material3 Controls Material3 (API 36) ✅ succeeded
Android UITests SafeAreaEdges (API 36 Pixel 3 XL) Controls SafeAreaEdges (API 36 Pixel 3 XL) ✅ succeeded
Android UITests Shell Renderer Controls Shell Renderer (API 30) Shell1 ✅ succeeded
Android UITests Shell Renderer Controls Shell Renderer (API 30) Shell2 ✅ succeeded
Build UITests Android CoreCLR Sample App Build Sample App (Android) ✅ succeeded
Build UITests CoreCLR Sample App Build Sample App ✅ succeeded
Build UITests Material3 Sample App Build Sample App (Material3) ✅ succeeded
Build UITests Windows CV1 Sample App Build Sample App (Windows CV1) ✅ succeeded
Build UITests Windows Sample App Build Sample App (Windows) ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Accessibility,ActionSheet,ActivityIndicator,Animation,AppLinks ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Border,BoxView,Brush,Button ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CarouselView ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Cells,CheckBox,ContextActions,CustomRenderers,DatePicker,Dispatcher,DisplayAlert,DisplayPrompt,DragAndDrop ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView1 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView2 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView3 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView4 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView5 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView6 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView7 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Editor,Effects,Essentials,FlyoutPage,Focus,Fonts,Frame,Gestures,GraphicsView ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Entry ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Image,ImageButton,IndicatorView,InputTransparent,IsEnabled,IsVisible ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Label ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Layout ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Lifecycle,ManualReview,Maps ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Navigation ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Page,Performance,Picker,ProgressBar ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) RadioButton,RefreshView ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) SafeAreaEdges ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) ScrollView ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) SearchBar,Shape,Slider ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Shadow ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Shell1 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) Shell2 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) SoftInput,Stepper,Switch,SwipeView ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) ViewBaseTests,VisualStateManager,Window ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) WebView ✅ succeeded
MacCatalyst UITests CoreCLR Controls Accessibility,ActionSheet,ActivityIndicator,Animation,AppLinks ✅ succeeded
MacCatalyst UITests CoreCLR Controls Border,BoxView,Brush,Button ✅ succeeded
MacCatalyst UITests CoreCLR Controls CarouselView ✅ succeeded
MacCatalyst UITests CoreCLR Controls Cells,CheckBox,ContextActions,CustomRenderers,DatePicker,Dispatcher,DisplayAlert,DisplayPrompt,DragAndDrop ✅ succeeded
MacCatalyst UITests CoreCLR Controls CollectionView1 ✅ succeeded
MacCatalyst UITests CoreCLR Controls CollectionView2 ✅ succeeded
MacCatalyst UITests CoreCLR Controls CollectionView3 ✅ succeeded
MacCatalyst UITests CoreCLR Controls CollectionView4 ✅ succeeded
MacCatalyst UITests CoreCLR Controls CollectionView5 ✅ succeeded
MacCatalyst UITests CoreCLR Controls CollectionView6 ✅ succeeded
MacCatalyst UITests CoreCLR Controls CollectionView7 ✅ succeeded
MacCatalyst UITests CoreCLR Controls Editor,Effects,Essentials,FlyoutPage,Focus,Fonts,Frame,Gestures,GraphicsView ✅ succeeded
MacCatalyst UITests CoreCLR Controls Entry ✅ succeeded
MacCatalyst UITests CoreCLR Controls Image,ImageButton,IndicatorView,InputTransparent,IsEnabled,IsVisible ✅ succeeded
MacCatalyst UITests CoreCLR Controls Label ✅ succeeded
MacCatalyst UITests CoreCLR Controls Layout ✅ succeeded
MacCatalyst UITests CoreCLR Controls Lifecycle,ManualReview,Maps ✅ succeeded
MacCatalyst UITests CoreCLR Controls Navigation ✅ succeeded
MacCatalyst UITests CoreCLR Controls Page,Performance,Picker,ProgressBar ✅ succeeded
MacCatalyst UITests CoreCLR Controls RadioButton,RefreshView ✅ succeeded
MacCatalyst UITests CoreCLR Controls SafeAreaEdges ✅ succeeded
MacCatalyst UITests CoreCLR Controls ScrollView ✅ succeeded
MacCatalyst UITests CoreCLR Controls SearchBar,Shape,Slider ✅ succeeded
MacCatalyst UITests CoreCLR Controls Shadow ✅ succeeded
MacCatalyst UITests CoreCLR Controls Shell1 ✅ succeeded
MacCatalyst UITests CoreCLR Controls Shell2 ✅ succeeded
MacCatalyst UITests CoreCLR Controls SoftInput,Stepper,Switch,SwipeView ✅ succeeded
MacCatalyst UITests CoreCLR Controls TabbedPage,TableView,TimePicker,TitleView,ToolbarItem,Triggers ✅ succeeded
MacCatalyst UITests CoreCLR Controls WebView ✅ succeeded
WinUI UITests Controls Accessibility,ActionSheet,ActivityIndicator,Animation,AppLinks ✅ succeeded
WinUI UITests Controls Border,BoxView,Brush,Button ✅ succeeded
WinUI UITests Controls CarouselView ✅ succeeded
WinUI UITests Controls Cells,CheckBox,ContextActions,CustomRenderers,DatePicker,Dispatcher,DisplayAlert,DisplayPrompt,DragAndDrop ✅ succeeded
WinUI UITests Controls CollectionView1 ✅ succeeded
WinUI UITests Controls CollectionView2 ✅ succeeded
WinUI UITests Controls CollectionView3 ✅ succeeded
WinUI UITests Controls CollectionView4 ✅ succeeded
WinUI UITests Controls CollectionView5 ✅ succeeded
WinUI UITests Controls CollectionView6 ✅ succeeded
WinUI UITests Controls CollectionView7 ✅ succeeded
WinUI UITests Controls Editor,Effects,Essentials,FlyoutPage,Focus,Fonts,Frame,Gestures,GraphicsView ✅ succeeded
WinUI UITests Controls Entry ✅ succeeded
WinUI UITests Controls Image,ImageButton,IndicatorView,InputTransparent,IsEnabled,IsVisible ✅ succeeded
WinUI UITests Controls Label ✅ succeeded
WinUI UITests Controls Layout ✅ succeeded
WinUI UITests Controls Lifecycle,ManualReview,Maps ✅ succeeded
WinUI UITests Controls Page,Performance,Picker,ProgressBar ✅ succeeded
WinUI UITests Controls RadioButton,RefreshView ✅ succeeded
WinUI UITests Controls SafeAreaEdges ✅ succeeded
WinUI UITests Controls ScrollView ✅ succeeded
WinUI UITests Controls SearchBar,Shape,Slider ✅ succeeded
WinUI UITests Controls Shadow ✅ succeeded
WinUI UITests Controls Shell1 ✅ succeeded
WinUI UITests Controls Shell2 ✅ succeeded
WinUI UITests Controls SoftInput,Stepper,Switch,SwipeView ✅ succeeded
WinUI UITests Controls TabbedPage,TableView,TimePicker,TitleView,ToolbarItem,Triggers ✅ succeeded
WinUI UITests Controls ViewBaseTests,VisualStateManager,Window ✅ succeeded
WinUI UITests CV1 Controls (CV1) CollectionView1 ✅ succeeded
WinUI UITests CV1 Controls (CV1) CollectionView2 ✅ succeeded
WinUI UITests CV1 Controls (CV1) CollectionView3 ✅ succeeded
WinUI UITests CV1 Controls (CV1) CollectionView4 ✅ succeeded
WinUI UITests CV1 Controls (CV1) CollectionView5 ✅ succeeded
WinUI UITests CV1 Controls (CV1) CollectionView6 ✅ succeeded
WinUI UITests CV1 Controls (CV1) CollectionView7 ✅ succeeded
🧪 Device tests — Controls.Button, Controls.Shell, Essentials on Android, iOS, MacCatalyst, Windows

✅ maui-pr-devicetests #1702367 passed.

GPT-6.2 Sol: Run targeted Shell, Button, and Essentials device tests for the shared Shell trimming diagnostic fix and the Windows test changes.
MAI Code 2: Run Windows Controls.Button and Essentials device tests for the changed Windows-only device assertions and image-processing test.

🧪 Ran — 3 categories on Android, iOS, MacCatalyst, Windows

Platform Categories
Android Controls.Button, Controls.Shell, Essentials
iOS Controls.Button, Controls.Shell, Essentials
MacCatalyst Controls.Button, Controls.Shell, Essentials
Windows Controls.Button, Controls.Shell, Essentials
📊 Results — succeeded: 7 passed, 0 failed of 7 jobs

🔗 All test results · Build logs

Job Result
net12.0 CoreCLR Android Helix Tests - Build Build Device Tests Android (CoreCLR) ✅ succeeded
net12.0 CoreCLR Android Helix Tests Run DeviceTests Android (CoreCLR) ✅ succeeded
net12.0 CoreCLR iOS Helix Tests Run DeviceTests iOS (CoreCLR) ✅ succeeded
net12.0 CoreCLR iOS/MacCatalyst Helix Tests - Build Build Device Tests iOS and MacCatalyst (CoreCLR) ✅ succeeded
net12.0 CoreCLR MacCatalyst Helix Tests Run DeviceTests MacCatalyst (CoreCLR) ✅ succeeded
net12.0 Windows Helix Tests - Build Build Device Tests (Windows) ✅ succeeded
net12.0 Windows Helix Tests Run DeviceTests Windows ✅ succeeded
⏭️ Skipped — what neither suite runs

Device tests — 102 categories, 0 platforms

Categories not run: Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml, Core.ActivityIndicator, Core.Animation, Core.Application, Core.Border, Core.BoxView, Core.Button, Core.CheckBox, Core.ContentView, Core.DatePicker, Core.Dispatcher, Core.Editor, Core.Element, Core.Entry, Core.FlowDirection, Core.FlyoutView, Core.Fonts, Core.Formatting, Core.Graphics, Core.GraphicsView, Core.Image, Core.ImageButton, Core.ImageSource, Core.IndicatorView, Core.Label, Core.Layout, Core.Lifecycle, Core.MauiContext, Core.Memory, Core.NavigationPage, Core.Page, Core.Picker, Core.ProgressBar, Core.RadioButton, Core.RefreshView, Core.ScrollView, Core.SearchBar, Core.ShapeView, Core.Slider, Core.Stepper, Core.SwipeView, Core.Switch, Core.TimePicker, Core.View, Core.WebView, Core.Window, Core.WindowOverlay, Graphics, BlazorWebView

Each skipped platform and project is listed as a maui-pr-devicetests (skipped) … status on this commit. Use /azp run maui-pr-devicetests for the full suite.

🤖 Why these tests — AI rationale (GPT-6.2 Sol + MAI Code 2)

UI tests

Each model chose independently; every test that runs was selected by at least one of them.

Platform GPT-6.2 Sol MAI Code 2
Android all categories all categories
iOS all categories all categories
MacCatalyst all categories all categories
Windows all categories all categories

GPT-6.2 Sol — Run the full UI suite on all four platforms because the shared HostApp now builds with trimmable XAML styles.

  • HostApp enables lazy XAML styles for all test pages, not just Shell.
  • Both changed issue pages pair with Shell1 tests; full coverage includes them.
  • The analyzer warning suppression and device-only edits do not widen UI scope.

MAI Code 2 — Trimmable/lazy styles are enabled across the UI test host, so the UI suite runs on all platforms; device coverage is limited to Windows Button and Essentials tests changed by this PR.

  • Controls.TestCases.HostApp.csproj enables MauiXamlTrimmableStyles for the shared UI test app, changing style/resource behavior across controls and platforms.
  • The Shell host pages are made partial to participate in source generation; the affected feature is part of the same cross-platform UI validation.
  • The broad UI style-processing change warrants a full run rather than selecting individual control categories.
  • UI-test-only analyzer suppression and validation-only Shell query-attribute suppressions do not add narrower lanes.

Device tests

Each model chose independently; every test that runs was selected by at least one of them.

Platform GPT-6.2 Sol MAI Code 2
Android Controls.Shell, Controls.Button, Essentials —
iOS Controls.Shell, Controls.Button, Essentials —
MacCatalyst Controls.Shell, Controls.Button, Essentials —
Windows Controls.Shell, Controls.Button, Essentials Controls.Button, Essentials

GPT-6.2 Sol — Run targeted Shell, Button, and Essentials device tests for the shared Shell trimming diagnostic fix and the Windows test changes.

  • Shared QueryPropertyConversion trimming diagnostics map to Controls.Shell on all platforms.
  • Windows ContentButton assertions map to Controls.Button; Windows image-processing tests map to Essentials.
  • The HostApp style setting and UI analyzer do not affect device test apps.

MAI Code 2 — Run Windows Controls.Button and Essentials device tests for the changed Windows-only device assertions and image-processing test.

  • ContentButtonControlTests.cs changes Windows-specific WinUI parent diagnostics and membership assertions under #if WINDOWS; run Controls.Button on Windows.
  • ImageProcessor_Tests.cs changes Windows image-processing coverage; run Essentials on Windows.
  • The remaining production diff removes trimming-warning suppressions without runtime behavior changes, and no other device platforms receive changed test logic.

Generated by /review run-tests. A targeted run is a fast signal, not full-suite certification.

@github-actions github-actions Bot 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.

Expert Review — 1 finding

Reviewed commit 8761919.

See inline comments for details.


[QueryProperty(nameof(ItemName), nameof(ItemName))]
internal sealed class SearchDetailPage : ContentPage
internal sealed partial class SearchDetailPage : ContentPage

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.

[moderate] Regression Prevention and Test Coverage - The missing query-property implementation fixed here has no active regression coverage. Every ShellSearchHandlerFeatureTests test that navigates to this SearchDetailPage is ignored for #35767; Issue17521/Issue33356 navigate different detail types, and the generator unit tests use synthetic types. Removing this partial declaration therefore makes the generator skip this page and ShellContent throw when applying ItemName on navigation to searchdetail, without an active test detecting the failure on Android, iOS, MacCatalyst or Windows. Add a focused test that navigates directly with ItemName and asserts DetailName, bypassing the unrelated search-result automation failure.

@simonrozsival

Copy link
Copy Markdown
Member Author

Closing: this validation-only PR has served its purpose (CI for #33561, now merged, together with #40666 and #40692). Further validation will happen on #40666 and #40692 directly.

kubaflo added a commit that referenced this pull request Nov 27, 2026
…st (#40692)

<!-- Please let the below note in for people that find this PR -->
> [!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!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change


`ContentButtonControlTests.ReparentingChildDuringHandlerCreationKeepsItInNewParent`
(added with the native `ContentButton` in #39762) fails on Windows only,
packaged and unpackaged, at its last assertion:

```
Assert.Same() Failure: Values are not the same instance
Expected: ContentPanel { ..., ActualSize = <0, 0>, ... }
Actual:   null
```

It never failed on `main`'s CI because Windows device tests have not
built there since #36581 (#40666 fixes that build).

The test creates its handlers with `CreateHandler`, which never adds
them to a window, so none of the WinUI elements are in the live tree. In
the original label's `HandlerChanged` callback it swaps the button's
content and moves the label into a `ContentView`. The last assertion
asked a WinUI parent query whether the label's `TextBlock` is parented
to the destination `ContentPanel`:

1. The original helper used `VisualTreeHelper.GetParent`, which [returns
null for any element outside the live
tree](https://github.com/microsoft/microsoft-ui-xaml/blob/main/dxaml/xcp/dxaml/lib/VisualTreeHelper.cpp)
("Don't return the parent unless we're in the live tree"). So that
failure didn't show anything about the product.
2. This PR's first commit switched to `FrameworkElement.Parent`. That
still returned `null` on CI (`maui-pr-devicetests` 1702098 on #40667,
with product code identical to `main`). Microsoft's docs say `Parent`
"can be null if an object was instantiated, but is not attached to an
object that eventually connects to a page object root".

Static tracing of the product path finds no step that detaches the
`TextBlock` or replaces the label's handler. The guarded
`ContentButtonHandler.MapContent` returns before touching the label once
the content has changed, and `ContentViewHandler.UpdateContent` adds the
`TextBlock` to the destination `ContentPanel`. Still, a parent query
that reads null off-tree can't tell a reporting gap from a real product
bug.

The test now checks the invariant directly on Windows instead of asking
WinUI for a parent:
- the label keeps the platform view it had right after the move;
- the destination `ContentPanel`'s children contain that view (checked
by enumerating its children and comparing references);
- the button's `ContentPanel` does not contain it.

A WinUI element can belong to only one parent, so this is as strict as
the previous parent check. Each assertion message records the view's
`Parent`, its `VisualTreeHelper` parent, and both panels' `Content` and
children, captured both right after the move and at the end. If the
product is wrong, the failure shows where the view went. Android
(`View.Parent`) and iOS (`Superview`) keep the parent assertion, which
works outside a window.

**Validation**
- Windows can't be built or run on the macOS dev machine. The new
Windows code was type-checked against the WinUI 2.3.9 reference
assemblies in a scratch `net10.0-windows10.0.19041.0` project, with
stubs for the internal MAUI types (`dotnet build`: succeeded; a
deliberate misspelling was reported as CS1061). The file was also
compiled with each of `ANDROID`, `IOS`, `MACCATALYST` and `WINDOWS`
defined: the only errors were missing references from compiling outside
the device-test project, with no syntax, preprocessor or missing-name
errors in the new code.
- The Windows device-test result needs CI (`maui-pr-devicetests`) on a
branch that includes the build fix from #40666.

### Issues Fixed

Fixes a Windows device-test failure in `ContentButtonControlTests` (no
separate issue). It was seen in `maui-pr-devicetests` builds 1701680 and
1702098 (#40667) and 1701815 (#40666).

### Let AI finish this PR

- [ ] **Let the MAUI agent address review feedback and fix remaining
issues on this PR.** Maintainers still decide whether it is merged. For
PRs from forks, the agent opens a follow-up PR that keeps your commits.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Don't merge this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants