Repository navigation
Spec 066 layer 2: compositor-only implicit transitions - #1661
Alexandre Zollinger Chohfi (azchohfi) wants to merge 21 commits into
Conversation
The four .XxxTransition() modifiers no longer set WinUI's XAML transitions, which blocked the handoff (#1623). Opacity, Scale and Rotation become implicit keys with the XAML curve (0.8,0,0.2,1) and the Components mask, and TranslationTransition a write-time animation of .Translation() writes through ResolvePolicy. The transitions honour the system's Animation effects setting, apply before setters on update, and take the visual even with animations off. A dropped BackgroundTransition is cleared, and the pool clears BackgroundTransition and user-written XAML transitions (#1624, #1626). A DiagnosticLog warning names the modifier when WinUI rejects a setter's facade write or a user facade blocks the handoff (spec 066 §9). The transitions join VisualOwningModifiers, ForMount demand and REACTOR_ANIM_004's advice and code fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Resolve .Animate() per channel across the decorator chain, so an outer declaration that excludes a channel doesn't hide an inner one. - Move a setter's facade Translation onto the visual when an update drops the last transition too. - REACTOR_ANIM_004: offer the Vector3 transition fix only for a value the compiler proves non-null, and advise removing a write that clears one. - Force animations on in the fixtures that check transition keys, and cover the masked Scale key and the replaced-control transition path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…anes' into azchohfi-spec-066-layer-2-compositor-transitions
…anes' into azchohfi-spec-066-layer-2-compositor-transitions
There was a problem hiding this comment.
🟡 Changes recommended
A replacement update can throw before a valid control mounts, while animation lookup and analyzer fixes also introduce behavior regressions.
4 open issues
What changed in this PR
Implements spec 066 layer 2 by moving Reactor’s implicit transitions onto the composition visual, allowing them to coexist with other compositor features and addressing transition cleanup issues.
Changes:
- Adds compositor transition timing, axis masks, reduced-motion handling, and per-channel
.Animate()precedence. - Updates reconciliation ordering, pool cleanup, and facade-conflict diagnostics and code fixes.
- Adds regression coverage and synchronizes the specification, generated guides, and changelog.
| File | Description |
|---|---|
| tests/Reactor.Tests/ElementPoolLaneTests.cs | Checks transition-driven visual-lane demand. |
| tests/Reactor.Tests/Animation/TransitionPolicyTests.cs | Tests timing, masks, and animation precedence. |
| tests/Reactor.Tests/AnalyzerTests/ModifierUnsetClearValueTests.cs | Recognizes null resets for XAML transitions. |
| tests/Reactor.Tests/AnalyzerTests/FacadeTransformSetAnalyzerTests.cs | Tests transition advice and code fixes. |
| tests/Reactor.AppTests.Host/SelfTest/SelfTestFixtureRegistry.cs | Registers new and renamed fixtures. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/RotationUnitsFixture.cs | Enables motion and updates fallback commentary. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/PoolLaneFixtures.cs | Tests transition cleanup and lane reuse. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/PooledFacadeTransformFixtures.cs | Updates visual-ownership expectations. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/ModifierEventFixtures.cs | Checks compositor keys and Translation claims. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/ImplicitAnimationSlotsFixtures.cs | Extends removal, replacement, and setter coverage. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/DslExtensionFixtures.cs | Checks compositor-backed opacity transitions. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/CompositorTransitionFixtures.cs | Covers combinations, motion policy, ordering, and diagnostics. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/AnimationCombinationTests.cs | Enables motion for transition-key assertions. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/AnimateModifierTests.cs | Enables motion for transition tests. |
| src/Reactor/Core/Reconciler.Update.cs | Applies transition policy before update-time writes. |
| src/Reactor/Core/Reconciler.cs | Adds visual demand, transition handling, and setter diagnostics. |
| src/Reactor/Core/ElementPool.cs | Clears transition residue during pool reset. |
| src/Reactor/Animation/ImplicitAnimationSlots.cs | Publishes compositor transitions and tracks Translation claims. |
| src/Reactor/Animation/FacadeConflictDiagnostic.cs | Reports rejected facade writes and blocked handoffs. |
| src/Reactor/Animation/AnimationHelper.cs | Implements transition curves, masks, and channel-aware policy. |
| src/Reactor.Analyzers/ModifierTable.cs | Marks four transitions as visual-owning modifiers. |
| src/Reactor.Analyzers/FacadeTransformSetCodeFix.cs | Supports transition modifier arguments. |
| src/Reactor.Analyzers/FacadeTransformSetAnalyzer.cs | Adds transition advice and guarded rewrites. |
| src/Reactor.Analyzers/AnalyzerReleases.Unshipped.md | Records expanded diagnostic fixes. |
| plugins/reactor/skills/reactor-build-and-check/SKILL.md | Updates shipped diagnostic guidance. |
| docs/specs/066-transforms-on-composition-visual.md | Records layer 2 behavior and validation. |
| docs/guide/element-pool.md | Regenerates lane and cleanup documentation. |
| docs/guide/animation.md | Documents compositor transition behavior. |
| docs/guide/animation-pipeline.md | Updates ownership, precedence, and ordering guidance. |
| docs/guide/analyzer-architecture.md | Documents expanded transition fixes. |
| docs/_pipeline/templates/element-pool.md.dt | Updates pool documentation source. |
| docs/_pipeline/templates/animation.md.dt | Adds transition semantics and readback guidance. |
| docs/_pipeline/templates/animation-pipeline.md.dt | Replaces fallback caveats with compositor behavior. |
| docs/_pipeline/templates/analyzer-architecture.md.dt | Updates analyzer documentation source. |
| CHANGELOG.md | Records behavior changes and transition fixes. |
Review effort: Balanced
📦 Build metricsArtifact sizes for Packages (compressed .nupkg)
Assemblies in Microsoft.UI.Reactor
Assemblies in Microsoft.UI.Reactor.Advanced
Assemblies in Microsoft.UI.Reactor.Devtools
✅ smaller / |
🧪 Merged coverageCoverage for
✅ higher / |
- Resolve a channel's .Animate() from the shared-target chain root first, so an inner layer's write finds an outer declaration. - Let a decorator replace a control whose visual user code blocked: the early transition policy defers to the replacement. - REACTOR_ANIM_004: decline a duration with a target-typed default or null, and unwrap mixed parentheses and suppressions when detecting a cleared transition. - Skip the warning oracle under NativeAOT, where EventListener callbacks don't flow. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Active issues allow null-suppressed transition values to be incorrectly rewritten and cause animation channel lookup to miss the middle layer in a three-layer SlotsForwarder chain.
2 open issues
4 resolved since last review
Review effort: Balanced
…anes' into azchohfi-spec-066-layer-2-compositor-transitions
- Resolve a channel's .Animate() declaration over the whole shared-target chain, through handler source targets and the recorded shared-control edges, as FindRemainingModifierOwner does. - REACTOR_ANIM_004: a '!' suppression doesn't prove a Vector3 transition non-null, so it gets no fix. - Clear BackgroundTransition on a pooled Border as well, once for both lanes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…anes' into azchohfi-spec-066-layer-2-compositor-transitions
There was a problem hiding this comment.
🟡 Changes recommended
Removing .Stagger() leaves a cached delay on child opacity animations with unchanged duration, so later opacity changes retain the removed stagger delay and need a fix with regression coverage.
1 open issue
2 resolved since last review
Review effort: Balanced
Rebuild a cached transition key that carries a .Stagger() delay, so a removed stagger's delay doesn't stay on the child's key. A parent re-applies its delays after its children update, as it did when every render built a fresh key. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The change removes active stagger delays before child opacity or scale updates, causing those transitions to start without staggering; restoring delays afterward does not fix animations already running.
1 open issue
1 resolved since last review
Review effort: Balanced
Keep a child's transition key, with its .Stagger() delay, across renders so a write under an active stagger starts staggered, carry the delay over when the timing changes, and clear the children's delays before they update when the parent drops .Stagger(). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The enter .Transition() writes its start value straight to the visual, which fired an implicit key on the same channel (a transition, or .Animate()), so the enter started from where the element already was. The enter's start writes and the exit's reset writes now run with the implicit collection suspended. Transforms matrix rules: #1623 no longer has disagreements to attribute. The #1651 and #1660 keyframe-opacity rules widen to every transition, which now reaches those cases, and the keyed-Memo exit gap gets its own issue (#1663). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ansitions # Conflicts: # src/Reactor/Core/Reconciler.Update.cs # tests/Reactor.AppTests.Host/SelfTest/Fixtures/ImplicitAnimationSlotsFixtures.cs # tests/Reactor.AppTests.Host/SelfTest/SelfTestFixtureRegistry.cs
Hosted record run 44921900403 on b3220cb, 0 failures. Every change from layer 3's ledger is declared with the §9 row it introduces or the issue it fixes. The @soak xaml counts (the OpacityTransition and BackgroundTransition leaks layer 3 recorded as residue) are now 0. Also regenerates docs/guide/element-pool.md for layer 3's snippet change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ansitions # Conflicts: # tests/Reactor.AppTests.Host/SelfTest/Baselines/transforms-ledger.expected.json
There was a problem hiding this comment.
🟡 Changes recommended
Stagger updates can use stale or missing delays and clear unrelated animation delays, while nested animation-only layers can cause translation changes to jump instead of animate.
3 open issues
1 resolved since last review
Review effort: Balanced
A child's transition key kept the delay from the previous render until the parent re-applied delays after its children updated, so a write in an update under a changed .Stagger(), after a reorder, or on a key published in that update started with the old delay or none. The parent now publishes its new children while they reconcile, and each child records its delay at its new position before its transition policy and writes; a newly published key takes it. Dropping the stagger resets only the channels stagger delays. Also adds a regression for an outer-layer Translation write resolving a middle forwarder's .Animate(Offset). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Stagger delay handling misidentifies repeated siblings and fails to match wrapped children, causing incorrect transition timing, while repeated reference scans add quadratic reconciliation work.
2 open issues
3 resolved since last review
Review effort: Balanced
Searching the parent's new children by reference missed a child wrapped in a ModifiedElement (each layer sees its unwrapped element) and gave repeated sibling records the first match's delay, with a scan per child. Child reconciliation now passes each updated child's new index, which every layer of that child sees. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Translation.Rotation.Animate (user=TranslationDrag) reads its change-step Translation curve as 0.2 or 0.0 across runs: layer 3's record and the compare on 66a3376 saw 0.2, the layer 2 record saw 0.0. The facade drag races the sample. Keep 0.2 so the ledger matches the base there. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because implicit opacity transitions can leave incoming navigation pages visible during exit delays, while keyed child indexing can start animations with incorrect stagger delays.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
.OpacityTransition() is now a key on the visual (spec 066 §5), so a page root declaring it faded the navigation's own writes: the connected animation's hide of the incoming page, the shared-element page swap and the reset after a transition. Those writes now run with the implicit collection suspended. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The page transitions write their start Offset and Scale straight to the incoming page's visual before starting their animation. A page root with .ScaleTransition() (now a key on the visual) or .LayoutAnimation() fired an implicit animation from those writes, so the explicit animation started from an in-flight value. They now run with the implicit collection suspended, as the opacity writes do. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


Summary
Spec 066 layer 2.
.OpacityTransition(),.ScaleTransition(),.RotationTransition()and.TranslationTransition()no longer set WinUI's XAML transitions, which blocked the composition visual and made every combination with.LayoutAnimation(),.Animate(),.Transition(),.InteractionStates()or.Keyframes()throw (#1623). They run on the visual and match WinUI's own transitions:ImplicitAnimationSlotskeeps a key-less claim andAnimationHelper.ResolvePolicy(formerlyResolveCurve) eases Reactor's.Translation()writes, with the mask (§5.3). It animates.Translation()changes and no longer layout moves..BackgroundTransition()clears it, and both pool lanes clear a panel'sBackgroundTransition([Bug] ElementPool doesn't reset UIElement implicit transitions on return, so they leak to the next renter #1624, the Background arm of [Bug] Removing .OpacityTransition()/.ScaleTransition()/.RotationTransition() never clears the transition #1626). A.Set-written XAML transition is nulled in the plain lane, and itsRenderTransformlock then drops the control. The Return fast-path check moved into that catch-and-drop path (§7.4).DiagnosticLog.Warningnames the modifier to use when WinUI rejects a setter's facade write after the handoff, or a user facade blocks the handoff. It is an exception filter, so the exception is unchanged.ModifierTable.VisualOwningModifiersandReconciler.ForMountdemand.REACTOR_ANIM_004now advises the modifiers for the*Transitionrows and fixes them (new ScalarTransition { Duration = d }to.OpacityTransition(d), and a non-nullVector3Transitionpassed through). This was the follow-up deferred from layer 0..Animate()flags..Animate(curve, properties)now animates only the channels it names, resolved per channel across the decorator chain. This is the same per-key precedence as the implicit keys (§5.3, §6.1).Spec §5.7 records what shipped.
Linked issue / spec
Implements docs/specs/066-transforms-on-composition-visual.md layer 2 (§5, §9 rows 1–2, §13). Stacked on #1656 (layer 3).
Fixes #1623
Fixes #1624
Fixes #1626
Test plan
dotnet test tests/Reactor.TestswithREACTOR_TRANSFORMS_BASE_REF=origin/azchohfi-spec-066-layer-3-pool-lanespasses (16,341 total, 0 failed). New:TransitionPolicyTests(ResolvePolicy order, flags, mask, zero duration),ElementPoolLaneTests(transition rows are demand, Background isn't),FacadeTransformSetAnalyzerTests(advice, fixes for every transition shape, and no fix for null, maybe-null,null!or an existingScalarTransition).CompositorTransitionFixtures.NoBlock_*covers each transition × LayoutAnimation/Animate/enter Transition/InteractionStates/Keyframes × Mount/Update/FeatureFirst, with a XAML-blocks positive control. Also covered: the curve at 25/50/75% within one frame, the Scale and Translation masks, the Translation semantics (layout moves don't animate,WithAnimationwins), reduced motion with an enabled control, same-reconcile add and drop, readback, Background removal, the §9 diagnostic with a silent negative control, and per-channel.Animate()lookup. PlusElementPoolLanes_ImplicitTransitions, extendedImplicitSlots_*(replaced control, setter Translation after removal) and the updated XAML-era fixtures.dotnet run --project tests/Reactor.AppTests.Host --no-build -c Debug -p:Platform=x64 -- --self-test --filter <prefix>passes for CompositorTransitions, ElementPoolLanes, ImplicitSlots, PooledFacadeTransform, ModifierEvent, Transition_, DslExt, Animate_, AnimCombo, Keyframe, LayoutAnimation and Stagger.BackgroundTransitionclear, the setter diagnostic, or the per-channel.Animate()lookup each turns the matching fixture red.TransformsMatrix_Instrument_Motionfails the same way on the unchanged base), so they skip there behind a seeked-linear positive control. CI runs them.transforms-ledger.expected.json(181 entries: "fixes [Bug] XAML implicit transitions crash with any compositor modifier (LayoutAnimation, Animate, Transition, InteractionStates, Keyframes) #1623" for cases that no longer throw, "fixes [Bug] ElementPool doesn't reset UIElement implicit transitions on return, so they leak to the next renter #1624" for pool and@soakcounts, where the xaml violations go to 0, "fixes [Bug] Removing .OpacityTransition()/.ScaleTransition()/.RotationTransition() never clears the transition #1626" for Background residue, and §9 rows 1, 2, 3, 5 and 6).known.jsondrops the [Bug] XAML implicit transitions crash with any compositor modifier (LayoutAnimation, Animate, Transition, InteractionStates, Keyframes) #1623 rule, widens [Bug] A declared .Opacity() change overrides a looping .Keyframes opacity animation #1651 and A finished one-shot .Keyframes() opacity entry overrides the declared .Opacity() #1660 to every transition, and adds An exit .Transition() declared on a keyed Memo doesn't play when the Memo is removed #1663 (pre-existing: an exit.Transition()on a keyedMemodoesn't play).dotnet test tests/Reactor.Tests --no-build -p:Platform=x64 --filter-class "*TransformsMatrixTests*"withREACTOR_TRANSFORMS_BASE_REF=a026a786fpasses. Oneuser=TranslationDragcurve reading (Translation.Rotation.Animate) races the drag across runs, so the ledger keeps the base value there..Transition()start write no longer fires the implicit key on the same channel (found by the matrix inScaleRotationCenter.Scale.TransitionEnter). Covered byCompositorTransitions_EnterWithTransition.CompositorTransitions_StaggerUpdated_*cover each, and all fail without the fix.CompositorTransitions_NavigationWriteshas a direct-write positive control.src/Reactorandsrc/Reactor.Analyzers. The fullReactor.slnxRelease build couldn't restore on this machine (an offline feed turns NU1900 into an error), so CI'sBuild solutionjob is the gate.animation.md.dt,animation-pipeline.md.dt,element-pool.md.dtandanalyzer-architecture.md.dtrecompiled through the docs pipeline.Risk / breaking changes
Changed). An element with one of the four transitions keeps its transforms on the visual.fe.Scale,fe.Rotationandfe.CenterPointread identity, and a.Setfacade or*Transitionwrite throws after the handoff (now with a warning naming the modifier)..Animate(curve, properties)no longer animates a channel its flags exclude (CHANGELOGChanged)..TranslationTransition()animates.Translation()writes, not layout moves (§9 row 5,Fixed). The transition curve changes from linear to the XAML curve (§9 row 6).UISettings.AnimationsEnabledonce.