Skip to content

Update breaking changes branch - #23482

Merged
MartinZikmund merged 292 commits into
feature/breakingchangesfrom
dev/mazi/breaking-spec
Jun 18, 2026
Merged

MartinZikmund merged 292 commits into
feature/breakingchangesfrom
dev/mazi/breaking-spec

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #

PR Type:

What changed? 🚀

PR Checklist ✅

jonpryor and others added 30 commits June 10, 2026 13:00
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Context: 9059f29

Same but different as 9059f29: instead of CS0117 errors in
`src\Uno.UI.RuntimeTests\Tests`, they're now in
`src\SamplesApp\SamplesApp.UnitTests.Shared`.

Update `[DynamicallyAccessedMemberTypes]` as was done in 9059f29.
Context: 0c795cf

Commit 0c795cf had the right idea, but in Skia configuration builds
the types of interest are actually in a `SamplesApp.Skia.dll` assembly.

Update the type names accordingly.
Context: 03c71f6

Commit 03c71f6 addressed some linker warnings by introducing a new
`SampleChooserType` struct to ensure that reflection metadata was
preserved.

Unfortunately this change to `src/SamplesApp/SamplesApp.UITests.Generator`
also impacted `src/SamplesApp/SamplesApp.UITests`; from a build log:

    /agent/_work/1/s/src/SamplesApp/SamplesApp.UITests/obj/Release/net9.0/Uno.Samples.UITest.Generator/Uno.Samples.UITest.Generator.SamplesListGenerator/AllSamplesList.g.cs(6,12):
    error CS0246: The type or namespace name 'SampleChooserType' could not be found (are you missing a using directive or an assembly reference?) [/agent/_work/1/s/src/SamplesApp/SamplesApp.UITests/SamplesApp.UITests.csproj]

Fix this by moving the definition of `SampleChooserType` into
`SamplesListGenerator.cs` / the generated `AllSamplesList.g.cs`.
This allows the `src/SamplesApp/SamplesApp.UITests` to have access
to the type, allowing `AllSamplesList.g.cs` to compile stand-alone.
Context: 14d0b86

Commit 14d0b86 stated:

> In a "is this a good or bad idea" mement, add trimmer annotations to
> `IValueConverter`.  This in turn requires *half the universe* to be
> updated to have matching annotations.

I can say that, in retrospect, this was a bad idea.  It created a
divergence from upstream WPF, requiring different-ish codepaths between
Uno and WinAppSDK and everything tangentially related, such as
**Tests - Unit Tests > Run > Run unit tests**, which fails with:

	// /0/Test0.cs(35,83): error CS0117: 'IValueConverter' does not contain a definition for 'TargetTypeRequirements'
	DiagnosticResult.CompilerError("CS0117").WithSpan(35, 83, 35, 105).WithArguments("Microsoft.UI.Xaml.Data.IValueConverter", "TargetTypeRequirements"),
	// /0/Test0.cs(40,87): error CS0117: 'IValueConverter' does not contain a definition for 'TargetTypeRequirements'
	DiagnosticResult.CompilerError("CS0117").WithSpan(40, 87, 40, 109).WithArguments("Microsoft.UI.Xaml.Data.IValueConverter", "TargetTypeRequirements"),

At this point, the experiment is over: it's not currently viable to try
to update `IValueConverter` to be more Native AOT friendly.

Revert the lot of it; we'll have to address the resulting trimmer
warnings by suppressing them.
Red tests capturing the current defect (spec 044):
- a batch merged into an in-flight operation that completes before the
  batch is processed has its compile outcome silently dropped
- HotReloadOperation.Complete on an already-completed operation drops
  the result and its diagnostics without a trace

Introduces IWatchHotReloadService so HotReloadManager can be unit
tested with a stub emitter, plus the Uno.HotReload.Tests project.

Co-Authored-By: Claude Fable 5 <[email protected]>
Operations are completed by the pass that processes them, which runs
while holding the solution-update gate. Deciding the TryMerge outside
the gate let a batch merge into an in-flight operation that completed
before the batch's own pass ran; that pass's outcome (e.g. Failed with
diagnostics for content that no longer compiles) was then silently
dropped by the already-completed operation, reporting broken content
as a clean reload.

- root-cause fix: move TryMerge/StartHotReload under the gate so a
  completed operation routes the batch to a fresh tracked operation
- defensive hardening: HotReloadOperation.Complete now reports dropped
  late completions through the reporter instead of returning silently

Co-Authored-By: Claude Fable 5 <[email protected]>
New .NET means new trimmer warnings!
Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v9...v10)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action) from 1.0.134 to 1.0.143.
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](anthropics/claude-code-action@36a69b6...eee73e2)

---
updated-dependencies:
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.143
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Context: dd5b4ff

Looks like commit dd5b4ff broke the **Tests - Android Native** stage:

	…/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_XYFocusTreeWalker.cs(23,14): error CS0260: Missing partial modifier on declaration of type 'Given_XYFocusTreeWalker'; another partial declaration of this type exists
	…/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_XYFocusTreeWalker.cs(198,23): error CS0260: Missing partial modifier on declaration of type 'FocusableXYFocusCUIElement'; another partial declaration of this type exists
	…/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_XYFocusTreeWalker.cs(208,23): error CS0260: Missing partial modifier on declaration of type 'XYFocusCUIElement'; another partial declaration of this type exists

Add the missing `partial` keyword so that this compiles.
…actions/stale-10

chore(deps): bump actions/stale from 9 to 10
…ossf/scorecard-action-2.4.3

chore(deps): bump ossf/scorecard-action from 2.3.1 to 2.4.3
…peter-evans/create-pull-request-8.1.1

chore(deps): bump peter-evans/create-pull-request from 6.0.5 to 8.1.1
…actions/upload-artifact-7

chore(deps): bump actions/upload-artifact from 4 to 7
…actions/github-script-9

chore(deps): bump actions/github-script from 6 to 9
…anthropics/claude-code-action-1.0.143

chore(deps): bump anthropics/claude-code-action from 1.0.134 to 1.0.143
…actions/labeler-6.1.0

chore(deps): bump actions/labeler from 4.3.0 to 6.1.0
@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation kind/documentation area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk labels Jun 18, 2026
@CLAassistant

CLAassistant commented Jun 18, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ MartinZikmund
✅ nickrandolph
✅ Xiaoy312
❌ Nick Randolph


Nick Randolph seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

…v/mazi/breaking-spec

# Conflicts:
#	build/ci/tests/.azure-devops-tests-android-native.yml
#	build/ci/tests/.azure-devops-tests-ios-native.yml
#	build/nuget/Uno.WinUI.DevServer.nuspec
#	build/nuget/Uno.WinUI.Graphics2DSK.nuspec
#	build/nuget/Uno.WinUI.Lottie.nuspec
#	build/nuget/Uno.WinUI.Svg.nuspec
#	build/nuget/Uno.WinUI.XamlHost.nuspec
#	build/nuget/Uno.WinUI.nuspec
#	build/test-scripts/run-netcore-mobile-template-tests.ps1
@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 8m 31s —— View job


PR Review

  • Gather context and read changed files
  • Review specs and documentation changes
  • Review code changes in src/
  • Post inline comments for findings
  • Post summary review

Overall Verdict: Approve with minor fixes ✅

This is a large, well-structured PR. The four major work areas — ALC resource projection cleanup, WinUI theming alignment (Phase 4: remove global theme stack), DependencyObjectStore WinUI Enter/Leave porting, and mentor-based DataContext inheritance — are all correctly implemented and well-documented. The code reads cleanly and the MUX reference comments accurately pin the corresponding WinUI source locations.

Issues by severity

Medium — 1 issue

  1. FrameworkElement.cs:277 — Resources setter null inconsistency (inline comment posted): The PR added _resources?.SetResourceOwner(this) (null-safe) immediately above the pre-existing _resources.InvalidateNotFoundCache(true) (not null-safe). If Resources = null is ever called, the pre-existing line throws but the new line doesn't, creating a misleading false sense of null safety. Should be _resources?.InvalidateNotFoundCache(true).

Low — 1 issue

  1. DependencyObjectStore.PropertySystem.mux.cs — ItemsSource string exclusion (inline comment posted): ShouldEnterLeaveProperty excludes all properties named "ItemsSource" by string name comparison. The comment correctly notes this is temporary until WinUI's IsVisualTreeProperty metadata is ported, but there is no tracking reference. A TODO with the phase reference would prevent this from being forgotten in future porting phases.

Cross-cutting notes (no action needed)

  • Global theme stack fully removed: The PushRequestedThemeForSubTree/PopRequestedThemeForSubTree static stack is gone; CoreServices.ScopeRequestedThemeForSubTree (scoped IDisposable) replaces every call site. A unit test asserts via reflection that the old methods are not reintroduced — an excellent regression guard.
  • ThemeWalkResourceCache correctly moved from a static singleton to a per-CoreServices instance. The cache keys on (Dict, Theme, Key) tuples matching WinUI's std::tuple<CResourceDictionary*, Theming::Theme, xstring_ptr>.
  • ActualThemeChanged event now registers with CoreServices so off-tree elements receive the notification — correctly mirrors WinUI's CCoreServices::m_elementsWithThemeChangedListener (ConditionalWeakTable avoids rooting elements, matching WinUI's weak-pointer semantics from the destructor).
  • Mentor mechanism (_mentorRef/_mentoredChildren) uses ManagedWeakReference throughout, preventing circular strong-reference cycles between parent and non-UIElement property values.
  • AlcContentHost projection tracking (_copiedDirectResourceKeys, _copiedThemeDictionaries with HadPreviousValue/PreviousValue restoration) correctly breaks the ALC-pinning chain for collectible resource types. The OnUnloaded handler releasing projections when the host leaves the tree (without a prior Content = null) is a correct defensive path.
  • DisplayInformation.DestroyForWindowId breaks the static map's reference to the closed window's native graph, eliminating the DisplayInformation → native wrapper → window → Closed subscriber → ALC retention chain.
  • No event Action / event Action<T> violations found; all new events use TypedEventHandler<FrameworkElement, object> or similar EventHandler<T> shapes.
  • SpecializedResourceDictionary.ResourceKey now implements IEquatable<ResourceKey> with proper GetHashCode and Equals(object) overrides, eliminating the reflection-based ValueType equality fallback and boxing for (Dict, Theme, Key) composite dictionary keys.
  • VisualStateGroup.cs theme-scope injection uses CoreServices.ScopeRequestedThemeForSubTree with correct guard for re-entrant GoToState during a theme walk (ownerIsProcessingThemeWalk ? default : ...); the default(RequestedThemeForSubTreeScope) path is safe since Dispose() is a no-op when _set == false.
  • PR description: closes # has no issue number. Per repo guidelines every PR should reference an associated issue.

Comment thread src/Uno.UI/UI/Xaml/FrameworkElement.cs Resolved
@unodevops

Copy link
Copy Markdown
Contributor

The 5.3 uno53AppWithLib template targets net10.0-only, but three
group-4 entries still built with -f net9.0, failing with NETSDK1005.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F9GnDY67RFwYYjBaxBiNqF
@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 4m 11s —— View job


PR Review

  • Gather context and read changed files
  • Review specs and documentation changes
  • Review code changes in src/
  • Review build/CI changes
  • Post inline comments for findings
  • Post summary review

Overall Verdict: Approve with minor fixes ✅

Solid incremental update. The Mac Catalyst re-enablement (IsCatalyst, IsIOSOrCatalyst in Directory.Build.props, __MACCATALYST__-specific handling in SvgCanvas.cs and LottieVisualSource.Skottie.cs) is consistent with existing usage of __MACCATALYST__ in the codebase. The SamplesApp additions follow conventions. The namespace migration in FrameExtensions.cs (Windows.UI.Xaml → Microsoft.UI.Xaml) is correct and the missing assembly qualifier on the second ApiInformation.IsTypePresent call is now fixed.

Issues by severity

Medium — 1 issue

  1. doc/articles/features/system-backdrop.md line 58 — Stale tip (inline comment posted): The tip says "The SamplesApp test performs a traversal of the visual tree and temporarily replaces opaque backgrounds with transparent brushes" — but this PR removes exactly that code (MakeAncestorBackgroundsTransparent + _savedBackgrounds) and replaces it with a comment saying the framework handles it automatically. The doc needs to match the new behavior.

Low — 2 issues

  1. FocusTrapRepro.xaml line 8 — Missing Background attribute (inline comment posted): New Page root is missing Background="{ThemeResource ApplicationPageBackgroundThemeBrush}". Every other new XAML page in this PR has it; the SamplesApp contribution rule requires it for light/dark theme safety.

  2. ControlStateViewer.xaml.cs line 48 — Thin assertion error message (inline comment posted): The AssertSetControlType<T> exception only names the expected type, not the actual type that was passed. Both sides should appear in the message so a mismatch is immediately actionable.

Cross-cutting notes (no action needed)

  • The Directory.Build.props changes correctly add IsCatalyst/IsIOSOrCatalyst and update IsAppleUIKit/IsApple to include Mac Catalyst, consistent with how __MACCATALYST__ is already used in Uno.UI.Runtime.Skia.AppleUIKit, RemoteControlClient.cs, and elsewhere.
  • The SvgCanvas.cs #if __MACCATALYST__ / #elif __APPLE_UIKIT__ split is correct: Mac Catalyst needs the simpler this.Opaque = false path rather than the GL view-tree traversal used for iOS/tvOS.
  • TransformToVisual_Transform.xaml.cs and TransformToVisual_ScrollViewer.xaml.cs switching from new TestRunner(this, …) to TestRunner.Create(this, …) propagates the [DynamicallyAccessedMembers] annotation correctly for trim-safe reflection.
  • The AccessibilityScreenReaderPage.xaml.cs LayoutUpdated subscription uses remove-then-add in OnPageLoaded, which is correct for idempotency on re-load. The change-guard in UpdateOffscreenReadout breaks the layout-invalidation → re-layout loop after one pass.
  • FrameExtensions.cs — both ApiInformation.IsTypePresent strings are now consistently using Microsoft.UI.Xaml namespace with Uno.UI assembly qualifier.
  • No event Action / event Action<T> violations found. ✅
  • No #if platform guards introduced into shared files — Mac Catalyst changes use the correct file-suffix and symbol approach. ✅

7.0 drops net9.0 (NetPrevious) support, so the remaining
net9.0-desktop app-packaging publish smoke test now targets
net10.0-desktop.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F9GnDY67RFwYYjBaxBiNqF
@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 11m 30s —— View job


PR Review

  • Gather context and read changed files
  • Review new commits since last review
  • Review code changes in src/
  • Review spec/documentation files
  • Post inline comments for findings
  • Post summary review

Overall Verdict: Approve with outstanding minor fixes ✅

The latest synchronize added two test-script version bumps (net9.0 → net10.0) plus a large merge from origin/feature/breakingchanges. The new code — FrameworkTheming, CoreServices.Theming, DependencyObjectStore.mux.cs / PropertySystem.mux.cs, ALC theming ownership, binding ALC cache clearing — is a well-structured set of WinUI ports with accurate MUX reference comments.

Issues by severity

Previously flagged, still outstanding — 2 issues:

  1. FrameworkElement.cs:277 — _resources.InvalidateNotFoundCache(true) NRE when Resources = null (inline comment re-posted; the ?. on line 276 makes the inconsistency visible).

  2. DependencyObjectStore.PropertySystem.mux.cs:215 — ItemsSource exclusion by string name has no tracking reference. Inline comment updated with a concrete suggestion.

New — 2 low issues:

  1. Application.Alc.cs:144 — #nullable disable at file scope means the new GetOwningApplication return type is unannotated despite two return null branches. Inline comment posted.

  2. FrameworkTheming.cs:200 — Theme theme = Theme.None; is immediately overwritten; dead initialization. Inline comment with suggestion.

Cross-cutting notes (no action needed)

  • FrameworkTheming / CoreServices.Theming.cs: The NotifyThemeChange port is structurally correct. The _elementsWithThemeChangedListener ConditionalWeakTable correctly avoids rooting elements (mirrors WinUI's destructor-based removal). IsSwitchingTheme guard, the ModifiedValue.SuppressLocalCanDefeatAnimations() scope, and the per-content-root secondary-ALC owner walk are all sound.
  • DependencyObjectStore.mux.cs — The Enter/Leave ports match depends.cpp structurally. The EstablishThemeOnEnterCore fallback via EnterParams.ThemeInheritanceCaller correctly fills the gap until WinUI's InheritanceContext per-DP tracking is ported.
  • DependencyObjectStore.PropertySystem.mux.cs — LeaveObjectProperty skipping ALL UIElements is intentional (detached ones were only theme-established, not live-entered; active ones belong to the visual Leave walk). The asymmetry is correct.
  • ArrayPool<ThemeResourceMap.Entry> in UpdateAllThemeReferences — Properly rented and returned in a finally with clearArray: true. No leak.
  • BindingPropertyHelper.GetPropertyTypeKey seed fix — Correctly prevents NPE from Clone() when a racing ClearCaches swap captures the old key instance between Update() and Clone().
  • BindingPath.BindingItem ALC accessor cache clearing — Clears all cached RuntimeMethodInfo closures when the DataContext type is collectible, preventing ALC pin-after-unload. The ordering (after RaiseValueChanged + subscription disposal) is correct.
  • AlcContentHost projection tracking — _copiedDirectResourceKeys / _copiedThemeDictionaries list correctly tracks and restores previous theme-dictionary values on clear. OnUnloaded path (when Content is not explicitly cleared) releases everything correctly.
  • Window.alc.cs ALC ownership — WeakReference<AssemblyLoadContext> avoids rooting a collectible ALC. ApplyAlcRequestedTheme correctly gates on ContentHostOverride's Content identity before updating RequestedTheme. DisplayInformation.DestroyForWindowId teardown is correctly guarded with a catch-all to avoid swallowing other ALC cleanup.
  • Application.cs RequestedThemeChanged — Correctly changed from event Action to event EventHandler. All call sites updated to use (this, EventArgs.Empty).
  • No event Action / event Action<T> violations introduced. ✅
  • No #if platform guards leaked into shared files; new Mac Catalyst code uses the correct IsCatalyst / IsIOSOrCatalyst MSBuild properties and __MACCATALYST__ symbol. ✅

Align the section comment with the net10.0 entries below it
(leftover from an earlier merge).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F9GnDY67RFwYYjBaxBiNqF
@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 30s —— View job


PR Review

  • Gather context and check new commits since last review
  • Review new code changes
  • Post inline comments for findings
  • Post summary review

New commits since last review

Three small commits were pushed, all modifying build/test-scripts/run-netcore-mobile-template-tests.ps1:

Commit Change
19ce79b93a Bump 3 uno53AppWithLib group-4 entries from net9.0/net9.0-browserwasm/net9.0-desktop → net10.0 (fixes NETSDK1005)
a7c556ef0e Bump the macOS desktop publish smoke test from net9.0-desktop → net10.0-desktop
5bc95b31ac Fix stale section comment # 5.3 Uno App with net9 → # 5.3 Uno App with net10

Verdict: ✅ Clean

All three changes are correct maintenance fixes with no issues. The remaining net9 strings in the file are template project path names (5.3/uno53net9blank/..., 5.3/uno53net9Lib/...) that reflect the historical template version — they're not TFM selectors and should not be changed. Every -f / -p:TargetFramework(s) argument in the file now consistently targets net10.0.

No inline findings to post.

Comment thread src/Uno.UI/UI/Xaml/FrameworkElement.cs Resolved
Comment thread src/Uno.UI/UI/Xaml/Application.Alc.cs Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 218836 did not find any UI Test snapshots differences.

@MartinZikmund
MartinZikmund enabled auto-merge June 18, 2026 17:18
@MartinZikmund
MartinZikmund merged commit 54bcf50 into feature/breakingchanges Jun 18, 2026
69 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/breaking-spec branch June 18, 2026 17:23
@MartinZikmund MartinZikmund mentioned this pull request Jun 22, 2026
1 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/solution-templates Categorizes an issue or PR as relevant to the solution template kind/documentation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.