Skip to content

refactor: Drop guards and references the fold made unreachable - #24020

Merged
MartinZikmund merged 4 commits into
dev/mazi/referencedropfrom
dev/mazi/deadflavorguards
Aug 10, 2026
Merged

MartinZikmund merged 4 commits into
dev/mazi/referencedropfrom
dev/mazi/deadflavorguards

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: part of #8339

Stacked on #24001 — targets dev/mazi/skianaming, and should be reviewed and merged after it. Retarget to feature/breakingchanges once #23999 and #24001 land.

PR Type:

🔄 Refactoring (no functional changes, no api changes)

What changed? 🚀

Follow-up cleanup to the Reference fold (#23999) and the .Skia rename (#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, while UNO_HAS_ENHANCED_LIFECYCLE, UNO_HAS_BORDER_VISUAL and UNO_HAS_MANAGED_SCROLL_PRESENTER are always defined. Branches that can no longer be taken are removed; guards that are now always true are unwrapped, 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, CustomEventManager.

Scope was the careful part. Only directories whose only compiling project carries UnoRuntimeIdentifier=Skia are 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:

Untouched Why
Uno.UI.Toolkit Uno.UI.Toolkit.Windows.csproj
Uno.UI.MSAL .Windows + .netcoremobile heads
Uno.WinUI.Graphics2DSK .Crossruntime + .Windows heads
Uno.WinUI.Graphics3DGL, Uno.UI.Foldable, Uno.UI.GooglePlay no Skia RID

Cross-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 from Uno.WinAppSDKSyncGenerator and 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 files

Names 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, Uno.UI.Svg.Skia with the add-in fold. Each was verified against master to have been an in-repo project — Uno.UI.Maps and Uno.UI.HotDesign.Client are left in place for exactly that reason, as are names that never matched a produced assembly and so predate this work.

Two stale descriptions

RemoteControlClient still described its #else arm as covering "the Reference build", and the PrismJsView sample in the WASM interop guide imported the removed Uno.UI.Runtime.WebAssembly namespace and declared namespace 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.v2 and Uno.UI.RuntimeTests.Skia. All clean, no new warnings. dotnet format whitespace run over every touched file.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable) — n/a, no behaviour change; existing suites are the regression net
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features) — repaired the WASM interop snippet
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

Copilot AI lite review requested due to automatic review settings August 9, 2026 10:35
@github-actions github-actions Bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform kind/documentation labels Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

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


Code Review

  • Load tools
  • Examine diff and changed files
  • Review guard removals for correctness
  • Review deleted files for any still-needed code
  • Review InternalsVisibleTo removals
  • Review doc fixes
  • Post inline comments for findings
  • Post summary

Verdict: fix-first — two minor issues should be tidied before merge; overall the PR is clean and well-scoped.

Summary

Scope and correctness. The scope analysis in the description is sound. The symbols (__NETSTD_REFERENCE__, UNO_HAS_BORDER_VISUAL, UNO_HAS_ENHANCED_LIFECYCLE, UNO_HAS_MANAGED_SCROLL_PRESENTER) are correctly characterised as always/never defined for the affected compilation units, and the exclusion of Toolkit, MSAL, Graphics2DSK/3DGL, Foldable, and GooglePlay (which still have non-Skia heads) is correct. InternalsVisibleTo removals were spot-checked against the changed-files set; Uno.UI.Maps and Uno.UI.HotDesign.Client are correctly kept. Deleted files (BorderLayerRenderer, Control.nonlifecycle, IScrollContentPresenter, NativeScrollContentPresenter.Xamarin, CustomEventManager) were entirely dead guards — no surviving references.

Findings (3 inline comments):

Severity File Issue
Low CalendarViewBaseItem.h.cs:29-34 Two dead guards (#if !UNO_HAS_BORDER_VISUAL, #if !UNO_HAS_ENHANCED_LIFECYCLE) missed by the sweep; neither is a compound condition. The _borderRenderer field they reference was removed from CalendarViewBaseItemChrome.uno.cs, so the first block silently avoids a compile error only because UNO_HAS_BORDER_VISUAL is always true.
Low FrameworkElement.cs:762-764 Stale comment referencing the no-longer-relevant lifecycle duality, plus a split method declaration (internal / void OnLayoutUpdated()) left by the removed #if block — dotnet format whitespace does not merge declaration lines.
Low ScrollPresenter.cs:3696 Inline comment "We use BorderLayerRenderer to draw the background" is stale; BorderLayerRenderer was deleted by this PR and the background is now driven via BorderVisual.

Cross-cutting cosmetic note (not inline-commented): several sites have double blank lines left after block removal (Application.cs:239, Application.cs:322, ContentPresenter.cs:45, ScrollPresenter.Uno.cs:11-12). These are harmless but worth a quick pass if the other nits are addressed anyway.

Validation confidence: Code-review assessment only. The PR author validated Skia compilation; no runtime execution performed here.

@mergify

mergify Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible
EnterImpl();
#endif

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.

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.

Suggested change
#endif
};

#if !UNO_HAS_ENHANCED_LIFECYCLE
virtual
#endif
void OnLayoutUpdated()

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.

Two artifacts of the guard removal:

  1. The comment on line 762 is now stale — it explains why the method was not virtual only 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.

  2. 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#endif block. dotnet format whitespace won't merge these lines.

Suggested cleanup:

Suggested change
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.

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.

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.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on f288628

The Uno.WinAppSDKSyncGenerator produced changes that are not committed on this PR.

To apply automatically (PRs from branches in this repo only): comment /apply-sync-gen on this PR and a bot will push chore: Sync generator run to the head branch.

To apply manually (required for PRs from forks):

  1. Download the sync-generator-patch artifact from this run.
  2. In your local checkout of the PR branch:
    git apply sync-generator.patch
    git add -A
    git commit -m "chore: Sync generator run"
    git push
    

Or re-run the generator locally on Windows via build\run-api-sync-tool.cmd.

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

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 InternalsVisibleTo references 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
Comment on lines 31 to 33
using Uno.Foundation;
using Uno.UI.Runtime.WebAssembly;

namespace PrismJsDemo;

using Uno.UI.NativeElementHosting;

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/deadflavorguards branch from f288628 to 428d6d6 Compare August 9, 2026 13:43
@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

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


Code Review

  • Load tools
  • Examine diff and changed files
  • Check if previous review findings were addressed
  • Review guard removals for correctness
  • Review stale comments/typos
  • Post inline comments for new findings
  • Post summary

Verdict: fix-first — the PR update (3 new commits) adds the sync-gen change and assembly cleanup but does not address any of the four inline findings from the previous review pass. All four are carried forward unchanged.

Scope and correctness

The sweep remains correctly bounded. The three new commits (refactor(sync-gen): Stop emitting Reference defines for Skia-only libraries, chore: Clean up references to assemblies that no longer exist, refactor: Drop preprocessor branches the fold made unreachable) are clean and consistent with the stated intent. No new issues introduced.

Unresolved findings (4 inline comments re-posted)

Severity File Issue
Low CalendarViewBaseItem.h.cs:29-35 #if !UNO_HAS_BORDER_VISUAL and #if !UNO_HAS_ENHANCED_LIFECYCLE — both always-false in the Skia build, both simple single-symbol conditions with no compound mixing. The first references _borderRenderer which was deleted by this PR; the guard is the only thing preventing a compile error today.
Low FrameworkElement.cs:762-764 Stale "on enhanced lifecycle" qualifier in comment + internal / void OnLayoutUpdated() split across two lines — the exact fragment left by the #if !UNO_HAS_ENHANCED_LIFECYCLE virtual #endif removal.
Low ScrollPresenter.cs:3696 Comment still reads "We use BorderLayerRenderer to draw the background" — BorderLayerRenderer was deleted by this PR.
Low VisualStateGroup.cs:147 Typo: EmterImpl → EnterImpl.

Cross-cutting cosmetic note (not inline-commented): double blank lines remain at Application.cs:321-322 and ScrollPresenter.Uno.cs:11-12 from block removal. Harmless but worth a quick dotnet format whitespace pass if the other nits are addressed.

Validation confidence: Code-review assessment only; no local build run.

@MartinZikmund

Copy link
Copy Markdown
Member Author

Added refactor(sync-gen): Stop emitting Reference defines for Skia-only libraries (428d6d6).

The generator already separates the libraries that still ship more than the Skia flavor — Uno.UWP, Uno.Foundation, Uno.UI.Dispatching — from the Skia-only ones, and withholds the native defines from the latter. That 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, so emitting it produces stubs guarded on a permanently-false condition and [NotImplemented] attributes naming a platform that doesn't exist.

The flag is renamed CurrentTypeEmitsNativeDefines → CurrentTypeEmitsNonSkiaDefines, because it now gates more than the native symbols and the old name is what invited this omission in the first place.

The committed Generated/ stubs are unchanged. Two reasons:

  • Running the sync tool needs the .NET 11 preview SDK this branch's pipeline pins (11.0.100-preview.6); locally it has to be coaxed with -p:NetCurrent=net10.0, which is exactly the kind of TFM override LoadProject warns breaks transitive project-reference resolution.
  • Nothing in CI diffs Generated/ — RunAPISyncTool exists only in Uno.UI.Build.csproj and is not wired into any pipeline. The only CI use of the generator is GenerateDoc, in the separate path-filtered docs pipeline.

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.

Comment on lines 29 to 35
@@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible
EnterImpl();
#endif
};

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.

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_VISUAL is always defined, so _borderRenderer ??= new(this) is never compiled in. _borderRenderer was also deleted from CalendarViewBaseItemChrome.uno.cs by 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_LIFECYCLE is always defined, so this arm of EnterImpl() 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.

Suggested change
this.Loaded += (_, _) =>
{
EnterImpl();
};

Comment on lines 762 to 764
// 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()

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.

Two leftovers of the guard removal, carried over from the previous review pass:

  1. 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.
  2. The method declaration is still split across two lines (internal on one line, void OnLayoutUpdated() on the next). This is the exact fragment left by removing the #if !UNO_HAS_ENHANCED_LIFECYCLE / virtual / #endif block — dotnet format whitespace doesn't merge declaration keywords.
Suggested change
// 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.

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.

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.

Suggested change
// 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

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.

Typo: EmterImpl → EnterImpl. Flagged in the previous review pass and still present.

Suggested change
// 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

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on 428d6d6

The Uno.WinAppSDKSyncGenerator produced changes that are not committed on this PR.

To apply automatically (PRs from branches in this repo only): comment /apply-sync-gen on this PR and a bot will push chore: Sync generator run to the head branch.

To apply manually (required for PRs from forks):

  1. Download the sync-generator-patch artifact from this run.
  2. In your local checkout of the PR branch:
    git apply sync-generator.patch
    git add -A
    git commit -m "chore: Sync generator run"
    git push
    

Or re-run the generator locally on Windows via build\run-api-sync-tool.cmd.

@github-actions

github-actions Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

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


Code Review

  • Load tools
  • Examine current diff and new commits
  • Check status of previous review findings
  • Scan for new issues in latest commits
  • Post inline comments for findings
  • Post summary

Verdict: fix-first — 4 inline findings, all carried over from prior passes; the three new commits are clean.

New commits (clean)

Commit Assessment
428d6d67 refactor(sync-gen): Stop emitting Reference defines for Skia-only libraries Correct. The flag rename (CurrentTypeEmitsNativeDefines → CurrentTypeEmitsNonSkiaDefines) makes the gate self-documenting and prevents future omissions. The scope logic is unchanged.
1b62b842 chore(sync-gen): Regenerate stubs without the Reference define Mechanically correct. All 1690 changed files follow the same shape (`#if SKIA
b4e2a2a7 fix(sync-gen): Load referenced projects as projects, not metadata Correct root-cause fix. LoadMetadataForReferencedProjects = false ensures internal members are visible to the generator, preventing spurious stubs over hand-written implementations. Comment in code explains the why clearly.

Unresolved findings (4 inline comments re-posted)

# Severity File Issue
1 Low CalendarViewBaseItem.h.cs:29–35 #if !UNO_HAS_BORDER_VISUAL and #if !UNO_HAS_ENHANCED_LIFECYCLE — always-false in the Skia build; neither is a compound condition. The first references _borderRenderer which was deleted by this PR — only the guard prevents a compile error.
2 Low FrameworkElement.cs:762–764 Stale "on enhanced lifecycle" qualifier in comment + internal / void OnLayoutUpdated() declaration split across two lines — exact leftover of the removed #if block.
3 Low ScrollPresenter.cs:3696 Comment still reads "We use BorderLayerRenderer to draw the background" — BorderLayerRenderer was deleted by this PR.
4 Low VisualStateGroup.cs:147 Typo: EmterImpl → EnterImpl.

Validation confidence: Code-review assessment only; no local build run performed here.

@MartinZikmund

Copy link
Copy Markdown
Member Author

Sync generator: root cause found, and Generated/ is regenerated

The exit 127 failure had nothing to do with the project list or the Reference repoint — and it is now fixed rather than worked around.

Root cause. 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 run died with

Uno.Foundation not found when loading '..\..\..\Uno.UWP\Uno.Reference.csproj (net10.0)'

The tell was that the netcoremobile heads loaded fine while the Reference head did not: their bin folders existed from restore but contained no DLLs, so Roslyn opened them as projects. Deleting the two Reference outputs moved the failure to the next project I happened to have built. So it fails on any tree that has been built, and CI never saw it because agents are clean and the sync-gen step only restores.

Why the assertion is right, and the flag was wrong. The generator resolves non-generated members to decide what to stub. A metadata reference exposes only the public surface, so an internal implementation reads as missing and gets a stub generated over it. Demanding compilations is correct; preferring metadata contradicted it. LoadMetadataForReferencedProjects = false makes the intent explicit instead of dependent on what's in bin/.

Verified as a controlled before/after: with outputs present — the case that previously failed — the generator now completes, and the regenerated tree is byte-identical to a run from a cleaned tree.

Regeneration is included. 1690 files: 1497 under Uno.UI, 193 under Uno.UI.Composition, all the same shape — #if __SKIA__ || __NETSTD_REFERENCE__ → #if __SKIA__, with the paired [NotImplemented] dropping the platform that can no longer be defined. Uno.UWP (4516 files), Uno.Foundation (12) and Uno.UI.Dispatching (6) keep their Reference defines untouched, since those libraries still ship that flavor. Uno.UI, Uno.UI.Composition and Uno.UI.RuntimeTests.Skia all build clean against the regenerated stubs.

One incidental note for anyone running the tool: a failed run deletes the Generated/ folders before regenerating and leaves them deleted, so git checkout them after a crash.

Comment on lines 29 to 35
@@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible
EnterImpl();
#endif
};

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.

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_VISUAL is always defined; this arm never compiles in. _borderRenderer was also deleted from CalendarViewBaseItemChrome.uno.cs by 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_LIFECYCLE is 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.

Suggested change
this.Loaded += (_, _) =>
{
EnterImpl();
};

Comment on lines 762 to 764
// 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()

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.

Two leftovers of the guard removal, carried over from previous review passes and still unresolved.

  1. 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.
  2. 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 whitespace does not merge declaration keywords.
Suggested change
// 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.

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.

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.

Suggested change
// We use BorderLayerRenderer to draw the background.
// We use BorderVisual to draw the background.

Comment on lines 146 to 147
// On Skia, we match WinUI and initialize the visual triggers of a Control in
// EmterImpl and/or InvokeApplyTemplate. Somehow the state triggers are also

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.

Typo: EmterImpl → EnterImpl. Carried over from previous review passes and still unresolved.

Suggested change
// 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

Base automatically changed from dev/mazi/skianaming to dev/mazi/referencedrop August 10, 2026 12:41
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/deadflavorguards branch from b4e2a2a to f77569e Compare August 10, 2026 12:46
@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

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


Code Review

  • Load tools
  • Read current state of files with prior unresolved findings
  • Check if previous review findings were addressed
  • Scan latest commits for new issues
  • Post inline comments for findings
  • Post summary

Verdict: fix-first — no new commits since the last review pass; all four prior findings remain open.

Status

No changes to the branch since the previous review (latest commit: f77569ee). The three new commits reviewed in the prior pass (refactor(sync-gen), chore, fix(sync-gen)) were assessed as clean, and that assessment holds.

Unresolved findings (4 inline comments re-posted — third consecutive pass)

# Severity File Issue
1 Low CalendarViewBaseItem.h.cs:29–35 #if !UNO_HAS_BORDER_VISUAL and #if !UNO_HAS_ENHANCED_LIFECYCLE — always-false in the Skia build; neither is a compound condition. The first references _borderRenderer which was deleted by this PR — only the guard prevents a compile error.
2 Low FrameworkElement.cs:762–764 Stale "on enhanced lifecycle" qualifier in comment + internal / void OnLayoutUpdated() declaration split across two lines — exact leftover of the removed #if block.
3 Low ScrollPresenter.cs:3696 Comment still reads "We use BorderLayerRenderer to draw the background" — BorderLayerRenderer was deleted by this PR.
4 Low VisualStateGroup.cs:147 Typo: EmterImpl → EnterImpl.

Each has an inline comment with a ready-to-apply suggestion block.

Cross-cutting cosmetic note (not inline-commented): double blank lines remain at Application.cs:321-322 and ScrollPresenter.Uno.cs:11-12 from block removal. Harmless, but worth a quick dotnet format whitespace pass if the other nits are addressed.

Validation confidence: Code-review assessment only; no local build run performed here.

Comment on lines 29 to 35
@@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible
EnterImpl();
#endif
};

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.

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_VISUAL is always defined; this arm never compiles in. _borderRenderer was also deleted from CalendarViewBaseItemChrome.uno.cs by 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_LIFECYCLE is 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.

Suggested change
this.Loaded += (_, _) =>
{
EnterImpl();
};

Comment on lines 762 to 764
// 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()

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.

Two leftovers of the guard removal, carried over from two prior review passes and still unresolved:

  1. 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.
  2. The internal / void OnLayoutUpdated() split declaration is the exact fragment left by removing #if !UNO_HAS_ENHANCED_LIFECYCLE / virtual / #endif. dotnet format whitespace does not merge declaration keywords across lines.
Suggested change
// 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.

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.

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.

Suggested change
// 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

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.

Typo: EmterImpl → EnterImpl. Flagged across three consecutive review passes and still unresolved.

Suggested change
// 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

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/referencedrop branch from 45f7d37 to 68766a1 Compare August 10, 2026 12:52
@github-actions

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on f77569e

The Uno.WinAppSDKSyncGenerator produced changes that are not committed on this PR.

To apply automatically (PRs from branches in this repo only): comment /apply-sync-gen on this PR and a bot will push chore: Sync generator run to the head branch.

To apply manually (required for PRs from forks):

  1. Download the sync-generator-patch artifact from this run.
  2. In your local checkout of the PR branch:
    git apply sync-generator.patch
    git add -A
    git commit -m "chore: Sync generator run"
    git push
    

Or re-run the generator locally on Windows via build\run-api-sync-tool.cmd.

MartinZikmund and others added 4 commits August 10, 2026 14:55
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
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/deadflavorguards branch from f77569e to e091fad Compare August 10, 2026 12:55
@MartinZikmund
MartinZikmund merged commit c477f2a into dev/mazi/referencedrop Aug 10, 2026
8 of 10 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/deadflavorguards branch August 10, 2026 12:56
@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

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


Code Review

  • Load tools
  • Read current state of files with prior unresolved findings
  • Check if previous findings were addressed
  • Post inline comments for remaining issues
  • Post summary

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)

# Severity File Status
1 Low CalendarViewBaseItem.h.cs:29–35 Unresolved — the outer #if !__NETSTD_REFERENCE__ was removed by the PR, but the two inner guards (#if !UNO_HAS_BORDER_VISUAL, #if !UNO_HAS_ENHANCED_LIFECYCLE) remain. Both are always-false in the Skia build, making the entire Loaded handler body dead. The subscription itself is now pointless and the whole block should be removed.
2 Low FrameworkElement.cs:762–764 Unresolved — stale "on enhanced lifecycle" qualifier in the comment, and the internal / void OnLayoutUpdated() split-line declaration (leftover of the guard removal) both remain.
3 Low ScrollPresenter.cs:3696 Partially resolved — the #if UNO_HAS_BORDER_VISUAL guard was correctly removed, but the comment still reads "We use BorderLayerRenderer to draw the background." BorderLayerRenderer was deleted by this PR.
4 Low VisualStateGroup.cs:147 Unresolved — typo EmterImpl → EnterImpl.

Cross-cutting cosmetic note (not inline-commented): double blank lines remain at Application.cs:321-322 and ScrollPresenter.Uno.cs:11-12 from block removal. Worth a dotnet format whitespace pass alongside the other fixes.

Validation confidence: Code-review assessment only; no local build run performed here.

@github-actions

Copy link
Copy Markdown
Contributor

WinAppSDK sync generator drift detected on e091fad

The Uno.WinAppSDKSyncGenerator produced changes that are not committed on this PR.

To apply automatically (PRs from branches in this repo only): comment /apply-sync-gen on this PR and a bot will push chore: Sync generator run to the head branch.

To apply manually (required for PRs from forks):

  1. Download the sync-generator-patch artifact from this run.
  2. In your local checkout of the PR branch:
    git apply sync-generator.patch
    git add -A
    git commit -m "chore: Sync generator run"
    git push
    

Or re-run the generator locally on Windows via build\run-api-sync-tool.cmd.

@@ -34,7 +33,6 @@ internal CalendarViewBaseItem() // Make sure the ctor is not publically visible
EnterImpl();
#endif
};

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.

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:

Suggested change
};
// Uno only
Initialize_CalendarViewBaseItemChrome();
}

This removes the dead subscription without changing any compiled behaviour.

Comment on lines 762 to 764
// 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()

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.

Fourth consecutive review pass — two artifacts of the guard removal are still present:

  1. 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.
  2. Split declaration (lines 763–764): internal and void OnLayoutUpdated() are on separate lines — the literal leftover of removing #if !UNO_HAS_ENHANCED_LIFECYCLE / virtual / #endif. dotnet format whitespace does not merge declaration keywords.
Suggested change
// 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.

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.

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.

Suggested change
// 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

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.

Fourth consecutive review pass — typo EmterImpl → EnterImpl still present.

Suggested change
// 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

MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
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
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
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
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
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
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
…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
MartinZikmund added a commit to ramezgerges/uno that referenced this pull request Sep 21, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/documentation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants