Skip to content

refactor: Remove the SamplesApp.Skia indirection layer - #24048

Merged
MartinZikmund merged 5 commits into
dev/mazi/samplesapp-drop-old-headsfrom
dev/mazi/samplesapp-drop-skia-lib
Aug 12, 2026
Merged

MartinZikmund merged 5 commits into
dev/mazi/samplesapp-drop-old-headsfrom
dev/mazi/samplesapp-drop-skia-lib

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: relates to unoplatform/uno-private#2151 (internal: "Convert Samples app to Uno.Sdk", Platform 7.0) — Phase 7 of specs/051-samplesapp-unosdk-skia

Stacked on #24046, which is itself stacked on #23536. Targets dev/mazi/samplesapp-drop-old-heads; retarget down the stack as each merges.

PR Type:

🔄 Refactoring (no functional changes, no api changes)

What changed? 🚀

Removes the SamplesApp.Skia indirection layer. The samples, unit tests and benchmarks now compile directly into the SamplesApp head on every target.

The point isn't just one fewer project. It's this:

#if __ANDROID__ in a sample page has never once been compiled.

The samples only ever built twice — as generic Skia (in the base library) and as WinUI (in the head's windows target). So WINAPPSDK worked, and 26 files with #if __ANDROID__, 22 with __APPLE_UIKIT__ and 27 with __WASM__ were dead code. You could write a platform fix in a sample and it would silently never run. Now every target compiles the samples with its own symbols.

The blocker that wasn't

#24046 recorded that the head couldn't take this over, because its mobile targets compile in native mode for their own .Android.cs / .iOS.cs entry points. That was wrong — and the csproj comment asserting it was wrong the same way its UnoRuntimeIdentifier comment had been.

Measured: with UnoRuntimeIdentifier=Skia on net11.0-android, DefineConstants carries __SKIA__, __CROSSRUNTIME__ and __ANDROID__ / __UNO_SKIA_ANDROID__ together, and all three .Android.cs entry points are still in Compile. The file suffixes are excluded on $(IsAndroid) / $(IsAppleUIKit), independently of the runtime identifier.

What the live guards surfaced

Cost of turning them on: 1 file on desktop, 9 on android — all native-Views-era code orphaned by the native rendering drop.

Sample Problem
NativeView + UIElement_Native_Child built a native Android ScrollView via Uno.UI's native-Views extensions — removed
WebView_Input_Keyboard_Insets ~195 lines of native Android view code behind an otherwise empty Control — removed
SplitViewBehavior BindableDrawerLayout fallback — branch removed
TextBox_Formatting_Flicker native IInputFilter on TextBoxView — branch removed
TextBlock_TextWrapping_PR1954_EdgeCase reflected into TextBlock's native LayoutBuilder — branch removed
Textbox_Keyboard_AutoFocus native focus paths whose cross-platform #else already worked — collapsed
ElevatedView_Tester, SequentialAnimationsPage new hiding native View members that no longer exist
FileSavePicker_LargeFileWrite WASM-only picker API gated on __CROSSRUNTIME__, which mobile now defines while referencing the netcoremobile flavour of Uno.UWP that lacks those APIs — retargeted to __WASM__
3 × WebView2_* unqualified WebView2. The desktop target references the Microsoft.Web.WebView2 package, which puts a global WebView2 namespace in scope; the base library never referenced it, so co-locating the samples exposed the clash. A using-alias can't fix it (CS0576 against a global namespace) — the type is qualified

Only the two fully-native samples were lost. Everything else kept working.

Cleanup that followed

  • Eight InternalsVisibleTo("SamplesApp.Skia") grants — all eight assemblies already grant SamplesApp.
  • App.xaml.cs picked the ICU data assembly by scanning loaded assemblies for a name starting with SamplesApp while excluding SamplesApp.Skia; now just typeof(App).Assembly.
  • RuntimeTestsApp and Given_FrameworkElement_And_Leak chose between SamplesApp.Skia and SamplesApp.Wasm. ⚠️ RuntimeTestsApp built the islands name as "UnoIslands" + assemblyName, which only produced the real UnoIslandsSamplesApp.Skia while the samples assembly still carried the suffix — now named explicitly.
  • UnoDisableHotRestartHelperGeneration existed because the ApplicationDefinition lived in the base library (Uno0005). App.xaml compiles into the head now, so it's gone — verified by building android without it.
  • Uno.UI.RuntimeTests now excludes its nested helper projects' obj/bin. The repo-wide DefaultItemExcludes is obj/**, relative to the project directory, so once AlcApp/HRApp/HRUnoLib had been built their generated AssemblyAttributes.cs was compiled into the parent (CS0579). Pre-existing; it blocked this work repeatedly.

Validation

Target Tool Result
net10.0-desktop dotnet build ✅
net10.0-android dotnet build ✅
net10.0-browserwasm dotnet build ✅
net10.0-windows10.0.19041.0 MSBuild.exe -r ✅
ios / tvos — requires macOS

All six solution filters and Uno.UI.slnx verified free of dangling project paths.

⚠️ iOS/tvOS are the real risk here. Their __APPLE_UIKIT__ branches (22 files) compile for the first time on CI, and I can't build them on Windows. Expect the same class of fallout as android — dead native-UIKit code. I pre-emptively cleaned the ones visible by inspection, but this needs a CI run to be sure.

PR Checklist ✅

  • 🧪 Existing samples/runtime tests exercised; two obsolete native-only samples removed
  • 📚 specs/051-samplesapp-unosdk-skia/plan.md Phase 7 records the measurements and watch-outs
  • 🖼️ Validated PR Screenshots Compare Test Run results (pending CI)
  • ❗ Contains NO breaking changes (no public API surface; samples-app restructuring)
  • 👀 Reviewed 2 other open pull requests

Copilot AI lite review requested due to automatic review settings August 11, 2026 14:54
@MartinZikmund MartinZikmund self-assigned this Aug 11, 2026
@github-actions github-actions Bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

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


PR Review: Remove SamplesApp.Skia indirection layer

Tasks:

  • Gather context and understand the PR
  • Review changed files for correctness issues
  • Check cross-platform targeting patterns
  • Review test/runtime helpers changes
  • Post inline comments for findings
  • Post summary

Summary

This is a well-motivated structural refactoring that eliminates the SamplesApp.Skia base library and gives every target its own compilation of the samples. The PR description is detailed and the build-validation table is good. The diff is clean overall.

2 issues found — 1 inline, 1 below.

Inline comment

  • LinkerConfig.xml line 3: Duplicate <assembly fullname="SamplesApp" /> root — see the inline comment.

Non-diff finding (pre-existing line now orphaned)

  • RuntimeTestsApp.cs line 78 — orphaned #pragma warning restore CS0162: The matching #pragma warning disable CS0162 lived inside the old #else { throw new PlatformNotSupportedException(); ... } block that this PR deleted, but the #pragma warning restore CS0162 after the #endif was left behind. Now that the entire #if block is gone the restore has no paired disable and is silently dead. It should be deleted: Fix this →

Observations (no action needed)

  • Main.Android.cs comment update: The old comment mentioned "runs in context of SamplesApp.Skia" — the new one says "generator does not see these Android-only add-ins." The manual ApiExtensibility.Register calls are still correct since the XAML generator doesn't auto-register platform-specific extensions; the comment is accurate.
  • FileSavePicker_LargeFileWrite __CROSSRUNTIME__ → __WASM__: Correct. WasmPickerConfiguration only exists in the WASM flavour of Uno.UWP; __CROSSRUNTIME__ is now defined for Skia-on-Android/iOS too, which reference the netcoremobile flavour that lacks these APIs.
  • RuntimeTestsApp.cs islands name hardcoded to "UnoIslandsSamplesApp.Skia": The hardcoded string is the right pragmatic choice (the islands host name can't be derived without the assembly in hand), and the comment explains the asymmetry. This is a latent maintenance risk if the islands project is ever renamed, but that's pre-existing complexity, not introduced here.
  • Directory.Build.props nested-project obj/bin exclusion: A clean fix for the CS0579 / duplicate-AssemblyAttributes problem. The comment in the added PropertyGroup explains the non-obvious "why" clearly.
  • InternalsVisibleTo cleanup: Correctly removes the SamplesApp.Skia grants from eight assemblies; existing SamplesApp grants already cover the samples head.
  • App.xaml.cs ICU data assembly lookup: Simplifying to typeof(App).Assembly is the correct and most robust approach — the previous StartsWith("SamplesApp") && !Equals("SamplesApp.Skia") heuristic was fragile.

⚠️ iOS/tvOS gap (acknowledged in PR)

The PR itself flags that 22 __APPLE_UIKIT__ branches compile for the first time on CI; it needs a successful CI run before merging. This is the right call — the android analogue surfaced 9 files in need of cleanup, so expecting something similar on UIKit is reasonable.

Verdict: fix-first (duplicate linker root + orphaned pragma, both trivial to fix), then safe to merge pending the iOS CI run.

<linker>
<assembly fullname="SamplesApp" />
<assembly fullname="SamplesApp.Skia" />
<assembly fullname="SamplesApp" />

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.

Duplicate SamplesApp entry — SamplesApp was already on line 2 before this diff, and the replacement of SamplesApp.Skia on this line with SamplesApp produced two identical roots. Remove the second one.

Suggested change
<assembly fullname="SamplesApp" />

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 removes the SamplesApp.Skia indirection project and moves samples/unit-tests/benchmarks to compile directly into the multi-target SamplesApp head, making platform #if branches in samples compile on their respective targets.

Changes:

  • Dropped SamplesApp.Skia (project + solution/filter references) and removed related InternalsVisibleTo grants.
  • Updated SamplesApp head project to import shared sample/test/benchmark content on all TFMs and to set Skia-related build properties on non-WinUI targets.
  • Cleaned up sample/test code paths that were previously hidden behind platform guards (e.g., removed obsolete native-view-based samples, qualified WebView2 references, adjusted assembly-name assumptions).

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Uno.UWP/AssemblyInfo.cs Remove InternalsVisibleTo("SamplesApp.Skia").
src/Uno.UI/AssemblyInfo.cs Remove InternalsVisibleTo("SamplesApp.Skia").
src/Uno.UI.XamlHost/Properties/AssemblyInfo.cs Remove InternalsVisibleTo("SamplesApp.Skia").
src/Uno.UI.slnx Remove SamplesApp.Skia project entry.
src/Uno.UI.RuntimeTests/UITests/_Engine/RuntimeTestsApp.cs Update sample assembly selection to SamplesApp vs UnoIslandsSamplesApp.Skia.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement_And_Leak.cs Simplify sample-assembly constant to SamplesApp.
src/Uno.UI.RuntimeTests/Directory.Build.props Exclude nested helper projects’ obj/bin from globbing to avoid duplicate assembly attributes.
src/Uno.UI.RuntimeTests/AssemblyInfo.cs Remove InternalsVisibleTo("SamplesApp.Skia").
src/Uno.UI.Dispatching/AssemblyInfo.cs Remove InternalsVisibleTo("SamplesApp.Skia").
src/Uno.UI.Composition/AssemblyInfo.cs Remove InternalsVisibleTo("SamplesApp.Skia").
src/Uno.UI-Skia-only.slnf Remove SamplesApp.Skia from Skia-only filter.
src/Uno.Foundation/AssemblyInfo.cs Remove InternalsVisibleTo("SamplesApp.Skia").
src/Uno.Foundation.Logging/AssemblyInfo.cs Remove InternalsVisibleTo("SamplesApp.Skia").
src/SamplesApp/SamplesApp/SamplesApp.csproj Inline shared content into head for all TFMs; set Skia runtime identifier for non-WinUI; bring forward Skia build props/imports.
src/SamplesApp/SamplesApp/Platforms/WebAssembly/LinkerConfig.xml Update linker roots for new assembly layout (but currently contains a duplicate entry).
src/SamplesApp/SamplesApp/Platforms/Android/Main.Android.cs Adjust comment to reflect new generator/add-in visibility constraints.
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Behaviors/SplitViewBehavior.cs Remove obsolete Android BindableDrawerLayout fallback branch.
src/SamplesApp/SamplesApp.Skia/SamplesApp.Skia.csproj Deleted project (indirection layer removed).
src/SamplesApp/SamplesApp.Shared/App.xaml.cs Simplify ICU data assembly resolution to typeof(App).Assembly.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml/UIElementTests/UIElement_Native_Child.xaml.cs Remove obsolete native-view based sample code-behind.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml/UIElementTests/UIElement_Native_Child.xaml Remove obsolete native-view based sample XAML.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml/UIElementTests/NativeView.cs Remove Android native ScrollView implementation sample.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Media_Animation/SequentialAnimationsPage.xaml.cs Remove Android-only new hiding for members that no longer exist.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/WebView/WebView_Input_Keyboard_Insets.xaml.cs Remove obsolete Android-native-view-heavy sample.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/WebView/WebView_Input_Keyboard_Insets.xaml Remove obsolete sample XAML.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/TextBox/Textbox_Keyboard_AutoFocus.xaml.cs Collapse platform-specific focus code to shared focus path.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/TextBox/TextBox_Formatting_Flicker.xaml.cs Remove Android-native IInputFilter / TextBoxView branch.
src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/TextBlockControl/TextBlock_TextWrapping_PR1954_EdgeCase.xaml.cs Remove Android reflection-based native layout probing; update description text (typo remains).
src/SamplesApp/SamplesApp.Samples/Windows_Storage/Pickers/FileSavePicker_LargeFileWrite.xaml.cs Retarget WASM-only picker configuration guard from __CROSSRUNTIME__ to __WASM__.
src/SamplesApp/SamplesApp.Samples/Toolkit/ElevatedView_Tester.xaml.cs Remove Android-only new hiding for Elevation.
src/SamplesApp/SamplesApp.Samples/SamplesApp.Samples.csproj Update comment to reflect samples now compile into head for all targets.
src/SamplesApp/SamplesApp.Samples/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_PostMessage_RemoveAdd.xaml.cs Fully qualify Microsoft.UI.Xaml.Controls.WebView2 to avoid namespace conflicts.
src/SamplesApp/SamplesApp.Samples/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_MultiViews.xaml.cs Fully qualify Microsoft.UI.Xaml.Controls.WebView2.
src/SamplesApp/SamplesApp.Samples/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_ContentDialogFocus.xaml.cs Fully qualify Microsoft.UI.Xaml.Controls.WebView2.
specs/051-samplesapp-unosdk-skia/plan.md Update plan to document Phase 7 and removal of SamplesApp.Skia.

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

Comment on lines 2 to 5
<assembly fullname="SamplesApp" />
<assembly fullname="SamplesApp.Skia" />
<assembly fullname="SamplesApp" />
<assembly fullname="Uno.UI" />
<assembly fullname="Uno.UI.Wasm.Tests" />
namespace UITests.Shared.Windows_UI_Xaml_Controls.TextBlockControl
{
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "[Droid]Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text lenght and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text lenght and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]
@mergify

mergify Bot commented Aug 11, 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

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/samplesapp-drop-old-heads branch from bbff48d to 5425f9c Compare August 11, 2026 17:35
MartinZikmund and others added 3 commits August 11, 2026 19:36
The samples, unit tests and benchmarks now build directly into the head rather
than being consumed pre-compiled from SamplesApp.Skia on the Skia targets. Each
target therefore compiles them with its own platform symbols, so a #if
__ANDROID__ / __APPLE_UIKIT__ / __WASM__ branch in a sample page is finally
live -- 26, 22 and 27 sample files respectively carried such branches, and none
of them had ever been compiled.

UnoRuntimeIdentifier is now Skia on every non-WinUI target, not just desktop and
browserwasm. That is what defines __SKIA__ alongside the platform symbol. The
csproj claimed this would make cross-targeting drop the head's own .Android.cs /
.iOS.cs entry points; measured, it does not -- the file suffixes are gated on
$(IsAndroid)/$(IsAppleUIKit), independently of the runtime identifier.

Turning the guards on surfaced the code they had been hiding since native
rendering was dropped:

- NativeView / UIElement_Native_Child built a native Android ScrollView through
  Uno.UI's native-Views extensions, and WebView_Input_Keyboard_Insets was ~195
  lines of native Android view code behind an otherwise empty Control. Both
  scenarios no longer exist; the samples are removed.
- SplitViewBehavior kept a BindableDrawerLayout fallback, TextBox_Formatting_Flicker
  installed a native IInputFilter on TextBoxView, TextBlock_TextWrapping_PR1954_EdgeCase
  reflected into TextBlock's native LayoutBuilder, and Textbox_Keyboard_AutoFocus had
  native focus paths whose cross-platform #else already did the job. Those branches
  are gone; the samples keep working.
- ElevatedView_Tester and SequentialAnimationsPage used `new` to hide native View
  members that no longer exist.
- FileSavePicker_LargeFileWrite gated WASM-only picker configuration on
  __CROSSRUNTIME__, which mobile now also defines while referencing the
  netcoremobile flavor of Uno.UWP that does not carry those APIs. Retargeted to __WASM__.
- Three WebView2 samples used the unqualified control name. The desktop target
  references the Microsoft.Web.WebView2 package, which puts a global WebView2
  namespace in scope; the base library never referenced it, so co-locating the
  samples exposed the clash. Qualified (a using-alias cannot work against a
  global namespace of the same name -- CS0576).

Also makes Uno.UI.RuntimeTests exclude its nested helper projects' obj/bin: the
repo-wide exclusion is relative to the project directory, so once AlcApp, HRApp
or HRUnoLib had been built their generated AssemblyAttributes.cs was compiled
into the parent and failed with CS0579.

Validated: net10.0-desktop and net10.0-android build clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DcqC3aauPNqhMqHvoZwNda
With the samples compiled into the head on every target, the intermediate
library has no remaining purpose. Its two reasons for existing are both gone:
it compiled the samples once as generic Skia (the head now does that per
target, with the platform symbols live), and it kept them out of the WinUI
compilation (the head already excluded it there).

Follow-on cleanup:

- Eight assemblies granted InternalsVisibleTo("SamplesApp.Skia"); every one of
  them already grants "SamplesApp", so the grants simply go.
- App.xaml.cs picked the ICU data assembly by scanning loaded assemblies for a
  name starting with "SamplesApp" while excluding "SamplesApp.Skia". The samples
  are in the head now, so it takes typeof(App).Assembly directly.
- RuntimeTestsApp and Given_FrameworkElement_And_Leak selected between
  "SamplesApp.Skia" and "SamplesApp.Wasm" per platform; both now resolve
  "SamplesApp". Note RuntimeTestsApp built the islands name by prefixing
  "UnoIslands", which only produced the right assembly while the suffix was
  present -- that host is still UnoIslandsSamplesApp.Skia, so it is named
  explicitly.
- The wasm LinkerConfig rooted the old assembly name.
- UnoDisableHotRestartHelperGeneration existed because the ApplicationDefinition
  lived in the base library, leaving the generator nothing to bind to (Uno0005).
  App.xaml is compiled into the head now, so the opt-out is removed -- verified
  by building android without it.

Validated: net10.0-desktop, net10.0-android, net10.0-browserwasm (dotnet build)
and net10.0-windows10.0.19041.0 (MSBuild.exe) all build clean. Every solution
filter and Uno.UI.slnx checked for dangling project paths.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DcqC3aauPNqhMqHvoZwNda
Documents the SamplesApp.Skia removal, and corrects the Phase 6 note claiming
the head could not compile the samples itself -- the constraint it described
does not exist.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DcqC3aauPNqhMqHvoZwNda
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/samplesapp-drop-skia-lib branch from 0f852bc to 4cc68ae Compare August 11, 2026 17:41
@github-actions

github-actions Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

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


PR Review: Remove SamplesApp.Skia indirection layer

Tasks:

  • Gather context and understand the PR
  • Review the diff against base branch
  • Check cross-platform targeting patterns
  • Check for orphaned pragmas and duplicate linker entries
  • Post inline comments for findings
  • Post summary

Summary

This is a well-executed structural refactoring. Removing the SamplesApp.Skia indirection layer so every TFM compiles the samples with its own platform symbols is the right long-term direction; the PR description explains the rationale clearly and the build table is thorough.

2 inline comments + 1 non-diff finding, all minor:

Inline comments posted

  1. LinkerConfig.xml line 3 — Duplicate <assembly fullname="SamplesApp" /> root. SamplesApp was already on line 2; replacing SamplesApp.Skia with SamplesApp on line 3 produced two identical entries. Remove line 3.
  2. TextBlock_TextWrapping_PR1954_EdgeCase.xaml.cs line 13 — Pre-existing typo lenght → length in the [Sample] description (this line is touched by the PR, so it's cheap to fix now).

Non-diff finding — orphaned pragma

RuntimeTestsApp.cs line 78: #pragma warning restore CS0162 has no matching disable — the paired disable lived inside the old #else { throw new PlatformNotSupportedException(); ... } block that this PR removed. The restore is now dead. It's not in the diff so no inline comment can be anchored, but it should be deleted: Fix this →

Observations (no action needed)

  • UnoRuntimeIdentifier=Skia for all non-WinUI TFMs: The expansion from desktop+WASM-only to all _IsSkiaTfm targets is what unlocks __ANDROID__/__APPLE_UIKIT__ in samples. Platform file-suffix exclusion (IsAndroid/IsAppleUIKit) is independent, so the head's own .Android.cs/.iOS.cs entry points still compile — the csproj comment explains this correctly.
  • UnoDisableHotRestartHelperGeneration removal: Correct — App.xaml now compiles into the head directly, so Uno0005 no longer fires.
  • Directory.Build.props nested-project exclusion: Clean fix for the CS0579 / duplicate AssemblyAttributes.cs issue; the comment explains the non-obvious why well.
  • WebView2 fully-qualified references: Correct root-cause fix — the Microsoft.Web.WebView2 package puts a global WebView2 namespace in scope on desktop, which the base library didn't reference; fully qualifying avoids the CS0576 clash that a using alias can't resolve.
  • FileSavePicker_LargeFileWrite __CROSSRUNTIME__ → __WASM__: Correct — WasmPickerConfiguration is only in the WASM flavour of Uno.UWP; __CROSSRUNTIME__ now includes Skia-on-mobile which references the netcoremobile flavour that lacks these APIs.
  • App.xaml.cs ICU assembly lookup: typeof(App).Assembly is simpler and more robust than the previous StartsWith("SamplesApp") && !Equals("SamplesApp.Skia") heuristic.

⚠️ iOS/tvOS gap (acknowledged in PR)

The PR correctly flags that 22 __APPLE_UIKIT__ branches compile for the first time on CI and cannot be validated on Windows. This needs a green iOS CI run before merging — the Android analogue surfaced 9 files of cleanup, so some UIKit fallout is possible.

Verdict: fix-first on the duplicate linker root (trivial one-line delete) + orphaned pragma, then safe to merge pending the iOS CI run.

<linker>
<assembly fullname="SamplesApp" />
<assembly fullname="SamplesApp.Skia" />
<assembly fullname="SamplesApp" />

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.

Duplicate linker root. SamplesApp is already declared on line 2; replacing SamplesApp.Skia with SamplesApp here produced two identical entries. Remove this line.

Suggested change
<assembly fullname="SamplesApp" />

namespace UITests.Shared.Windows_UI_Xaml_Controls.TextBlockControl
{
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "[Droid]Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text lenght and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text lenght and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]

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 in sample description (pre-existing, but this line is touched by the PR): lenght → length.

Suggested change
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text lenght and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text length and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]

MartinZikmund and others added 2 commits August 12, 2026 13:40
The head declares only platform-qualified TFMs, but targetframework-override.props
assigned UnoTargetFrameworkOverride verbatim. Every platform-less value — net10.0
and net11.0, which is what the library layer builds and what the "Skia (Desktop,
WebAssembly)" row of crosstargeting_override.props documents — therefore left the
head on a TFM it does not have: $(_Platform) resolved to empty, every platform gate
switched off, and the head silently lost its runtime and WinRT assemblies (14 of 26
ProjectReferences). It only ever worked on CI, which passes the platform-qualified
form plus -f, neither of which Visual Studio can do.

Map a platform-less override onto desktop, the flavor a plain TFM used to select
back when desktop and wasm were separate projects, and strip the head-only desktop
and browserwasm monikers for the library layer so a head-shaped override works
repo-wide. Platform-qualified values still pass through untouched, so every CI leg
resolves exactly as before — including the unversioned net11.0-ios its -f relies on.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MhL4CfQQZ3bCQQQ5vCCiV2
The override table's "Skia (Desktop, WebAssembly)" row predates the unified head,
where those are two target frameworks of one project rather than two projects.

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

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

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


PR Review: Remove SamplesApp.Skia indirection layer

Tasks:

  • Gather context and understand the PR
  • Review the diff against base branch (new commits: 0a43c6de, 3c2e14b4)
  • Check cross-platform targeting patterns
  • Post inline comments for findings
  • Post summary

Summary

The two newest commits address a real Visual Studio breakage: targetframework-override.props stripped desktop/browserwasm monikers from UnoTargetFrameworkOverride for library projects, but the SamplesApp head (whose every TFM carries a platform) then saw an empty $(_Platform) and silently dropped 14 of 26 ProjectReferences. The fix — strip in the common props, re-apply in the head — is logically correct and the MSBuild evaluation order (the new PropertyGroup reads $(UnoTargetFrameworkOverride) verbatim, after the library layer has already stripped it) is sound. The accompanying documentation in crosstargeting_override.props.sample accurately reflects the new three-way split (plain, -desktop, -browserwasm).

2 inline comments posted; 1 non-diff finding in the summary.

Inline comments posted

  1. LinkerConfig.xml line 3 — Duplicate <assembly fullname="SamplesApp" /> root (still unfixed from the two previous review cycles). One-line delete.
  2. TextBlock_TextWrapping_PR1954_EdgeCase.xaml.cs line 13 — Pre-existing typo lenght → length in the [Sample] description (line touched by the PR; suggestion included).

Non-diff finding — orphaned pragma

RuntimeTestsApp.cs line 78: #pragma warning restore CS0162 remains without a matching disable (flagged in the previous two review cycles; still unfixed). The paired disable was inside the old #if __SKIA__ / #else / throw / #pragma warning disable CS0162 block that this PR deleted, but the restore at the closing #endif was not removed. It is inert but dead. Because it is outside the diff range an inline comment cannot be anchored there: delete the line manually.

New-commit observations (no action needed)

  • targetframework-override.props _UnoEffectiveTargetFrameworkOverride: net$([MSBuild]::GetTargetFrameworkVersion('...')) is the correct idiomatic way to rebuild the version-only form. Conditions for 'desktop'/'browserwasm' only — all other platforms pass through unchanged.
  • SamplesApp.csproj head re-application block (lines 27–31): Platform-less overrides (net10.0) correctly map to net10.0-desktop. Platform-qualified non-head monikers (net10.0-android, net10.0-windows…) fall through untouched. MSBuild within-PropertyGroup evaluation order is top-to-bottom, so _HeadOverridePlatform is visible to the subsequent TargetFrameworks conditions. Correct.
  • AGENTS.md build-system rule ("TFMs come from Directory.Build.props properties — don't hardcode"): the new props use $(UnoTargetFrameworkOverride) verbatim (caller-supplied, not hardcoded), so this rule is not violated.

⚠️ iOS/tvOS gap (acknowledged in PR)

22 __APPLE_UIKIT__ branches compile for the first time on CI and could not be validated on Windows. Needs a green iOS CI run before merging.

Verdict: fix-first (duplicate linker root + orphaned pragma; both trivial), then safe to merge pending the iOS CI run.

@MartinZikmund
MartinZikmund merged commit 64fdf86 into dev/mazi/samplesapp-drop-old-heads Aug 12, 2026
7 of 10 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/samplesapp-drop-skia-lib branch August 12, 2026 11:43
<linker>
<assembly fullname="SamplesApp" />
<assembly fullname="SamplesApp.Skia" />
<assembly fullname="SamplesApp" />

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.

Duplicate linker root — SamplesApp is already declared on line 2. When SamplesApp.Skia was renamed to SamplesApp on this line the first entry was not removed, producing two identical <assembly fullname="SamplesApp" /> roots. The IL linker deduplicates by identity, so it won't cause a build failure, but it's confusing to maintain.

Suggested change
<assembly fullname="SamplesApp" />

namespace UITests.Shared.Windows_UI_Xaml_Controls.TextBlockControl
{
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "[Droid]Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text lenght and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text lenght and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]

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.

Pre-existing typo in the sample description: lenght → length. This line is touched by the PR so it's cheap to fix now.

Suggested change
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text lenght and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]
[Sample("TextBlock", Name = nameof(TextBlock_TextWrapping_PR1954_EdgeCase), Description = "Repro sample for PR1954. When the text is limited to 1 line, due to enough height available for 2 lines, it should take the size of 1 line only. You may need to adjust text length and/or container height depending on the device. Expected behavior: text should always be in the center of pink area")]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation kind/documentation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants