Skip to content

Move Reconciler.InteractionStates into an internal static InteractionStateApplier - #1725

Merged
Alexandre Zollinger Chohfi (azchohfi) merged 2 commits into
mainfrom
azchohfi-interaction-states-static-class
Nov 26, 2026
Merged

Alexandre Zollinger Chohfi (azchohfi) merged 2 commits into
mainfrom
azchohfi-interaction-states-static-class

Conversation

@azchohfi

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

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 09d8d2c71e0bdda9f2a9a4054b54a22be2cf561f

Dimension Assessment Rationale
Change confidence 9.5/10 ↑ Moved method bodies are unchanged apart from Reconciler. 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.cs held only static members, but as a partial of Reconciler it could read every private reconciler field. It is now a standalone internal 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, RestTransformOf and RestOpacityOf move to Reconciler.CompositionState.cs, next to the field they read, since transitions, AnimationHelper and TransformOriginBinding use them too. RestTransformOf goes from private to internal.
  • InteractionStateTracker and the InteractionState enum stay nested, now under InteractionStateApplier. CompositionState.InteractionTracker is retyped to match.
  • No member was public, so no forwarders are needed. mur --regen-api leaves reactor.api.txt unchanged.
  • Call sites in Mount/Update/Unmount/Keyframes, the selftest seams (SimulatePointerOverForTests, SimulatePressedForTests, InteractionTrackerCountForTests), and the reflection tests in AnimationBugTests now point at the new class.
  • ReconcilerSource.HelperFiles and both tools/reviewer/manifest.json batches list the new file, so the source-parsing and reviewer-manifest gates still see it.
  • AGENTS.md, CONTRIBUTING.md and the architecture overview (template plus recompiled guide) name it.

Reconciler.Modifiers.cs isn'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.slnx then dotnet build Reactor.slnx --no-restore -c Release (with NuGetAudit=false behind a TLS proxy): passed, except the 3 src/vs-reactor projects, which can't restore offline here. Nothing there is touched.
  • dotnet test tests/Reactor.Tests: passed, 16399 passed, 0 failed, 19 skipped.
  • Full selftest suite via 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 in ConnectedNav_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.
  • CI green on the current head after merging main.

Risk / breaking changes

None. Internal move only, with no behavior or public API change.

…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>

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.

🟢 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 InteractionStateApplier and relocates shared rest-value helpers to Reconciler.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

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build metrics

Artifact sizes for 09d8d2c vs the base branch (789c91b).

Packages (compressed .nupkg)

Artifact base PR Δ
Microsoft.UI.Reactor.nupkg 2.14 MB 2.14 MB +124 B (+0.01%) ≈
Microsoft.UI.Reactor.Advanced.nupkg 530.1 KB 530.1 KB -15 B (0.00%) ≈
Microsoft.UI.Reactor.Devtools.nupkg 287.9 KB 287.8 KB -16 B (-0.01%) ≈

Assemblies in Microsoft.UI.Reactor

Artifact base PR Δ
Microsoft.UI.Reactor.dll 2.90 MB 2.90 MB +0 B (0.00%) ≈
Reactor.Analyzers.dll 444.5 KB 444.5 KB +0 B (0.00%) ≈
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 Δ
Microsoft.UI.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%) ≈

No size change beyond the noise floor. ✅

✅ 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 26, 2026 •

Copy link
Copy Markdown
Contributor

🧪 Merged coverage

Coverage for 09d8d2c vs the base branch (789c91b) — unit + selftest merged.

Metric base PR Δ
Line 89.08% 89.07% -0.01 pp ≈
Branch 44.64% (18722/41941) 44.63% (18720/41941) -0.01 pp ≈

No coverage change beyond the noise floor. ✅

✅ 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.

@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 26, 2026
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 26, 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.

🟢 Approval recommended

No active review issues block approval of the interaction-state helper extraction.

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 26, 2026
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) merged commit d0846dd into main Nov 26, 2026
56 checks passed
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) deleted the azchohfi-interaction-states-static-class branch November 26, 2026 07:15
@azchohfi Alexandre Zollinger Chohfi (azchohfi) removed the ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge label Nov 26, 2026
Alexandre Zollinger Chohfi (azchohfi) added a commit to PaperHammer/microsoft-ui-reactor that referenced this pull request Nov 26, 2026
microsoft#1725 moved them off Reconciler.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Nov 26, 2026
…#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants