Repository navigation
Move Reconciler.InteractionStates into an internal static InteractionStateApplier - #1725
Conversation
…StateApplier The .InteractionStates() partial held only static members but, as a partial of Reconciler, could read every private reconciler field. It is now a standalone internal static class, InteractionStateApplier, so the compiler enforces the boundary, as #1712 did for the other all-static partials. TransformRest and the RestTransformOf/RestOpacityOf readers move to Reconciler.CompositionState.cs next to the field they read, since transitions use them too. No member was public, so no forwarders are needed and the public API surface is unchanged. ReconcilerSource.HelperFiles and the reviewer manifest list the new file. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the interaction-state helper extraction.
No open issues 🎉
What changed in this PR
This PR completes the helper extraction begun in #1712 after the composition-state changes in #1713. It moves interaction-state handling into an internal static helper, restricting access to reconciler internals without changing behavior or public APIs.
Changes:
- Extracts
InteractionStateApplierand relocates shared rest-value helpers toReconciler.CompositionState.cs. - Redirects lifecycle calls, selftest seams, and reflection tests to the new helper.
- Updates source-check coverage, reviewer manifests, and architecture documentation.
| File | Description |
|---|---|
| tools/reviewer/manifest.json | Includes the extracted helper in both review batches. |
| tests/Reactor.Tests/AnimationBugTests.cs | Retargets reflection checks to the helper. |
| tests/Reactor.Tests/AnalyzerTests/ReconcilerSource.cs | Includes the helper in source-parsing checks. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/TransformVisualHandoffFixtures.cs | Redirects hover simulation calls. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/TransformsOnVisualFixtures.cs | Redirects transform hover simulations. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/TransformsMatrixRecorder.cs | Uses the moved hover test seam. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/TransformOriginFixtures.cs | Redirects transform-origin hover simulations. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/ThemeRefStyleFixtures.cs | Redirects hover and press simulations. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/RotationUnitsFixture.cs | Updates simulation and tracker-count references. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/RenderErrorHandlerFixtures.cs | Updates rollback tracker-count checks. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/PoolLaneFixtures.cs | Updates hover and pool-cleanup test seams. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/PanelBorderFixture.cs | Redirects border-brush hover simulations. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/InteractionStatesTests.cs | Uses the moved hover test seam. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/FlyoutTargetCallbacksFixtures.cs | Updates tracker checks and explicit cleanup. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/CurveLinearProgressFixture.cs | Redirects interaction-state simulation. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/CompositorTransitionFixtures.cs | Redirects transition hover simulations. |
| src/Reactor/Core/Reconciler.Update.cs | Delegates interaction-state updates and removal. |
| src/Reactor/Core/Reconciler.Unmount.cs | Delegates interaction-state cleanup. |
| src/Reactor/Core/Reconciler.Mount.cs | Delegates interaction-state setup. |
| src/Reactor/Core/Reconciler.Keyframes.cs | Uses the helper during composition cleanup. |
| src/Reactor/Core/Reconciler.CompositionState.cs | Houses shared rest-value helpers and retypes the tracker. |
| src/Reactor/Core/InteractionStateApplier.cs | Extracts interaction handlers and state transitions. |
| src/Reactor.Analyzers/ModifierTable.cs | Updates the method name in explanatory metadata. |
| docs/guide/architecture-overview.md | Refreshes the generated architecture guide. |
| docs/_pipeline/templates/architecture-overview.md.dt | Documents the extracted helper in the source template. |
| CONTRIBUTING.md | Adds interaction states to the helper layout description. |
| AGENTS.md | Updates architecture guidance for the extraction. |
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
No size change beyond the noise floor. ✅ ✅ smaller / |
🧪 Merged coverageCoverage for
No coverage change beyond the noise floor. ✅ ✅ higher / |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
microsoft#1725 moved them off Reconciler. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…#1687) * Share foreground lookup across modifier paths Refs #1674. * Address foreground review feedback * Restore RichTextBlock foreground when hover states are removed * Restore retained foreground when interaction states are removed * Read interaction trackers from per-control composition state #1713 moved the trackers off the static dictionary. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Regenerate API reference for the Foreground ThemeRef receivers Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Call interaction helpers on InteractionStateApplier #1725 moved them off Reconciler. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Alexandre Zollinger Chohfi <alzollin@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
09d8d2c71e0bdda9f2a9a4054b54a22be2cf561fReconciler.qualification.↑ All CI checks green on this head after merging main (#1691), including Build solution, Unit Tests, Selftests, AOT and Packaged selftests, and E2E.
↑ Local Release build,
Reactor.Tests(16399 passed) and the full TAP selftest suite (0 failures, matching main) all passed.↑ 7-dimension pr-review plus a GPT cross-check found nothing, and Copilot review came back 🟢 on both heads with no threads.
↓ Two early local selftest runs crashed the host in
ConnectedNav_RoundTrip. It passed on a rerun of the same build, on main, and in CI, so I treated it as environmental.Summary
Reconciler.InteractionStates.csheld only static members, but as a partial ofReconcilerit could read every private reconciler field. It is now a standaloneinternal static class InteractionStateApplier, the same way #1712 split out the other all-static partials. #1712 skipped this one because #1713 was changing it at the time.TransformRest,RestTransformOfandRestOpacityOfmove toReconciler.CompositionState.cs, next to the field they read, since transitions,AnimationHelperandTransformOriginBindinguse them too.RestTransformOfgoes from private to internal.InteractionStateTrackerand theInteractionStateenum stay nested, now underInteractionStateApplier.CompositionState.InteractionTrackeris retyped to match.mur --regen-apileavesreactor.api.txtunchanged.SimulatePointerOverForTests,SimulatePressedForTests,InteractionTrackerCountForTests), and the reflection tests inAnimationBugTestsnow point at the new class.ReconcilerSource.HelperFilesand bothtools/reviewer/manifest.jsonbatches list the new file, so the source-parsing and reviewer-manifest gates still see it.Reconciler.Modifiers.csisn't touched, so this doesn't overlap the spec 067 work.Linked issue / spec
Follow-up to #1712 and #1713.
Test plan
dotnet restore Reactor.slnxthendotnet build Reactor.slnx --no-restore -c Release(withNuGetAudit=falsebehind a TLS proxy): passed, except the 3src/vs-reactorprojects, which can't restore offline here. Nothing there is touched.dotnet test tests/Reactor.Tests: passed, 16399 passed, 0 failed, 19 skipped.dotnet run --project tests/Reactor.AppTests.Host -- --self-test: 0 failures, the same result as main at the same commit. Two earlier runs crashed the host inConnectedNav_RoundTrip(0xC000027B). The fixture passes in isolation, passed on the rerun, and passes on main, so I treated it as environmental.dotnet test tests/Reactor.SelfTests --filter ShutdownPolicyProcessLifetimeTests: passed, 17/17. One of these timed out during the first batched run.mur --regen-api: no changes to the API index.Risk / breaking changes
None. Internal move only, with no behavior or public API change.