Skip to content

Spec 066 layer 3: pool lanes and the native VisualTaken marker - #1656

Open
Alexandre Zollinger Chohfi (azchohfi) wants to merge 22 commits into
azchohfi-spec-066-layer-1-implicit-anim-slotsfrom
azchohfi-spec-066-layer-3-pool-lanes
Open

Alexandre Zollinger Chohfi (azchohfi) wants to merge 22 commits into
azchohfi-spec-066-layer-1-implicit-anim-slotsfrom
azchohfi-spec-066-layer-3-pool-lanes

Conversation

@azchohfi

@azchohfi Alexandre Zollinger Chohfi (azchohfi) commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Spec 066 layer 3. A control whose composition visual Reactor took now goes back to the pool instead of being dropped. Each poolable type gets two lanes. The plain lane is unchanged. The visual lane holds controls whose visual was taken, reset to a fresh control's pixels by the §7.3 list, and only an element that takes the visual at mount and has no .Set setter or .OnMount callback rents from it. So user code never gets a control whose Rotation or Scale write would throw.

What changes:

  • ReactorState.VisualTaken replaces the wrapper-keyed _compositorTainted table. It lives on the native control, so every wrapper sees it, and every AnimationHelper.GetElementVisual sets it, including the stagger and EnsureCompositor handoffs that never did ([Bug] ElementPool can recycle controls whose composition visual was taken (Stagger handoff isn't tainted; taint is lost across RCW wrappers) #1643).
  • ElementPool has a plain and a visual lane per type, each capped at 32. CleanElement runs the §7.3 reset on visual-lane controls. It stops animations, drops implicit animations, writes identity to the visual, disables translation, zeroes the Translation facade and forgets Reactor's composition bookkeeping. It skips the facade writes WinUI refuses after a handoff.
  • Both lanes clear ChildrenTransitions, ChildTransitions and ContentTransitions ([Bug] ElementPool doesn't clear ChildrenTransitions/ChildTransitions/ContentTransitions on return #1639). The visual lane also clears a brush transition on any panel or border, zeroes the relative offset and size adjustments, and writes the layout offset (ActualOffset) back, since layout doesn't rewrite an unchanged position after a stopped animation or a direct visual write. XAML also pushes UIElement.Opacity to the visual only when it changes, so the reset writes opacity 1 and a visual-lane renter gets its own UIElement.Opacity on the visual when it loads, without a fade, unless something already owns or wrote the visual's opacity.
  • A control unmounted mid-hover gets its interaction-state brushes restored, so a recycled control doesn't show the previous renter's hover color. A connected-animation source is the exception: it stays out of the pool, keeps its pixels for WinUI's snapshot, and only drops the element and handlers it hosted.
  • The lane is picked at rent from the declarations being mounted, including a keyed Memo over the element. App handlers never get the visual lane. That covers per-host and derived-type registrations, global ControlRegistry overrides of a built-in, and records derived from a built-in element.
  • Exit completions are keyed to their exit. A completion that outlives a control torn down mid-exit no longer pools it a second time. Navigation pages stay out of the pool, since their transition completion can still reach them.
  • Docs: element-pool.md.dt (recompiled), the diagram, TESTING.md's soak description, AGENTS.md and the pr-review correctness notes.

One deliberate reading of §7.2. A feature counts as demand only when it takes the visual at mount. .InteractionStates() takes it on the first state change, and an exit-only .Transition() on removal, so a fresh control keeps writable facades until then. Those elements rent from the plain lane. The spec sentence now says so.

Linked issue / spec

Implements docs/specs/066-transforms-on-composition-visual.md §7 (layer 3 in §13).

Fixes #1639
Fixes #1643

Related to #1624. This fixes the compositor-side leak, and layer 2 finishes it (OpacityTransition and BackgroundTransition).

Test plan

  • dotnet test tests/Reactor.Tests -p:Platform=x64 passed except CompilationLoaderTests.Cold_load_under_500ms_warm_under_50ms_for_minimal_project, a CLI timing test that also fails on a loaded machine without this change. New ElementPoolLaneTests cover the lane rules and mirror ModifierTable.VisualOwningModifiers.
  • TransformsMatrixTests.Ledger_ChangesFromTheBase_AreAllDeclared passed with REACTOR_TRANSFORMS_BASE_REF=origin/azchohfi-spec-066-layer-1-implicit-anim-slots.
  • Selftests (dotnet run --project tests/Reactor.AppTests.Host --no-build -c Debug -p:Platform=x64 -- --self-test --filter <prefix>) passed for ElementPoolLanes, PooledFacadeTransform, ModifierTransform_CompositionOwnership, NavCov_Transition, ImplicitAnimationSlots, RegisterType, CovBoost_ElementPool, Stagger, AnimationCombination.
  • ModifierTransform_Handoff_*, TransformHandoff_Transition_*, RotationUnits_CompositorTransitionRunning and three ConnectedNav_* checks fail identically on the layer 1 base on my desktop (an RDP session with no compositor animations), so they aren't from this change.
  • Mutation checks, each turning the named checks red. Marker on the early handoff path → Stagger_ChildMarked. Exit guard → ExitTornDown_PooledOnce. Identity writes → VisualLane_IdentityVisual. Translation facade reset → VisualLane_TranslationZero. StopAnimation → VisualLane_NoRunningAnimation. Implicit collection clear → VisualLane_NoImplicitKeys. Theme-transition clear → ThemeTransitions_StackPanel_Cleared. Setter block → LaneRules_SetterWithDemand. App-handler check → AppHandler_FacadeWriteWorks. Pool exclusion → NavTaint_PoolRefusesPage. Hover as demand → LaneRules_InteractionStatesOnly. The ambient-exit guard isn't caught because a stopped ambient fade never completes here, so it stays as a defensive check.
  • pr-review pass (seven dimensions plus a GPT cross-check). Its findings are fixed in 38d1c66.
  • Later review rounds added ElementPoolLanes_HoverBrush, _ResetLeftovers, _LayoutOffset, _MemoAppHandler, _ReturnTwice, _MemoKeyframes, _ConnectedSource and _KeyframeNames. _ResetLeftovers also covers a styled 0.65 opacity, an interrupted enter fade, and a visual hidden before the renter loads. Each one turns red locally with its fix removed, except the .ScrollLinked cases of _LayoutOffset. Those only show the frozen offset on a hosted runner, where they failed before 1c0db63 and pass after it. The pool's local Foreground and setter-written UIElement.Clip aren't reset in either lane, the same as main. That's tracked in Pool keeps a previous renter's local Foreground and UIElement.Clip #1662.
  • Transforms ledger recorded on a hosted runner on top of layer 1 be95c3d (transforms-matrix-record, run 44912244613, 0 failures). Every difference is [Bug] ElementPool can recycle controls whose composition visual was taken (Stagger handoff isn't tainted; taint is lost across RCW wrappers) #1643. Staggered children now read taken=1, plain renters no longer get a taken visual, and the soak's visual-lane probes report anims=0 facade=0 keys=0 taken=0 visual=0. All are declared in transforms-ledger.expected.json, and TransformsMatrixTests passed (57/57) against layer 1.

Perf, Release x64, interleaved with layer 1 (be95c3d). Each cycle mounts 30 keyed children, lays them out, removes them and lays out again. Median of 5 reps, 40 cycles, two processes each:

Workload Layer 1 This PR
Border(TextBlock) plain 271 ms 271 ms
Border(TextBlock).Animate() 625–662 ms 402–486 ms
Border(TextBlock).LayoutAnimation() 369–394 ms 298–347 ms
VStack(TextBlock).Animate() 713–831 ms 556–612 ms
TextBlock.Animate() 583–645 ms 369–404 ms
Button plain 308 ms 320 ms (within noise, n=12)
Button.Animate() 975–1043 ms 624–679 ms

Per type, in one process with the visual lane switched off and on, the lane costs this share of discarding the control: Border 0.90, StackPanel 0.67, Grid 0.70, Canvas 0.69, TextBlock 0.63, RichTextBlock 0.65, ScrollViewer 0.31, Viewbox 0.63, ProgressBar 0.95, ProgressRing 0.25, Image 0.54, InfoBadge 0.47, Button 0.51, TextBox 0.49, ToggleSwitch 0.91. The pool's own return and rent cost is unchanged from layer 1 (about 58 µs for a Border, 110 µs for a Button). The visual reset adds about 15.5 µs, matching the spec's 12.8 to 18.6 µs.

One shape is slower. An empty, childless 6×6 Border with .Animate() or .LayoutAnimation(), rendered a frame per cycle, is about 25 to 35% slower than layer 1, because a new bare Border costs almost nothing to create. I considered a per-type rule that discards visual-taken Borders, but that would give up the 10% win for a Border with content and the 30 to 37% wins for panels and text, so the lane stays on for every type. It's the same trade-off the plain lane already makes on main for cheap controls. Lanes hold 32 per type, so large lists are unaffected either way.

Risk / breaking changes

No public API change. ElementPool.TryRent(Type) keeps renting from the plain lane.

Elements with .Animate(), an enter .Transition(), .Keyframes(), .LayoutAnimation() or .ScrollLinked() now reuse pooled controls. The reset is pixel-identical to a fresh control in the selftests. A control nested in a removed panel still isn't recycled, because ForceDetach rejects it. That predates this change and is left alone.

A control whose composition visual was taken now returns to a visual lane,
reset by the spec 066 section 7.3 list, instead of leaving the pool. Only a
built-in element that takes the visual itself and carries no setters or mount
callbacks rents from it. The lane marker lives on the native control's
ReactorState and every AnimationHelper.GetElementVisual sets it, replacing the
wrapper-keyed taint table. Both lanes clear ChildrenTransitions,
ChildTransitions and ContentTransitions. Exit completions are keyed to their
exit, so one that outlives a torn-down control can't return it to the pool
twice, and navigation pages stay out of the pool.

Fixes #1639, #1643 and the rest of #1624.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Keep app handlers off the visual lane: exact built-in element types only,
  plus global ControlRegistry overrides (a contested registration) and
  derived-type registrations, not just per-host RegisterHandler.
- Count a feature as demand only when it takes the visual at mount, so
  .InteractionStates(), an exit-only .Transition() and a ScrollLinked
  without a ScrollViewer rent from the plain lane (spec 066 section 7.2).
- Tests: app-handler, ambient-exit and pool-exclusion cases, lazy-feature
  lane rules, and a mirror test against ModifierTable.VisualOwningModifiers.
- Docs: lane cap label, TESTING.md soak description, spec 7.2 wording.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…it-anim-slots' into azchohfi-spec-066-layer-3-pool-lanes

# Conflicts:
#	tests/Reactor.AppTests.Host/SelfTest/Fixtures/TransformsMatrixFixture.cs
#	tests/Reactor.AppTests.Host/SelfTest/Fixtures/TransformsMatrixRecorder.cs
@azchohfi Alexandre Zollinger Chohfi (azchohfi) added transforms-matrix Run the spec 066 transforms matrix against the ledger (Transforms matrix workflow) transforms-matrix-record Record the spec 066 transforms ledger on a hosted runner and upload it as an artifact labels Nov 21, 2026
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build metrics

Artifact sizes for c98885d vs the base branch (344e6c5).

Packages (compressed .nupkg)

Artifact base PR Δ
Microsoft.UI.Reactor.nupkg 2.10 MB 2.10 MB +5.70 KB (+0.27%) ⚠️
Microsoft.UI.Reactor.Advanced.nupkg 528.7 KB 528.7 KB -5 B (0.00%) ≈
Microsoft.UI.Reactor.Devtools.nupkg 287.8 KB 287.7 KB -7 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor

Artifact base PR Δ
Reactor.Analyzers.dll 437.5 KB 437.5 KB +0 B (0.00%) ≈
Reactor.dll 2.84 MB 2.85 MB +9.50 KB (+0.33%) ⚠️
Reactor.Localization.Generator.dll 16.0 KB 16.0 KB +0 B (0.00%) ≈
Reactor.Wrappers.Abstractions.dll 10.5 KB 10.5 KB +0 B (0.00%) ≈
Reactor.Wrappers.Generator.dll 164.0 KB 164.0 KB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Advanced

Artifact base PR Δ
Reactor.Advanced.dll 1.08 MB 1.08 MB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Devtools

Artifact base PR Δ
Microsoft.UI.Reactor.Devtools.dll 787.0 KB 787.0 KB +0 B (0.00%) ≈

✅ smaller / ⚠️ larger / ≈ within noise. Sizes come from a Release dotnet pack on the CI runner: packages are the compressed .nupkg download size, assemblies the uncompressed DLL inside it.
workflow run.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🧪 Merged coverage

Coverage for c98885d vs the base branch (28a8722) — unit + selftest merged.

Metric base PR Δ
Line 88.70% 88.80% +0.10 pp ✅
Branch 45.68% (18380/40239) 45.52% (18489/40617) -0.16 pp ⚠️

✅ higher / ⚠️ lower / ≈ within noise. Δ is in percentage points; coverage is unit + selftest merged (Debug x64) on the CI runner. Cobertura reports attached to the workflow run as artifacts.

Recorded by run 44897514815 (transforms-matrix-record). The changes are all
#1643: staggered children are now marked visual-taken, plain renters no longer
get a taken visual, and the soak's visual-lane probes pass the section 7.3
reset checks. Each is declared in transforms-ledger.expected.json.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azchohfi Alexandre Zollinger Chohfi (azchohfi) added agent-preparing Agent is addressing feedback or completing required validation and CI and removed transforms-matrix-record Record the spec 066 transforms ledger on a hosted runner and upload it as an artifact labels Nov 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Visual-lane reuse can corrupt connected-animation snapshots, and concurrent keyframe cleanup can throw; visual reset and test coverage issues also remain.

6 open issues
What changed in this PR

Implements spec 066 layer 3 in Reactor’s native-control pool, enabling reuse of controls whose composition visual was taken while keeping them separate from renters that require writable facade transforms. It targets the handoff-marker and theme-transition leaks described in #1643 and #1639.

Changes:

  • Adds native VisualTaken state, separate plain and visual pool lanes, mount-time eligibility checks, and visual cleanup.
  • Guards stale exit completions, excludes navigation participants from pooling, and clears theme transitions.
  • Adds lane and soak coverage, updates recorded baselines, and documents the pooling contract.
File Description
tests/​Reactor.Tests/​ElementPoolLaneTests.cs Tests visual-lane eligibility rules.
tests/​Reactor.Tests/​AnalyzerTests/​CleanElementScan.cs Recognizes content-control transition resets.
tests/​Reactor.AppTests.Host/​SelfTest/​SelfTestFixtureRegistry.cs Registers six pooling selftests.
tests/​Reactor.AppTests.Host/​SelfTest/​Fixtures/​TransformsMatrixRecorder.cs Reads the native handoff marker.
tests/​Reactor.AppTests.Host/​SelfTest/​Fixtures/​TransformsMatrixFixture.cs Adds visual-lane soak probes.
tests/​Reactor.AppTests.Host/​SelfTest/​Fixtures/​TransformModifierFixtures.cs Updates marker and wrapper-lifetime assertions.
tests/​Reactor.AppTests.Host/​SelfTest/​Fixtures/​RotationUnitsFixture.cs Updates the handoff-marker assertion.
tests/​Reactor.AppTests.Host/​SelfTest/​Fixtures/​RegisterTypeElementTagFixtures.cs Updates exit-transition marker checks.
tests/​Reactor.AppTests.Host/​SelfTest/​Fixtures/​PoolLaneFixtures.cs Tests reset, reuse, exclusions, and exit safety.
tests/​Reactor.AppTests.Host/​SelfTest/​Fixtures/​PooledFacadeTransformFixtures.cs Updates the plain-control marker check.
tests/​Reactor.AppTests.Host/​SelfTest/​Fixtures/​NavigationCoverageFixtures.cs Tests navigation pool exclusion.
tests/​Reactor.AppTests.Host/​SelfTest/​Baselines/​transforms-ledger.json Records marker and lane observations.
tests/​Reactor.AppTests.Host/​SelfTest/​Baselines/​transforms-ledger.expected.json Declares expected ledger differences.
TESTING.md Documents visual-lane soak checks.
src/​Reactor/​Core/​V1Protocol/​NavigationHostLifecycle.cs Excludes an incoming navigation page from pooling.
src/​Reactor/​Core/​V1Protocol/​ControlRegistry.cs Tracks contested handler registrations.
src/​Reactor/​Core/​Reconciler.Mount.cs Applies mount-time rental eligibility.
src/​Reactor/​Core/​Reconciler.cs Adds rental context, exit tokens, and composition cleanup.
src/​Reactor/​Core/​Navigation/​TransitionEngine.cs Excludes transitioning pages from pooling.
src/​Reactor/​Core/​Navigation/​ConnectedNavigationOperation.cs Excludes connected-navigation participants.
src/​Reactor/​Core/​ElementPool.cs Implements two lanes and visual resets.
src/​Reactor/​Animation/​ImplicitAnimationSlots.cs Removes a redundant marker write.
src/​Reactor/​Animation/​AnimationHelper.cs Marks successful handoffs using native state.
src/​Reactor.Analyzers/​ModifierTable.cs Adds comments linking modifier demand to lane tests.
docs/​specs/​066-transforms-on-composition-visual.md Clarifies mount-time visual demand.
docs/​guide/​images/​element-pool/​rental-states.svg Updates generated diagram labels.
docs/​guide/​element-pool.md Updates the generated pooling guide.
docs/​_pipeline/​templates/​element-pool.md.dt Documents lane eligibility and cleanup.
docs/​_pipeline/​diagrams/​element-pool/​rental-states.svg Updates source diagram labels.
CHANGELOG.md Describes pooling and transition fixes.
AGENTS.md Updates contributor pooling guidance.
.github/​skills/​pr-review/​dimensions/​correctness.md Updates pooling review checks.

Review effort: Balanced

Comment thread src/Reactor/Core/ElementPool.cs Resolved
Comment thread src/Reactor/Core/Reconciler.cs Resolved
Comment thread src/Reactor/Core/ElementPool.cs Resolved
Comment thread src/Reactor/Core/ElementPool.cs Resolved
Comment thread src/Reactor/Core/Reconciler.cs Resolved
- Keep a prepared connected-animation source out of the pool: WinUI
  captures it at the next frame.
- Restore Visual.IsVisible and clear a Grid/StackPanel BackgroundTransition
  in the visual-lane reset.
- Drop the cross-host keyframe trigger scan from the reset; unmount already
  removes those entries.
- Declare the soak's violation counts with exact before/after values.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical teardown and pooling defects can leave stale references and triggers or rent the same control twice, while reset gaps can leak visual state between renters.

2 open issues
3 previously missed issues

In code that hasn't changed since last review

Medium severity Discard stale visual controls from the plain pool

src/​Reactor/​Core/​ElementPool.cs:144

PoolPolicy.Reset runs after _pool.Return and can take the visual through CompositorProvider.EnsureCompositor when no compositor is cached. The control then remains in the plain stack, so the next .Set(b => b.Rotation = 10) can receive it and throw. Recheck the marker when renting and discard stale plain-lane entries, or finish the author reset before choosing the lane.

Medium severity Clear foreground brushes before pooling controls

src/​Reactor/​Core/​ElementPool.cs:292

Visual-lane controls can retain the previous renter's foreground because CleanElement clears neither Control.Foreground nor TextBlock.Foreground. Removing an animated red TextBlock and mounting an animated one without a foreground can therefore leave the new text red. Clear both foreground properties on return, including local brushes left by interaction states.

Medium severity Clear attached child visuals during reset

src/​Reactor/​Core/​ElementPool.cs:649

The visual-lane reset leaves a visual attached with SetElementChildVisual in place. An element that installs a sprite in .OnMount(...) and declares .Animate(...) can now be pooled, so a later animated renter displays the previous renter's sprite. Clear the attached child visual during reset.

6 resolved since last review

Review effort: Balanced

Comment thread src/Reactor/Core/ElementPool.cs Resolved
Comment thread src/Reactor/Core/Reconciler.cs Resolved
- Make ElementPool.Return idempotent: a control already on a stack isn't
  pushed again, so a handler's ReturnControl plus the engine's return can't
  hand one control to two renters.
- Record keyframe trigger names on the native control and drop exactly those
  entries in the visual reset, so a keyed Memo's keyframes don't suppress the
  next renter's playback. (#1659 tracks the Memo .Ref gap, which predates
  this layer.)
- Wait for matching layout before the pixel comparison in the VisualLane
  fixture.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unsynchronized global registries can corrupt reconciliation across UI threads, while incomplete pool cleanup and memo handling can leak state or cause exceptions.

1 open issue
6 previously missed issues

In code that hasn't changed since last review

Medium severity Clear overridden foreground brushes when returning controls to the pool

src/​Reactor/​Core/​ElementPool.cs:306

Removing a TextBlock or Button while an interaction state overrides its foreground leaves a local brush behind. The next animated renter inherits that hover color because neither ClearInteractionStates nor CleanElement clears Foreground. Clear the corresponding foreground dependency property on return.

Medium severity Stop and reset expression targets across keyed Memo wrappers

src/​Reactor/​Core/​ElementPool.cs:648

A keyed Memo can apply .ScrollLinked(...) to its inner control, but CleanupElementChainForUnmount does not visit the wrapper. Custom expression targets such as RelativeOffsetAdjustment and RotationAxis are missing from the reset's stop list, so an old viewer can keep driving the recycled control. Record and stop the actual expression targets, including wrapper declarations, and restore their values or exclude unsupported targets before pooling.

Medium severity Reset relative offset and size adjustments before reuse

src/​Reactor/​Core/​ElementPool.cs:663

The reset leaves RelativeOffsetAdjustment and RelativeSizeAdjustment unchanged. An outgoing element can write either property through its visual in .OnMount(...), then enter the visual lane through .Animate(), causing a later renter to inherit its relative position or size. Restore both properties to zero during reset.

Medium severity Clear background transitions on every poolable Panel

src/​Reactor/​Core/​ElementPool.cs:675

This misses poolable Canvas controls, which also inherit Panel.BackgroundTransition. A canvas that sets a background transition and takes its visual can enter the visual lane, leaving that transition active for the next animated renter. Clear the property for every poolable Panel, rather than only Grid and StackPanel.

Medium severity Clear memo transparency before invoking registered handlers

src/​Reactor/​Core/​Reconciler.Mount.cs:126

A registered handler for KeyedMemoElement still inherits Transparent = true. If it mounts a plain Border and then writes Rotation, an .Animate() declaration on the memo lets the child rent a taken visual and makes that write throw. Clear memo transparency before invoking any registered handler; the same issue affects all three registry dispatch branches.

Medium severity Allocate exit tokens only when an ambient animation is active

src/​Reactor/​Core/​Reconciler.cs:5130

This allocates an exit token for every removal without an explicit transition, even when there is no ambient animation and the token is never used. That adds avoidable allocations to ordinary list and virtualization churn. Create the token only when an effective ambient animation is present.

2 resolved since last review

Review effort: Balanced

Comment thread src/Reactor/Core/Reconciler.cs Resolved
Restore interaction-state brushes when a control unmounts mid-hover, stop every animatable visual property in the visual reset and zero the relative adjustments, clear brush transitions on any panel or border, keep memo transparency away from registered handlers, and allocate the ambient exit token only when an ambient animation is active.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Removing interaction states while hovered can overwrite a newly updated border brush with the stale pre-hover value.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread src/Reactor/Core/Reconciler.cs Resolved
Restore interaction-state brushes only on unmount, so an update that drops the states keeps its new brushes. Put back the Offset and Size layout last wrote when the visual reset stops an animation on them, since layout won't rewrite an unchanged position.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The visual reset writes opacity 1 again, since the visual's static value can be an interrupted enter fade's 0. A visual-lane renter instead gets its UIElement.Opacity on the visual when it loads, unless a Reactor feature owns the visual's opacity by then, because XAML pushes it only when it changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Opacity synchronization can prematurely reveal recycled pages, overwrite caller-set opacity, and trigger unintended fades for styled controls.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread src/Reactor/Core/ElementPool.cs Resolved
Comment thread src/Reactor/Core/ElementPool.cs Resolved
The load-time opacity sync skips pool-excluded controls and visuals written since the reset, and holds back the renter's implicit Opacity key so the value shows without a fade.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Snapshot preservation and cleanup span multiple unmount and pooling paths, while permissive visual baselines add uncertainty that warrants human assessment.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@azchohfi Alexandre Zollinger Chohfi (azchohfi) added ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Nov 21, 2026
The sync runs on the first layout pass that finds the renter in the live tree, before its first frame, with Loaded kept for popups. WinUI can raise Loaded late or skip it for a control re-added while its Unloaded is pending, which made the opacity fixtures intermittent on CI. A return unsubscribes a renter that never loaded. The fixtures wait on the sync itself, assert it ran, and reproduce navigation's mount, hide, attach order. Pixel comparisons recapture until both bitmaps have the same size and report the sizes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azchohfi Alexandre Zollinger Chohfi (azchohfi) added agent-preparing Agent is addressing feedback or completing required validation and CI and removed ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge labels Nov 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Opacity-sync handlers can remain registered after cancellation or when pooling is disabled after rent, and the stale generated guide snippet will fail documentation CI.

2 open issues

Review effort: Balanced

Comment thread src/Reactor/Core/ElementPool.cs Resolved
Comment thread docs/guide/element-pool.md Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Navigation-owned visuals can lose their pending opacity sync, while controls unmounted without a pool return can retain layout handlers indefinitely.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread src/Reactor/Core/ElementPool.cs Resolved
A renter's pending opacity sync is cancelled on every unmount, not only on a pool return, so one unmounted before it attached (a cancelled navigation, a disabled pool) doesn't stay on the window's layout list.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed to evaluate lifecycle cleanup, pooled-property reuse, and ledger coverage risks omitted from the published review.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

XAML may push a styled opacity itself when a control re-enters the tree, which made the final visual value an unreliable oracle on CI. A test-only counter records the sync's writes: HiddenBeforeLoad asserts the sync made none, and NoFade judges only a fade after a sync write.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Native-control ownership, disposal behavior, and broad regression allowances warrant human assessment.

No open issues 🎉

Review effort: Balanced

@azchohfi Alexandre Zollinger Chohfi (azchohfi) added ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Nov 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge transforms-matrix Run the spec 066 transforms matrix against the ledger (Transforms matrix workflow)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants