Repository navigation
feat(semanticzoom): add Skia support - #23943
morning4coffe-dev wants to merge 68 commits into
Conversation
Co-authored-by: Copilot <[email protected]>
Squashed from origin/dev/mazi/pending/scrollviewer. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
Claude finished @morning4coffe-dev's task in 6m 31s —— View job Code Review
Verdict: fix-first — one confirmed correctness bug and one systemic design issue around exception-and-state consistency. The rest of the port (async discipline, platform targeting, pragma scoping, event types, test structure) looks clean. 3 issues by severity:
Cross-cutting notes:
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23943/wasm-skia-net9/index.html |
|
The build 225350 found UI Test snapshots differences: Details
|
|
Claude finished @morning4coffe-dev's task in 5m 29s —— View job Code Review (re-review after sync)
Verdict: fix-first — one unresolved correctness issue from the previous round, one new style violation. Two prior findings were properly justified by WinUI source parity. Status of previous findings
Open unresolved issue (from previous review, still unaddressed)
New finding in this sync
Cross-cutting notes
|
|
Published Validation:
The |
WinAppSDK sync generator drift detected on
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23943/wasm-skia-net9/index.html |
|
The build 225404 found UI Test snapshots differences: Details
|
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23943/wasm-skia-net9/index.html |
|
Claude finished @morning4coffe-dev's task in 3m 19s —— View job Code Review (re-review after sync)
Verdict: ship — the two new commits are a clean root-cause fix plus the cleanup it enabled. No new issues found. What the new commits do
if (GetScrollOwner() is ScrollViewer)
{
return;
}I verified this guard is correctly scoped, not a blanket disable: The accompanying test update in
Cross-cutting notes
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23943/wasm-skia-net9/index.html |
|
Claude finished @morning4coffe-dev's task in 4m 41s —— View job Code Review (re-review after sync)
Verdict: ship — the three new commits close out the long-running keyboard-occlusion arrange/bring-into-view saga with a genuine simplification rather than another guard layer. No new issues found. What changed since the last review (
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23943/wasm-skia-net9/index.html |
|
The build 232643 found UI Test snapshots differences: Details
|
|
Final CI update for 7dda316: all 61 checks are successful (two neutral), the PR is mergeable, and all 39 review threads are resolved. The Android occlusion regression was fixed at its cause: the legacy presenter handler and source-ported ScrollViewer.MakeVisible had both processed the same bring-into-view request. The exact Android case and hosted Android/macOS runs now pass. Source repair is ready for maintainer review; no PR approval or merge was performed. |
WinUI's OnPointerWheelChanged disallows mouse zoom when the template has no ScrollViewer part; the null-propagating check allowed it instead. Also records why MakeStoryboardEssential and the ChangeViews content guard deviate from SemanticZoom_Partial.cpp.
|
Claude finished @morning4coffe-dev's task in 4m 19s —— View job Code Review (re-review after sync)
Verdict: ship — one confirmed correctness bug fix (with a null-propagation defect) landed cleanly, plus a legitimate root-cause fix for double bring-into-view handling, a simplification revert, and doc-only comment additions. No blocking issues. What changed since the last review (
|
| Commit | What it does | Assessment |
|---|---|---|
7b9c646b6 revert(inputpane) |
Reverts the multi-round InputPane.EnsureFocusedElementInViewPartial drift-compensation logic back to a plain focusedElement.StartBringIntoView() |
Sound simplification — resolves the fragility flagged across the prior 9-commit churn on this exact path by removing the speculative logic rather than patching it further |
3b9b86648 fix(scrollviewer) |
Adds if (GetScrollOwner() is ScrollViewer) return; guard in ScrollContentPresenter.OnBringIntoViewRequested (legacy ScrollPresenter-ported path), since the WinUI-ported ScrollViewer.OnBringIntoViewRequested now owns that handling and both firing double-scrolled the target |
Correct root-cause fix — confirmed ScrollViewer's own OnBringIntoViewRequested override exists (ScrollViewer.partial.mux.cs:2665) and would otherwise run alongside the presenter's legacy path on the same bubbling event. Updated Given_ScrollViewer.cs assertions (OriginalSource/TargetRect now reflecting ScrollViewer.MakeVisible re-origination) are consistent with the fix |
7dda3161e test(semanticzoom) |
Targets keyboard input ($d$_ctrl#...) at sut instead of the child zoomedInView/zoomedOutView |
Correct test-only fix, no functional change |
494fcbd67 chore |
Deletes a 24,826-line themeresources_v2.xaml that leaked back in via a master merge |
Verified this file was already untracked on master (f2477ed6e); re-removing it is correct cleanup, not a content regression |
3a2a12e71 fix(semanticzoom) |
Fixes m_tpScrollViewer?.ZoomMode != ZoomMode.Disabled → m_tpScrollViewer is { } scrollViewer && scrollViewer.ZoomMode != ZoomMode.Disabled |
Confirmed real bug: the null-conditional version evaluated to true when there's no ScrollViewer template part (null != ZoomMode.Disabled is true), incorrectly allowing mouse-wheel zoom instead of disallowing it per WinUI's OnPointerWheelChanged. One minor test-coverage gap flagged inline. Also adds two short, non-obvious-WHY comments documenting deviations (FrameworkElement-content assumption, MakeStoryboardEssential approximation) |
262cbc93c docs |
Adds 3 short comments explaining WinUI-parity gaps (m_disableScrollingPlaceholders no-op, header key-forwarding origin gate, GetScaleFactorForLayoutRounding gating) with no code change |
Comment-only, appropriately concise, explains non-obvious WHY per style rule |
Cross-cutting notes
- No
async void, no.Result/.GetAwaiter().GetResult(), noevent Action, no new#pragma warning disablewithout restore, no hand-edits toGenerated/files. - The
GetScrollOwner() is ScrollViewerguard inScrollContentPresenter.mux.csis unconditional (no#if __SKIA__), consistent with the architecture already established and validated in prior review rounds for this PR (Uno.UI's UI layer ships a single build;ScrollViewer's WinUI-port members are gated to__SKIA__internally, and CI across Android/iOS/WASM/Desktop has been green on this pattern throughout the PR) — not re-litigating that settled point here. - All prior open findings from earlier rounds remain resolved; nothing in this delta reintroduces them.
(branch:dev/doti/port-semanticzoom)
| // allow zooming using mouse in Win8 desktop apps. Phone does not have mouse in phone blue. | ||
| // in threshold mouse zoom is disabled by default. unless you enable zoom mode on the | ||
| // ScrollViewer | ||
| var shouldAllowMouseZoom = m_tpScrollViewer is { } scrollViewer && scrollViewer.ZoomMode != ZoomMode.Disabled; |
There was a problem hiding this comment.
Minor: no regression test for this fix.
Good catch on the null-propagation bug (m_tpScrollViewer?.ZoomMode != ZoomMode.Disabled evaluated to true when m_tpScrollViewer was null, incorrectly allowing wheel-zoom with no ScrollViewer template part). The fix is correct, but there's no runtime test asserting that mouse-wheel zoom is a no-op when the template omits the ScrollViewer part — worth adding one to Given_SemanticZoom.cs (e.g. a SemanticZoom with a custom/empty template lacking a "ScrollViewer"-named part, verify IsZoomedInViewActive doesn't change on mouse.WheelDown()/WheelUp() with Ctrl held) so a future refactor of this null-check doesn't silently regress.
|
The build 234951 found UI Test snapshots differences: Details
|
|
|
GetManipulationConfigurations pre-filled the bring-into-viewport output with the full configuration set, so an unloaded, content-less or disabled ScrollViewer claimed bring-into-viewport capability. WinUI clears the output up front and publishes the set only once every gate has passed.
MakeVisible treated a zero-width or zero-height rectangle as empty and bailed out. WinUI only skips the sentinel empty rect, and Rect.Intersect already yields Empty when the rectangles do not touch, so the extra test only dropped valid targets such as a not-yet-measured element. Also records why SetZoomFactor cannot use WinUI's if/else.
Uno.UI builds Skia-only, and the branch called ChangeViewNative, which no longer exists anywhere in the repository.
The test asserted defaults of a throwaway ScrollViewer instance, which say nothing about SemanticZoom and duplicated ScrollViewer's own coverage.
|
Claude finished @morning4coffe-dev's task in 2m 56s —— View job Code Review (re-review after sync)
Verdict: ship — all four new commits are clean, verified fixes/cleanups. No new issues found. What the new commits do
Cross-cutting notes
|
The animated branch fell through to the unanimated switch whenever ProcessInputMessage reported the key unhandled, so a request DManip had declined - during touch contact, or with no manipulation handler - still scrolled. WinUI ignores that outcome and never falls through. Measured on Skia desktop with a 200x200 ScrollViewer over 4000px of content: ScrollInDirection(Down, animate: true) moves 16px (one line delta) both with and without the fallback, so the direct-manipulation path already handles the key on its own.
|
Claude finished @morning4coffe-dev's task in 3m 12s —— View job Code Review (re-review after sync)
Verdict: ship — six new commits since the last review, all correct and well-justified. No new issues found; nothing from prior rounds regressed. What the new commits do
Cross-cutting notes
|
DMConfigurations, DMAlignment, DMOverpanMode, DMSnapCoordinate and DMMotionTypes were renumbered during the port, and DMAlignmentUnlockCenter arrived as an Unlocked member at a different bit alongside an unused Stretch member. Nothing depends on the numeric values today - every use is symbolic - but the types are documented as ports of DirectManipulationTypes.h, so literal WinUI constants would silently disagree.
|
Claude finished @morning4coffe-dev's task in 8m 19s —— View job Code Review (re-review after sync)
Verdict: ship — the six new commits are clean re-applications of previously-vetted fidelity fixes plus one safe cleanup. No new issues found. What changed since the last review (
|
|
The build 234994 found UI Test snapshots differences: Details
|
|
|
|
Hi @morning4coffe-dev 👋 This PR has merge conflicts with 🤖 AI-generated on Martin's behalf — tag @MartinZikmund if something needs a human. |
GitHub Issue: closes #5252
PR Type:
✨ Feature
What changed? 🚀
This ports
SemanticZoomto Uno's Skia targets and aligns its observable behavior with WinUI. It adds the control state machine, template lifecycle, automation peer behavior, andListViewBasezoomed-in and zoomed-out item mapping.It also ports the managed
ScrollViewerandScrollContentPresenterdirect-manipulation behavior that Semantic Zoom depends on — extent publication, zoom transitions and view-change sequencing.Still unported from
ScrollViewer_Partial.cpp/ScrollContentPresenter_Partial.cpp, and out of scope here: header support (top / left / top-left headers), gamepad navigation, zoom snap-point collection change handling, anchor-candidate registration, and the native DManip element plumbing.GetManipulationViewportandGetManipulationPrimaryContentare ported but have no caller yet — in WinUI the native DManip service calls them.Deliberate deviations from the WinUI sources, each commented at the call site:
ListViewBase.StartViewChangeTodoes not raise WinUI'sm_disableScrollingPlaceholders— Uno has no scrolling-placeholder pipeline (ShowsScrollingPlaceholdersis[NotImplemented]), so there is nothing to suppress during the transition.ListViewBaseHeaderItem.OnKeyDowndoes not callListViewBase.SetHandleKeyDownArgsFromItem— Uno'sListViewBase.TryHandleKeyDownhas no key-origin gate to feed.ScrollContentPresenter.SetZoomFactorkeeps two independentifs where WinUI usesif/else: Uno'sIsScrollClient()is also true for theManipulationDataProviderScrollInfobridge, whose provider still needs the zoom factor while the presenter owns the scroll data.SemanticZoom.MakeStoryboardEssentialapproximatesStoryboard::IsEssentialthroughEnableDependentAnimation.UIElement.GetScaleFactorForLayoutRoundinghas noIsManipulatable()gate; onlyScrollContentPresenterassigns the global factor, and only to the elements DManip manipulates.Breaking changes ❗
GroupItem.GetTemplatedItemsControl()moves frompublictointernal. It was an Uno-only compatibility shim that always returnednull; WinUI declares it as an implementation-only helper and omits it from MIDL. It is now implemented against theItemsControltemplate part, matchingGroupItem_Partial.cpp. Recorded inbuild/PackageDiffIgnore.xml.Validation
Given_SemanticZoom,Given_ScrollViewer,Given_ScrollViewer_Integration,Given_ScrollViewer_ZoomandGiven_ListViewBase— 240 passed, 0 failed (1 pre-existingAssert.Inconclusive).Fidelity review against
microsoft-ui-xamlat the pinned commit produced these corrections, all included here:ScrollViewer.GetManipulationConfigurationscleared the bring-into-viewport output before its gates, so an unloaded, content-less or disabledScrollViewerno longer claims bring-into-viewport capability.ScrollViewer.ScrollInDirectionno longer falls through to an unanimated scroll when direct manipulation declines an animated request, matching WinUI. Measured on Skia desktop: the animated call moves one line delta with or without the fallback.ScrollContentPresenter.MakeVisibleno longer treats a zero-sized rectangle as empty;Rect.Intersectalready yieldsEmptyfor rectangles that do not touch.SemanticZoom.OnPointerWheelChangedrequires aScrollViewertemplate part before allowing wheel zoom, as WinUI does.ChangeViewbranch that called a method no longer present in the repository.DirectManipulationenums (DMConfigurations,DMAlignment,DMOverpanMode,DMSnapCoordinate,DMMotionTypes), which had been renumbered. Every use is symbolic, so this changes no behavior.Reviewers should note one change that reaches beyond Semantic Zoom:
UIElement.Pointersnow assignsPointerRoutedEventArgs.GestureFollowing, which was never set before. Six existing consumers test it forRightTappedand were inert until now -ButtonBase,ComboBox,MenuFlyoutItem,Slider,CalendarDatePickerandScrollViewer- so a right-button release no longer invokes their pointer-up action. This matches WinUI, but it is not covered by the tests in this PR.PR Checklist ✅
Screenshots Compare Test Runresults.