Skip to content

refactor(sync-gen)!: Relocate 4 namespaces to WinUI-aligned assemblies - #23669

Merged
MartinZikmund merged 2 commits into
feature/breakingchangesfrom
dev/mazi/moveapis
Aug 7, 2026
Merged

MartinZikmund merged 2 commits into
feature/breakingchangesfrom
dev/mazi/moveapis

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: #22927 (partial — removes 4 of the back-compat redirects; Content / WebView2 / WindowNative remain as follow-ups)

PR Type:

🔄 Refactoring (no functional changes, no api changes)

What changed? 🚀

The WinAppSDK sync generator (Uno.WinAppSDKSyncGenerator) carried a block of "BACKWARDS COMPATIBILITY REDIRECTS" in GetNamespaceBasePath that forced several namespaces into a legacy assembly instead of the one matching their WinAppSDK metadata. This removes the redirects for the four namespaces that route cleanly, so each now generates into its WinUI-aligned assembly:

Namespace WinAppSDK assembly Was Now
Microsoft.UI.System (ThemeSettings) InteractiveExperiences Uno.UI Uno.UWP
Microsoft.Graphics.DirectX / .Display InteractiveExperiences Uno.UI.Composition Uno.UWP
Microsoft.UI.IClosableNotifier / ClosableNotifierHandler InteractiveExperiences Uno.UI.Composition Uno.UWP
Microsoft.Windows.ApplicationModel.Resources (MRT-Core) Resources.Projection Uno.UI Uno.UWP
  • Hand-written partials are moved next to their regenerated stubs. Partials are relocated before regeneration so the generator's per-head "already declared" dedup keeps the stubs skipped on every target — otherwise the Wasm/mobile heads emit duplicate definitions (CS0101/CS0102).
  • Fixes a name-shadowing break the Microsoft.UI.System move exposes: the namespace becomes newly visible in Uno.UI.Composition, shadowing the BCL System, so SkiaExtensions now qualifies global::System.Drawing.Color.
  • Documents the intentionally-retained redirects (Content, WebView2, WindowNative) and the Input / Xaml.Automation force-routes, whose WinUI-correct assembly cannot host their hand-written implementations without a dedicated seam.
  • PackageDiff 6.6 baseline updated for the relocated public types (they move from package Uno.WinUI to Uno.WinRT).

Why the remaining redirects aren't in this PR

Each is a genuine architectural constraint of Uno's layered assemblies (Uno.Foundation → Uno.UI.Dispatching → Uno.UWP → Uno.UI.Composition → Uno.UI), not just caution:

  • Microsoft.UI.Content — WinUI assembly is InteractiveExperiences (→ Uno.UWP), but ContentIsland/ContentSite require Compositor/Visual from Uno.UI.Composition, a layer above Uno.UWP. Its reachable home is Uno.UI.Composition, not Uno.UWP.
  • WinRT.Interop.WindowNative / InitializeWithWindow — defined in Microsoft.Windows.SDK.NET (→ Uno.UWP), but the impl depends on Microsoft.UI.Xaml.Window (Uno.UI); needs an ApiExtensibility seam.
  • Microsoft.Web.WebView2.Core, Microsoft.UI.Input — kept in Uno.UI; their implementations are welded to the Uno.UI visual tree / windowing.

Validation

  • ✅ Compile — full Skia stack (Uno.UI.Skia → Foundation / Dispatching / UWP / Composition / UI), 0 errors.
  • ✅ Compile — Uno.UWP Wasm head, 0 errors (the native head that surfaced, and now passes, the dedup case).
  • Generated tree regenerated from the sync generator; diff is surgical — only the 5 relocated namespaces change.
  • No runtime behavior change: relocated types are [Uno.NotImplemented] stubs plus their existing hand-written partials — only the declaring assembly changes.

PR Checklist ✅

  • 🧪 Added Runtime tests / UI tests / sample — n/a: assembly relocation of NotImplemented stubs; validated by cross-head compile.
  • 📚 Docs have been added/updated — n/a.
  • 🖼️ Validated PR Screenshots Compare Test Run results — n/a (no visual change).
  • ❗ Contains NO breaking changes — intentional binary break for 7.0; targets feature/breakingchanges (see below).
  • 👀 Reviewed 2 other open pull requests.

