Repository navigation
feat(listview): Port ListViewItemPresenter and GridViewItemPresenter chrome - #25389
Conversation
WinAppSDK sync generator drift detected on
|
WinAppSDK sync generator drift detected on
|
|
Ran the sync generator — no drift detected, nothing to commit. |
ae91d7e to
b7a59ca
Compare
|
Claude finished @MartinZikmund's task in 21s —— View job Review summary: ListViewItemPresenter / GridViewItemPresenter chrome portVerdict: no blocking issues found in the parts I checked. This was a targeted scan, not a line-by-line review of the ~18k added lines. Checked
Review-bot float-equality comments (
Cross-cutting items for the author
|
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
Ignored until #25754 is fixed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
InvalidateRender now marks the layers dirty, as WinUI's NWSetContentDirty does, and the next arrange rebuilds them once, or when the size changes. ChangeVisualState reads the cached rounded-chrome value. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
DragBackground, DragForeground, DragOpacity, FocusBorderBrush and FocusSecondaryBorderBrush have no reader while the drag visual and focus rectangle are parked. ListViewItem.TemplateSettings is live now that DragItemsCount updates. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
The implicit GridViewItem style is BasedOn DefaultGridViewItemStyle again, as in WinUI, so default GridView items render through the ListViewItemPresenter chrome and default to AllowDrop=True. The Fluent GridViewItemExpanded is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
The chrome ships in 7.1, so describe it with ListViewBase rather than as a 7.0 migration step, now including GridView's default style. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N
Ports microsoft-ui-xaml#12402: measure and the pointer-over/pressed selected states recreate the indicator when the item is still selected. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N
- Rebuild the chrome layers on every presenter property change, like WinUI's NWSetContentDirty flag. - Keep drawing the Overlay state ring on keyboard focus until the focus visual takes it through CustomizeFocusRectangle (#25923). - Stroke focus rectangles with any brush, as WinUI's static_cast does. - Treat AcrylicBrush like WinUI, and connect other composition brushes before checking their CompositionBrush. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N
WinUI flyouts size and place themselves for the last input device. The touch injected here stayed the last input on WinAppSDK, where the harness can't inject a mouse move to restore it, so Verify_MenuBarItem_Bounds failed later in the run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N
On a slow agent the slide could finish between two polls. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N
Both baselines are winui3/release/2.5.1, the tag every MUX Reference header names; detection against 2.6.5 reports both areas up to date. The shared ListViewBaseItem chrome lives in the ListViewItemPresenter area, so the two areas share no files. The LVI/GVI theme resources are verbatim copies of CommonStyles, so they are mirrored. The seed script's theme lookup keys off the _Partial names (ListViewItemPresenter_themeresources.xaml) and does not find them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzpwqXiaSHwvb2y5UA
A container DragStarting handler that cancels, even after a deferral, gets no DropCompleted, so the list kept its primary dragged container, drag count and visual states. Clean up like WinUI's wasCanceled path. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzpwqXiaSHwvb2y5UA
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzpwqXiaSHwvb2y5UA
A Style value set under a Local one went through the method call and replaced the backing field, though the store kept Local as highest. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzpwqXiaSHwvb2y5UA
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzpwqXiaSHwvb2y5UA
Clearing a presenter alias left its forwarded value on the ContentPresenter property. Track the forwarded precedence and clear it when the alias reverts, as WinUI's single-slot target replaces it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzpwqXiaSHwvb2y5UA
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzpwqXiaSHwvb2y5UA
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Claude finished @MartinZikmund's task in 16s —— View job Review summary: ListViewItemPresenter / GridViewItemPresenter chrome portVerdict: ship after fresh evidence. This is a summary pass only. I did not read the ~19k-line diff, build, or run anything. It rests on the PR description and the existing review threads, so it is not an inspection or runtime validation of the current head. I posted no inline comments because I found no new defect. Closed in the threads (per the author's replies)
Still worth confirming (not re-verified)
Before merge
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
GitHub Issue: closes #1444, closes #19707, closes #17231
PR Type:
✨ Feature
What changed? 🚀
ListView/GridView items on Skia used to render their chrome through the
ListViewItemExpanded/GridViewItemExpandedtemplates: a full tree of Grids, Rectangles, Borders and VisualStates per container, which differed visually from WinUI and cost a lot per item. This PR is a 1:1 port of the WinUI 2.5.1ListViewItemPresenter/GridViewItemPresenterchrome, and the default FluentListViewItemstyle now uses it, matching WinUI's template.Targets 7.1. This is not a 7.0 change, so the notes moved out of the 7.0 migration guide into
controls/ListViewBase.md. GridView uses the presenter by default too: the implicitGridViewItemstyle isBasedOn="{StaticResource DefaultGridViewItemStyle}"as in WinUI, and the Uno-only FluentGridViewItemExpandedis removed. This absorbs #25925.Depends on #25921. The ContentPresenter measure-time
OnApplyTemplatecommit was split out there at review request. It stays here until #25921 merges, then drops out on rebase.ListViewBaseItemPresenter,ListViewBaseItemandListViewBaseItemTemplateSettings, as in WinUI.ListViewItemPresenter/GridViewItemPresenterproperties, including the rounded-chrome flag.ListViewBaseItemvisual state machine and its wiring intoListViewBaseinteraction state (pointer over, pressed, selection, focus, drag and reorder).ThemeGeneratorHelper, reorder and drag animations, and the selection-indicator animation.ContentPresenterTransitionTargetCSizeUtilzero clampingwinui3/mainas of 2026-11-13. The one chrome change since the port, Fix selection indicator lifetime across popup reconnection microsoft/microsoft-ui-xaml#12402 (a selected item whose indicator was dropped gets it back on measure or on a pointer-over/pressed selected state), is ported. The other upstream deltas don't apply here: theListViewBaseItem::OnPointerReleasedchange needsAutomaticDragHelper, which isn't ported, and theListViewBasetelemetry and selection-focus changes belong with the ListView port that follows this PR.BorderVisualpath rebuilds no longer defeat picture collapse (GridView scroll ~50 → ~106 fps)Performance (SamplesApp harness, Win32 Skia, Release, this branch vs its merge-base on master, 3 rounds, null-copy noise check)
Single selection now runs WinUI's selection-indicator animation (~170 ms), which is a visible behavior change and not a regression.
GridView. The presenter element carries 41
{ThemeResource}and 9{TemplateBinding}attributes per container. On GridViewItem that replaces only 5 template elements, so GridView got slower. This PR now reuses the chrome's hover and selection borders. The rest is fixed by general mechanism PRs, each of which also helps other controls:{ThemeResource}allocation cutsThe GridView default no longer waits for these PRs; they still improve it as they merge. GridView with all of them stacked, vs master (3 rounds, null-copy check):
Why the multiple-selection rows can't match master. Master's GridViewItem default template has an empty
MultiSelectEnabledstate, so master shows no check boxes in multiple selection mode. This PR draws WinUI's overlay check box on every item, which master never renders, lays out or updates on selection.Not in this PR
These are parked on purpose:
CustomizeFocusRectangleis ported but not wired, and dotted-line focus is missing.FocusBorderBrushandFocusSecondaryBorderBrushstay[Uno.NotImplemented]; tracked in Port the ListViewItemPresenter/GridViewItemPresenter focus rectangle (FocusBorderBrush, FocusSecondaryBorderBrush) #25923.SetDragVisualCapturedand the dragged/placeholder states.DragBackground,DragForegroundandDragOpacitystay[Uno.NotImplemented]; tracked in Port the ListViewItemPresenter/GridViewItemPresenter drag visual (DragBackground, DragForeground, DragOpacity) #25922.PointerDownThemeAnimationandPointerUpThemeAnimationare unimplemented stubs in Uno. WinUI builds them fromPointerAnimationUsingKeyFramesover aPlaneProjection, which Uno has no support for. Only the non-rounded chrome uses them, and the default Fluent styles use the rounded chrome.Until #25923 wires
CustomizeFocusRectangle, the non-rounded Overlay chrome keeps drawing its selection/pointer-over ring on a keyboard-focused item, so the state stays visible. In WinUI the focus visual draws that ring instead.Known gap:
When_UpdateLayout_In_DragDropping_Content_AllowDropkeeps master's scenario (AllowDropon the item content) but is[Ignore]d. This PR's drag path now runs into #25754, a bug master already has.PR Checklist ✅
Screenshots Compare Test Runresults.Behavior changes in 7.1 (documented in
controls/ListViewBase.md):GridViewItemExpandedis removed, as WinUI has none, so{StaticResource GridViewItemExpanded}resolves to the older non-Fluent copy inGeneric.xaml.GridViewItemdefaults toAllowDrop="True", as in WinUI.ListViewItemExpandedstyle still ships and can be set explicitly asItemContainerStyle.ListViewItemPresenter/GridViewItemPresentermust be the template root.<Grid><ListViewItemPresenter/></Grid>now throws during measure, as in WinUI.AllowDrop="True", the item marksDragOverhandled, as in WinUI. PlainDragOverhandlers on the list don't run there, and built-in reordering only happens over the item's edge zones.🤖 Generated with Claude Code
https://claude.ai/code/session_01NL1zD4nmcDjrcPhceNXFNm
https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
https://claude.ai/code/session_01TXMNtydz1T8BfF5rA6Ft9N