Repository navigation
fix: Widen members to public for WinUI API parity - #23668
Conversation
Five members were declared narrower than the WinUI reference surface, the same class of defect as #23653 (Hyperlink.UnderlineStyleProperty), silently blocking external use despite the type being public: - ItemsRepeaterScrollHost.HorizontalAnchorRatio (internal -> public) - ItemsRepeaterScrollHost.VerticalAnchorRatio (internal -> public) - RepeatedScrollSnapPoint.Start (private -> public) - RepeatedScrollSnapPoint.End (private -> public) - ItemsSourceView.IndexOf(object) (internal -> public) Each was confirmed against the WinAppSDK 2.1 reference assembly and the WinUI IDL. Widening accessibility is additive and non-breaking. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011xvpioeKGiCR8NnouBZHwY
|
Claude finished @MartinZikmund's task in 1m 24s —— View job Review complete
Verdict: ✅ LGTM — no issues found0 blocking issues, 0 warnings. All five changes are accurate, additive, and structurally clean:
No behavior changes, no interface contract disruption, no API breakage — widening is source- and binary-compatible. The checklist rationale (no runtime tests needed for pure accessibility fixes) is valid. |
There was a problem hiding this comment.
Pull request overview
This PR widens the accessibility of a small set of Microsoft.UI.Xaml.* API members to match the WinUI reference surface, preventing external consumers from being blocked by unintentionally narrow members on otherwise-public types.
Changes:
- Made
RepeatedScrollSnapPoint.Start/Endpublic read-only properties. - Made
ItemsSourceView.IndexOf(object)public. - Made
ItemsRepeaterScrollHost.HorizontalAnchorRatio/VerticalAnchorRatiopublic settable properties.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/ScrollPresenter/SnapPoint.cs | Exposes RepeatedScrollSnapPoint.Start/End publicly to align with WinUI’s public API surface. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ItemsSourceView.cs | Exposes ItemsSourceView.IndexOf(object) publicly for WinUI parity and external consumption. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ItemsRepeaterScrollHost.cs | Exposes anchor ratio properties publicly to match WinUI accessibility on a public control. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PointInt32, RectInt32 and SizeInt32 declared their parameterized constructors `internal`, while the WinAppSDK projection exposes them as `public` — so `new PointInt32(x, y)` (used throughout the AppWindow / windowing APIs) compiles against WinAppSDK but not Uno. Found by extending the reflection-vs-reference accessibility sweep to Uno.UWP / Uno.Foundation / Uno.UI.Composition / Uno.UI.Dispatching. Widening matches the reference surface and is additive / non-breaking. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011xvpioeKGiCR8NnouBZHwY
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23668/wasm-skia-net9/index.html |
|
Claude finished @MartinZikmund's task in 2m 6s —— View job Review complete
Verdict: ✅ LGTM — no issues found0 blocking issues, 0 warnings. Each change was cross-checked against the corresponding generated reference file in
The checklist rationale (no runtime tests for pure accessibility widening) is valid. All changes are source- and binary-compatible: no API behavior changed, no interface contract was altered. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23668/wasm-skia-net9/index.html |
|
The build 221033 did not find any UI Test snapshots differences. |
|
Tick the box to add this pull request to the merge queue (same as
|
GitHub Issue: closes unoplatform/uno-private#2201
PR Type:
🐞 Bugfix
What changed? 🚀
Some
Microsoft.UI.Xaml.*/Windows.*members were declared narrower than the WinAppSDK reference surface — the same class of defect as #23653 (Hyperlink.UnderlineStylePropertywasinternalwhile its CLR wrapper waspublic), which silently blocks external use (binding,ClearValue, styles, animations, construction, direct reads) even though the containing type is public.The entire Uno WinRT-facing surface was audited (see method below); 8 genuine narrowings were found and fixed:
Uno.UI(Microsoft.UI.Xaml.*)ItemsRepeaterScrollHost.HorizontalAnchorRatiointernal→publicItemsRepeaterScrollHost.VerticalAnchorRatiointernal→publicRepeatedScrollSnapPoint.Startprivate→publicRepeatedScrollSnapPoint.Endprivate→publicItemsSourceView.IndexOf(object)internal→publicUno.UWP(Windows.Graphics.*)PointInt32(int, int)ctorinternal→publicRectInt32(int, int, int, int)ctorinternal→publicSizeInt32(int, int)ctorinternal→publicIn every case the sibling members were already public (
Offset/IntervalonRepeatedScrollSnapPoint;GetAt/IndexFromKey/KeyFromIndexonItemsSourceView; the publicX/Y/Width/Heightfields on the*Int32structs), so these were accidental narrowings.new PointInt32(x, y)/new SizeInt32(w, h)are the idiomatic forms used throughout theAppWindow/ windowing APIs and now compile against Uno as they do against WinAppSDK.How they were found
The whole public/protected surface of
Uno.UI,Uno.UWP,Uno.Foundation,Uno.UI.CompositionandUno.UI.Dispatchingwas diffed against the WinAppSDK 2.1 reference assemblies (Microsoft.WinUI.dll,Microsoft.Windows.SDK.NET.dll,Microsoft.InteractiveExperiences+Microsoft.Windows.*projections — the same set the sync generator references), reflected viaMetadataLoadContext. Every member Uno declares narrower than the reference exposes was flagged, then verified against the WinUI IDL / MS Learn. This generalizes the recurring #23653 shape to all member kinds (fields, properties, events, methods, constructors) across every WinRT-facing assembly.Uno.FoundationandUno.UI.Dispatchingwere clean (zero findings). All remaining flagged constructors were investigated and ruled out as WinRT projection artifacts — the projectedFoo(DerivedComposed)composability constructor on unsealed base types (Visual,CompositionBrush,AppWindowPresenter,InfoBar*EventArgs, …) and abstract-base constructors, which match only by parameter count and are not real developer API — and left untouched.PR Checklist ✅
Screenshots Compare Test Runresults — n/a (no visual change).