Breaking change (intentional, 7.0). Relocating a public type across assemblies is binary-breaking: Microsoft.UI.System.ThemeSettings, Microsoft.Graphics.DirectX.*, Microsoft.Graphics.Display.*, Microsoft.UI.IClosableNotifier / ClosableNotifierHandler, and Microsoft.Windows.ApplicationModel.Resources.* move from Uno.UI / Uno.UI.Composition (package Uno.WinUI) to the Uno assembly / Uno.UWP (package Uno.WinRT). Source-compatible — the namespaces are unchanged, so ordinary using-based code keeps compiling; only assembly-identity-sensitive code (typeof/reflection/InternalsVisibleTo) is affected. This is one of the intended 7.0 major-version corrections to align Uno's generated surface with WinAppSDK.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GDb8ugFEpgnj4B2Z2E5psM

Copilot AI review requested due to automatic review settings July 7, 2026 09:45
@github-actions github-actions Bot added area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/build Categorizes an issue or PR as relevant to build infrastructure labels Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

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


PR Review: refactor(sync-gen)!: Relocate 4 namespaces to WinUI-aligned assemblies

Todo List

  • Gather context and understand the request
  • Read changed files (Generator.cs, SkiaExtensions.skia.cs, PackageDiffIgnore.xml)
  • Review generated stub files moved to Uno.UWP
  • Check for code style, correctness, and Uno Platform conventions
  • Post inline review comments for findings
  • Update comment with final summary

Summary

Verdict: ship — 1 nit (comment clarity), no blocking issues found.

Findings: 1 nit

The logic and structure of this PR are sound. The single finding is a comment/code mismatch in Generator.cs at the Microsoft.UI.Content retained-redirect block (line 439): the comment says "The WinUI-correct Uno home is Uno.UI.Composition" while the code returns Uno.UI. The comment is technically not wrong about the eventual goal, but it reads as if it's describing what the code does — a future maintainer could interpret it as a bug and incorrectly redirect to Uno.UI.Composition. See inline comment for a suggested rewording.

Everything else looks correct:

  • Relocated generated stubs (DisplayInformation, DisplayAdvancedColorInfo, ThemeSettings, etc.) now carry the full #if __ANDROID__ || __IOS__ || __TVOS__ || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ guards consistent with other Uno.UWP stubs, and ShouldEmitNativeDefines correctly returns true for these types after the move.
  • IClosableNotifier / ClosableNotifierHandler dedup (generated stub + hand-written partial in Uno.UWP) is clean — the generated stub is empty since all members are already declared in the hand-written partial.
  • SkiaExtensions.skia.cs fix (global::System.Drawing.Color) is correct and targeted — only the overload taking the BCL System.Drawing.Color needs qualification; the overload taking Windows.UI.Color is unambiguous.
  • PackageDiffIgnore.xml 6.6 baseline entries are complete, properly scoped to the moved types, and include the right reason strings.
  • Retained-redirect documentation (Microsoft.UI.Content, Microsoft.Web.WebView2, WinRT.Interop.WindowNative) correctly explains why each cannot be relocated in this PR.
  • Conventional Commit title format and breaking-change declaration are correct for the feature/breakingchanges base target.

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.

Pull request overview

Refactors the WinAppSDK sync generator routing so selected namespaces generate into their WinAppSDK-aligned assemblies (primarily moving from Uno.UI / Uno.UI.Composition into Uno.UWP), while documenting/retaining redirects that still require architectural seams (tracked by #22927).

Changes:

  • Removes backwards-compat namespace redirects in Uno.WinAppSDKSyncGenerator for namespaces that can be relocated cleanly, and clarifies which redirects remain intentional.
  • Moves/introduces hand-written partials alongside regenerated stubs in Uno.UWP to avoid duplicate type definitions across heads.
  • Updates PackageDiff ignore baseline entries to account for public type moves across packages/assemblies.

Reviewed changes

Copilot reviewed 3 out of 38 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Uno.WinAppSDKSyncGenerator/Generator.cs Removes legacy redirects for some namespaces; documents retained redirects and routing rationale.
src/Uno.UWP/Microsoft/Windows/ApplicationModel/Resources/ResourceLoader.cs Adds hand-written partial wrapper for Microsoft.Windows.ApplicationModel.Resources.ResourceLoader.
src/Uno.UWP/Microsoft/Windows/ApplicationModel/Resources/ResourceCandidateKind.cs Adds hand-written ResourceCandidateKind enum to match projection surface after relocation.
src/Uno.UWP/Microsoft/Windows/ApplicationModel/Resources/MrtCoreContract.cs Adds hand-written MrtCoreContract contract type in the relocated namespace.
src/Uno.UWP/Microsoft/Windows/ApplicationModel/Resources/IResourceManager.cs Adds hand-written IResourceManager interface in the relocated namespace.
src/Uno.UWP/Microsoft/Windows/ApplicationModel/Resources/IResourceContext.cs Adds hand-written IResourceContext interface in the relocated namespace.
src/Uno.UWP/Microsoft/UI/IClosableNotifier.cs Adds hand-written IClosableNotifier interface in Uno.UWP (guarded by HAS_UNO_WINUI).
src/Uno.UWP/Microsoft/UI/ClosableNotifierHandler.cs Adds hand-written ClosableNotifierHandler delegate in Uno.UWP (guarded by HAS_UNO_WINUI).
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/ResourceNotFoundEventArgs.cs Regenerated stubs now live in Uno.UWP with updated platform #if guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/ResourceMap.cs Regenerated stub moved into Uno.UWP with updated platform guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/ResourceManager.cs Regenerated stub moved into Uno.UWP with updated platform guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/ResourceLoader.cs Regenerated stub moved into Uno.UWP, skipping members provided by hand-written partial.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/ResourceContext.cs Regenerated stub moved into Uno.UWP with updated platform guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/ResourceCandidateKind.cs Regenerated stub now skips enum members provided by hand-written type.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/ResourceCandidate.cs Regenerated stub moved into Uno.UWP with updated platform guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/MrtCoreContract.cs Regenerated stub representation remains excluded via #if false... after relocation.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/KnownResourceQualifierName.cs Regenerated stub moved into Uno.UWP with updated platform guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/IResourceManager.cs Regenerated stub moved into Uno.UWP, aligning with relocated hand-written partial.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Windows.ApplicationModel.Resources/IResourceContext.cs Regenerated stub moved into Uno.UWP, aligning with relocated hand-written partial.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.UI/IClosableNotifier.cs Regenerated stub moved into Uno.UWP, skipping members provided by hand-written partial.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.UI/ClosableNotifierHandler.cs Regenerated stub added to acknowledge relocated delegate (skipped due to hand-written declaration).
src/Uno.UWP/Generated/3.0.0.0/Microsoft.UI.System/ThemeSettings.cs Regenerated ThemeSettings stub now hosted in Uno.UWP with expanded platform guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Graphics.Display/DisplayInformation.cs Regenerated stub now hosted in Uno.UWP with expanded platform guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Graphics.Display/DisplayHdrMetadataFormat.cs Adds regenerated enum stub under Uno.UWP after relocation.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Graphics.Display/DisplayAdvancedColorKind.cs Adds regenerated enum stub under Uno.UWP after relocation.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Graphics.Display/DisplayAdvancedColorInfo.cs Regenerated stub now hosted in Uno.UWP with expanded platform guards.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Graphics.DirectX/DirectXPrimitiveTopology.cs Adds regenerated enum stub under Uno.UWP after relocation.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Graphics.DirectX/DirectXPixelFormat.cs Adds regenerated enum stub under Uno.UWP after relocation.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Graphics.DirectX/DirectXColorSpace.cs Adds regenerated enum stub under Uno.UWP after relocation.
src/Uno.UWP/Generated/3.0.0.0/Microsoft.Graphics.DirectX/DirectXAlphaMode.cs Adds regenerated enum stub under Uno.UWP after relocation.
src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.Graphics.Display/DisplayHdrMetadataFormat.cs Removes old generated enum from Uno.UI.Composition (now generated in Uno.UWP).
src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.Graphics.Display/DisplayAdvancedColorKind.cs Removes old generated enum from Uno.UI.Composition (now generated in Uno.UWP).
src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.Graphics.DirectX/DirectXPrimitiveTopology.cs Removes old generated enum from Uno.UI.Composition (now generated in Uno.UWP).
src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.Graphics.DirectX/DirectXPixelFormat.cs Removes old generated enum from Uno.UI.Composition (now generated in Uno.UWP).
src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.Graphics.DirectX/DirectXColorSpace.cs Removes old generated enum from Uno.UI.Composition (now generated in Uno.UWP).
src/Uno.UI.Composition/Generated/3.0.0.0/Microsoft.Graphics.DirectX/DirectXAlphaMode.cs Removes old generated enum from Uno.UI.Composition (now generated in Uno.UWP).
src/Uno.UI.Composition/Composition/SkiaExtensions.skia.cs Qualifies System.Drawing.Color with global:: to avoid namespace shadowing after relocation.
build/PackageDiffIgnore.xml Updates PackageDiff ignore entries to reflect relocated public types across packages/assemblies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

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

Comment thread build/PackageDiffIgnore.xml Resolved
@github-actions

github-actions Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

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


PR Review: refactor(sync-gen)!: Relocate 4 namespaces to WinUI-aligned assemblies

Todo List

  • Gather context and understand the request
  • Read changed files (Generator.cs, SkiaExtensions.skia.cs, PackageDiffIgnore.xml, generated stubs)
  • Investigate #if-conditional changes in DisplayAdvancedColorInfo.cs (Xiaoy312's question)
  • Investigate PackageDiff version entries (Xiaoy312's question)
  • Review for correctness, code style, and Uno Platform conventions
  • Post inline review comments for findings
  • Update comment with final summary

Summary

Verdict: fix-first — 2 findings (1 nit already flagged, 1 new correctness concern).

Findings: 2

# Severity File Description
1 Nit Generator.cs:443 Comment/code mismatch (also flagged by github-actions and copilot-reviewer): the phrase "The WinUI-correct Uno home is Uno.UI.Composition" reads as describing what the code does, but the code returns Uno.UI. A maintainer could treat this as a bug and incorrectly redirect to Uno.UI.Composition. Suggested rewording in inline comment.
2 Low PackageDiffIgnore.xml:3015 New entries added to baseVersion="6.6" IgnoreSet, but 6.6 is not yet on NuGet. The file's own instructions say baseVersion must be the current latest stable published on NuGet (6.5). The IgnoreSet baseVersion="6.5" section already exists at line 2113 — the new entries should be appended there. (The pre-existing 6.6 entries for FeatureConfiguration removals have the same problem, but that's a separate cleanup; these new entries should use the correct baseline.)

Answering Xiaoy312's #if-conditional question:

The expanded guards in DisplayAdvancedColorInfo.cs (and all other relocated stubs) from #if __SKIA__ || __NETSTD_REFERENCE__ → #if __ANDROID__ || __IOS__ || __TVOS__ || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ are correct and expected. In Uno.UI.Composition (the old home), the assembly only compiles for Skia and Reference targets, so only those two symbols were needed. In Uno.UWP (the new home), the assembly compiles for all platform targets, so the stubs must be guarded for all of them — otherwise the types would be unconditionally visible on Android/iOS/WASM without the [Uno.NotImplemented] protection. The generator correctly regenerated these with the broader guard set.

Everything else looks correct:

  • SkiaExtensions.skia.cs fix (global::System.Drawing.Color) is targeted and correct — namespace shadowing from the newly visible Microsoft.UI.System namespace necessitates the qualification.
  • Hand-written partials (IClosableNotifier, ResourceLoader, etc.) cleanly co-locate alongside their regenerated stubs in Uno.UWP, and the generated stubs correctly skip the already-declared members.
  • The retained redirects (Microsoft.UI.Content, Microsoft.Web.WebView2, WinRT.Interop) are well-documented with the architectural reason each cannot move yet.
  • Conventional Commit title (refactor(sync-gen)!) and the breaking-change declaration are correct for the feature/breakingchanges base.

Comment thread build/PackageDiffIgnore.xml Resolved
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 221961 found UI Test snapshots differences: skia-linux-screenshots: 68, skia-windows-screenshots: 77

Details
  • skia-linux-screenshots: 68 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • Focus_FocusVisual_Properties.png-dark
    • Image_Margin_Large.png
    • Image_AnimatedWebP.png-dark
    • ClipboardTests.png-dark
    • Buttons.png-dark
    • ClipboardTests.png
    • Buttons.png
    • DisplayInformation.png-dark
    • CornerRadiusControls.png
    • DoubleImageBrushInList.png-dark
    • ContextRequested.png-dark
    • DropDownButtonPage.png-dark
    • CompositionPath.png
    • DoubleImageBrushInList.png
    • ContextRequested.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • EllipsemaskingEllipseGrid.png
  • skia-windows-screenshots: 77 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • Gamepad_CurrentReading.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Basics Pivot Test.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CommandBar_LongTitle_Navigation.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_Enumeration.png-dark
    • ImageIconPage.png-dark

@github-actions

github-actions Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 34s —— View job


PR Review: refactor(sync-gen)!: Relocate 4 namespaces to WinUI-aligned assemblies

Todo List

  • Gather context and understand the request
  • Read current state of changed files (Generator.cs, PackageDiffIgnore.xml)
  • Investigate UI test screenshot differences (68 linux, 77 windows)
  • Check if previously flagged issues were addressed in latest commits
  • Post inline comments for any remaining/new findings
  • Update comment with final summary

Summary

Verdict: ship — both previously flagged issues are resolved; no new findings; screenshot diffs are from unrelated branch changes.

Previously flagged issues — now fixed

# File Was Now
1 Generator.cs:443 Comment read as if describing what the code does ("The WinUI-correct Uno home is Uno.UI.Composition") — misleading since the code returns Uno.UI Fixed in 692fb77c: comment now says "stubs therefore stay in Uno.UI for now; the eventual Uno home is Uno.UI.Composition, which requires a layering seam not yet in place" — clearly distinguishes current home from eventual target
2 PackageDiffIgnore.xml 22 type-relocation entries added to baseVersion="6.6" IgnoreSet — 6.6 is not on NuGet so the diff tool can't resolve the baseline Fixed in 8900bfec: all 22 entries are now correctly under the baseVersion="6.5" IgnoreSet (lines 2284–2305)

UI test screenshot differences

The 68 (linux) / 77 (windows) screenshot differences are not caused by this PR. The DisplayInformation.png change is present in both lists, but DisplayInformation is a [Uno.NotImplemented] stub — relocating its assembly has no rendering effect. The broader set of changes (Buttons.png, CalendarView_Theming.png, CornerRadiusControls.png, DynamicFont.png, etc.) traces to the Vulkan rendering backend switch (852470b4 feat: Default to Vulkan rendering backend where available) and other feature/breakingchanges merges that pre-date this PR's base commit. These baselines need to be updated against the new Vulkan output — that work is out of scope here.

Everything else still correct

  • SkiaExtensions.skia.cs — global::System.Drawing.Color qualification at line 29 is correct and targeted.
  • Generated stubs in Uno.UWP have the correct expanded #if __ANDROID__ || __IOS__ || __TVOS__ || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ guards, consistent with all other Uno.UWP stubs.
  • IClosableNotifier / ResourceLoader dedup is clean; generated stubs correctly skip already-declared members.
  • The retained-redirect documentation (Microsoft.UI.Content, Microsoft.Web.WebView2, WinRT.Interop) correctly explains architectural constraints.
  • Conventional Commit format and breaking-change declaration are correct for feature/breakingchanges.

@MartinZikmund

MartinZikmund commented Jul 14, 2026 •

Copy link
Copy Markdown
Member Author

Review comments addressed — pushed 692fb77c8f

Two commits on top of 00ac445dbe:

commit what
8900bfec2a fix(build): Move relocation ignores to 6.5 baseline
692fb77c8f docs(sync-gen): Clarify Microsoft.UI.Content redirect

All 6 unresolved threads are covered below.

Fixed (5)

file:line reviewer point what changed
build/PackageDiffIgnore.xml (@Xiaoy312) These belong under 6.5 — 6.6 isn't on NuGet yet Moved all 22 type-relocation entries from the baseVersion="6.6" IgnoreSet into the existing baseVersion="6.5" one. You're right, and the file's own CDATA guidance agrees: "The 'baseVersion' should be the current latest stable version published on nuget, NOT what will be published by the PR in progress." With a 6.6 baseline the diff tool has no baseline package to resolve, so the ignores would silently never apply.
build/PackageDiffIgnore.xml:3015 (github-actions) Same point — use the 6.5 baseline that already exists at line 2113 Same fix. The pre-existing 6.6 FeatureConfiguration entries (#2053) have the same defect, but they aren't mine and I left them alone rather than widen this PR — flagging below.
src/Uno.WinAppSDKSyncGenerator/Generator.cs:443 (github-actions) Comment says the WinUI-correct home is Uno.UI.Composition, but the code returns Uno.UI Comment reworded to separate current home from eventual target.
src/Uno.WinAppSDKSyncGenerator/Generator.cs:443 (copilot) Same comment/code mismatch Same fix.
src/Uno.WinAppSDKSyncGenerator/Generator.cs:443 (github-actions) Same — a future reader could "fix" the return to Uno.UI.Composition and break the build Same fix. New text:
// which Uno.UWP cannot reference. The stubs therefore stay in Uno.UI for now; the eventual
// Uno home is Uno.UI.Composition, which requires a layering seam not yet in place.

No change needed (1)

file:line the point why the code is already right
.../Microsoft.Graphics.Display/DisplayAdvancedColorInfo.cs:6 (@Xiaoy312) "if we are just moving them around (read: regenerated), shouldn't the #if-conditionals remain the same?" They can't, and the widening is the correct output. The conditional set isn't a property of the type — it's a function of the heads the destination assembly is generated for. Uno.UI.Composition has 2 heads (Uno.UI.Composition.Reference, .Skia) → #if __SKIA__ || __NETSTD_REFERENCE__. Uno.UWP has 4 (Uno.Reference, Uno.Skia, Uno.Wasm, Uno.netcoremobile) → #if __ANDROID__ || __IOS__ || __TVOS__ || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__. So no head loses the type; Android/iOS/tvOS/WASM simply gain the [NotImplemented] stub they never had — which is the intent, since in WinAppSDK these live in the WinRT projection that is available on every platform. The only real change is the assembly (Uno.WinUI → Uno.WinRT), i.e. exactly the intentional binary break the ignore entries above cover.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 222270 found UI Test snapshots differences: skia-linux-screenshots: 68, skia-windows-screenshots: 81

Details
  • skia-linux-screenshots: 68 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CornerRadiusControls.png
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_Enumeration.png-dark
    • Buttons.png-dark
    • Buttons.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • EllipsemaskingEllipseGrid.png
    • Gamepad_CurrentReading.png-dark
    • Image_AnimatedWebP.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Image_Margin_Large.png
    • ColorPickerSample.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
  • skia-windows-screenshots: 81 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Basics Pivot Test.png
    • ButtonClippingTestsControl.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • DropDownButtonPage.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Gamepad_CurrentReading.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Buttons.png
    • ClipboardTests.png-dark
    • Gamepad_Enumeration.png-dark

@MartinZikmund
MartinZikmund requested a review from Xiaoy312 July 15, 2026 07:37
@MartinZikmund
MartinZikmund enabled auto-merge July 15, 2026 07:38
@MartinZikmund MartinZikmund added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Jul 15, 2026
MartinZikmund and others added 2 commits August 5, 2026 14:15
Remove the back-compat redirects in Uno.WinAppSDKSyncGenerator that forced
these namespaces into their legacy Uno.UI / Uno.UI.Composition home. Each now
falls through to the assembly-based switch and lands in the library matching
its WinAppSDK metadata assembly:

- Microsoft.UI.System (ThemeSettings)                      -> Uno.UWP
- Microsoft.Graphics.DirectX / Microsoft.Graphics.Display  -> Uno.UWP
- Microsoft.UI.IClosableNotifier / ClosableNotifierHandler -> Uno.UWP
- Microsoft.Windows.ApplicationModel.Resources (MRT-Core)  -> Uno.UWP

Hand-written partials are moved next to their regenerated stubs (partials are
relocated before regeneration so the generator's per-head "already declared"
dedup keeps the stubs skipped on every target). Also documents the
intentionally-retained redirects (Content, WebView2, WindowNative) and the
Input/Automation force-routes, whose WinUI-correct assembly cannot host their
hand-written implementations without a dedicated seam.

Fixes a name-shadowing break the ThemeSettings move exposes: Microsoft.UI.System
becomes visible in Uno.UI.Composition, so SkiaExtensions now qualifies
global::System.Drawing.Color.

Relocating types across assemblies is binary-breaking (Uno.WinUI -> Uno.WinRT);
the PackageDiff 6.6 baseline is updated accordingly.

Part of #2065 / #2090 (7.0 breaking changes).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GDb8ugFEpgnj4B2Z2E5psM
The comment read as if it described the code below it, which returns
Uno.UI. State the current home explicitly and mark Uno.UI.Composition as
the eventual target so nobody "fixes" the return path and breaks the build.

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

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 5m 58s —— View job


PR Review: refactor(sync-gen)!: Relocate 4 namespaces to WinUI-aligned assemblies

Todo List

  • Gather context and understand the request
  • Check what changed since last review (git diff)
  • Read current state of Generator.cs and other key files
  • Investigate Xiaoy312's question about sync-gen #if constants
  • Post inline review comments for any findings
  • Update comment with final summary

Summary

Verdict: ship — no new issues; rebase only (commit hashes changed, diff identical to the July 14 "ship" verdict). Answering Xiaoy312's approval-comment question below.

Answering Xiaoy312's question about "the first 4 constants"

The relevant code in Generator.cs is the dead field _unoUINamespaces (line 147), which still lists "Microsoft.Graphics" and "Microsoft.Windows.ApplicationModel.Resources" even though those namespaces were relocated to Uno.UWP by this PR:

private static readonly string[] _unoUINamespaces = new[]
{
    ...
    "Microsoft.Graphics",                            // ← now in Uno.UWP after this PR
    "Microsoft.Windows.ApplicationModel.Resources",  // ← now in Uno.UWP after this PR
};

However, _unoUINamespaces is declared but never read anywhere in the codebase — the field is dead code. Stale entries have zero effect on generation. The generator's actual routing is purely driven by GetNamespaceBasePath / ShouldEmitNativeDefines, both of which are correct after this PR's redirect removals. Cleaning up this dead field is a nice-to-have, not a correctness issue, and can be a follow-up.

State of previously flagged issues

# File Status
1 Generator.cs:447 ✅ Fixed — comment clearly distinguishes current home (Uno.UI) from eventual target (Uno.UI.Composition)
2 PackageDiffIgnore.xml ✅ Correct — 22 entries live under baseVersion="6.6" (lines 2307–2328), which is right: the inline comment at line 2114 explains that generatepkgdiff consults only the IgnoreSet matching the current latest stable major.minor, now 6.6.x, so the 6.5 set is intentionally empty

Everything else still correct

  • SkiaExtensions.skia.cs — global::System.Drawing.Color qualification is correct and targeted.
  • Uno.UI.Composition generated directories for Microsoft.Graphics.DirectX and Microsoft.Graphics.Display are correctly deleted; zero remaining stubs in Uno.UI.Composition emit __ANDROID__ / __IOS__ / __TVOS__ / __WASM__.
  • Generated stubs in Uno.UWP carry the correct expanded #if __ANDROID__ || __IOS__ || __TVOS__ || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ guards consistent with all other Uno.UWP stubs.
  • IClosableNotifier / ResourceLoader dedup is clean.
  • Retained-redirect documentation (Microsoft.UI.Content, Microsoft.Web.WebView2, WinRT.Interop) correctly explains architectural constraints.
  • Conventional Commit format and breaking-change declaration are correct.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 225870 found UI Test snapshots differences: skia-linux-screenshots: 74, skia-windows-screenshots: 279

Details
  • skia-linux-screenshots: 74 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • DamageRegion_ShadowChildPaintingCaster.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ClipboardTests.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • DoubleImageBrushInList.png-dark
    • DropDownButtonPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ImageBrushWithRotateTransform.png
    • Image_UseTargetSizeLate.png-dark
    • Image_UseTargetSizeLate.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • Gamepad_Enumeration.png-dark
    • Buttons.png
  • skia-windows-screenshots: 279 changed over 2392

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • DataTemplate_Update_Sample.png-dark
    • DataTemplate_Update_Sample.png
    • ElevatedView_Dimensions.png-dark
    • ElevatedView_Dimensions.png
    • ElevatedView_Levels.png-dark
    • ElevatedView_Levels.png
    • BitmapIcon_Generic.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • CompositionPath.png-dark
    • CompositionPath.png
    • DamageRegion_ShadowChildShape.png-dark
    • DamageRegion_ShadowChildShape.png
    • ElementLevelTheme.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 225870 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund merged commit ada9a6c into feature/breakingchanges Aug 7, 2026
66 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/moveapis branch August 7, 2026 14:54
@Xiaoy312 Xiaoy312 mentioned this pull request Aug 19, 2026
3 of 5 tasks
Xiaoy312 added a commit that referenced this pull request Aug 22, 2026
Asserts each Microsoft.Windows.ApplicationModel.Resources type is declared in
assembly Uno (the Uno.WinRT package), that the pre-MRT
Windows.ApplicationModel.Resources.ResourceLoader is there too - the claim the
migration note makes explicitly - and that Uno.UI declares none of the MRT Core
namespace. The sweep is what earns its keep: the DataRows only cover today's 11
types, while a routing regression would declare a new one back in Uno.UI. It
pins its anchor assembly first, so the sweep cannot silently start checking a
different assembly, and both failure paths name the two repair sites.

This is a regression guard rather than a fails-before/passes-after test - the
relocation shipped in #23669.

HAS_UNO-guarded rather than [PlatformCondition]-skipped: on the WinAppSDK head
these types come from the platform projection, so the assertions have no meaning
there and the file should not compile at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Xiaoy312 added a commit that referenced this pull request Aug 22, 2026
BC75 landed inside the four-namespace sync-generator relocation (#23669), not as
its own PR; its file list pointed at the old Windows.* loader paths rather than
the Microsoft.Windows.* types that moved. Records that no type-forwarder shim was
taken, and that the three sibling relocations plus BC41's Microsoft.UI.Input.*
are still undocumented and need their own tracking item rather than being parked
on a closed one.

BC21 is settled - the drifted line ref named valid WinUI surface and the real
misspelling fix already shipped. Checks off the PasswordBox reparenting and adds
the three reparenting items that were missing entirely, labelled by subject and
public PR so the spec stays free of non-public identifiers.

BC74 stays open with its blocker recorded: the draft PR targets master and the
nine-patch regression comes first.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Xiaoy312 added a commit that referenced this pull request Aug 25, 2026
Asserts each Microsoft.Windows.ApplicationModel.Resources type is declared in
assembly Uno (the Uno.WinRT package), that the pre-MRT
Windows.ApplicationModel.Resources.ResourceLoader is there too - the claim the
migration note makes explicitly - and that Uno.UI declares none of the MRT Core
namespace. The sweep is what earns its keep: the DataRows only cover today's 11
types, while a routing regression would declare a new one back in Uno.UI. It
pins its anchor assembly first, so the sweep cannot silently start checking a
different assembly, and both failure paths name the two repair sites.

This is a regression guard rather than a fails-before/passes-after test - the
relocation shipped in #23669.

HAS_UNO-guarded rather than [PlatformCondition]-skipped: on the WinAppSDK head
these types come from the platform projection, so the assertions have no meaning
there and the file should not compile at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Xiaoy312 added a commit that referenced this pull request Aug 25, 2026
BC75 landed inside the four-namespace sync-generator relocation (#23669), not as
its own PR; its file list pointed at the old Windows.* loader paths rather than
the Microsoft.Windows.* types that moved. Records that no type-forwarder shim was
taken, and that the three sibling relocations plus BC41's Microsoft.UI.Input.*
are still undocumented and need their own tracking item rather than being parked
on a closed one.

BC21 is settled - the drifted line ref named valid WinUI surface and the real
misspelling fix already shipped. Checks off the PasswordBox reparenting and adds
the three reparenting items that were missing entirely, labelled by subject and
public PR so the spec stays free of non-public identifiers.

BC74 stays open with its blocker recorded: the draft PR targets master and the
nine-patch regression comes first.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Xiaoy312 added a commit that referenced this pull request Aug 25, 2026
Asserts each Microsoft.Windows.ApplicationModel.Resources type is declared in
assembly Uno (the Uno.WinRT package), that the pre-MRT
Windows.ApplicationModel.Resources.ResourceLoader is there too - the claim the
migration note makes explicitly - and that Uno.UI declares none of the MRT Core
namespace. The sweep is what earns its keep: the DataRows only cover today's 11
types, while a routing regression would declare a new one back in Uno.UI. It
pins its anchor assembly first, so the sweep cannot silently start checking a
different assembly, and both failure paths name the two repair sites.

This is a regression guard rather than a fails-before/passes-after test - the
relocation shipped in #23669.

HAS_UNO-guarded rather than [PlatformCondition]-skipped: on the WinAppSDK head
these types come from the platform projection, so the assertions have no meaning
there and the file should not compile at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Xiaoy312 added a commit that referenced this pull request Aug 25, 2026
BC75 landed inside the four-namespace sync-generator relocation (#23669), not as
its own PR; its file list pointed at the old Windows.* loader paths rather than
the Microsoft.Windows.* types that moved. Records that no type-forwarder shim was
taken, and that the three sibling relocations plus BC41's Microsoft.UI.Input.*
are still undocumented and need their own tracking item rather than being parked
on a closed one.

BC21 is settled - the drifted line ref named valid WinUI surface and the real
misspelling fix already shipped. Checks off the PasswordBox reparenting and adds
the three reparenting items that were missing entirely, labelled by subject and
public PR so the spec stays free of non-public identifiers.

BC74 stays open with its blocker recorded: the draft PR targets master and the
nine-patch regression comes first.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Xiaoy312 added a commit that referenced this pull request Aug 25, 2026
Asserts each Microsoft.Windows.ApplicationModel.Resources type is declared in
assembly Uno.WinRT, that the pre-MRT
Windows.ApplicationModel.Resources.ResourceLoader is there too - the claim the
migration note makes explicitly - and that Uno.UI declares none of the MRT Core
namespace. The sweep is what earns its keep: the DataRows only cover today's 11
types, while a routing regression would declare a new one back in Uno.UI. It
pins its anchor assembly first, so the sweep cannot silently start checking a
different assembly, and both failure paths name the two repair sites.

This is a regression guard rather than a fails-before/passes-after test - the
relocation shipped in #23669.

HAS_UNO-guarded rather than [PlatformCondition]-skipped: on the WinAppSDK head
these types come from the platform projection, so the assertions have no meaning
there and the file should not compile at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Xiaoy312 added a commit that referenced this pull request Aug 25, 2026
BC75 landed inside the four-namespace sync-generator relocation (#23669), not as
its own PR; its file list pointed at the old Windows.* loader paths rather than
the Microsoft.Windows.* types that moved. Records that no type-forwarder shim was
taken, and that the three sibling relocations plus BC41's Microsoft.UI.Input.*
are still undocumented and need their own tracking item rather than being parked
on a closed one.

BC21 is settled - the drifted line ref named valid WinUI surface and the real
misspelling fix already shipped. Checks off the PasswordBox reparenting and adds
the three reparenting items that were missing entirely, labelled by subject and
public PR so the spec stays free of non-public identifiers.

BC74 stays open with its blocker recorded: the draft PR targets master and the
nine-patch regression comes first.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure area/skia ✏️ Categorizes an issue or PR as relevant to Skia ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants