Repository navigation
refactor: Drop guards and references the fold made unreachable - #24020
Conversation
|
Claude finished @MartinZikmund's task in 4m 16s —— View job Code Review
Verdict: fix-first — two minor issues should be tidied before merge; overall the PR is clean and well-scoped. SummaryScope and correctness. The scope analysis in the description is sound. The symbols ( Findings (3 inline comments):
Cross-cutting cosmetic note (not inline-commented): several sites have double blank lines left after block removal ( Validation confidence: Code-review assessment only. The PR author validated Skia compilation; no runtime execution performed here. |
|
Tick the box to add this pull request to the merge queue (same as
|
| @@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible | |||
| EnterImpl(); | |||
| #endif | |||
There was a problem hiding this comment.
These two guards were missed by the sweep. UNO_HAS_BORDER_VISUAL and UNO_HAS_ENHANCED_LIFECYCLE are always defined in the Skia build — both are simple single-symbol conditions with no compound mixing, so they fall squarely in scope. The _borderRenderer field they reference was already removed from CalendarViewBaseItemChrome.uno.cs, so the #if !UNO_HAS_BORDER_VISUAL block references a now-deleted symbol; it only compiles out by luck. Worth removing both blocks for consistency with the rest of the sweep.
| #endif | |
| }; |
| #if !UNO_HAS_ENHANCED_LIFECYCLE | ||
| virtual | ||
| #endif | ||
| void OnLayoutUpdated() |
There was a problem hiding this comment.
Two artifacts of the guard removal:
-
The comment on line 762 is now stale — it explains why the method was not
virtualonly on enhanced-lifecycle platforms. Since enhanced lifecycle is now always active, the rationale reduces to "it won't be called if there's no real subscriber", which is worth keeping, but "on enhanced lifecycle" no longer means anything. -
The method declaration is split across two lines (
internal/void OnLayoutUpdated()), which is the literal leftover of the removed#if !UNO_HAS_ENHANCED_LIFECYCLE\n virtual\n#endifblock.dotnet format whitespacewon't merge these lines.
Suggested cleanup:
| void OnLayoutUpdated() | |
| // Won't be called if there is no real subscriber to LayoutUpdated. | |
| internal void OnLayoutUpdated() |
| @@ -3694,11 +3694,7 @@ void OnPropertyChanged( | |||
| // So, they can just cast ScrollPresenter to Panel and set the Background. | |||
| // In our case, we can't do that as there is no multi inheritance in C#. | |||
| // We use BorderLayerRenderer to draw the background. | |||
There was a problem hiding this comment.
Stale comment — BorderLayerRenderer was deleted from the Skia build by this very PR. The background is now rendered via BorderVisual (the UpdateBackground() call drives IBorderInfoProvider). Worth updating the comment to reflect the current mechanism.
WinAppSDK sync generator drift detected on
|
There was a problem hiding this comment.
Pull request overview
This PR continues the Skia-only UI-layer cleanup by removing now-unreachable preprocessor branches (__NETSTD_REFERENCE__, UNO_HAS_ENHANCED_LIFECYCLE, UNO_HAS_BORDER_VISUAL, UNO_HAS_MANAGED_SCROLL_PRESENTER) and by pruning stale InternalsVisibleTo entries for assemblies that are no longer produced. It also updates a WASM interop documentation snippet to reflect the removed WebAssembly runtime namespace.
Changes:
- Unwraps Skia-always-true feature guards across Uno.UI XAML/layout/theming/control code paths.
- Deletes dead, guard-only source files (e.g., non-enhanced lifecycle / non-managed-scroll presenter implementations).
- Removes stale
InternalsVisibleToreferences and refreshes a WASM interop guide snippet.
Review verdict (summary): changes needed (2 minor issues found).
Reviewed changes
Copilot reviewed 103 out of 103 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UWP/AssemblyInfo.cs | Removes stale friend-assembly entries tied to dropped WebAssembly/native outputs. |
| src/Uno.UI/UI/Xaml/XamlRoot.crossruntime.cs | Unwraps enhanced-lifecycle frame scheduling calls. |
| src/Uno.UI/UI/Xaml/VisualStateGroup.cs | Unwraps enhanced-lifecycle logic around trigger evaluation. |
| src/Uno.UI/UI/Xaml/UIElement.mux.cs | Removes enhanced-lifecycle compile guard around Enter/Leave-related internals. |
| src/Uno.UI/UI/Xaml/UIElement.Layout.crossruntime.cs | Drops __NETSTD_REFERENCE__ file-level guard so layout code is always included. |
| src/Uno.UI/UI/Xaml/UIElement.cs | Removes now-dead __NETSTD_REFERENCE__ / enhanced-lifecycle guard blocks in layout/theming paths. |
| src/Uno.UI/UI/Xaml/UIElement.crossruntime.cs | Unwraps enhanced-lifecycle child enter/leave handling. |
| src/Uno.UI/UI/Xaml/Shapes/Rectangle.cs | Removes reference-only Measure/Arrange overrides. |
| src/Uno.UI/UI/Xaml/Shapes/Polyline.cs | Removes reference-only Measure/Arrange overrides. |
| src/Uno.UI/UI/Xaml/Shapes/Polygon.cs | Removes reference-only Measure/Arrange overrides. |
| src/Uno.UI/UI/Xaml/Shapes/Path.cs | Removes reference-only Measure/Arrange overrides. |
| src/Uno.UI/UI/Xaml/Shapes/Line.cs | Removes reference-only Measure/Arrange overrides. |
| src/Uno.UI/UI/Xaml/Shapes/Ellipse.cs | Removes reference-only Measure/Arrange overrides. |
| src/Uno.UI/UI/Xaml/ResourceResolver.cs | Removes reference-only throw branch for master dictionary access. |
| src/Uno.UI/UI/Xaml/ResourceDictionary.cs | Unwraps enhanced-lifecycle theme-walk/materialization logic and removes non-enhanced branches. |
| src/Uno.UI/UI/Xaml/Internal/VisualTree.cs | Removes enhanced-lifecycle guards around root attach/enter and pending Loaded dispatch. |
| src/Uno.UI/UI/Xaml/Internal/EventManager.uno.cs | Removes enhanced-lifecycle guard so the partial is always compiled. |
| src/Uno.UI/UI/Xaml/Internal/EventManager.cs | Removes enhanced-lifecycle guard so the partial is always compiled. |
| src/Uno.UI/UI/Xaml/Internal/CustomEventManager.cs | Deletes dead non-enhanced-lifecycle custom event manager. |
| src/Uno.UI/UI/Xaml/Internal/CoreServices.Theming.cs | Unwraps enhanced-lifecycle theming listener infrastructure and removes inert native branch. |
| src/Uno.UI/UI/Xaml/Internal/CoreServices.cs | Makes EventManager/additional-frame scheduling unconditional for Skia-only UI layer. |
| src/Uno.UI/UI/Xaml/Internal/ContentManager/ContentManager.cs | Removes enhanced-lifecycle guard around pending Loaded requests. |
| src/Uno.UI/UI/Xaml/FrameworkElement.Theming.cs | Removes non-enhanced theming flows and makes enhanced-lifecycle theme propagation unconditional. |
| src/Uno.UI/UI/Xaml/FrameworkElement.Layout.cs | Drops __NETSTD_REFERENCE__ file-level guard for layout implementation. |
| src/Uno.UI/UI/Xaml/FrameworkElement.EffectiveViewport.cs | Removes non-enhanced viewport propagation/event-queue workarounds and unconditionally uses EventManager path. |
| src/Uno.UI/UI/Xaml/FrameworkElement.cs | Removes non-enhanced lifecycle branches (LayoutUpdated wiring, theme/style/resource update paths). |
| src/Uno.UI/UI/Xaml/FrameworkElement.crossruntime.cs | Removes reference-only pragma guard at file top. |
| src/Uno.UI/UI/Xaml/ElementStub.cs | Unwraps enhanced-lifecycle Enter/Leave overrides. |
| src/Uno.UI/UI/Xaml/Documents/Inline.cs | Removes reference-only font-property-changed overrides. |
| src/Uno.UI/UI/Xaml/DependencyObjectStore.Theming.cs | Unwraps enhanced-lifecycle theme walk / theme-resource binding behaviors. |
| src/Uno.UI/UI/Xaml/DependencyObjectStore.PropertySystem.mux.cs | Removes enhanced-lifecycle guard so Skia-only property-system behavior is unconditional. |
| src/Uno.UI/UI/Xaml/DependencyObjectStore.mux.cs | Removes enhanced-lifecycle guard so Skia-only DO-store MUX code is unconditional. |
| src/Uno.UI/UI/Xaml/DependencyObjectStore.cs | Removes enhanced-lifecycle compile guards around theme enter/leave and value-theme notifications. |
| src/Uno.UI/UI/Xaml/Controls/TwoPaneView/TwoPaneView.cs | Removes non-enhanced lifecycle XamlRoot subscription workaround and unwraps Skia path. |
| src/Uno.UI/UI/Xaml/Controls/ToolTip/ToolTip.cs | Unwraps enhanced-lifecycle-only behaviors (Loaded vs Loading, theme change subscription). |
| src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.Managed.cs | Removes always-true managed-scroll-presenter guard. |
| src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.cs | Unwraps managed-scroll-presenter aliasing and removes non-managed/native-scrollbar branches. |
| src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.ConstantVelocity.cs | Unwraps managed-scroll-presenter aliasing. |
| src/Uno.UI/UI/Xaml/Controls/ScrollPresenter/ScrollPresenter.Uno.cs | Removes non-border-visual renderer fallback; unconditionally uses BorderVisual creation. |
| src/Uno.UI/UI/Xaml/Controls/ScrollPresenter/ScrollPresenter.cs | Removes non-border-visual background update path. |
| src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.Managed.cs | Removes always-true managed-scroll-presenter guard. |
| src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.cs | Removes managed-scroll-presenter guards and reference-only override stub. |
| src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/NativeScrollContentPresenter.Xamarin.cs | Deletes dead non-managed scroll presenter implementation. |
| src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/IScrollContentPresenter.cs | Deletes dead non-managed presenter interface. |
| src/Uno.UI/UI/Xaml/Controls/ScrollBar/ScrollBar.uno.cs | Removes non-enhanced layout-updated handler. |
| src/Uno.UI/UI/Xaml/Controls/ScrollBar/ScrollBar.mux.cs | Removes non-enhanced LayoutUpdated subscription. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ViewportManagerWithPlatformFeatures.cs | Removes non-enhanced lifecycle perf workarounds and state. |
| src/Uno.UI/UI/Xaml/Controls/Repeater/ItemsRepeater.cs | Removes non-enhanced early ElementPrepared hook for native targets. |
| src/Uno.UI/UI/Xaml/Controls/ProgressBar/ProgressBar.cs | Removes non-enhanced LayoutUpdated workaround. |
| src/Uno.UI/UI/Xaml/Controls/Primitives/ButtonBase/ButtonBase.mux.cs | Removes non-enhanced enter/leave simulation hooks. |
| src/Uno.UI/UI/Xaml/Controls/Popup/PopupRoot.cs | Unwraps enhanced-lifecycle theme notification behavior for popups. |
| src/Uno.UI/UI/Xaml/Controls/Popup/Popup.WithPopupRoot.cs | Unwraps async event dispatch for popup open/close notifications. |
| src/Uno.UI/UI/Xaml/Controls/Popup/Popup.cs | Unwraps enhanced-lifecycle theme forwarding for popup child. |
| src/Uno.UI/UI/Xaml/Controls/Panel/Panel.IBorderInfoProvider.cs | Removes border-visual guard so BorderVisual is always exposed for Skia-only UI. |
| src/Uno.UI/UI/Xaml/Controls/Panel/Panel.cs | Removes BorderLayerRenderer fallback and unwraps BorderVisual update paths. |
| src/Uno.UI/UI/Xaml/Controls/Page/Page.IBorderInfoProvider.cs | Removes border-visual guard so BorderVisual is always exposed for Skia-only UI. |
| src/Uno.UI/UI/Xaml/Controls/Page/Page.cs | Removes BorderLayerRenderer fallback and unwraps BorderVisual update paths. |
| src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationViewItemSeparator.cs | Removes non-enhanced delayed template application/workaround fields. |
| src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationViewItemHeader.cs | Removes non-enhanced delayed template application/workaround fields. |
| src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationViewItemBase.cs | Removes non-enhanced reinitialization workaround and state field. |
| src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationViewItem.cs | Removes non-enhanced delayed template application/workaround fields. |
| src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.Uno.cs | Removes non-enhanced repeater early-prepared hook. |
| src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.Header.cs | Removes non-enhanced early-prepared revokers. |
| src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.cs | Removes non-enhanced early-prepared wiring and late-realization reinit workaround. |
| src/Uno.UI/UI/Xaml/Controls/MenuFlyout/SplitMenuFlyoutItem/SplitMenuFlyoutItem.mux.cs | Unwraps enhanced-lifecycle enter/leave hooks used for keyboard accelerator logic. |
| src/Uno.UI/UI/Xaml/Controls/MenuFlyout/MenuFlyoutSubItem/MenuFlyoutSubItem.mux.cs | Unwraps enhanced-lifecycle enter/leave hooks used for keyboard accelerator logic. |
| src/Uno.UI/UI/Xaml/Controls/MenuFlyout/MenuFlyoutItem/MenuFlyoutItem.mux.cs | Removes non-enhanced lifecycle enter/leave simulation and unwraps enhanced implementation. |
| src/Uno.UI/UI/Xaml/Controls/MenuFlyout/MenuFlyout.mux.cs | Unwraps enhanced-lifecycle enter/leave iteration over menu items. |
| src/Uno.UI/UI/Xaml/Controls/MenuBar/MenuBarItem.cs | Unwraps enhanced-lifecycle enter/leave propagation for DP-owned item collections. |
| src/Uno.UI/UI/Xaml/Controls/MediaPlayerElement/MediaTransportControls.cs | Removes non-enhanced OnLayoutUpdated path in favor of AfterArrange. |
| src/Uno.UI/UI/Xaml/Controls/FocusVisual/SystemFocusVisual.cs | Removes non-enhanced LayoutUpdated subscription path for focus visual updates. |
| src/Uno.UI/UI/Xaml/Controls/Flyout/FlyoutBase.cs | Unwraps enhanced-lifecycle theme forwarding mechanics and removes native-only commentary branch. |
| src/Uno.UI/UI/Xaml/Controls/Flyout/Flyout.mux.cs | Unwraps enhanced-lifecycle Enter/Leave propagation to flyout content. |
| src/Uno.UI/UI/Xaml/Controls/Control/Control.nonlifecycle.cs | Deletes dead non-enhanced lifecycle Control template-application implementation. |
| src/Uno.UI/UI/Xaml/Controls/Control/Control.cs | Removes reference/non-enhanced branches, keeping Skia-only template lifecycle path. |
| src/Uno.UI/UI/Xaml/Controls/Control/Control.crossruntime.cs | Removes reference guard so enhanced lifecycle EnterImpl runs unconditionally. |
| src/Uno.UI/UI/Xaml/Controls/ContentPresenter/ContentPresenter.IBorderInfoProvider.cs | Removes border-visual guard so BorderVisual is always exposed for Skia-only UI. |
| src/Uno.UI/UI/Xaml/Controls/ContentPresenter/ContentPresenter.cs | Removes BorderLayerRenderer/non-enhanced branches and unwraps BorderVisual update paths. |
| src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItemChrome.uno.cs | Removes BorderLayerRenderer fallback and unwraps BorderVisual update paths. |
| src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItem.IBorderInfoProvider.cs | Removes border-visual guard so BorderVisual is always exposed for Skia-only UI. |
| src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItem.h.cs | Removes __NETSTD_REFERENCE__ guard around Loaded hook. |
| src/Uno.UI/UI/Xaml/Controls/CalendarView/CalendarViewBaseItem.cs | Removes __NETSTD_REFERENCE__ guard around enter/leave code paths. |
| src/Uno.UI/UI/Xaml/Controls/Button/Button.mux.cs | Unwraps enhanced-lifecycle enter/leave propagation to flyout content. |
| src/Uno.UI/UI/Xaml/Controls/Border/IBorderInfoProvider.cs | Removes border-visual guard so BorderVisual is always required for Skia-only UI. |
| src/Uno.UI/UI/Xaml/Controls/Border/BorderLayerRenderer.cs | Deletes dead non-border-visual renderer implementation. |
| src/Uno.UI/UI/Xaml/Controls/Border/Border.IBorderInfoProvider.cs | Removes border-visual guard so BorderVisual is always exposed for Skia-only UI. |
| src/Uno.UI/UI/Xaml/Controls/Border/Border.cs | Removes BorderLayerRenderer fallback and unwraps BorderVisual update paths. |
| src/Uno.UI/UI/Xaml/BorderHelper.cs | Removes border-visual guard so BorderVisual helper code is always included. |
| src/Uno.UI/UI/Xaml/Application.cs | Removes non-enhanced lifecycle theme storage/flow branches. |
| src/Uno.UI/UI/Xaml/Application.Alc.cs | Removes enhanced-lifecycle guard around owner-A LC theming helpers and un-wraps MasterDictionary cleanup call. |
| src/Uno.UI/Extensions/ViewExtensions.crossruntime.cs | Drops __NETSTD_REFERENCE__ guard around visual-tree helpers. |
| src/Uno.UI/AssemblyInfo.cs | Removes stale friend-assembly entries for dropped WASM/netcoremobile/naming variants. |
| src/Uno.UI.XamlHost/Properties/AssemblyInfo.cs | Removes stale SamplesApp.Wasm friend-assembly entry. |
| src/Uno.UI.Toolkit/AssemblyInfo.cs | Removes stale SamplesApp.Wasm friend-assembly entry. |
| src/Uno.UI.RuntimeTests/AssemblyInfo.cs | Removes stale SamplesApp.Wasm friend-assembly entry. |
| src/Uno.UI.RemoteControl/RemoteControlClient.cs | Updates comment to remove reference-build wording. |
| src/Uno.UI.Dispatching/AssemblyInfo.cs | Removes stale SamplesApp.Wasm friend-assembly entry. |
| src/Uno.UI.Composition/AssemblyInfo.cs | Removes stale SamplesApp.Wasm friend-assembly entry. |
| src/Uno.Foundation/AssemblyInfo.cs | Removes stale friend-assembly entries for removed variants (Svg.Skia/Wasm runtime outputs). |
| src/Uno.Foundation.Logging/AssemblyInfo.cs | Removes stale friend-assembly entries for removed variants (WASM/MediaPlayer.WebAssembly). |
| src/AddIns/Uno.UI.Svg/SvgProvider.cs | Removes reference-only branches and makes Skia-backed implementation unconditional. |
| src/AddIns/Uno.UI.Svg/SvgCanvas.cs | Removes reference-only file guard to keep Skia canvas implementation unconditional. |
| doc/articles/interop/wasm-javascript-2.md | Removes stale WebAssembly runtime namespace reference and fixes duplicated namespace in sample snippet. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| OnOwnerElementChanged(); | ||
| #if UNO_HAS_ENHANCED_LIFECYCLE | ||
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | ||
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
| using Uno.Foundation; | ||
| using Uno.UI.Runtime.WebAssembly; | ||
|
|
||
| namespace PrismJsDemo; | ||
|
|
||
| using Uno.UI.NativeElementHosting; | ||
|
|
22e3f6e to
20153d2
Compare
f288628 to
428d6d6
Compare
|
Claude finished @MartinZikmund's task in 2m 42s —— View job Code Review
Verdict: fix-first — the PR update (3 new commits) adds the Scope and correctnessThe sweep remains correctly bounded. The three new commits ( Unresolved findings (4 inline comments re-posted)
Cross-cutting cosmetic note (not inline-commented): double blank lines remain at Validation confidence: Code-review assessment only; no local build run. |
|
Added The generator already separates the libraries that still ship more than the Skia flavor — The flag is renamed The committed
So the regeneration is a separate deliberate run rather than part of this PR, and this change simply makes that run produce the right thing. |
| @@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible | |||
| EnterImpl(); | |||
| #endif | |||
| }; | |||
There was a problem hiding this comment.
Both inner guards are dead in the Skia build and were flagged in the previous review pass — they haven't been removed yet.
#if !UNO_HAS_BORDER_VISUAL(line 29-31):UNO_HAS_BORDER_VISUALis always defined, so_borderRenderer ??= new(this)is never compiled in._borderRendererwas also deleted fromCalendarViewBaseItemChrome.uno.csby this PR, so the block references a field that no longer exists — it only avoids a compile error by luck of the guard.#if !UNO_HAS_ENHANCED_LIFECYCLE(line 32-34):UNO_HAS_ENHANCED_LIFECYCLEis always defined, so this arm ofEnterImpl()is never compiled in either.
Neither is a compound condition mixed with an out-of-scope symbol, so both are squarely in scope for this sweep.
| this.Loaded += (_, _) => | |
| { | |
| EnterImpl(); | |
| }; |
| // This shouldn't be virtual on enhanced lifecycle as it won't be called if there is no real subscriber to LayoutUpdated. | ||
| internal | ||
| #if !UNO_HAS_ENHANCED_LIFECYCLE | ||
| virtual | ||
| #endif | ||
| void OnLayoutUpdated() |
There was a problem hiding this comment.
Two leftovers of the guard removal, carried over from the previous review pass:
- The comment still references "enhanced lifecycle" as a conditional state ("shouldn't be virtual on enhanced lifecycle"). Since enhanced lifecycle is now unconditional, the rationale shrinks to "won't be called if there is no real subscriber to LayoutUpdated" — the platform qualifier is no longer meaningful.
- The method declaration is still split across two lines (
internalon one line,void OnLayoutUpdated()on the next). This is the exact fragment left by removing the#if !UNO_HAS_ENHANCED_LIFECYCLE/virtual/#endifblock —dotnet format whitespacedoesn't merge declaration keywords.
| // This shouldn't be virtual on enhanced lifecycle as it won't be called if there is no real subscriber to LayoutUpdated. | |
| internal | |
| #if !UNO_HAS_ENHANCED_LIFECYCLE | |
| virtual | |
| #endif | |
| void OnLayoutUpdated() | |
| // Won't be called if there is no real subscriber to LayoutUpdated. | |
| internal void OnLayoutUpdated() |
| @@ -3694,11 +3694,7 @@ void OnPropertyChanged( | |||
| // So, they can just cast ScrollPresenter to Panel and set the Background. | |||
| // In our case, we can't do that as there is no multi inheritance in C#. | |||
| // We use BorderLayerRenderer to draw the background. | |||
There was a problem hiding this comment.
Stale comment — BorderLayerRenderer was deleted from the Skia build by this PR; the background is now driven via UpdateBackground() through IBorderInfoProvider/BorderVisual. Flagged in the previous review pass and still present.
| // We use BorderLayerRenderer to draw the background. | |
| // We use BorderVisual to draw the background. |
| OnOwnerElementChanged(); | ||
| #if UNO_HAS_ENHANCED_LIFECYCLE | ||
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | ||
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
There was a problem hiding this comment.
Typo: EmterImpl → EnterImpl. Flagged in the previous review pass and still present.
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also | |
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | |
| // EnterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
WinAppSDK sync generator drift detected on
|
|
Claude finished @MartinZikmund's task in 3m 18s —— View job Code Review
Verdict: fix-first — 4 inline findings, all carried over from prior passes; the three new commits are clean. New commits (clean)
Unresolved findings (4 inline comments re-posted)
Validation confidence: Code-review assessment only; no local build run performed here. |
Sync generator: root cause found, and
|
| @@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible | |||
| EnterImpl(); | |||
| #endif | |||
| }; | |||
There was a problem hiding this comment.
Both inner guards are dead in the Skia build — carried over from the previous two review passes and still unresolved.
#if !UNO_HAS_BORDER_VISUAL(lines 29–31):UNO_HAS_BORDER_VISUALis always defined; this arm never compiles in._borderRendererwas also deleted fromCalendarViewBaseItemChrome.uno.csby this PR, so the block references a non-existent field — it avoids a compile error only by luck of the guard.#if !UNO_HAS_ENHANCED_LIFECYCLE(lines 32–34):UNO_HAS_ENHANCED_LIFECYCLEis always defined; this arm never compiles in either.
Neither is a compound condition mixed with an out-of-scope symbol, so both are squarely in scope for this sweep.
| this.Loaded += (_, _) => | |
| { | |
| EnterImpl(); | |
| }; |
| // This shouldn't be virtual on enhanced lifecycle as it won't be called if there is no real subscriber to LayoutUpdated. | ||
| internal | ||
| #if !UNO_HAS_ENHANCED_LIFECYCLE | ||
| virtual | ||
| #endif | ||
| void OnLayoutUpdated() |
There was a problem hiding this comment.
Two leftovers of the guard removal, carried over from previous review passes and still unresolved.
- The comment still references "enhanced lifecycle" as a conditional state ("shouldn't be virtual on enhanced lifecycle"). Since enhanced lifecycle is now unconditional, the qualifier is meaningless — "won't be called if there is no real subscriber to LayoutUpdated" is all the comment needs to say.
- The method declaration is split across two lines (
internal/void OnLayoutUpdated()). This is the exact fragment left by removing#if !UNO_HAS_ENHANCED_LIFECYCLE/virtual/#endif—dotnet format whitespacedoes not merge declaration keywords.
| // This shouldn't be virtual on enhanced lifecycle as it won't be called if there is no real subscriber to LayoutUpdated. | |
| internal | |
| #if !UNO_HAS_ENHANCED_LIFECYCLE | |
| virtual | |
| #endif | |
| void OnLayoutUpdated() | |
| // Won't be called if there is no real subscriber to LayoutUpdated. | |
| internal void OnLayoutUpdated() |
| @@ -3694,11 +3694,7 @@ void OnPropertyChanged( | |||
| // So, they can just cast ScrollPresenter to Panel and set the Background. | |||
| // In our case, we can't do that as there is no multi inheritance in C#. | |||
| // We use BorderLayerRenderer to draw the background. | |||
There was a problem hiding this comment.
Stale comment — BorderLayerRenderer was deleted from the Skia build by this very PR; the background is now driven via UpdateBackground() through IBorderInfoProvider/BorderVisual. Carried over from the previous two review passes and still unresolved.
| // We use BorderLayerRenderer to draw the background. | |
| // We use BorderVisual to draw the background. |
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | ||
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
There was a problem hiding this comment.
Typo: EmterImpl → EnterImpl. Carried over from previous review passes and still unresolved.
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | |
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also | |
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | |
| // EnterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
b4e2a2a to
f77569e
Compare
|
Claude finished @MartinZikmund's task in 1m 36s —— View job Code Review
Verdict: fix-first — no new commits since the last review pass; all four prior findings remain open. StatusNo changes to the branch since the previous review (latest commit: Unresolved findings (4 inline comments re-posted — third consecutive pass)
Each has an inline comment with a ready-to-apply Cross-cutting cosmetic note (not inline-commented): double blank lines remain at Validation confidence: Code-review assessment only; no local build run performed here. |
| @@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible | |||
| EnterImpl(); | |||
| #endif | |||
| }; | |||
There was a problem hiding this comment.
Both inner guards are dead in the Skia build — now flagged across three consecutive review passes and still unresolved.
#if !UNO_HAS_BORDER_VISUAL(lines 29–31):UNO_HAS_BORDER_VISUALis always defined; this arm never compiles in._borderRendererwas also deleted fromCalendarViewBaseItemChrome.uno.csby this PR — the block references a non-existent field; the guard is the only thing preventing a compile error.#if !UNO_HAS_ENHANCED_LIFECYCLE(lines 32–34):UNO_HAS_ENHANCED_LIFECYCLEis always defined; this arm never compiles in either.
Neither is a compound condition mixed with an out-of-scope symbol, so both are squarely in scope for this sweep.
| this.Loaded += (_, _) => | |
| { | |
| EnterImpl(); | |
| }; |
| // This shouldn't be virtual on enhanced lifecycle as it won't be called if there is no real subscriber to LayoutUpdated. | ||
| internal | ||
| #if !UNO_HAS_ENHANCED_LIFECYCLE | ||
| virtual | ||
| #endif | ||
| void OnLayoutUpdated() |
There was a problem hiding this comment.
Two leftovers of the guard removal, carried over from two prior review passes and still unresolved:
- The comment references "enhanced lifecycle" as a conditional state ("shouldn't be virtual on enhanced lifecycle"). Enhanced lifecycle is now unconditional, so the qualifier is meaningless. "Won't be called if there is no real subscriber to LayoutUpdated" is all it needs to say.
- The
internal/void OnLayoutUpdated()split declaration is the exact fragment left by removing#if !UNO_HAS_ENHANCED_LIFECYCLE/virtual/#endif.dotnet format whitespacedoes not merge declaration keywords across lines.
| // This shouldn't be virtual on enhanced lifecycle as it won't be called if there is no real subscriber to LayoutUpdated. | |
| internal | |
| #if !UNO_HAS_ENHANCED_LIFECYCLE | |
| virtual | |
| #endif | |
| void OnLayoutUpdated() | |
| // Won't be called if there is no real subscriber to LayoutUpdated. | |
| internal void OnLayoutUpdated() |
| @@ -3694,11 +3694,7 @@ void OnPropertyChanged( | |||
| // So, they can just cast ScrollPresenter to Panel and set the Background. | |||
| // In our case, we can't do that as there is no multi inheritance in C#. | |||
| // We use BorderLayerRenderer to draw the background. | |||
There was a problem hiding this comment.
Stale comment — BorderLayerRenderer was deleted from the Skia build by this very PR; the background is now driven via UpdateBackground() through IBorderInfoProvider/BorderVisual. Flagged across three consecutive review passes and still unresolved.
| // We use BorderLayerRenderer to draw the background. | |
| // We use BorderVisual to draw the background. |
| OnOwnerElementChanged(); | ||
| #if UNO_HAS_ENHANCED_LIFECYCLE | ||
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | ||
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
There was a problem hiding this comment.
Typo: EmterImpl → EnterImpl. Flagged across three consecutive review passes and still unresolved.
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also | |
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | |
| // EnterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
45f7d37 to
68766a1
Compare
WinAppSDK sync generator drift detected on
|
Uno.UI and the other folded projects now build only for Skia, so a family of guards can no longer go either way: __NETSTD_REFERENCE__ is never defined, and UNO_HAS_ENHANCED_LIFECYCLE, UNO_HAS_BORDER_VISUAL and UNO_HAS_MANAGED_SCROLL_PRESENTER are always defined. Removes the 264 branches that can no longer be taken and unwraps the guards that are now always true, keeping the #else body wherever one existed. Five files were nothing but a dead guard and are deleted outright: BorderLayerRenderer, Control.nonlifecycle, IScrollContentPresenter, NativeScrollContentPresenter.Xamarin and CustomEventManager. Scope is limited to directories whose only compiling project carries UnoRuntimeIdentifier=Skia. Uno.UI.Toolkit, Uno.UI.MSAL, Uno.WinUI.Graphics2DSK, Uno.WinUI.Graphics3DGL, Uno.UI.Foldable and Uno.UI.GooglePlay are deliberately untouched: each still has a Windows or netcoremobile head globbing the same sources, where these symbols are undefined and the branches remain live. Files linked into a non-Skia project were checked the same way; none of them carries one of these guards. Generated/ is excluded -- those stubs come from the sync generator and have to be fixed there. Compound conditions that mix in symbols outside this set (IS_UNIT_TESTS, HAS_UNO, IS_NATIVE_ELEMENT, DEBUG) are left alone rather than guessed at. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Up7iYTmpcRPz3MaYzNvmPy
Drops 20 InternalsVisibleTo entries naming assemblies this repo used to produce and no longer does: Uno.UI.Runtime.WebAssembly, Uno.UI.MediaPlayer.WebAssembly, SamplesApp.Wasm and SamplesApp.netcoremobile went with the native drop, Uno.UI.RuntimeTests.Wasm with the WASM test head, and Uno.UI.Svg.Skia with the add-in fold. Each was confirmed against master to have been an in-repo project rather than an assembly from another repository -- Uno.UI.Maps and Uno.UI.HotDesign.Client are left alone for that reason, as are names that never matched a produced assembly in the first place and so predate this work. Also corrects the RemoteControlClient comment that still described its #else arm as covering the Reference build, and repairs the PrismJsView sample in the WASM interop guide, which imported the removed Uno.UI.Runtime.WebAssembly namespace and declared `namespace PrismJsDemo;` twice -- the second half of that has been wrong since long before this branch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Up7iYTmpcRPz3MaYzNvmPy
…raries The generator already distinguishes the libraries that still ship more than the Skia flavor -- Uno.UWP, Uno.Foundation and Uno.UI.Dispatching -- from the Skia-only ones, and withholds the native defines from the latter. That same set is exactly the set that kept a Reference head through the fold, so __NETSTD_REFERENCE__ belongs on the same switch: for Uno.UI and Uno.UI.Composition the symbol can no longer be defined, and emitting it leaves stubs guarded on a condition that is always false and [NotImplemented] attributes naming a platform that does not exist. Renames the flag from CurrentTypeEmitsNativeDefines to CurrentTypeEmitsNonSkiaDefines, since it now gates more than the native symbols and the old name would invite exactly this kind of omission again. This only changes what a future regeneration produces. The committed Generated/ stubs are unchanged here: running the sync tool needs the .NET 11 preview SDK the CI pipeline pins, and nothing in CI diffs Generated/, so the regeneration is a separate deliberate run rather than part of this change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Up7iYTmpcRPz3MaYzNvmPy
MSBuildWorkspace was created with LoadMetadataForReferencedProjects=true, so a referenced project resolved to its compiled output whenever one happened to exist on disk. LoadProject asserts its expected references are CompilationReferences, so the generator failed with Uno.Foundation not found when loading 'Uno.UWP\Uno.Reference.csproj (net10.0)' and exit 127 -- but only on a tree that had been built, which is why CI never saw it and a local run after any `dotnet build` did. Which project it named depended purely on which outputs happened to be present. The assertion is right to demand compilations: the generator resolves non-generated members to decide what to stub, and a metadata reference exposes only the public surface, so an internal implementation would read as missing and get a stub generated over it. Turning the flag off makes that explicit rather than dependent on what is lying in bin/. Verified by running the generator with the outputs present, which previously failed: it now completes, and the regenerated tree is byte-identical to the run from a cleaned tree. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Up7iYTmpcRPz3MaYzNvmPy
f77569e to
e091fad
Compare
|
Claude finished @MartinZikmund's task in 5m 49s —— View job Code Review
Verdict: fix-first — the PR is now merged, but all four inline findings from prior passes remain unresolved and should be addressed as a follow-up. Status of prior findings (4th consecutive pass)
Cross-cutting cosmetic note (not inline-commented): double blank lines remain at Validation confidence: Code-review assessment only; no local build run performed here. |
WinAppSDK sync generator drift detected on
|
| @@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible | |||
| EnterImpl(); | |||
| #endif | |||
| }; | |||
There was a problem hiding this comment.
Fourth consecutive review pass — both inner guards (and the outer one) remain. UNO_HAS_BORDER_VISUAL is always defined in the Skia build (#if !UNO_HAS_BORDER_VISUAL is always false), and UNO_HAS_ENHANCED_LIFECYCLE is always defined (#if !UNO_HAS_ENHANCED_LIFECYCLE is also always false). That makes the Loaded handler body permanently empty in the Skia build, which also makes the subscription itself pointless.
From CalendarViewBaseItem.cs (lines 155–179) we can see that EnterImpl(bool live) is the override used in the enhanced-lifecycle path — it's called by the lifecycle system, not from Loaded. The non-enhanced private void EnterImpl() variant is also gone for the same reason.
The entire block (lines 27–37) should be removed:
| }; | |
| // Uno only | |
| Initialize_CalendarViewBaseItemChrome(); | |
| } |
This removes the dead subscription without changing any compiled behaviour.
| // This shouldn't be virtual on enhanced lifecycle as it won't be called if there is no real subscriber to LayoutUpdated. | ||
| internal | ||
| #if !UNO_HAS_ENHANCED_LIFECYCLE | ||
| virtual | ||
| #endif | ||
| void OnLayoutUpdated() |
There was a problem hiding this comment.
Fourth consecutive review pass — two artifacts of the guard removal are still present:
- Stale comment (line 762): "shouldn't be virtual on enhanced lifecycle" refers to a conditional that no longer exists. The only meaningful part is that it won't be called without a real subscriber.
- Split declaration (lines 763–764):
internalandvoid OnLayoutUpdated()are on separate lines — the literal leftover of removing#if !UNO_HAS_ENHANCED_LIFECYCLE/virtual/#endif.dotnet format whitespacedoes not merge declaration keywords.
| // This shouldn't be virtual on enhanced lifecycle as it won't be called if there is no real subscriber to LayoutUpdated. | |
| internal | |
| #if !UNO_HAS_ENHANCED_LIFECYCLE | |
| virtual | |
| #endif | |
| void OnLayoutUpdated() | |
| // Won't be called if there is no real subscriber to LayoutUpdated. | |
| internal void OnLayoutUpdated() |
| @@ -3694,11 +3694,7 @@ void OnPropertyChanged( | |||
| // So, they can just cast ScrollPresenter to Panel and set the Background. | |||
| // In our case, we can't do that as there is no multi inheritance in C#. | |||
| // We use BorderLayerRenderer to draw the background. | |||
There was a problem hiding this comment.
Fourth consecutive review pass — the #if UNO_HAS_BORDER_VISUAL guard was correctly removed, but the comment on this line still says "We use BorderLayerRenderer to draw the background." BorderLayerRenderer was deleted by this PR; the background is now driven via UpdateBackground() / IBorderInfoProvider / BorderVisual.
| // We use BorderLayerRenderer to draw the background. | |
| // We use BorderVisual to draw the background. |
| OnOwnerElementChanged(); | ||
| #if UNO_HAS_ENHANCED_LIFECYCLE | ||
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | ||
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
There was a problem hiding this comment.
Fourth consecutive review pass — typo EmterImpl → EnterImpl still present.
| // EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also | |
| // On Skia, we match WinUI and initialize the visual triggers of a Control in | |
| // EnterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also |
The drawing-backend merges re-split Ellipse/Line/Path/Polygon/Polyline/ Rectangle/Shape into base .cs + .skia.cs pairs that unoplatform#24001 (skianaming) had already folded into single files on master. Fold them back into one .cs per type, laid out like master, keeping the branch's neutral IGeometry/GeometryFactory/CompositionPath implementation in place of the old SkiaGeometrySource2D/SKPathBuilder bodies. Also removes the #if __NETSTD_REFERENCE__ MeasureOverride/ArrangeOverride stubs that unoplatform#23999 (referencedrop) and unoplatform#24020 (deadflavorguards) dropped and the merges brought back. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
EllipseGeometry/Geometry/GeometryGroup/PathGeometry/RectangleGeometry were re-split into base .cs + .skia.cs pairs; unoplatform#24001 (skianaming) had already folded these on master. Fold back into one .cs per type, keeping the branch's neutral IGeometry/GeometryFactory implementation in place of the old SKPath/SKPathBuilder bodies. Also removes the #if __NETSTD_REFERENCE__ guard-drop reverts from unoplatform#23999 (referencedrop) that the merges brought back. NonUniformCornerRadius.GetRadii(SKPoint*) from unoplatform#23999/unoplatform#24020 is not restored: BorderVisual.skia.cs already builds rounded-rect geometry straight from the Vector2 corner fields (AddRoundedRectangle), so the unsafe pointer adapter has no remaining caller under the branch design. LineGeometry.cs was left untouched: its only difference from master is the intentional GetGeometry()/IGeometry neutral-seam rewrite. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
The merges re-split Inline.skia.cs/Run.skia.cs out of the base files and brought back the __NETSTD_REFERENCE__ block unoplatform#23999/unoplatform#24020 removed. Folded back into master's layout, keeping the neutral IFont members. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
…tform#23619/unoplatform#23671/unoplatform#24020/unoplatform#23999 Fold Application.skia.cs and Application.reference.cs back into Application.cs (unoplatform#24001 skianaming), fix the Lauched->Launched typo (unoplatform#23619), keep the branch's __SKIA__-only ALC window teardown (unoplatform#23671 was WASM+Skia but native heads are gone), and drop the dead UNO_HAS_ENHANCED_LIFECYCLE/__NETSTD_REFERENCE__ guards (unoplatform#24020/unoplatform#23999). Application.reference.cs is dead code in the Skia-only build and is removed, matching master. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
…rm#24020 The merge brought back a guard master removed; the symbol is always defined on Skia, so dropping it again changes nothing at runtime. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01XsQppKuZgijApgJxaTZt81
GitHub Issue: part of #8339
PR Type:
🔄 Refactoring (no functional changes, no api changes)
What changed? 🚀
Follow-up cleanup to the Reference fold (#23999) and the
.Skiarename (#24001). Now that the UI layer builds only for Skia, a family of preprocessor guards can no longer go either way — this removes what has become unreachable. No behaviour change: every branch removed is one the compiler was already discarding.Dead preprocessor branches — 264 sites, 92 files, ~1400 lines
__NETSTD_REFERENCE__is never defined for these projects, whileUNO_HAS_ENHANCED_LIFECYCLE,UNO_HAS_BORDER_VISUALandUNO_HAS_MANAGED_SCROLL_PRESENTERare always defined. Branches that can no longer be taken are removed; guards that are now always true are unwrapped, keeping the#elsebody wherever one existed.Five files were nothing but a dead guard and are deleted outright:
BorderLayerRenderer,Control.nonlifecycle,IScrollContentPresenter,NativeScrollContentPresenter.Xamarin,CustomEventManager.Scope was the careful part. Only directories whose only compiling project carries
UnoRuntimeIdentifier=Skiaare swept. Deliberately untouched, because each still has a Windows or netcoremobile head globbing the same sources, where these symbols are undefined and the branches are still live:Uno.UI.ToolkitUno.UI.Toolkit.Windows.csprojUno.UI.MSAL.Windows+.netcoremobileheadsUno.WinUI.Graphics2DSK.Crossruntime+.WindowsheadsUno.WinUI.Graphics3DGL,Uno.UI.Foldable,Uno.UI.GooglePlayCross-project
<Compile Include>links were checked the same way — 212 files are compiled from outside their own directory, and none of the ones reachable from a non-Skia project carries any of these guards.Generated/is excluded: those stubs come fromUno.WinAppSDKSyncGeneratorand have to be fixed there.Compound conditions mixing in symbols outside this set (
IS_UNIT_TESTS,HAS_UNO,IS_NATIVE_ELEMENT,DEBUG) are left alone rather than guessed at — about 30 sites.Dangling
InternalsVisibleTo— 20 entries, 9 filesNames this repo used to produce and no longer does:
Uno.UI.Runtime.WebAssembly,Uno.UI.MediaPlayer.WebAssembly,SamplesApp.WasmandSamplesApp.netcoremobilewent with the native drop,Uno.UI.RuntimeTests.Wasmwith the WASM test head,Uno.UI.Svg.Skiawith the add-in fold. Each was verified againstmasterto have been an in-repo project —Uno.UI.MapsandUno.UI.HotDesign.Clientare left in place for exactly that reason, as are names that never matched a produced assembly and so predate this work.Two stale descriptions
RemoteControlClientstill described its#elsearm as covering "the Reference build", and thePrismJsViewsample in the WASM interop guide imported the removedUno.UI.Runtime.WebAssemblynamespace and declarednamespace PrismJsDemo;twice — the latter has been wrong since long before this branch, so the snippet never compiled as printed.Validation
Compile-validated on Skia (
net10.0):Uno.UI,Uno.UI.Composition,Uno.UI.XamlHost,Uno.UI.RemoteControl,Uno.UI.Svg,Uno.UI.Lottie,Uno.Foundation,Uno.Foundation.Logging,Uno.WinRT, plus the consumers most likely to notice a removed type —Uno.UI.Toolkit.Skia,Uno.UI.FluentTheme.v2andUno.UI.RuntimeTests.Skia. All clean, no new warnings.dotnet format whitespacerun over every touched file.PR Checklist ✅
Screenshots Compare Test Runresults.