Repository navigation
feat: NavigationView update to latest WinUI sources - #21132
Conversation
NavigationViewItemPresenter update to latest WinUI sourcesNavigationView update to latest WinUI sources
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21132/docs/index.html |
2 similar comments
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21132/docs/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21132/docs/index.html |
2021fee to
aa02481
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21132/docs/index.html |
1 similar comment
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21132/docs/index.html |
|
|
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21132/docs/index.html |
|
|
0911934 to
8437f22
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21132/docs/index.html |
8437f22 to
294e010
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21132/docs/index.html |
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days. |
|
This PR was closed because it has been stalled for 10 days with no activity. |
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days. |
|
This PR was closed because it has been stalled for 10 days with no activity. |
294e010 to
3387da5
Compare
SettingsItem, NavigationViewItem.CompactPaneLength/MenuItems and NavigationViewTemplateSettings.OpenPaneLength are get-only in WinUI; NavigationViewSelectionChangedEventArgs is not activatable. Co-Authored-By: Claude Fable 5 <[email protected]>
- Use safe `as IElementFactoryShim` cast in NavigationViewItemsFactory - Replace stale Tapped-era chevron comment with current pointer flow - Resolve personal TODO notes in native-only deferred-state blocks Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Keep the `// TODO Uno:` convention for the native-Android deferred visual-state divergence; align the chevron and pointer-canceled comments with the WinUI source instead of dropping the markers. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Wrap the previously un-gated Uno-specific code so every deviation from the WinUI source is explicit: deferred pressed/over visual states, the Android back-button rule, ThemeShadow support checks, GetForCurrentViewSafe, the item revoker storage and the #4727 pane-header workaround. Modifications keep the exact WinUI original under #else. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Align the four CoerceToGreaterThanZero changed-callbacks with WinUI's generated memcmp guard (DoubleToInt64Bits), so small negatives in the (-0.1, 0) band set via SetValue coerce to 0 instead of slipping past the old Math.Abs(...) > 0.1 tolerance. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01KdpTap1i2v8UE7XDWYauXB
0665f2c to
3ab6c41
Compare
|
Claude finished @MartinZikmund's task in 3m 2s —— View job PR Review Complete
Overall VerdictThe two new commits are clean. The last open finding from prior reviews (bit-exact compare for pane-length DP coercion) is now fixed. No new issues found. New Commits
All Previously Flagged Issues — Final Status
The PR is clean. All review findings have been addressed or explicitly accepted with rationale. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21132/wasm-skia-net9/index.html |
OnNavigationViewItemInvoked carried a Uno-only block that called AnimateSelectionChanged a second time after UpdateSelectionModelSelection had already driven the full ChangeSelection -> AnimateSelectionChanged chain. WinUI animates once per invoke; the extra call re-entered the "same target" branch and reset the incoming indicator's opacity to 0, so it stayed invisible until the animation completed (it "popped in" instead of animating into the new item). Drop the block so the flow matches WinUI 1:1; collapsed/minimal cases are already handled by the shared CompletePendingSelectionChange / FindLowestLevelContainer path. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01KdpTap1i2v8UE7XDWYauXB
|
Claude finished @MartinZikmund's task in 1m 50s —— View job PR Review Complete
Overall VerdictThe latest commit ( What This Commit DoesRemoves a 20-line Chain verified:
Minor observation (non-blocking): The existing test All Previously Flagged Issues — Final Status
The PR is clean. All review findings have been addressed or explicitly accepted with rationale. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21132/wasm-skia-net9/index.html |
|
Claude finished @MartinZikmund's task in 1m 45s —— View job PR Review Complete
Overall VerdictThe latest commit ( What This Commit DoesChanges
Consistency: The commit message correctly identifies the broken invariant (parent-link not cleared on recycle because the cast failed), the root cause (WinUI/Uno All Previously Flagged Issues — Final Status
The PR is clean. All review findings have been addressed or explicitly accepted with rationale. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21132/wasm-skia-net9/index.html |
NavigationViewItemsFactory.UnlinkElementFromParent matched the recycled container's parent against the Panel class, ported from WinUI's try_as<Panel>(). In WinUI that is an interface query that succeeds on an ItemsRepeater because its implementation derives from DeriveFromPanelHelper_base (the public base stays FrameworkElement). Uno models that split as `ItemsRepeater : FrameworkElement, IPanel`, so the class check `is Panel` fails and the container is left parented to its source repeater. During a top-nav overflow selection the de-realized container (GetElementIndex == -1) then stays under the overflow repeater, so GetIndexPathForContainer indexes GetOverflowItems()[-1] and throws. Match IPanel (Panel implements it too) to unlink exactly like WinUI, as already done in RecyclePool. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01KdpTap1i2v8UE7XDWYauXB
15dc210 to
6efdaa9
Compare
|
Claude finished @MartinZikmund's task in 2m 15s —— View job PR Review Complete
Overall VerdictThe new commit ( What This Commit DoesAdds a 4-line explanatory comment above
Verified clean:
All Previously Flagged Issues — Final Status
The PR is clean. All review findings have been addressed or explicitly accepted with rationale. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21132/wasm-skia-net9/index.html |
|
|
|
Tick the box to add this pull request to the merge queue (same as
|
…ettled Rapid session switching under concurrent catalog load left the gray selection mask stranded on several rows at once, contradicting NavigationView's contract that the entire control shows no more than one selection indicator. WinUI documents the trigger: an item "that is currently selected and/or has focus where the move is achieved by a 'Remove' followed by an 'Add' will lose focus and no longer be selected", and prescribes INotifyCollectionChanged so a real Move action is delivered instead. Uno 6.6.x decomposes NotifyCollectionChangedAction.Move back into Remove+Add inside ItemsRepeater, so every reorder recycles a realized container. The recycle pool does not clear the selected flag and NavigationView's deselect of the previous item silently no-ops once it can no longer resolve that container, so one poisoned container keeps being handed to other rows and repainted selected. Fixed upstream by unoplatform/uno#21132, which is not in any released 6.6 line. Insert and remove are safe: for those actions the repeater only re-indexes the surviving realized elements. So the pane now holds already-rendered rows in place while a session activation is in flight or the catalog is still loading, appending newcomers instead of relocating anything, and converges to the full recency order once quiet. Nothing reads or writes control-owned selection state. Verified with a Skia desktop stress run (60 rounds of rapid switching against a 5ms catalog-churn pump, ~500 audits of the realized container tree): the pane never exceeds one selected container, and the same run reports two when the hold is disabled.
6.7 is the first stable line that contains unoplatform/uno#21132, which re-syncs NavigationView with the latest WinUI sources and fixes the container-recycling selection defect behind #171. 6.8 is not an option: NuGet only publishes 6.8.0-dev.* and global.json sets allowPrerelease: false. Uno.WinUI.Lottie is the only Uno package pinned explicitly, so it moves with the line (6.6.166 -> 6.7.103); the rest stay implicit Uno.Sdk versions. 6.7 also pulls in the transitive WebView2Aot package, whose WebView2.dll declares a top-level "WebView2" namespace. A namespace in the global namespace wins simple-name lookup over a using-imported type, so the bare name in XtermTerminalView stopped resolving to the XAML control (CS0118); name the control type in full. net10.0-desktop builds Release with 0 warnings and 0 errors and the Presentation.Core suite is green. net10.0-browserwasm still fails UNOWA0001 on this machine, unchanged from 6.6.29 - WasmNativeWorkloadAvailable is false on both SDK versions - so the WASM head needs CI to verify. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
6.7 is the first stable line that contains unoplatform/uno#21132, which re-syncs NavigationView with the latest WinUI sources and fixes the container-recycling selection defect behind #171. 6.8 is not an option: NuGet only publishes 6.8.0-dev.* and global.json sets allowPrerelease: false. Uno.WinUI.Lottie is the only Uno package pinned explicitly, so it moves with the line (6.6.166 -> 6.7.103); the rest stay implicit Uno.Sdk versions. 6.7 also pulls in the transitive WebView2Aot package, whose WebView2.dll declares a top-level "WebView2" namespace. A namespace in the global namespace wins simple-name lookup over a using-imported type, so the bare name in XtermTerminalView stopped resolving to the XAML control (CS0118); name the control type in full. net10.0-desktop builds Release with 0 warnings and 0 errors and the Presentation.Core suite is green. net10.0-browserwasm still fails UNOWA0001 on this machine, unchanged from 6.6.29 - WasmNativeWorkloadAvailable is false on both SDK versions - so the WASM head needs CI to verify. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
GitHub Issue: closes #21131, closes #19482, closes #8584, closes #20193, closes #20247, closes #20588, closes #20911
PR Type: ✨ Feature
What is the current behavior? 🤔
NavigationView/NavigationViewItemand their Fluent styles were ported from old WinUI sources (RS-era styles, MUX 1.7.3-era code). This drift caused several long-standing issues:NavigationView- Can't removeNavigationViewItem#8584).NavigationViewstate lost after successful navigation #20588).NavigationViewback button is misaligned #20911, WinUI Hamburger Button Cut Off #19482).What is the new behavior? 🚀
NavigationViewis aligned 1:1 with WinUI at microsoft-ui-xaml commitbac7a9c33— code, Fluent v2 styles, and the MUX reference headers.Parity review fixed additional transliteration defects on top of the straight port:
Remove→RemoveAtin top-nav overflow recovery.SerialDisposableauto-revoke for the title-bar andSplitViewcallbacks.ExpandedModeThresholdWidthcoercion.7 new runtime tests cover the fixed issues, validated on Skia Desktop (Win32).
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️
The sub-issues of #21054 were systematically triaged. Issues not closed by this PR, and why:
NavigationViewoverflow items disappear #5723 — top overflow: programmatic selection of an overflowed item still throwsArgumentOutOfRangeExceptioninGetIndexPathForContainer(stale repeater element index for moved containers); needs anItemsRepeater-side fix.NavigationView- ChangingCompactPaneLengththe Hamburger menu still visible #20199 — already fixed on master before this PR (verified at the merge-base).ItemsRepeaterOnElementPreparedis called afterNavigationViewItem.OnApplyTemplate#4689 —ElementPreparedordering is now correct on Skia, but the Uno-specific workarounds referencing it remain in code; closing belongs to the follow-up that removes them.NavigationViewItemdoes not contain a definition forUpdateResourceBindings#7279 / Smooth Animation inNavigationView#6320 /AutoSuggestBoxinNavigationViewdoes not collapse when hidden #11660 /MoveOwnershipToLayoutFromElementFactoryassert is failing withNavigationView#4691 / Enable moreNavigationViewruntime/UI tests #4769 — root causes are outside this PR's scope.