Repository navigation
feat: Frame navigation transitions - #22450
MartinZikmund wants to merge 46 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Implements WinUI-style NavigationTransitionInfo-based page navigation animations for Frame, along with a manual sample to exercise the different transition types.
Changes:
- Extend the
NavigationTransitionInfohierarchy with concrete implementations (EntranceNavigationTransitionInfo,DrillInNavigationTransitionInfo,SlideNavigationTransitionInfo,ContinuumNavigationTransitionInfo,CommonNavigationTransitionInfo,SuppressNavigationTransitionInfo) that generate appropriateStoryboards based on navigation direction. - Wire up
NavigationThemeTransitionto pages/frames so thatFramenavigations can use these transitions (including overrides viaFrame.Navigate/GoBackand transition collections). - Add a new sample (
NavigationTransitionSampleand three colored pages) to manually validate the various navigation transitions.
Reviewed changes
Copilot reviewed 20 out of 23 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
src/Uno.UI/UI/Xaml/Media/Animation/Transition.cs |
Makes AttachToElement/DetachFromElement virtual so NavigationThemeTransition can customize attach/detach behavior for pages. |
src/Uno.UI/UI/Xaml/Media/Animation/SuppressNavigationTransitionInfo.cs |
Converts to file‑scoped namespace and implements CreateStoryboardsCore to return an empty storyboard list, effectively disabling navigation animations when used. |
src/Uno.UI/UI/Xaml/Media/Animation/SlideNavigationTransitionInfo.cs |
Implements slide navigation animations (horizontal and vertical) driven by NavigationTrigger, with an Effect DP selecting direction and storyboard generation for enter/exit/back navigations. |
src/Uno.UI/UI/Xaml/Media/Animation/NavigationTrigger.cs |
Introduces an internal enum expressing the four navigation directions (forward/back, to/away) used by all NavigationTransitionInfo subclasses. |
src/Uno.UI/UI/Xaml/Media/Animation/NavigationTransitionInfo.cs |
Adds the CreateStoryboards internal API and a virtual CreateStoryboardsCore hook for transition types to provide platform‑agnostic Storyboards. |
src/Uno.UI/UI/Xaml/Media/Animation/NavigationThemeTransition.mux.cs |
Implements the WinUI‑style behavior for NavigationThemeTransition: selects the effective NavigationTransitionInfo (frame override, page, frame transitions, default, or entrance), maps navigation direction to NavigationTrigger, and invokes the transition’s CreateStoryboards(...). |
src/Uno.UI/UI/Xaml/Media/Animation/NavigationThemeTransition.cs |
Adds WinUI headers and a simple constructor, keeping NavigationThemeTransition as a XAML‑usable transition with DefaultNavigationTransitionInfo as content property. |
src/Uno.UI/UI/Xaml/Media/Animation/EntranceNavigationTransitionInfo.cs |
Reworks this type to generate entrance/exit storyboards based on NavigationTrigger, supports IsTargetElement attached property for targeting a specific descendant, and tracks target elements via weak references. |
src/Uno.UI/UI/Xaml/Media/Animation/DrillInNavigationTransitionInfo.cs |
Implements drill‑in navigation animations using scale + opacity storyboards tuned for forward/back enter/exit directions. |
src/Uno.UI/UI/Xaml/Media/Animation/ContinuumNavigationTransitionInfo.cs |
Adds a continuum‑style transition with attached properties (IsEntranceElement, IsExitElement, ExitElement, ExitElementContainer) and generates simplified scale/opacity animations for marked elements and the page. |
src/Uno.UI/UI/Xaml/Media/Animation/CommonNavigationTransitionInfo.cs |
Implements the common navigation transition (turnstile‑like) with optional staggering via IsStaggeringEnabled and IsStaggerElement attached property, producing main page and staggered child animations. |
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Media.Animation/SlideNavigationTransitionInfo.cs |
Switches the generated Effect/EffectProperty stubs behind #if false, delegating to the real implementation in SlideNavigationTransitionInfo.cs on supported targets. |
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Media.Animation/NavigationThemeTransition.cs |
Disables the generated DefaultNavigationTransitionInfo stubs (via #if false) so the partial implementation in NavigationThemeTransition.mux.cs is the active one. |
src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Media.Animation/ContinuumNavigationTransitionInfo.cs |
Marks generated members as implemented in the hand‑written ContinuumNavigationTransitionInfo (getters/attached properties/ctor) and prevents duplicate declarations. |
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/Animation/NavigationTransitionSample.xaml.cs |
Adds a manual sample page that hosts a Frame and lets the user navigate between three pages using different NavigationTransitionInfo instances (DrillIn, Slide variants, Entrance, Common, Continuum, Suppress). |
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/Animation/NavigationTransitionSample.xaml |
Declares the sample UI: transition selector ComboBox, navigation buttons, and a Frame whose ContentTransitions include a NavigationThemeTransition. |
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/Animation/NavigationTransitionPage1.xaml.cs |
Code‑behind for the blue sample page, just initializing its XAML. |
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/Animation/NavigationTransitionPage1.xaml |
Defines the “Blue Page” sample content (title + subtitle) for the navigation demo. |
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/Animation/NavigationTransitionPage2.xaml.cs |
Code‑behind for the green sample page. |
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/Animation/NavigationTransitionPage2.xaml |
Defines the “Green Page” sample content used by the navigation sample. |
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/Animation/NavigationTransitionPage3.xaml.cs |
Code‑behind for the orange sample page. |
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/Animation/NavigationTransitionPage3.xaml |
Defines the “Orange Page” sample content used by the navigation sample. |
src/SamplesApp/UITests.Shared/UITests.Shared.projitems |
Includes the new navigation transition sample pages and code‑behind in the samples project build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Can't wait to have this implemented! Good work! 🚀 |
b76da87 to
ad58956
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22450/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 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. |
ad58956 to
a21ee85
Compare
|
Claude finished @MartinZikmund's task in 4m 15s —— View job Code Review: Frame Navigation TransitionsTasks:
This PR implements WinUI-compatible Critical:
|
WinAppSDK sync generator drift detected on
|
|
Claude finished @MartinZikmund's task in 4m 26s —— View job Code Review: Frame Navigation TransitionsTasks:
SummaryThe API surface and animation timing constants closely match WinUI, and the Storyboard-based fallback approach is a reasonable choice for Skia. However, there are several correctness issues that affect user-facing behavior. Validation note: This review is code-inspection only — no runtime validation was performed. Issues by severityCritical (3)
Significant (1)
Minor (3)
|
WinAppSDK sync generator drift detected on
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242649 found UI Test snapshots differences: Details
|
|
|
|
/apply-sync-gen |
|
Pushed GitHub does not re-trigger workflows for commits pushed by the default bot, so the WinAppSDK Sync Generator Check will not automatically re-run. To turn it green, push any additional commit (for example |
|
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242778 found UI Test snapshots differences: Details
|
|
|
GitHub Issue: closes #252
PR Type: ✨ Feature
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️