Sitelet https://github.com/unoplatform/uno/pull/24974
Skip to content

refactor!: Internalise Uno-only members in WinUI namespaces - #24974

Open
MartinZikmund wants to merge 2 commits into
masterfrom
dev/mazi/internalize-uno-only
Open

MartinZikmund wants to merge 2 commits into
masterfrom
dev/mazi/internalize-uno-only

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes unoplatform/uno-private#2106

PR Type:

🔄 Refactoring (breaking, 7.0)

What changed? 🚀

Two Uno-only members were public inside WinUI types, with no WinUI counterpart. Both are now internal:

Member Before After
Microsoft.Web.WebView2.Core.INativeWebViewProvider public interface, its only member internal internal
VisualTreeHelper.GetChildren(DependencyObject) public internal
VisualTreeHelper.GetChildren<T>(DependencyObject) public internal

INativeWebViewProvider could never be implemented outside Uno Platform anyway, since CreateNativeWebView was already internal. Every implementer (Win32, macOS, X11 add-in, Browser, Android, UIKit hosts) already has InternalsVisibleTo from Uno.UI.

VisualTreeHelper.DisconnectChildrenRecursive stays public. It is genuine WinUI API.

Also included:

  • PackageDiffIgnore.xml entries in the 6.6 and 6.7 sets.
  • A migration-guide entry under Public API removed that points to GetChildrenCount/GetChild.

PR Checklist ✅

Breaking change (7.0): this breaks source for callers of VisualTreeHelper.GetChildren/GetChildren<T>. Migrate to VisualTreeHelper.GetChildrenCount + GetChild. Nobody outside Uno Platform could do anything useful with INativeWebViewProvider.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S8tfVTnfxKUm4xrCApq4cb

MartinZikmund and others added 2 commits October 5, 2026 09:39
INativeWebViewProvider and VisualTreeHelper.GetChildren have no WinUI
counterpart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S8tfVTnfxKUm4xrCApq4cb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S8tfVTnfxKUm4xrCApq4cb
Copilot AI balanced review requested due to automatic review settings October 5, 2026 07:39
@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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


Review complete ✅

  • Gather context (diff, changed files, AGENTS.md rules)
  • Review INativeWebViewProvider.cs visibility change
  • Review VisualTreeHelper.cs visibility change
  • Review PackageDiffIgnore.xml entries
  • Review migration guide entry
  • Check for remaining public usages / breaking-change scope
  • Post inline findings (none needed)
  • Post summary

Verdict: ship. No blocking issues found; no inline comments posted.

Scope verified:

  • INativeWebViewProvider → internal: its only member (CreateNativeWebView) was already internal, so this closes a real visibility gap rather than introducing one. Every implementer (Win32NativeWebViewProvider, BrowserWebViewProvider, MacOSNativeWebViewProvider, UIKitNativeWebViewProvider, AndroidNativeWebViewProvider, X11NativeWebViewProvider) lives in an assembly already covered by Uno.UI's InternalsVisibleTo list, so no implementer breaks.
  • VisualTreeHelper.GetChildren/GetChildren<T> → internal: matches the sibling overloads (GetChildren(UIElement)) that were already internal. Searched the repo for external callers of the now-internal overloads outside Uno.UI — only in-tree callers found (Uno.UI, Uno.UI.RuntimeTests), both IVT-covered.
  • PackageDiffIgnore.xml: entries correctly land in the 6.6 and 6.7 <IgnoreSet> sections (the two prior published stable baselines, per the file's own doc comment at the bottom — baseVersion must be the latest-published-on-nuget version, not the in-progress one). The regex used for the GetChildren method entries ((::|\.) alternation, .+/.* wildcards) follows the same pattern already used elsewhere in the file for similar "demoted to internal" entries (e.g. DataContext, DispatcherQueue, XamlControlsResourcesV1).
  • Migration guide addition is accurate and gives the correct replacement (GetChildrenCount/GetChild loop).
  • Commits are Conventional-Commits-compliant (refactor!: …, docs: …) and correctly flagged as breaking.

Not independently verified: the PackageDiffIgnore.xml regex entries weren't run against the actual Uno.PackageDiff tool output (requires a built nupkg + the stable 6.7 baseline per the tool's own instructions in the file) — pattern inspection against existing conventions is what's checked here, consistent with the repo's own validation note that this needs the external tool to confirm.

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.

Copilot review overview

🟢 Approval recommended

The focused visibility changes, internal consumers, compatibility exclusions, and migration documentation are consistent.

Review effort: Balanced
Findings: None

What changed in this PR

Internalizes Uno-only APIs to improve WinUI compatibility for the 7.0 release.

Changes:

  • Internalizes VisualTreeHelper.GetChildren overloads and INativeWebViewProvider.
  • Adds package-diff exclusions for 6.6 and 6.7 baselines.
  • Documents migration to standard WinUI visual-tree APIs.

No issues found.

File Description
VisualTreeHelper.cs Internalizes Uno-only child enumeration helpers.
INativeWebViewProvider.cs Internalizes the native WebView provider contract.
migrating-to-uno-7.md Documents removed APIs and migration guidance.
PackageDiffIgnore.xml Records intentional breaking API changes.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24974/wasm-skia-net9/index.html

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24974/docs/index.html

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 237374 found UI Test snapshots differences: skia-linux-screenshots: 113, skia-windows-screenshots: 218

Details
  • skia-linux-screenshots: 113 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ColorPickerSample.png-dark
    • ColorPickerSample.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Examples.png
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
  • skia-windows-screenshots: 218 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • CalendarView_Theming.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • DoubleImageBrushInList.png-dark
    • Examples.png
    • DoubleImageBrushInList.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • Grid_with_UserControl_HorizonalAlignment.png-dark
    • Grid_with_UserControl_HorizonalAlignment.png
    • Grid_with_UserControl_VerticalAlignment_Fixed_Height.png-dark
    • Grid_with_UserControl_VerticalAlignment_Fixed_Height.png
    • Grid_with_UserControl_VerticalAlignment_Variable_Height.png-dark
    • Grid_with_UserControl_VerticalAlignment_Variable_Height.png
    • Grid_with_UserControl_VerticalAlignment_Variable_Width.png-dark
    • Grid_with_UserControl_VerticalAlignment_Variable_Width.png
    • ImageIconPage.png-dark

@unodevops

Copy link
Copy Markdown
Contributor

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

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 kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants