FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor: Remove conditional branches no compilation can take by MartinZikmund · Pull Request #24089 · unoplatform/uno · GitHub

refactor: Remove conditional branches no compilation can take - #24089

Merged
MartinZikmund merged 18 commits into
feature/breakingchangesfrom
dev/mazi/dead-conditional-branches
Aug 26, 2026
Merged

refactor: Remove conditional branches no compilation can take#24089
MartinZikmund merged 18 commits into
feature/breakingchangesfrom
dev/mazi/dead-conditional-branches

Conversation

MartinZikmund commented Aug 15, 2026
edited
Loading

Copy link
Copy Markdown
Member

GitHub Issue: part of #8339

PR Type:

🔄 Refactoring (no functional changes, no api changes)

Stacked on #24087 and #24088. It targets feature/breakingchanges too, so the diff
below includes both of those — the five commits from 405f60aa onward are what is new here. Please review
after the other two merge.

What changed? 🚀

Removal of #if branches that no compilation can take, in src/Uno.UI and src/Uno.UI.Composition. No
behaviour change: in every case the surviving arm is the one that was already being compiled.

How the branches were established, rather than assumed. A conditional is only dead if its expression is
constant for every compilation the file takes part in, which needs three inputs:

  1. The define set from MSBuild, not inferred — dotnet msbuild Uno.UI.csproj -getProperty:DefineConstants.
  2. Which files more than one project compiles. 41 files under src/Uno.UI are Compile Included by
    Uno.UI.Composition, Uno.UI.SourceGenerators, Uno.UI.Toolkit.Windows, the Skia runtimes and the
    SamplesApp heads. Their conditionals are excluded from the sweep.
  3. Configuration-dependent symbols must not be folded. DEBUG (148 sites) varies by configuration, so a
    define set captured from one configuration cannot prove it constant.

The simplification is three-valued: only symbols verified against the above are folded, every other symbol stays
unknown, and a conditional that stays unknown is left byte-for-byte alone. Compound expressions are simplified
rather than guessed at — !__CROSSRUNTIME__ && !IS_UNIT_TESTS becomes !__CROSSRUNTIME__, and the residue of an
earlier sweep, #if false || false || IS_UNIT_TESTS || false || __NETSTD_REFERENCE__, collapses.

What was removed:

Symbol Why it cannot be defined
IS_UNIT_TESTS (89 sites) Absent from Uno.UI's define set; Uno.UI.UnitTests takes a ProjectReference, not the sources
__NETSTD_REFERENCE__ (27) Uno.UI no longer builds a Reference flavor
NETFX_CORE (13) UWP era
UNO_HAS_UIELEMENT_IMPLICIT_PINNING (7) Not defined for Uno.UI
SILVERLIGHT, __UWP__, NET46 Defined nowhere
HAS_NATIVE_IMPLICIT_POINTER_CAPTURE (3) Defined only for the Apple and Android target frameworks, which Uno.UI does not build
__APPLE_UIKIT__, __WASM__, __ANDROID__, NETFRAMEWORK In Uno.UI.Composition, which targets net10.0;net11.0 only

Uno.UI.Composition also drops XAMARIN from its DefineConstants: nothing branched on it, neither its own
sources nor the four Uno.UI files it compiles.

Four symbols were not removed despite reading as always-false. NETSTANDARD, WASM_SKIA, WINUI and
__ANDROID__ have every site inside a shared file where the symbol really is defined — the WebView native
sources compiled by the WebAssembly and Android runtimes, the sources compiled by Uno.UI.SourceGenerators, and
VisibleBoundsPadding.cs compiled by the WinAppSDK Toolkit. Sweeping them would have deleted live code.

Also not touched, deliberately: the 144 bare #if false blocks, which are an author's disable rather than a
dead symbol and want individual triage; the ten completed-migration feature flags, which want their owners; and
__SKIA__ / HAS_UNO, which should change once with the drawing-backend work rather than twice. HAS_UNO in
MUX-ported files is provenance for the next upstream sync, not a condition.

After this, src/Uno.UI has no always-false conditional outside those categories: what remains is 50 sites of
parked ported code, 62 of developer diagnostics, 26 of MUX port fidelity, and DEBUG.

Two of the removed blocks had rotted rather than merely gone cold: the HAS_NATIVE_IMPLICIT_POINTER_CAPTURE arm
calls UIElement.ReRoutePointerSequenceTo, a method that exists nowhere in the tree, so it could not have
compiled had the symbol ever been defined.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable) — not applicable: no reachable code changes, so no behaviour is available to test. Covered by the existing suites below.
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features) — not applicable, no public surface changes
  • 🖼️ Validated PR Screenshots Compare Test Run results — pending CI
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

Validation

  • SamplesApp.Skia.Generic (net10.0-desktop) builds clean, 0 errors / 0 warnings, after every commit.
  • Uno.UI.UnitTests: 4017 passing, unchanged across all five commits. The 12 failures are the known
    When_Gregorian_FixedDate* tests, which assume a UTC machine and are green on CI —
    Windows.Globalization.Calendar lives in src/Uno.UWP, which this branch does not touch.
  • dotnet format whitespace --verify-no-changes reports no violations on the changed files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PTBMNbcPLwzdYrtPzY8s9Z

github-actions Bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/solution-templates Categorizes an issue or PR as relevant to the solution template area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation kind/documentation platform/x11 🐧 Categorizes an issue or PR as relevant to X11 labels Aug 15, 2026

github-actions Bot commented Aug 15, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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


PR Review — refactor: Remove conditional branches no compilation can take

  • Load tools
  • Gather PR diff and key changed files
  • Review .claude/rules/ changes
  • Review src/ changes
  • Review specs/ changes
  • Post inline comments for findings
  • Update summary comment

Overall verdict: Ship (3 low-severity findings, all optional)

The methodology is rigorous and correctly applied. The three-input check — define set from MSBuild, shared-file exclusion, and configuration-dependent symbol protection — produces correct results, and the mid-stream correction (retaining WASM_SKIA, NETSTANDARD, WINUI, __ANDROID__ after discovering their sites are all in shared files) shows the guard working as designed. The cleanup is conservative in all the right places: DEBUG, feature flags, MUX annotations, parked ported code, and vendor-synced sources are all untouched.

The HAS_NATIVE_IMPLICIT_POINTER_CAPTURE removal is particularly well-verified: UIElement.ReRoutePointerSequenceTo does not exist anywhere in the tree (confirmed by search), so those branches were never compilable — removing the symbol definition from CrossTargetting.targets is the correct final step.

Findings (3 low, all cosmetic/documentation)

# Severity File Summary
1 Low CompositionObject.cs:69 Stray blank line at start of StartAnimation body after removing #if __APPLE_UIKIT__ block
2 Low CompositionObject.cs:340 Double blank line between members after removing the virtual StartAnimationCore
3 Low specs/058-dead-conditional-branches/spec.md:22 Shared-file count says "roughly 15" but implementation found 41; spec not updated to match

A fourth inline comment is left on code-style.md:39 — the existing wording "#if IS_UNIT_TESTS gates code per build flavor" doesn't communicate that the symbol is absent from Uno.UI's define set, which is exactly the condition this PR cleaned up. Suggested tightening to prevent the same mistake in new code.

No correctness, behavioural, or build-system issues found across the 5 new commits.

Comment thread .claude/rules/code-style.md Outdated

Copy link
Copy Markdown
Contributor

The build 227932 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 123

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Attributed_text_FontSize_Changing.png
    • CalendarView_Theming.png-dark
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
  • skia-windows-screenshots: 123 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • EmailManagerTests.png-dark
    • EmailManagerTests.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
    • Attributed_text_FontSize_Changing.png-dark
    • Attributed_text_FontSize_Changing.png
    • DisplayInformation.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Haptics.VibrationDevice.png-dark
    • Haptics.VibrationDevice.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • Contacts_Pick.png-dark
    • Contacts_Pick.png
    • ExpanderColorValidationPage.png-dark
    • ImageIconPage.png-dark

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 227933 has failed on Uno.UI - docs.

Copy link
Copy Markdown
Contributor

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

MartinZikmund force-pushed the dev/mazi/dead-conditional-branches branch from 3f70680 to a6c5583 Compare August 15, 2026 16:18

github-actions Bot commented Aug 15, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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


PR Review — refactor: Remove conditional branches no compilation can take

  • Load tools
  • Gather PR diff and analyze new commits
  • Review .claude/rules/ changes
  • Review src/ and specs/ changes
  • Post inline comments for findings
  • Update summary comment

Overall verdict: Ship (1 new low-severity cosmetic finding)

The five new commits (0f042b28 through a6c55835) are correct and safe. All three previous findings are fixed. The methodology continues to be applied rigorously — UNO_HAS_UIELEMENT_IMPLICIT_PINNING correctly stays defined in CrossTargetting.targets for iOS/tvOS and consumed by XamlFileGenerator, while its never-reachable branches in Uno.UI are removed. The non-existent UIElement.ReRoutePointerSequenceTo call is gone cleanly.

Verification of key changes

Change Verdict
HAS_NATIVE_IMPLICIT_POINTER_CAPTURE removal ✅ Zero remaining references in source tree — CrossTargetting.targets, Composition, and all of Uno.UI are clean
XAMARIN drop from Uno.UI.Composition.csproj ✅ Zero remaining XAMARIN refs in that project
Visual.generic.cs !__APPLE_UIKIT__ && !__SKIA__ && !__WASM__ && !__ANDROID__ && !NETFRAMEWORK → !__SKIA__ ✅ Correct — Uno.UI.Composition sets UnoRuntimeIdentifier=Skia, so __SKIA__ is always defined; all dropped terms were !false = true and don't affect the result
ScalarKeyFrameAnimation.cs !__APPLE_UIKIT__ guard removal ✅ Correct — Skia-only project, Apple UIKit never defined
Canvas.Layout.cs #elif !__NETSTD_REFERENCE__ && !IS_UNIT_TESTS → #else ✅ Correct — neither symbol is in Uno.UI's define set; file has no cross-project Compile Includes
InputManager.Pointers.cs dead ReRoutePointerSequenceTo call removal ✅ Correct — method never existed in the tree
UIElement.Pointers.cs unconditional ✅ Correct — !HAS_NATIVE_IMPLICIT_POINTER_CAPTURE was always true for Uno.UI
code-style.md update (committed in a6c55835) ✅ The new categorized table (parked ported code, developer diagnostics, MUX port fidelity, vendored, genuinely dead) is a clear improvement and prevents the same mistake in future sweeps

Findings

# Severity File Summary
1 Low InputManager.Pointers.cs:97 Stray blank line left after removing the HAS_NATIVE_IMPLICIT_POINTER_CAPTURE block — same pattern as those fixed in 03de8c23

Working-tree heads-up

The environment's working tree has unstaged changes in three .claude/rules/ files (.claude/rules/code-style.md, .claude/rules/build-system.md, .claude/rules/platform-targeting.md) that revert improvements committed in a6c55835. These are not part of the PR but could cause confusion if accidentally committed. Running git restore .claude/rules/ will discard them and restore the committed (improved) state.

github-actions Bot commented Aug 15, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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


PR Review — refactor: Remove conditional branches no compilation can take

  • Load tools
  • Gather PR diff and analyze new commits
  • Review .claude/rules/ changes
  • Review src/ and specs/ changes
  • Post inline comments for findings
  • Update summary comment

Overall verdict: Ship (1 cosmetic nit remaining)

Four commits added since the previous review cycle, all clean:

Commit What it does
a15bca1e Records spec 058 progress and two analysis pitfalls (UTF-8 BOM blind spot, always-true #elif)
03de8c23 Removes leftover blank lines in CompositionObject.cs — directly addresses prior findings 1 & 2
a6c55835 Corrects shared-file count (15 → 41) and tightens the IS_UNIT_TESTS rule — addresses prior findings 3 & 4; the deletion-safety table added to code-style.md is a useful bonus
81ada91a Fixes five markdownlint violations (MD028 in three files, MD049 in one) introduced earlier in the stack — should resolve the docs CI failure

Findings (1 low, cosmetic)

# Severity File Summary
1 Low InputManager.Pointers.cs:97 Stray blank line before closing } after removing #if HAS_NATIVE_IMPLICIT_POINTER_CAPTURE — same pattern as the two fixed in CompositionObject.cs by 03de8c23

The fix is a one-liner; a suggestion is attached to the inline comment. No correctness, behavioural, or build-system issues found in the new commits.

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

1 similar comment

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

The build 227950 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 126

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • DynamicFont.png
    • Focus_FocusVisual_Properties.png-dark
    • ImageBrushInList.png-dark
    • ImageBrushInList.png
    • Image_Margin_Large.png
    • Buttons.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • Gamepad_CurrentReading.png-dark
    • ExpanderColorValidationPage.png
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ImageIconPage.png-dark
  • skia-windows-screenshots: 126 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ContentPresenter_Template.png-dark
    • ContentPresenter_Template.png
    • DisplayInformation.png-dark
    • Dopes.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageSourceUrlMsAppDataScheme.png-dark
    • ImageSourceUrlMsAppDataScheme.png
    • ContentPresenter_NativeEmbedding_Android_FillType.png
    • DataTransferManager.png-dark
    • DataTransferManager.png
    • EllipsemaskingEllipseGrid.png-dark
    • Attributed_text_FontSize_Changing.png
    • ClipboardTests.png-dark
    • ButtonClippingTestsControl.png-dark
    • DropDownButtonPage.png-dark
    • EmailManagerTests.png-dark
    • DropDownButtonPage.png
    • EmailManagerTests.png
    • Examples.png

Copy link
Copy Markdown
Contributor

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

MartinZikmund and others added 5 commits August 26, 2026 08:34
Spec 058 estimated 'roughly 15' files shared between Uno.UI and other
projects; the sweep established 41, spanning Uno.UI.Composition,
Uno.UI.SourceGenerators, Uno.UI.Toolkit.Windows, the Skia runtimes and the
SamplesApp heads. The spec is the reference for future sweeps, so it carries
the measured number.

The code-style rule described IS_UNIT_TESTS as gating code per build flavor
without saying where it is valid. It is defined for Uno.UI.UnitTests and the
view-library helpers but absent from Uno.UI's define set, so an #if written
in Uno.UI source is dead on arrival.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
Three residues of the dead-branch removal: a blank line before the closing
brace in InputManager.Pointers.cs, a blank line at the top of the
TargetPropertyPath class body, and VirtualizingPanelLayout.Stub.cs, which the
IS_UNIT_TESTS removal left holding nothing but a UTF-8 BOM. Uno.UI.UnitTests
consumes Uno.UI through a ProjectReference rather than by globbing its sources,
so no compilation ever saw that file's contents.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015HhivECGyuqHTQ3J5gULjW
Uno.UI defines UNO_HAS_ENHANCED_LIFECYCLE unconditionally, so the
`#if !UNO_HAS_ENHANCED_LIFECYCLE` fallback for the removed native
targets could never compile. Removing it orphans the
Microsoft.UI.Xaml.Input using, which goes too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vgZ3cDuKKFqDCPDLpWSPu
The file carried two identical `#if !IS_UNIT_TESTS` guards and only
one was unwrapped. Both are always true for Uno.UI, which consumes
no IS_UNIT_TESTS define. The two doc comments describing the
scavenger as disabled under that symbol no longer match anything.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vgZ3cDuKKFqDCPDLpWSPu
Name the three projects that define IS_UNIT_TESTS and why the symbol
cannot reach Uno.UI source: they consume it via ProjectReference, so
it only applies to files they Compile-link.

Record that UNO_HAS_UIELEMENT_IMPLICIT_PINNING stays defined for
iOS/tvOS. XamlFileGenerator emits it into generated x:Bind code,
where it makes Bindings.Owner a WeakReference; only the Uno.UI sites
were dead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vgZ3cDuKKFqDCPDLpWSPu
MartinZikmund force-pushed the dev/mazi/dead-conditional-branches branch from 2915a0e to b34b008 Compare August 26, 2026 07:03

github-actions Bot commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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


PR Review — refactor: Remove conditional branches no compilation can take

  • Load tools
  • Investigate new commits since last review (0cf8cc62, c576c4ac, b34b0085)
  • Check UNO_HAS_ENHANCED_LIFECYCLE status
  • Check HAS_NATIVE_IMPLICIT_POINTER_CAPTURE in CrossTargetting.targets
  • Review code-style.md clarity
  • Post inline comments for findings
  • Update summary comment

Overall verdict: Ship (1 low-severity finding, new)

Three commits since the previous review (2026-08-25) directly address Xiaoy312's reviewer questions:

Commit What it does Verdict
0cf8cc62 Removes #if !UNO_HAS_ENHANCED_LIFECYCLE fallback from MenuFlyoutSubItem.mux.cs ✅ Correct — Uno.UI targets only NetSkiaPreviousAndCurrent, which always defines the symbol
c576c4ac Removes second #if !IS_UNIT_TESTS guard missed in the initial PagePool sweep ✅ Correct — dead for same reason as the first
b34b0085 Clarifies code-style.md by naming all three projects that define IS_UNIT_TESTS ✅ Addresses Xiaoy312's clarity concern; UNO_HAS_UIELEMENT_IMPLICIT_PINNING note in spec is accurate

HAS_NATIVE_IMPLICIT_POINTER_CAPTURE was already correctly removed from CrossTargetting.targets (iOS, tvOS, Android sections) in an earlier commit; no references remain in the tree.

Finding (1 low)

# Severity File Summary
1 Low SplitMenuFlyoutItem.mux.cs:26 Identical #if !UNO_HAS_ENHANCED_LIFECYCLE block (same body, same comment) as the one removed from MenuFlyoutSubItem.mux.cs in 0cf8cc62 — removal was half-applied; this file still carries the dead block

An inline suggestion is attached. Everything else is clean.

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

MartinZikmund and others added 2 commits August 26, 2026 09:39
Uno.UI defines UNO_HAS_ENHANCED_LIFECYCLE unconditionally, so every
`#if !UNO_HAS_ENHANCED_LIFECYCLE` block in it is code no compilation can
take. 0cf8cc6 removed one; these are the remaining three.

SplitMenuFlyoutItem carried the same OnProcessKeyboardAccelerators
fallback as MenuFlyoutSubItem, orphaning the Microsoft.UI.Xaml.Input
using with it. ViewManager called OnUnoBeforeElementPrepared, a method
not declared anywhere in the tree. CalendarViewBaseItem's `#else` arm
declared a parameterless EnterImpl() overload whose only caller was the
dead line in the Loaded handler, so the arm folded with the call.

The always-true `#if UNO_HAS_ENHANCED_LIFECYCLE` sites stay parked, and
the Uno.UI.RuntimeTests / SamplesApp sites are untouched — those compile
under WinAppSDK without the symbol, where the branches are live.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qzt3TUqSg3yqfwBWm3Tj4V
§4 noted a single exception taken during review. Three more sites turned
out to be dead the same way, so the note now lists all four with what
each guarded, states the always-false/always-true line the exception
follows, and records why the RuntimeTests and SamplesApp sites are live
rather than dead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qzt3TUqSg3yqfwBWm3Tj4V

github-actions Bot commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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


PR Review — refactor: Remove conditional branches no compilation can take

  • Load tools
  • Gather PR diff and analyze new commits (d6217968, 7919336f)
  • Verify OnUnoBeforeElementPrepared absent from tree
  • Check no remaining !UNO_HAS_ENHANCED_LIFECYCLE in Uno.UI
  • Review spec update
  • Post inline comments for findings
  • Update summary comment

Overall verdict: Ship (no findings)

Two commits since the previous review (2026-08-26T07:04), both correct and complete.

Commit What it does Verdict
d6217968 Removes the three remaining #if !UNO_HAS_ENHANCED_LIFECYCLE blocks in Uno.UI (SplitMenuFlyoutItem.mux.cs, Repeater/ViewManager.cs, CalendarViewBaseItem.h.cs + .cs) ✅ Correct — grep confirms OnUnoBeforeElementPrepared does not exist anywhere in the tree; CalendarViewBaseItem #if/#else folds cleanly to the UNO_HAS_ENHANCED_LIFECYCLE arm; SplitMenuFlyoutItem removes the orphaned using Microsoft.UI.Xaml.Input along with the block
7919336f Updates spec §4 to list all four removed sites, distinguishing the always-false sites (deleted) from the always-true sites (parked) and explaining why Uno.UI.RuntimeTests / SamplesApp sites are live ✅ Correct — accurately reflects the sweep

Verification

Check Result
grep !UNO_HAS_ENHANCED_LIFECYCLE src/Uno.UI/ --include="*.cs" ✅ Zero hits — sweep is complete
OnUnoBeforeElementPrepared anywhere in tree ✅ Zero hits — method never existed, block was never compilable
Remaining #if UNO_HAS_ENHANCED_LIFECYCLE (always-true) sites ℹ️ 5 files (DependencyObject.mux.cs, ThemingHelper.cs, ResourceDictionary.cs, Application.cs, UIElement.cs) — correctly left parked per §4
All prior findings ✅ Fixed in earlier commits and verified

The diff is clean and ready to merge. No new findings.

The note said the runtime-test sites were live and left it there, which
read as an endorsement. Native WinUI has enhanced lifecycle, so the six
sites that use the symbol unpaired put it on the legacy Uno path — four
skip a test there and two assert Uno's divergence against real WinUI.

Records the correct count (15 + 1, not 13), the ten correctly-paired
sites, and points at #24201 for the fix, which changes
what the WinUI test leg runs and so does not belong in this sweep.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qzt3TUqSg3yqfwBWm3Tj4V

github-actions Bot commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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


PR Review — refactor: Remove conditional branches no compilation can take

  • Load tools
  • Gather PR diff and analyze new commits
  • Review changed files
  • Post inline comments for findings
  • Update summary comment

Overall verdict: Ship (no findings)

One new commit since the previous review (9b0e7ea3 docs: Correct the WinUI enhanced-lifecycle note). It is correct and complete.

New commit — 9b0e7ea3

Spec §4's note on the enhanced-lifecycle runtime-test sites was previously accurate about them being "live, not dead" but stopped short — it implied endorsement without characterizing the 6 problematic sites. The correction:

Detail Result
Count corrected (13 → 15 + 1) ✅ Correct — 15 sites in Uno.UI.RuntimeTests, 1 in SamplesApp.Shared
10 correctly-paired sites identified ✅ Correct — paired with WINAPPSDK or !HAS_UNO so WinUI takes the enhanced path
6 incorrectly-bare sites identified ✅ Correct — WinUI has enhanced lifecycle; bare !UNO_HAS_ENHANCED_LIFECYCLE puts it on the legacy Uno path
Fix tracked in #24201 ✅ Appropriate — fixing these changes what WinUI test legs run, so it belongs in a separate PR
§1 input 2 check preserved ✅ None of the four affected files is shared with another project

Working-tree heads-up (environment only, not a PR issue)

The CI runner's working tree carries an unstaged modification to .claude/rules/code-style.md that reverts the improvements committed earlier in this branch. This is local runner state — the committed version (0cfb5fcf) carries the correct wording, and there is no action required on the PR itself.

The diff is clean and ready to merge. No new findings.

MartinZikmund and others added 2 commits August 26, 2026 10:26
Uno.UI builds UnoRuntimeIdentifier=Skia, which defines the flag, so all
three of its sites were constant.

Two had rotted past compiling: ContentPresenter.EnterImpl called
UpdateBorder() and CalendarViewBaseItem assigned _borderRenderer, and
neither is declared anywhere in the tree. Removing the latter left an
empty Loaded handler, so the subscription went with it. Border keeps
this.UpdateBackground() — a real IBorderInfoProvider extension — now
unwrapped.

With no reference left anywhere, the define and its documentation line
go from Uno.CrossTargetting.targets, the same end state
HAS_NATIVE_IMPLICIT_POINTER_CAPTURE reached in f629d38.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qzt3TUqSg3yqfwBWm3Tj4V
§4 said the feature flags were best handled one at a time by whoever
owns them. This one was small enough to finish, so the section now
records it as done rather than parked: the three sites and their
disposition, and the removal of the define itself.

Adds two distinctions the sweep surfaced. A flag whose dead side no
longer compiles is finished rather than parked — that is what separated
this one from its neighbours. And this flag was Skia-only, never defined
for WebAssembly, so it and UNO_HAS_ENHANCED_LIFECYCLE were not
interchangeable despite both reading as "the modern path".

Also notes, without fixing, the third dead UpdateBorder() call sitting
in a parked `#if !__SKIA__` arm in Border.cs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qzt3TUqSg3yqfwBWm3Tj4V

github-actions Bot commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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


PR Review — refactor: Remove conditional branches no compilation can take

  • Load tools
  • Check new commits since last review (713a8d53, 43019ec6)
  • Review changed files
  • Post inline comments for findings
  • Update summary comment

Overall verdict: Ship (no findings)

Two commits since the previous review (2026-08-26T08:16), both correct and complete.

Commit What it does Verdict
713a8d53 Retires UNO_HAS_BORDER_VISUAL — unwraps the always-true Border.cs site, deletes the two always-false sites that had rotted past compiling ✅ Correct
43019ec6 Records the retirement in spec §4 and updates §5 sequencing table ✅ Correct

Verification

Check Result
UNO_HAS_BORDER_VISUAL anywhere in tree ✅ Zero hits — define removed from CrossTargetting.targets, all three sites gone
_borderRenderer anywhere in Uno.UI ✅ Zero hits — field was never declared; the CalendarViewBaseItem block was dead
UpdateBorder() in ContentPresenter.cs ✅ Zero compilable call sites — commit removed the only one; remaining Border.cs:253 is inside a #if !__SKIA__ arm, correctly parked per §3 and noted in the new spec note
this.UpdateBackground() in Border.cs ✅ Real method — IBorderInfoProvider.UpdateBackground is defined in BorderHelper.cs
Shared-file guard (§1 input 2) ✅ None of the four changed files is Compile Included by another project
Skia-only vs WASM distinction ✅ Spec correctly notes UNO_HAS_BORDER_VISUAL was never defined for WebAssembly — distinct from UNO_HAS_ENHANCED_LIFECYCLE which covers both

No prior findings remain open. The diff is clean and ready to merge.

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

MartinZikmund and others added 2 commits August 26, 2026 10:58
The type-name sanitizer compared against a literal U+007F byte embedded
in the source, which is invisible in review and depends on the file
surviving an encoding round-trip. Spell it as an escape instead.

Carried over from #24087, which is otherwise already merged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vgZ3cDuKKFqDCPDLpWSPu
UNOB0020 was only exercised for an android head and only rejected for
browserwasm; it now runs for ios and tvos, and the negative case covers
desktop and an unset identifier. The selector tests claimed the assets
were untouched while asserting only the remove-lists.

PackageCacheFixture cleanup also tolerates UnauthorizedAccessException,
which Windows raises instead of IOException when a handle is still open.

Carried over from #24087, which is otherwise already merged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vgZ3cDuKKFqDCPDLpWSPu

github-actions Bot commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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


PR Review — refactor: Remove conditional branches no compilation can take

  • Load tools
  • Gather PR diff and analyze new commits (4931f3f3, 307a3521)
  • Review changed files
  • Post inline comments for findings
  • Update summary comment

Overall verdict: Ship (no findings)

Two commits since the previous review (2026-08-26T08:26), both correct and complete. Both are carried over from #24087.

Commit What it does Verdict
4931f3f3 Replaces a literal U+007F (DEL) byte embedded in the type-name sanitizer comparison with the explicit escape '\x7F' ✅ Correct — the literal byte is invisible in code review tools and fragile across encoding round-trips; the escape is unambiguous
307a3521 Expands UNOB0020 validator test to cover iOS and tvOS heads (was android-only); adds desktop and empty-identifier negative cases; adds missing ToAdd assertions to the selector tests; PackageCacheFixture.Dispose now catches UnauthorizedAccessException in addition to IOException ✅ Correct — the missing ToAdd assertions were a test gap (tests claimed assets were untouched but only checked remove-lists); Windows raises UnauthorizedAccessException when a file handle is still open, so the catch-all silencing is correct

Verification

Check Result
'\x7F' escape value ✅ U+007F is DEL — correct replacement
ResolvedCompileFileDefinitionsToAdd.Should().BeEmpty() added in two selector test cases ✅ Closes the assertion gap noted in the commit message
DataRow("ios", "net10.0-ios26.0") / ("tvos", "net10.0-tvos26.0") ✅ Consistent with the ios/tvos identifiers the new vocabulary uses (established in 8a333677)
DataRow("") empty identifier negative case ✅ Sensible — confirms UNOB0020 is suppressed when no UnoRuntimeIdentifier is set
All prior findings ✅ Unchanged — all previously confirmed correct removals remain correct

No prior findings remain open. The diff is clean and ready to merge.

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

The build 230306 found UI Test snapshots differences: skia-linux-screenshots: 73, skia-windows-screenshots: 208

Details
  • skia-linux-screenshots: 73 changed over 2366

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Buttons.png
    • DisplayInformation.png-dark
    • DisplayInformation.png
    • CalendarView_Theming.png-dark
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • ImageBrush_Stretch.png
    • Image_Margin_Large.png
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • DropDownButtonPage.png-dark
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • ImageBrushInList.png-dark
  • skia-windows-screenshots: 208 changed over 2368

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Attributed_text_FontSize_Changing.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • BitmapImage_vs_SvgImageSource.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • Grid_in_Canvas.png-dark
    • Grid_in_Canvas.png
    • Buttons.png
    • GetFocus.png-dark
    • GetFocus.png
    • Clipping652.png-dark
    • Clipping652.png
    • ContentPresenter_TextProperties.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Grid_ScrollViewer.png-dark
    • Grid_ScrollViewer.png
    • Attributed_text_FontSize_Changing.png-dark

MartinZikmund merged commit f8efe4d into feature/breakingchanges Aug 26, 2026
54 checks passed
MartinZikmund deleted the dev/mazi/dead-conditional-branches branch August 26, 2026 10:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/solution-templates Categorizes an issue or PR as relevant to the solution template 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 platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/x11 🐧 Categorizes an issue or PR as relevant to X11

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL