Skip to content

[XSG] Hot reload: refresh keyed and Class style consumers on setter edits - #40418

Merged
kubaflo merged 3 commits into
candidate/11.0.1xx-sr2from
stephanedelcroix-fix-39984-hotreload-keyed-class-styles
Nov 20, 2026
Merged

kubaflo merged 3 commits into
candidate/11.0.1xx-sr2from
stephanedelcroix-fix-39984-hotreload-keyed-class-styles

Conversation

@StephaneDelcroix

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!

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

Targets main: this is XAML incremental hot reload work, like #39928, and it adds a generator-only public API.

Description of Change

When a Setter.Value changed on a keyed Style or a Class style in a root ResourceDictionary, UpdateComponent() emitted something like ((Setter)node!).Value = "Blue";. That assigns an unconverted string and never reapplies the style, so existing consumers kept stale values. With lazy resources, even new consumers kept them. #39928 fixed implicit styles by replacing the dictionary entry. That doesn't help keyed or Class styles, because StaticResource, StyleClass and BasedOn consumers hold the Style instance directly.

Changes:

  • Generator (UpdateComponentCodeWriter, SetPropertyHelpers): setter-value edits on keyed and Class styles in a root RD now rebuild the style through the normal IC visitor pipeline, as for implicit styles, and call XamlComponentRegistry.TryUpdateStyle. Fallback when that returns false:

    • Lazy keyed styles: replace the factory.
    • Eager keyed styles: assign the dictionary entry.
    • Class styles: no fallback, since they live in a shared per-class list.

    The implicit-style path is unchanged.

  • XamlComponentRegistry.TryUpdateStyle (new public, EditorBrowsable(Never)): finds the live style without forcing lazy factories. That means a shared, already-materialized lazy entry, an eager entry, or the single matching entry in a class list. If only the setters changed, it replaces them in place; otherwise it returns false. "Only the setters" means the same TargetType, Class, BasedOn, BaseResourceKey, ApplyToDerivedTypes and CanCascade.

  • Style.ReplaceSetters (internal): unapplies the old setters from all tracked targets, swaps them, and reapplies the new ones with each target's specificity. Derived-style consumers are covered because a base style tracks them with AsBaseStyle specificity. Local values still win.

  • ResourceDictionary.TryGetLocalMaterializedValue / LazyResource.TryGetCachedValue (internal): let the helper peek at an entry without resolving it.

Known limitations:

Issues Fixed

Fixes #39984

Validation

New tests are in src/Controls/tests/SourceGen.UnitTests/HotReload/Maui39984Tests.cs, run with both lazy and eager RD. I added a LazyRD option to the test harness for them. They cover:

  • the generated patch shape
  • live StaticResource, DynamicResource and locally overridden consumers
  • BasedOn propagation
  • StyleClass consumers
  • unresolved lazy styles and x:Shared="False" styles

The new tests failed (8 of 8) before the fix. Commands run:

  • DOTNET_MODIFIABLE_ASSEMBLIES=debug dotnet test Microsoft.Maui.Controls.SourceGen.UnitTests.dll --filter "FullyQualifiedName~Maui39984|FullyQualifiedName~Maui39780": Passed, 14/14. I ran it from a copy of the build output outside the ~-containing worktree path.
  • Same command, full SourceGen.UnitTests suite: Passed, 683/683.
  • dotnet test src/Controls/tests/Core.UnitTests/Controls.Core.UnitTests.csproj: 6733 passed, 1 failed. The failure is TwoWayBindingToNullableDoublePropertyWithEmptyStringBecomesNull, which also fails without this change: it's locale-dependent ("3,14" vs "3.14").
  • dotnet build src/Controls/src/Xaml/Controls.Xaml.csproj -f netstandard2.0: succeeded with no PublicAPI errors.

I did not test this on a device or in Visual Studio.

…dits

Incremental XAML Hot Reload patched a keyed or Class style's setter by
assigning the raw string to the live Setter.Value, which skipped type
conversion and never reapplied the style. Consumers kept stale values.

The generator now rebuilds the style through the normal visitor pipeline
and calls the new XamlComponentRegistry.TryUpdateStyle helper. When the
live style is materialized and shared, its setters are replaced in place
and reapplied to every element using it (StaticResource, DynamicResource,
StyleClass and derived styles). Otherwise the dictionary entry is
replaced so future lookups get the new style.

Fixes #39984

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

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 -- 40418

Or

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

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026

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.

🟡 Changes recommended

Style edits can leave consumers with stale values, break precedence across multiple style classes, and prematurely initialize unused lazy styles and their resource dependencies.

4 open issues
What changed in this PR

Extends source-generated XAML Hot Reload to refresh keyed and class-style consumers after scalar setter edits in root resource dictionaries. This addresses #39984 and builds on the implicit-style support in #39928.

Changes:

  • Rebuilds edited styles and updates compatible live instances rather than replacing references held by consumers.
  • Adds setter reapplication and non-materializing resource lookup helpers.
  • Adds lazy/eager regression tests, test-harness options, and public API declarations.
File Description
src/​Controls/​tests/​SourceGen.UnitTests/​SourceGeneratorDriver.cs Adds the lazy-resource generation option.
src/​Controls/​tests/​SourceGen.UnitTests/​HotReload/​XamlHotReloadTestHarness.cs Passes lazy-resource settings into generation.
src/​Controls/​tests/​SourceGen.UnitTests/​HotReload/​Maui39984Tests.cs Tests generated patches and live style updates.
src/​Controls/​src/​Xaml/​XamlComponentRegistry.cs Locates compatible live styles and updates their setters.
src/​Controls/​src/​Xaml/​PublicAPI/​netstandard/​PublicAPI.Unshipped.txt Declares the helper for .NET Standard.
src/​Controls/​src/​Xaml/​PublicAPI/​net/​PublicAPI.Unshipped.txt Declares the helper for .NET.
src/​Controls/​src/​Xaml/​PublicAPI/​net-windows/​PublicAPI.Unshipped.txt Declares the helper for Windows.
src/​Controls/​src/​Xaml/​PublicAPI/​net-maccatalyst/​PublicAPI.Unshipped.txt Declares the helper for Mac Catalyst.
src/​Controls/​src/​Xaml/​PublicAPI/​net-ios/​PublicAPI.Unshipped.txt Declares the helper for iOS.
src/​Controls/​src/​Xaml/​PublicAPI/​net-android/​PublicAPI.Unshipped.txt Declares the helper for Android.
src/​Controls/​src/​SourceGen/​UpdateComponentCodeWriter.cs Generates keyed and class-style update patches.
src/​Controls/​src/​SourceGen/​SetPropertyHelpers.cs Generates live-update calls with lazy-factory fallback.
src/​Controls/​src/​Core/​Style.cs Replaces setters and reapplies them to tracked targets.
src/​Controls/​src/​Core/​ResourceDictionary.cs Adds lookup of already-materialized local resources.

Review effort: Balanced

Comment thread src/Controls/src/Core/Style.cs Resolved

@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 — 2 findings

Reviewed commit 79a9ad9.

See inline comments for details.

Comment thread src/Controls/src/Core/Style.cs Outdated

foreach (var (target, specificity) in targets)
foreach (Setter setter in Setters)
setter.Apply(target, specificity);

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.

[major] Logic and Correctness Verification - Reapplying only the edited style breaks precedence between styles sharing a specificity. For a Label with StyleClass="A,B", let A set TextColor=Red and FontSize=12, and B set TextColor=Blue. Editing only A's FontSize turns the retained Label red: MergedStyle applies both classes at the same specificity, so unapplying A clears B's winning TextColor entry and these lines reapply A without B. A newly created Label remains blue. The same issue affects an implicit style BasedOn an edited keyed base when both set TextColor, because AsBaseStyle() preserves implicit specificity. Reconcile the affected style layers in their original order, and cover overlapping setters in the regression tests; the current tests use only one class and nonoverlapping base/derived properties.

&& live.Class == replacement.Class
&& live.ApplyToDerivedTypes == replacement.ApplyToDerivedTypes
&& live.CanCascade == replacement.CanCascade
&& ReferenceEquals(live.BasedOn, replacement.BasedOn)

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] Logic and Correctness Verification - An unchanged inline Style.BasedOn is rebuilt as a fresh object, so this identity comparison rejects a scalar setter-only edit. For a root Class="Warning" style with an inline base and TextColor=Red, editing only TextColor to Blue makes TryUpdateStyle return false; the generated Class-style caller ignores false, leaving both retained and subsequently created StyleClass consumers red with either resource setting. A keyed style with the same inline base leaves retained StaticResource consumers stale after its dictionary-entry fallback. A shared keyed style based on a lazy x:Shared="False" base has the same failure, even though the edited style itself is shared and tracked. Preserve or reconcile an unchanged base rather than requiring the freshly generated base to have the old identity, and add a retained-consumer regression case for this guard.

@MauiBot

This comment has been minimized.

@MauiBot MauiBot added s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) and removed s/agent-review-in-progress AI review is currently running for this PR labels Nov 19, 2026

@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 check the ai's suggestions?

@kubaflo

kubaflo commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

/review run-tests

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Selected UI Tests

@kubaflo — AI-selected UI tests (GPT-6.1 Sol + Claude Opus 5.5) for commit 79a9ad98.

Result FAILED Platforms Android, iOS, MacCatalyst, Windows Categories All 77 Commit 79a9ad98


🧪 Test selection — click to expand

❌ maui-pr-uitests #1691859 failed. See the failing checks below or the run for details.

GPT-6.1 Sol: Shared style and resource infrastructure changes require a full UI test run on Android, iOS, MacCatalyst, and Windows.
Claude Opus 5.5: XAML source-gen hot reload fix for keyed/Class style setter edits; adds only new hot-reload-only code paths, so no UI tests are needed.

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

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

📊 Results — failed: 124 passed, 9 failed of 133 jobs
Job Result
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 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 ❌ failed
iOS UITests CoreCLR Controls (vlatest) Cells,CheckBox,ContextActions,CustomRenderers,DatePicker,Dispatcher,DisplayAlert,DisplayPrompt,DragAndDrop ❌ failed
iOS UITests CoreCLR Controls (vlatest) CollectionView1 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView2 ❌ failed
iOS UITests CoreCLR Controls (vlatest) CollectionView3 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView4 ❌ failed
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 ❌ failed
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) TabbedPage,TableView,TimePicker,TitleView,ToolbarItem,Triggers ✅ 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 ❌ failed
MacCatalyst UITests CoreCLR Controls Cells,CheckBox,ContextActions,CustomRenderers,DatePicker,Dispatcher,DisplayAlert,DisplayPrompt,DragAndDrop ✅ succeeded
MacCatalyst UITests CoreCLR Controls CollectionView1 ❌ failed
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 ❌ failed
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 ViewBaseTests,VisualStateManager,Window ❌ failed
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 Navigation ✅ 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

Failed tests (17)

Test Platforms
Bugzilla43469.Bugzilla43469Test iOS
CarouselViewAdjustPeekAreaInsets.ChangePeekAreaInsetsInOnSizeAllocatedTest iOS
CarouselViewPositionVisibility.Issue12848Test iOS
Issue17664.VerifyGroupedCollectionViewVisibleItemIndices iOS
Issue19609.CanTapButtonOnEmptyView iOS
Issue21814.VerifyNavigationEventArgs MacCatalyst
Issue22417.AddItemsToCarouselViewWorks iOS
Issue23902.Issue23902NavigationTest MacCatalyst
Issue27418.CarouselItemsShouldRenderProperly iOS
Issue31680.CollectionViewInsideCarouselViewShouldNotThrowIndexOutOfRangeException iOS
Issue31897.EnsureCollectionViewLayoutOnItemsSourceChange iOS
Issue35613.VerifyNavigatingToAndNavigatingFromArgsForPopAndPopToRoot MacCatalyst
Issue38730.VerifyVerticalItemSpacingPageRendering MacCatalyst
Issue7678_1.VerifyCarouselViewBindingAndRendering MacCatalyst
Issue7678.VerifyCarouselViewItemsRenderAfterBinding iOS, MacCatalyst
Issue9075.FlexLayoutCycleException iOS
VisualStateManager_EntryFeatureTests.VerifyVSM_Entry_Disable MacCatalyst
🤖 Why these tests — AI rationale (GPT-6.1 Sol + Claude Opus 5.5)

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

Platform GPT-6.1 Sol Claude Opus 5.5
Android all categories —
iOS all categories —
MacCatalyst all categories —
Windows all categories —

GPT-6.1 Sol — Shared style and resource infrastructure changes require a full UI test run on Android, iOS, MacCatalyst, and Windows.

  • Core/Style.cs and ResourceDictionary.cs change shared style/resource infrastructure: full run on all platforms.
  • XamlComponentRegistry.cs adds runtime updates, so this is not compiler-only.
  • Unit tests/API listings add no categories; no Android Material3 rendering changes.

Claude Opus 5.5 — XAML source-gen hot reload fix for keyed/Class style setter edits; adds only new hot-reload-only code paths, so no UI tests are needed.

  • Style.cs / ResourceDictionary.cs: add only new internal methods (ReplaceSetters, TryGetLocalMaterializedValue, TryGetCachedValue); existing style/resource behavior is unchanged.
  • XamlComponentRegistry.TryUpdateStyle: a new public API that only code emitted by the generator's UpdateComponent() calls during incremental hot reload.
  • SourceGen/SetPropertyHelpers.cs / UpdateComponentCodeWriter.cs: the new output only appears in the hot-reload UpdateComponent path (updateLiveStyle defaults to false), so normal InitializeComponent codegen is unchanged.
  • PublicAPI files and SourceGen unit tests: no runtime UI impact. Unit tests cover these changes.

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

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

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.

🟡 Changes recommended

An unrelated setter edit currently reattaches all merged-style triggers and behaviors, rerunning active trigger actions and restarting behavior state; setter-only refreshes and regression coverage are needed.

1 open issue
4 resolved since last review

Review effort: Balanced

Comment on lines +260 to +261
if (mergedStyle != null && mergedStyle.ContainsStyle(this))
mergedStyle.Reapply();
@kubaflo

kubaflo commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

/review run-tests

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Selected UI Tests

@kubaflo — AI-selected UI tests (GPT-6.1 Sol + Claude Opus 5.5) for commit 135b0f91.

Result FAILED Platforms Android, iOS, MacCatalyst, Windows Categories All 77 Commit 135b0f91


🧪 Test selection — click to expand

❌ maui-pr-uitests #1692548 failed. See the failing checks below or the run for details.

GPT-6.1 Sol: Shared style/resource infrastructure changes select a full UI run on all four platforms, including Android Material3.
Claude Opus 5.5: XAML hot-reload (UpdateComponent) fix for keyed/Class style setter edits; no UI test behavior changes, so no UI tests are run.

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

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

📊 Results — failed: 125 passed, 8 failed of 133 jobs
Job Result
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 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 ❌ failed
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 ❌ failed
iOS UITests CoreCLR Controls (vlatest) CollectionView3 ✅ succeeded
iOS UITests CoreCLR Controls (vlatest) CollectionView4 ❌ failed
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 ❌ failed
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) TabbedPage,TableView,TimePicker,TitleView,ToolbarItem,Triggers ✅ 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 ❌ failed
MacCatalyst UITests CoreCLR Controls Cells,CheckBox,ContextActions,CustomRenderers,DatePicker,Dispatcher,DisplayAlert,DisplayPrompt,DragAndDrop ❌ failed
MacCatalyst UITests CoreCLR Controls CollectionView1 ❌ failed
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 ❌ failed
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 ViewBaseTests,VisualStateManager,Window ✅ 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 Navigation ✅ 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

Failed tests (14)

Test Platforms
CarouselViewAdjustPeekAreaInsets.ChangePeekAreaInsetsInOnSizeAllocatedTest iOS
CarouselViewPositionVisibility.Issue12848Test iOS
Issue17664.VerifyGroupedCollectionViewVisibleItemIndices iOS
Issue19609.CanTapButtonOnEmptyView iOS
Issue21814.VerifyNavigationEventArgs MacCatalyst
Issue22417.AddItemsToCarouselViewWorks iOS
Issue27418.CarouselItemsShouldRenderProperly iOS
Issue28416.DragAndDropWithAnElementThatIsRemoved MacCatalyst
Issue31680.CollectionViewInsideCarouselViewShouldNotThrowIndexOutOfRangeException iOS
Issue31897.EnsureCollectionViewLayoutOnItemsSourceChange iOS
Issue38730.VerifyVerticalItemSpacingPageRendering MacCatalyst
Issue7678_1.VerifyCarouselViewBindingAndRendering MacCatalyst
Issue7678.VerifyCarouselViewItemsRenderAfterBinding iOS, MacCatalyst
Issue9075.FlexLayoutCycleException iOS
🤖 Why these tests — AI rationale (GPT-6.1 Sol + Claude Opus 5.5)

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

Platform GPT-6.1 Sol Claude Opus 5.5
Android all categories —
iOS all categories —
MacCatalyst all categories —
Windows all categories —

GPT-6.1 Sol — Shared style/resource infrastructure changes select a full UI run on all four platforms, including Android Material3.

  • Core Style.cs, MergedStyle.cs and ResourceDictionary.cs change shared styling: full run on all platforms.
  • Include Android Material3 to cover styled controls.
  • SourceGen/HotReload changes and unit tests add no separate UI categories; no platform exclusions.

Claude Opus 5.5 — XAML hot-reload (UpdateComponent) fix for keyed/Class style setter edits; no UI test behavior changes, so no UI tests are run.

  • Style.cs, MergedStyle.cs, ResourceDictionary.cs: only add new internal members (ReplaceSetters, ContainsStyle, TryGetLocalMaterializedValue, TryGetCachedValue) that are only called from the hot-reload path; existing apply/lookup code is unchanged.
  • XamlComponentRegistry.cs + PublicAPI files: new generator-only hot-reload APIs.
  • SetPropertyHelpers.cs / UpdateComponentCodeWriter.cs: new parameters default to the previous behavior (emitReplacement=true, updateLiveStyle=false). Normal InitializeComponent codegen is unchanged; only the UpdateComponent output changes.
  • Tests are SourceGen unit tests only. No UI test categories are affected.

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

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 20, 2026
@MauiBot

MauiBot commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@StephaneDelcroix — existing-test verification for commit 135b0f91.

Result PASSED Platform Android Commit 135b0f91


🧪 Gate analysis — click to expand

✅ Passed. The selected verification satisfied the gate's passing conditions. Unmatched, skipped, or inconclusive groups are not passing evidence.

🧪 Unit tests
Test group Without fix With fix
Maui39984Tests ✅ Failed as expected (76s) ✅ Passed (53s)
Execution log excerpts

Without fix Maui39984Tests

     at Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.Maui39984Tests.KeyedAndClassStyleSetterPatch_UpdatesExistingStyles(Boolean lazy) in /_/src/Controls/tests/SourceGen.UnitTests/HotReload/Maui39984Tests.cs:line 58
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at InvokeStub_Maui39984Tests.KeyedAndClassStyleSetterPatch_UpdatesExistingStyles(Object, Span`1)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

With fix Maui39984Tests

denciesWhenPatched [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.Maui39984Tests.ClassStyleSetter_UpdatesExistingConsumers [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.Maui39984Tests.KeyedStyleSetter_UpdatesExistingStaticAndDynamicConsumers [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.Maui39984Tests.InlineBaseAndDuplicateClassStylesUpdateTheCorrectDeclaration [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.Maui39984Tests.SharedStyleBasedOnUnsharedResourceRetainsItsBase [1 ms]
  Skipped Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.Maui39984Tests.UnresolvedOrUnsharedKeyedStyleSetter_UpdatesNewConsumers [1 ms]
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.Maui39984Tests.KeyedAndClassStyleSetterPatch_UpdatesExistingStyles(lazy: False) [2 s]
[xUnit.net 00:00:03.30]   Finished:    Microsoft.Maui.Controls.SourceGen.UnitTests
  Passed Microsoft.Maui.Controls.SourceGen.UnitTests.HotReload.Maui39984Tests.KeyedAndClassStyleSetterPatch_UpdatesExistingStyles(lazy: True) [312 ms]
Test Run Successful.
Total tests: 11
     Passed: 2
    Skipped: 9
 Total time: 4.2664 Seconds

PR head: 135b0f91.

Without-fix baseline: f79bb5b3.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 20, 2026

@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 — 3 findings

Reviewed commit 135b0f9.

See inline comments for details.

_ => null
};
if (mergedStyle != null && mergedStyle.ContainsStyle(this))
mergedStyle.Reapply();

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.

[major] Logic and Correctness Verification - Editing only FontSize on a retained Label's keyed or class style restarts active trigger actions and behavior state. MergedStyle.Reapply calls Style.UnApplyCore/ApplyCore for every style layer; an active IsEnabled=True trigger's PropertyCondition.TearDown clears its true state and SetUp restores it, invoking ExitActions and EnterActions even though IsEnabled never changed. AttachedCollection also invokes behavior detach/attach callbacks again, including attachments on unedited layers. Refresh setter layers in precedence order without tearing down existing triggers and behaviors. Add lazy/eager repeated-edit coverage asserting unchanged action and lifecycle counts; the new tests contain no such attachments.

return false;
key = keyString;
}
bool isImplicitStyle = key is null && !style.Properties.ContainsKey(new XmlName("", "Class"));

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.

[major] Input and Path Correctness - A root XAML Style with Class="" and no x:Key reaches the class-style update path because this predicate checks attribute presence rather than its value. ResourceDictionary.Add(Style) treats an empty Class as implicit and stores it under TargetType.FullName. Editing TextColor from Red to Blue therefore emits TryUpdateClassStyle, whose StyleClass-prefix lookup finds no class list; the generated caller throws InvalidOperationException and leaves the retained Label red. This fails with either LazyRD setting because Class-bearing declarations are generated eagerly. Classify the supplied Class value consistently with ResourceDictionary.Add and cover the empty-Class setter edit.

else
{
if (!isImplicitStyle)
replacement = CreateReplacement(includeBase: false);

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] XAML & Bindings - Rebuilding these setters leaves descendant component IDs pointing at the old instances. With eager resources, use a keyed ContentView style containing a scalar BackgroundColor setter and a Content setter whose value is a Label with Text="Before". Editing BackgroundColor recreates and installs the Label, but the conversion context has no NodeIds and this path emits no XamlComponentRegistry.Register calls for the replacement subtree. A subsequent edit to Text="After" is emitted against the original Label's ID, updating the detached object or skipping it after collection instead of changing the displayed replacement. Re-register replacement setter descendants under their stable IDs and cover this two-edit sequence.

kubaflo added a commit that referenced this pull request Nov 20, 2026
… commit (#40483)

<!-- 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!

### Target Branch

- [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).

CI workflow infrastructure, so it targets `main`.

### Description of Change

Follow-up to #40468, found while testing `/review run-tests` on open PRs
after it merged.

`maui-pr-uitests` builds GitHub's test-merge commit
(`refs/pull/N/merge`). GitHub does not refresh it when `main` moves; it
waits for activity on the PR. Right after #40468 merged, every open PR's
merge ref still merged an older `main` (21 merged #40305's `main`, 20
merged an even older one). Some had been stale for hours. The pipeline
in those commits does not declare the new `uitest_*` parameters, so the
dispatcher stopped straight away with "merges an older main".

Changes:

- **Wait instead of failing.** `Get-VerifiedPullRequest` now treats a
merge ref whose pipeline cannot take the selection as "not ready yet".
It keeps polling for up to 10 minutes, which covers a refresh GitHub is
already computing. A missing merge of a new head still gives up after
about 3 minutes, as before. The dispatcher job timeout goes from 15 to
25 minutes to fit.
- **Check every parameter that will be sent.**
`Test-RunTestsPipelineSupportsSelection` also requires each
`uitest_<Category>` / `uitestPlatform*` name in the queue request.
Otherwise a category added to `main` later would reach Azure as an
"Unexpected parameter" 400 on PRs whose merge ref predates it.
- If GitHub still hasn't refreshed after 10 minutes, the comment says so
and suggests commenting again later or updating the branch.

### Validation

- `RunTests.Tests.ps1` and `CopilotPipeline.Tests.ps1`: 66 passed. A new
test covers parameters that are missing from the built pipeline,
including regex metacharacters.
- Real `/review run-tests` comments after #40468 merged, using the
current `main` dispatcher (without this PR):

  | PR | Merge ref merges | Selection | Result |
  | --- | --- | --- | --- |
| #40437 | new `main` (head pushed after the merge) | 9 categories, all
platforms | **Queued targeted build 1692555** as the trigger identity
(no 403). Azure shows `selectedRun=true`, the four platform booleans and
only the 9 `uitest_*` values; only the CollectionView, CV1 and
per-platform stages started |
| #40418 | new `main` | full suite (both models) | Full build 1692548 |
| #40369, #40344, #40288 | #40305's `main` | 5 / 4 / 2 categories |
Stopped: stale merge ref |
| #40420 | older `main` | 4 categories, Android | Stopped: stale merge
ref |

A `/review run-tests` comment, an API read and a no-op base edit did not
refresh a stale merge ref within 10+ minutes; a push to the PR head
refreshes it at once. Until GitHub refreshes the older PRs, they need an
update or push. This PR waits for any refresh GitHub is already
computing, explains the situation in the comment, and keeps a later
category addition from becoming an Azure 400.

Co-authored-by: Copilot CI <copilot-ci@microsoft.com>
@kubaflo
kubaflo changed the base branch from main to candidate/11.0.1xx-sr2 November 20, 2026 19:22
Preserve live-style updates alongside metadata-safe local resource factories and combine lazy dictionary options with existing test driver controls.

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

kubaflo commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Resolved the conflicts with candidate/11.0.1xx-sr2 and pushed merge commit b9ca8ce44c to the original stephanedelcroix-fix-39984-hotreload-keyed-class-styles branch.

Combined live-style updates with the target’s metadata-safe local resource factories and explicit delegate construction, preserving resource additions and replacement behavior. Retained the lazy-resource dictionary option alongside the existing diagnostics, preview-feature, line-info and inflator controls in the shared test drivers and Hot Reload harness.

@kubaflo
kubaflo merged commit fd0b34b into candidate/11.0.1xx-sr2 Nov 20, 2026
2 of 12 checks passed
@kubaflo
kubaflo deleted the stephanedelcroix-fix-39984-hotreload-keyed-class-styles branch November 20, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[XIHR] Scalar setter edits in keyed and class styles leave existing consumers stale, including with eager resources

4 participants