Skip to content

Bump @apollo/server from 4.13.0 to 5.5.0 in /samples/apps/headtrax/service - #5

Merged
Chris Anderson (codemonkeychris) merged 1 commit into
mainfrom
dependabot/npm_and_yarn/samples/apps/headtrax/service/apollo/server-5.5.0
Apr 17, 2026
Merged

Chris Anderson (codemonkeychris) merged 1 commit into
mainfrom
dependabot/npm_and_yarn/samples/apps/headtrax/service/apollo/server-5.5.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Apr 17, 2026

Copy link
Copy Markdown
Contributor

Bumps @apollo/server from 4.13.0 to 5.5.0.

Release notes

Sourced from @​apollo/server's releases.

@​apollo/server-integration-testsuite@​5.5.0

Minor Changes

  • #8191 ada1200 - ⚠️ SECURITY @apollo/server/standalone:

    Apollo Server now rejects GraphQL GET requests which contain a Content-Type header other than application/json (with optional parameters such as ; charset=utf-8). Any other value is now rejected with a 415 status code.

    (GraphQL GET requests without a Content-Type header are still allowed, though they do still need to contain a non-empty X-Apollo-Operation-Name or Apollo-Require-Preflight header to be processed if the default CSRF prevention feature is enabled.)

    This improvement makes Apollo Server's CSRF more resistant to browsers which implement CORS in non-spec-compliant ways. Apollo is aware of one browser which as of March 2026 has a bug which allows an attacker to circumvent Apollo Server's CSRF prevention feature to carry out read-only XS-Search-style CSRF attacks. The browser vendor is in the process of patching this vulnerability; upgrading Apollo Server to v5.5.0 mitigates this vulnerability.

    If your server uses cookies (or HTTP Basic Auth) for authentication, Apollo encourages you to upgrade to v5.5.0.

    This is technically a backwards-incompatible change. Apollo is not aware of any GraphQL clients which provide non-empty Content-Type headers with GET requests with types other than application/json. If your use case requires such requests, please file an issue and we may add more configurability in a follow-up release.

    See advisory GHSA-9q82-xgwf-vj6h for more details.

Patch Changes

  • Updated dependencies [ada1200]:
    • @​apollo/server@​5.5.0

@​apollo/server@​5.5.0

Minor Changes

  • #8191 ada1200 Thanks @​glasser! - ⚠️ SECURITY @apollo/server/standalone:

    Apollo Server now rejects GraphQL GET requests which contain a Content-Type header other than application/json (with optional parameters such as ; charset=utf-8). Any other value is now rejected with a 415 status code.

    (GraphQL GET requests without a Content-Type header are still allowed, though they do still need to contain a non-empty X-Apollo-Operation-Name or Apollo-Require-Preflight header to be processed if the default CSRF prevention feature is enabled.)

    This improvement makes Apollo Server's CSRF more resistant to browsers which implement CORS in non-spec-compliant ways. Apollo is aware of one browser which as of March 2026 has a bug which allows an attacker to circumvent Apollo Server's CSRF prevention feature to carry out read-only XS-Search-style CSRF attacks. The browser vendor is in the process of patching this vulnerability; upgrading Apollo Server to v5.5.0 mitigates this vulnerability.

    If your server uses cookies (or HTTP Basic Auth) for authentication, Apollo encourages you to upgrade to v5.5.0.

    This is technically a backwards-incompatible change. Apollo is not aware of any GraphQL clients which provide non-empty Content-Type headers with GET requests with types other than application/json. If your use case requires such requests, please file an issue and we may add more configurability in a follow-up release.

    See advisory GHSA-9q82-xgwf-vj6h for more details.

@​apollo/server-integration-testsuite@​5.4.0

Patch Changes

  • Updated dependencies [d25a5bd]:
    • @​apollo/server@​5.4.0

@​apollo/server@​5.4.0

Minor Changes

... (truncated)

Changelog

Sourced from @​apollo/server's changelog.

5.5.0

Minor Changes

  • #8191 ada1200 Thanks @​glasser! - ⚠️ SECURITY @apollo/server/standalone:

    Apollo Server now rejects GraphQL GET requests which contain a Content-Type header other than application/json (with optional parameters such as ; charset=utf-8). Any other value is now rejected with a 415 status code.

    (GraphQL GET requests without a Content-Type header are still allowed, though they do still need to contain a non-empty X-Apollo-Operation-Name or Apollo-Require-Preflight header to be processed if the default CSRF prevention feature is enabled.)

    This improvement makes Apollo Server's CSRF more resistant to browsers which implement CORS in non-spec-compliant ways. Apollo is aware of one browser which as of March 2026 has a bug which allows an attacker to circumvent Apollo Server's CSRF prevention feature to carry out read-only XS-Search-style CSRF attacks. The browser vendor is in the process of patching this vulnerability; upgrading Apollo Server to v5.5.0 mitigates this vulnerability.

    If your server uses cookies (or HTTP Basic Auth) for authentication, Apollo encourages you to upgrade to v5.5.0.

    This is technically a backwards-incompatible change. Apollo is not aware of any GraphQL clients which provide non-empty Content-Type headers with GET requests with types other than application/json. If your use case requires such requests, please file an issue and we may add more configurability in a follow-up release.

    See advisory GHSA-9q82-xgwf-vj6h for more details.

5.4.0

Minor Changes

  • d25a5bd Thanks @​phryneas! - ⚠️ SECURITY @apollo/server/standalone:

    The default configuration of startStandaloneServer was vulnerable to denial of service (DoS) attacks through specially crafted request bodies with exotic character set encodings.

    In accordance with RFC 7159, we now only accept request bodies encoded in UTF-8, UTF-16 (LE or BE), or UTF-32 (LE or BE). Any other character set will be rejected with a 415 Unsupported Media Type error. Note that the more recent JSON RFC, RFC 8259, is more strict and will only allow UTF-8. Since this is a minor release, we have chosen to remain compatible with the more permissive RFC 7159 for now. In a future major release, we may tighten this restriction further to only allow UTF-8.

    If you were not using startStandaloneServer, you were not affected by this vulnerability.

    Generally, please note that we provide startStandaloneServer as a convenience tool for quickly getting started with Apollo Server. For production deployments, we recommend using Apollo Server with a more fully-featured web server framework such as Express, Koa, or Fastify, where you have more control over security-related configuration options.

5.3.0

Minor Changes

  • #8062 8e54e58 Thanks @​cristunaranjo! - Allow configuration of graphql execution options (maxCoercionErrors)

    const server = new ApolloServer({
      typeDefs,
      resolvers,
      executionOptions: {
        maxCoercionErrors: 50,
      },

... (truncated)

Commits
Maintainer changes

This version was pushed to npm by [GitHub Actions](https://www.npmjs.com/~GitHub Actions), a new releaser for @​apollo/server since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the Security Alerts page.

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript labels Apr 17, 2026
@codemonkeychris
Chris Anderson (codemonkeychris) merged commit 017409a into main Apr 17, 2026
1 check passed
@dependabot
dependabot Bot deleted the dependabot/npm_and_yarn/samples/apps/headtrax/service/apollo/server-5.5.0 branch April 17, 2026 03:50
Chris Anderson (codemonkeychris) added a commit that referenced this pull request Apr 18, 2026
…ames

Addresses the second-round AI-agent field feedback. Build still compiles
and 3708 unit tests pass.

- #2 Stable window id: WindowIdAllocator.Reserve pins the primary
  devtools window to "main" so the handle survives switchComponent
  changing the window title. Windows payload surfaces `currentComponent`.
- #4 Scroll units + readback: description explicitly calls out
  percentage-delta semantics; response now carries `scrollOffsetPx` and
  `scrollableSizePx` dug out of the underlying ScrollViewer, and the
  -1 sentinel is replaced with null when an axis isn't scrollable.
- #5 Accessible names at mount: the reconciler now mirrors visible
  captions into AutomationProperties.Name for Button, HyperlinkButton,
  RepeatButton, ToggleButton, DropDownButton, SplitButton,
  ToggleSplitButton, CheckBox, RadioButton, ToggleSwitch, TextField, and
  TextBlock. Author-supplied .AutomationName(...) still wins; the
  Update path handles label changes via a provenance-aware compare so
  author overrides are preserved.
- #6 includeReactorSource rejection: tree tool returns structured
  not-implemented instead of silently no-opping.
- #7 ComboBox expand/collapse: new `expand` / `collapse` MCP verbs
  wrap IExpandCollapseProvider; `select` auto-expands a closed
  container so the popup items resolve.
- #9 Fire lambda confusion: unknown-event payload lists
  reachableMethods and explains inline lambdas aren't reflectable;
  tool description warns upfront.
- Usability: GET /mcp self-describes (schema, protocolVersion, tools,
  selectorGrammar, events); tools/list adds _selectorGrammar +
  _treeSchemaVersion extensions so POST-based agents get the grammar
  without a second hop; components tool returns ComponentInfo[] with
  isNested/isPublic/namespace; AnnounceReady emits a
  {"event":"devtools-ready", ...} JSON sentinel alongside the human
  banner; full-view tree nodes carry supportedPatterns[] probed from
  the UIA peer.

#8 (state selector scoping) deferred — requires reconciler component
registry. The resolution table previously in the feedback doc is
superseded; the doc itself has been removed from the working tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request Apr 18, 2026
…ames

Addresses the second-round AI-agent field feedback. Build still compiles
and 3708 unit tests pass.

- #2 Stable window id: WindowIdAllocator.Reserve pins the primary
  devtools window to "main" so the handle survives switchComponent
  changing the window title. Windows payload surfaces `currentComponent`.
- #4 Scroll units + readback: description explicitly calls out
  percentage-delta semantics; response now carries `scrollOffsetPx` and
  `scrollableSizePx` dug out of the underlying ScrollViewer, and the
  -1 sentinel is replaced with null when an axis isn't scrollable.
- #5 Accessible names at mount: the reconciler now mirrors visible
  captions into AutomationProperties.Name for Button, HyperlinkButton,
  RepeatButton, ToggleButton, DropDownButton, SplitButton,
  ToggleSplitButton, CheckBox, RadioButton, ToggleSwitch, TextField, and
  TextBlock. Author-supplied .AutomationName(...) still wins; the
  Update path handles label changes via a provenance-aware compare so
  author overrides are preserved.
- #6 includeReactorSource rejection: tree tool returns structured
  not-implemented instead of silently no-opping.
- #7 ComboBox expand/collapse: new `expand` / `collapse` MCP verbs
  wrap IExpandCollapseProvider; `select` auto-expands a closed
  container so the popup items resolve.
- #9 Fire lambda confusion: unknown-event payload lists
  reachableMethods and explains inline lambdas aren't reflectable;
  tool description warns upfront.
- Usability: GET /mcp self-describes (schema, protocolVersion, tools,
  selectorGrammar, events); tools/list adds _selectorGrammar +
  _treeSchemaVersion extensions so POST-based agents get the grammar
  without a second hop; components tool returns ComponentInfo[] with
  isNested/isPublic/namespace; AnnounceReady emits a
  {"event":"devtools-ready", ...} JSON sentinel alongside the human
  banner; full-view tree nodes carry supportedPatterns[] probed from
  the UIA peer.

#8 (state selector scoping) deferred — requires reconciler component
registry. The resolution table previously in the feedback doc is
superseded; the doc itself has been removed from the working tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 12, 2026
* feat(spec-038): Phase 2 — MSBuild passthrough + deterministic pre-emit ranker

`mur check` grows two agent-visible behaviors on top of the Phase-1 Tier-2
suggester: MSBuild flag passthrough via the `--` separator with
default-merging (`--nologo`, `-v:m`, `-p:Platform={host arch}` injected
only when not named in passthrough), and a pre-emit ranker that suppresses
cosmetic noise mid-iteration (CS1591 XML doc, CS0168 unused-var, IDE0xxx
style, NU1701/NU1605, MSB3245/3270/3277, CS8600-8625 nullable warnings,
REACTOR_* info-severity) while always emitting errors via a universal-
error floor. New mode flags `--strict` / `--final` / `--quiet` and
`--emit-threshold <float>` round-trip through ArgsParser. Trace output
records the effective `dotnet build` argv as a `kind: "command"` header
row so replays are bit-faithful.

Suppress→error guardrail at tools/Reactor.MurCheckGuardrail audits an
iter+final trace pair against PolicyTable's universal-error-floor
invariant. Re-uses the live PolicyTable via InternalsVisibleTo so the
two sources can never drift. Eight unit tests; the harness-side CI
wiring is deferred behind the same WindowsAppSDK-fixture blocker as
Phase-1 §1.6.

Phase-2.x post-EC2 fixes:
  * Gate-input regression. CheckCommand.ShouldEmitSuggestions now counts
    the full parsed diagnostic list, not the post-ranker emittable list.
    EC2's 3-round preview measured Tier-2 firing collapse from EC1's 80%
    to 0% on kanban-mur because the ranker's nullable-warning suppression
    closed the gate on builds EC1 had left open. Regression test
    RankerTests.Suggest_gate_counts_full_parsed_list_not_post_ranker_emittable
    locks the behavior.
  * `--final` framing softened in both plugins/reactor/skills/reactor-
    build-and-check/SKILL.md and the legacy root SKILL.md. EC2's 3-round
    preview measured 0/6 production value across mandatory --final
    invocations; the framing now describes --final as an optional pre-
    merge sweep for human review / CI gates, explicitly not a task-
    completion requirement.
  * TraceWriter mode propagation fix. The diagnostic-row `mode` field
    used to be hardcoded to "iteration" even when invoked via --final.
    Now piped through TraceWriter.Open(path, root, mode); regression
    test TraceWriterTests.Diag_row_mode_matches_writer_invocation_mode
    locks it.

EC2 5×N PASS by median (2026-05-11):
  * reactor-calc-mur-check beats base on every metric — cost −5.1%,
    tokens −5.8%, turns −5.1%, wall −7.9%; CV cost 1.9× tighter.
  * reactor-kanban-mur-check at cost median parity ($3.30 = $3.30);
    mean dragged to +5.7% by R2 outlier (R2-excluded mean −3.3%).
  * First-build OK 5/5 both variant arms.
  * --final invocation 0/10 across both projects (SKILL framing
    working as designed; the previous bugged-Phase-2 batch had 6/6
    mandatory invocations).
  * Tier-2 firing 0/10 — gate correctly inhibits on small-batch
    iteration patterns; closing the kanban token gap is Phase-3's
    scope (rules > fuzzy match).
  * Criterion-2 guardrail audit deferred to a harness retrofit
    (post-run `mur check --final` against the final workspace state).

Tests: 7102 / 7102 passing on the post-fix tree. CheckCommandTests
grew from 120 to 148 tests across the Phase-2 surfaces (ArgsParser
passthrough + mode flags, Ranker scoring + emit gates, Guardrail
trace-pair audit, TraceWriter mode propagation, gate-input regression).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(spec-038): Phase 3 — Class-B rules + Margin/Padding API ergonomics

Three Class-B vocabulary-translation rules under the Phase-3 rule
infrastructure, plus two Reactor API/skill fixes surfaced while authoring
them.

Rules (Validation Gate; ready for review, not merge — bar #5 is human):
- ThemeBackgroundSuffixRule: CS0117 on Theme.*Background → Theme.SolidBackground
  (cluster C0019, 16 events)
- AlignmentShortcutRule: CS1061 on Reactor *Element receivers for
  HorizontalAlignment / VerticalAlignment → .HAlign(...) / .VAlign(...)
  (cluster C0017 + adjacent, ~22 events)
- ButtonOnClickFactoryMoveRule: CS1061 on ButtonElement.OnClick →
  Button(..., onClick: ...), explicitly naming .OnTapped as the wrong sibling
  to keep agents from reaching for the gesture event

Reactor API fixes (driven by 525-run corpus signal):
- Margin / Padding per-side overloads now default unspecified sides to 0.0,
  eliminating ~198 corpus build failures from .Margin(top: 12)-shaped calls
- BREAKING (pre-1.0): Margin(double, double) and Padding(double, double)
  parameter order swapped from (horizontal, vertical) to (vertical, horizontal)
  to match CSS shorthand (top/bottom first). All repo callsites migrated to
  named-arg form for layout preservation and reviewer clarity.

Skill updates (agent context):
- reactor-getting-started cheatsheet shows named-arg Button("Save", onClick: handler)
  with explicit anti-pattern call-out
- .OnTapped example re-anchored to non-Button surfaces (Border, Image, ScrollView)

§3.1a residual: trace-channel rule_self_disabled row when a rule's declared
target stops resolving against the live Reactor compilation; routed through
TraceWriter.WriteRuleSelfDisabled, dedup'd per-invocation per-rule.

Tests: Reactor.Tests 7156/7202 (46 expected-skip); CheckCommandTests 193/193.
Solution builds clean (no new C# / REACTOR_* warnings).

Class-A rule PRs remain blocked on second-agent corpus drop (Validation Gate
bar #2, cross-agent reproducibility).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(spec-038): force-load Reactor.dll BEFORE enumerating refs

Copilot review feedback on #248: BuildLiveReactorCompilation enumerated
AppDomain.CurrentDomain.GetAssemblies() before the
`typeof(...AsyncValue<int>).Assembly` force-load, so on a cold xunit
run where Reactor.dll wasn't already loaded, the enumeration completed
without Reactor in the reference list and target resolution failed for
every rule.

Moving the force-load to the head of the method guarantees Reactor.dll
is in the AppDomain before enumeration begins. Spec 038 §3.1a.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 16, 2026
Adds the .NavigateUri(Uri) fluent on HyperlinkButtonElement (spec 039
§14 #5). The init property already existed and the reconciler already
piped it through Mount and Update, so this is a pure extension method —
no record or reconciler changes.

Also updates the XML doc on HyperlinkButton(Command) — it used to send
callers to .Set() with a hand-written NavigateUri assignment. The
promise is now real: HyperlinkButton(cmd).NavigateUri(uri) compiles
and routes through the existing reconciler path. The Button(Command)
doc gets a parallel example to keep the discoverability story tight.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 16, 2026
Adds SpecFlaggedBugRegressionTests with named regression checkpoints for
the three spec-039 §14 bugs:

  - §3.4 AutoSuggestBox.OnSuggestionChosen reachable via record
    constructor (factory path) and via .SuggestionChosen(...) fluent
  - §14 #5 HyperlinkButton.NavigateUri fluent exists and the
    HyperlinkButton(Command) + .NavigateUri(...) doc-promise holds
  - §17.5 Card(child) theme-binding wiring (cross-reference to the
    detailed smoke in CardThemeResolutionSmokeTests)

Flips the Phase 11 checkboxes and the bottom-tracker "Tests landed
(Phase 11)" entry. Two AppTests-harness-blocked deferrals tracked
inline:
  - 11.4 real theme-flip Light/Dark/HighContrast resolution test
  - 11.6 real Phase-8 page mount-and-fire test

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 16, 2026
… props, named styles (#314)

* feat(039): land Phase 0-2 — scaffolding, event fluents, named-style helpers (#039)

Implements the foundational layers of the property & event API scrub
(spec 039). Phases 0-2 (Phase 3+ to follow in subsequent commits).

Phase 0: Scaffolding
- Added empty partial classes ElementExtensions.Events,
  ElementExtensions.NamedStyles, Factories.NamedStyles.
- Generated event-fluent inventory CSV (68 rows) under
  tests/Reactor.SelfTests/Fixtures/event-fluent-inventory.csv via
  tools/api-scrub/Build-EventFluentInventory.ps1.

Phase 1: Universal event fluents
- Hand-written extensions covering every Action/Action<T> callback on
  every element record across §1–§9, §12 (~63 fluents). Names drop the
  leading "On" to avoid the C# property-vs-extension delegate-invocation
  clash; property names unchanged.
- 63 null-clear unit tests confirm passing null clears handler.

Phase 2: Named-style helpers + Card + type-ramp factories
- .AccentButton(), .SubtleButton() on ButtonElement and its subtypes.
- .TextLink() on Hyperlink/Button.
- InputScope fluents on TextField (Numeric/Email/Url/Phone/Search) +
  generic .InputScope() escape hatch.
- InfoBar severity fluents (Informational/Success/Warning/Error).
- Card(child) factory: corner radius 8, padding 16, theme-aware
  background + stroke via ThemeRef plumbing.
- Type-ramp factories Title/Subtitle/Body/BodyStrong/BodyLarge in
  Factories.NamedStyles.cs (no matching fluents — §17.6 two-ways trap).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 3.1 — CalendarView SelectedDates + SelectedDatesChanged

Models the missing multi-select event on CalendarView (spec 039 §3 +
Q4). Adds:

- CalendarViewElement.SelectedDates: declarative initial selection
  as IReadOnlyList<DateTimeOffset>?.
- CalendarViewElement.OnSelectedDatesChanged: user-event callback
  receiving a snapshot of the full selection (not added/removed delta —
  easier to bind into component state without diffing).
- Fluents .SelectedDates(...) / .SelectedDatesChanged(handler).

Reconciler wiring:

- Initial selection applied at mount BEFORE subscribing, so the
  declarative seed doesn't fire the user event.
- Subscription is unconditional; the handler reads the latest element
  via the element tag so a later record-with that attaches a handler
  picks up without re-wiring.
- Updates diff current vs desired selection and apply add/remove via
  ChangeEchoSuppressor.BeginSuppress so subsequent declarative writes
  don't echo back as user events.

Tests: null-clear unit test added. Reconciler-level "no-event-on-mount /
event-fires-once-per-user-change" deferred to Phase 11.7 (AppTests
harness — requires a WinUI runtime).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 3.2 — Frame navigation events

Adds the three commonly-needed Frame events to FrameElement (spec 039
§3.2). Modelled as Reactor-shaped substitutes — Action<Type> /
Action<Type,Exception> — matching the rest of the codebase, which
doesn't surface raw WinUI EventArgs in user-facing callbacks. Users
who need NavigationMode, NavigationParameter, or cancellation can wire
the raw event via .Set(...).

- OnNavigated: Action<Type>? — receives the new SourcePageType.
- OnNavigating: Action<Type>? — receives the target SourcePageType
  (cancellation not surfaced; spec accepts this trade for ergonomics).
- OnNavigationFailed: Action<Type, Exception>? — target + failure.

Fluents .Navigated / .Navigating / .NavigationFailed land per Phase 1
conventions. Reconciler subscribes unconditionally; the trampoline reads
the latest element via the element tag so a later record-with picks up
without re-wiring.

Sample (spec §3.2 last bullet, §8.3) deferred — requires XAML
Page-derived types, better authored alongside the rest of the Phase 8
sample sweep.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 3.3 — ScrollView.ViewChanged

Adds OnViewChanged to ScrollViewElement (spec 039 §3.3). Callback is
Action<ScrollViewerViewChangedEventArgs>? — args carry IsIntermediate
for callers who want to debounce until the scroll settles.

ScrollViewer is pooled, so subscription uses the established
PoolableWireFlags.ScrollViewerViewChanged once-per-instance gate; the
trampoline reads the live element via GetElementTag so a later
record-with that attaches the handler doesn't require re-subscription.

Fluent .ViewChanged(handler) + null-clear test. Reconciler-level
"scroll triggers callback" deferred to AppTests harness (Phase 11.7).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 3.4 — Popup.Opened

Adds OnOpened to PopupElement (spec 039 §3.4). PopupElement already
exposed OnClosed; this rounds out the lifecycle. Trampoline mirrors
the existing OnClosed wiring — both resolve the live element via the
wrapper StackPanel's element tag so updates pick up fresh closures.

Fluent .Opened(handler) + null-clear test.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 3.5 — WebView2 message + init events

Adds two commonly-needed WebView2 events (spec 039 §3.5):

- OnWebMessageReceived(Action<string>?) — fired on the UI thread when
  the hosted page posts a message via window.chrome.webview.postMessage.
  Handler falls back from TryGetWebMessageAsString() to WebMessageAsJson
  so callers always receive a string payload even when the page sends
  a structured message.
- OnCoreWebView2Initialized(Action?) — fires once on the UI thread when
  the underlying CoreWebView2 is available, the earliest point at which
  features like AddScriptToExecuteOnDocumentCreatedAsync become usable.

Both subscribed unconditionally in MountWebView2 — the trampolines read
the live element via the element tag so later record-with that attaches
a handler picks up without re-subscription. Threading contract
documented in XML doc comments. Fluents and null-clear tests land.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 3.6 — MediaPlayerElement events

Adds MediaOpened, MediaEnded, and MediaFailed callbacks to
MediaPlayerElementElement (spec 039 §3.6). MediaPlayer raises these on
a worker thread, so a new DispatchToElement<TElement> helper marshals
through the element's DispatcherQueue and resolves the live element via
GetElementTag — handler is a no-op if the element has unmounted between
the event firing and the dispatched continuation.

- OnMediaOpened: Action?
- OnMediaEnded: Action?
- OnMediaFailed: Action<string>? — receives args.ErrorMessage ??
  args.Error.ToString() to keep the callback signature simple while
  preserving the most-useful failure detail.

Fluents .MediaOpened / .MediaEnded / .MediaFailed + null-clear tests.
Threading contract documented in XML doc comments. Integration test
that asserts events fire on real media playback deferred to Phase 11.7
(AppTests harness).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 4.1 — Slider init fluents

Adds five frequently-set init properties on SliderElement (spec 039 §3.8)
and the matching fluent extension methods:

- .Orientation(Orientation) — horizontal vs vertical layout
- .TickFrequency(double) — interval between tick marks
- .TickPlacement(TickPlacement) — where ticks render on the track
- .SnapsTo(SliderSnapsTo) — snap to ticks vs step values during drag
- .ThumbToolTip(bool = true) — floating value tooltip during drag

The reconciler wires all five through Mount (initial control creation)
and Update (delta-based property writes guarded by equality checks so a
no-op render doesn't bounce the control state).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 4.2 — NumberBox init fluents

Adds four init properties on NumberBoxElement (spec 039 §3.3) and the
matching fluents:

- .NumberFormatter(INumberFormatter2) — currency / percent / etc.
- .AcceptsExpression(bool = true) — arithmetic expressions like 2*3+1
- .ValidationMode(NumberBoxValidationMode) — overwrite-vs-disabled
- .Description(string) — help text rendered under the box

The reconciler writes NumberFormatter only when the reference actually
changed, so a same-formatter re-render won't reformat the text and
clobber an in-progress edit.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 4.3 — ColorPicker init fluents

Adds six fluents over the existing ColorPickerElement init properties
(spec 039 §3.11) — one per visibility toggle:

- .AlphaEnabled(bool = true)
- .MoreButtonVisible(bool = true)
- .ColorSpectrumVisible(bool = true)
- .ColorSliderVisible(bool)
- .ColorChannelTextInputVisible(bool)
- .HexInputVisible(bool)

UpdateColorPicker now reconciles all five visibility flags (previously
only IsAlphaEnabled propagated through update), so flipping a toggle
mid-session takes effect on the next render.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 4.4 — TabView init fluents

Adds seven init properties on TabViewElement (spec 039 §7.4) and the
matching fluents:

- .TabWidthMode(TabViewWidthMode) — Equal / SizeToContent / Compact
- .CloseButtonOverlayMode(TabViewCloseButtonOverlayMode) — Auto / OnPointerOver / Always
- .CanDragTabs(bool = true) — detach to a new window
- .CanReorderTabs(bool = true) — drag within the strip
- .AllowDropTabs(bool = true) — accept tabs from another TabView
- .TabStripHeader(Element) — leading-edge content
- .TabStripFooter(Element) — trailing-edge content

Strip header/footer children are reconciled via the existing
ReconcileChild helper so update-in-place works (no full remount when
their content changes).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 4.5 — NavigationView init fluents

Adds six init properties on NavigationViewElement (spec 039 §7.2) and
the matching fluents:

- .AutoSuggestBox(AutoSuggestBoxElement) — pane-top search box
- .PaneFooter(Element) — pane-bottom slot below menu items
- .PaneCustomContent(Element) — slot between AutoSuggestBox and items
- .OpenPaneLength(double) — pane width when expanded
- .CompactModeThresholdWidth(double) — window width to collapse the pane
- .ExpandedModeThresholdWidth(double) — window width to auto-expand

Threshold/length init properties default to NaN so the WinUI defaults
take effect when unset (Mount/Update only writes when a real value is
provided). Pane children reconcile in place via ReconcileChild.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 4.6 — TitleBar init fluents

Adds fluents over existing TitleBarElement init properties (spec 039
§7.3):

- .BackButtonVisible(bool) / .BackButtonEnabled(bool)
- .PaneToggleButtonVisible(bool)
- .Content(Element) / .RightHeader(Element)
- .Icon(IconData) and convenience .Icon(string imageUri) — the string
  overload wraps the URI in an ImageIconData, matching the spec §7.3
  shorthand. No new init properties needed; reconciler already wires
  every target.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 4.7 — TextField init fluents

Adds five init properties on TextFieldElement (spec 039 §3.1) and the
matching fluents:

- .MaxLength(int) — character limit (0 = unlimited)
- .IsSpellCheckEnabled(bool = true) — toggle built-in spell-check
- .CharacterCasing(CharacterCasing) — Normal / Upper / Lower input
- .TextAlignment(TextAlignment) — horizontal text alignment
- .Description(string) — help text rendered below the box

InputScope is intentionally out of scope here — Phase 2.3 owns it.

The reconciler writes each property only when the WinUI TextBox value
diverges from the element, so a no-op render doesn't cause flicker.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 4.8 — HyperlinkButton .NavigateUri fluent + doc fix

Adds the .NavigateUri(Uri) fluent on HyperlinkButtonElement (spec 039
§14 #5). The init property already existed and the reconciler already
piped it through Mount and Update, so this is a pure extension method —
no record or reconciler changes.

Also updates the XML doc on HyperlinkButton(Command) — it used to send
callers to .Set() with a hand-written NavigateUri assignment. The
promise is now real: HyperlinkButton(cmd).NavigateUri(uri) compiles
and routes through the existing reconciler path. The Button(Command)
doc gets a parallel example to keep the discoverability story tight.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 5.1 — Text family init properties

Adds high-traffic init properties and matching fluents on the three
text records (spec 039 §1.1 / §1.3 / §1.4):

- TextBlockElement: .LineHeight(double), .MaxLines(int),
  .CharacterSpacing(int), .TextDecorations(TextDecorations)
- RichTextBlockElement: .MaxLines(int), .LineHeight(double),
  .TextAlignment(TextAlignment), .TextTrimming(TextTrimming),
  .CharacterSpacing(int)
- RichEditBoxElement: .IsSpellCheckEnabled(bool = true),
  .MaxLength(int), .TextWrapping(TextWrapping = Wrap),
  .AcceptsReturn(bool = true), .SelectionHighlightColor(SolidColorBrush)

The TextBlock bitmask diff (EXP-2) gained four new bits so the fast
path keeps avoiding interop reads for unchanged properties.
RichTextBlock and RichEditBox update paths reconcile all five props.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 5.2 — ToggleButton three-state + CheckedState fluents

Brings ToggleButtonElement to parity with CheckBoxElement / WinUI's
ToggleButton three-state cycle (true → false → null → true). Spec
039 §2.4 — matches the existing CheckBox/ThreeStateCheckBox precedent
(single record, IsThreeState flag), not the alternative split-record
shape.

Adds to ToggleButtonElement:
- IsThreeState (bool)
- CheckedState (bool?)  — active when IsThreeState=true
- OnCheckedStateChanged (Action<bool?>?)

New fluents:
- .IsThreeState(bool = true)
- .CheckedState(bool?) — auto-sets IsThreeState=true
- .CheckedStateChanged(Action<bool?>?) — null clears

New factory:
- ThreeStateToggleButton(label, checkedState = null, onCheckedStateChanged = null)

The reconciler now writes IsThreeState explicitly and clears it when
flipped back to two-state, so toggling .IsThreeState() between renders
works without remounting. The Click trampoline dispatches both
OnIsCheckedChanged and OnCheckedStateChanged; HasCallbacks was widened
to include the new callback.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 5.3 — Input control init props + fluents

Spec 039 §3.2 / §3.4 / §3.7 / §3.10 / §3.11. New init properties on
five input records, with matching value fluents plus event fluents
for the two new ComboBox callbacks.

PasswordBoxElement:
- MaxLength, Header, PasswordRevealMode, PasswordChar

AutoSuggestBoxElement:
- Header, QueryIcon (IconData), IsSuggestionListOpen

ComboBoxElement:
- MaxDropDownHeight, Description
- OnDropDownOpened, OnDropDownClosed (with .DropDownOpened /
  .DropDownClosed fluents per the leading-On rule)

RatingControlElement:
- PlaceholderValue (double), InitialSetValue (int — matches WinUI's
  RatingControl.InitialSetValue signature), .Caption() promoted from
  init-property to a fluent

ColorPickerElement:
- ColorSpectrumShape, Min/MaxHue, Min/MaxSaturation, Min/MaxValue
- .HueRange / .SaturationRange / .ValueRange paired-bound helpers

Reconciler wires every new property; ComboBox's two new events join
the HasCallbacks OR-chain. QueryIcon uses the existing ResolveIcon
helper (AutoSuggestBox.QueryIcon takes an IconElement, not IconSource).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 5.4 — Date/time picker init props + fluents

Spec 039 §4.1. New init properties on the three date/time records,
all with matching fluents.

CalendarDatePickerElement:
- DateFormat (string), IsTodayHighlighted (bool = true),
  IsCalendarOpen (bool), IsGroupLabelVisible (bool = true)

DatePickerElement:
- DayFormat / MonthFormat / YearFormat (string), Orientation
  (default Horizontal)

CalendarViewElement:
- MinDate / MaxDate (DateTimeOffset?), FirstDayOfWeek
  (Windows.Globalization.DayOfWeek?), NumberOfWeeksInView (int = 6),
  DisplayMode (CalendarViewDisplayMode = Month)

The reconciler reconciles every new property in the corresponding
Update* method (CalendarDatePicker, DatePicker, CalendarView).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 5.5 — Progress/layout/navigation init props + fluents

Spec 039 §5 / §6. New init properties on InfoBar, Expander, SplitView,
plus VariableSizedWrapGrid attached-prop fluents.

InfoBarElement:
- IconSource (IconData? — overrides severity icon), Content (Element? —
  rich body below the message). Both reconcile via ReconcileChild so the
  body element updates in place across re-renders.

ExpanderElement:
- HeaderTemplate (Element? — wins over the string Header), ContentTransitions
  (TransitionCollection? — custom expand/collapse motion).

SplitViewElement:
- PaneBackground (Brush?) with a `.PaneBackground(ThemeRef)` overload that
  routes through the existing ThemeBindings pipeline for light/dark-adaptive
  pane backgrounds.
- LightDismissOverlayMode (default Auto).

VariableSizedWrapGrid attached-prop fluents:
- new WrapGridAttached record + `.WrapGridColumnSpan(int)` /
  `.WrapGridRowSpan(int)` extensions. MountWrapGrid applies
  VariableSizedWrapGrid.SetRowSpan/SetColumnSpan at mount time, and
  UpdateWrapGrid re-applies on every render in lockstep with
  ReconcileChildren's null/EmptyElement filtering.

MountInfoBar/UpdateInfoBar now accept `requestRerender` so the child
Element mounts/reconciles correctly. UpdateExpander reconciles
HeaderTemplate via ReconcileChild with a string-header fallback when the
element header is cleared.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 5.6 — Collections + dialogs init props + fluents

Spec 039 §8 / §9. New init properties on ListView, GridView,
ContentDialog, Flyout, TeachingTip.

ListViewElement / GridViewElement:
- ItemContainerStyle (Style?), IncrementalLoadingTrigger (default Edge).
  Both wire at mount and reconcile on update.

ContentDialogElement:
- IsPrimaryButtonEnabled (bool = true), IsSecondaryButtonEnabled (bool = true),
  OnOpened with `.Opened()` event fluent. (WinUI 3 ContentDialog has no
  `Opening` event, so the spec's `OnOpening` is dropped — deferred upstream.)

FlyoutElement:
- ShowMode (FlyoutShowMode = Auto), AreOpenCloseAnimationsEnabled (bool = true),
  OverlayInputPassThroughElement (Element? — mounted as a DependencyObject).
  Both the existing-flyout reuse path and the fresh-flyout creation path in
  UpdateFlyoutElement propagate the new props.

TeachingTipElement:
- IconSource (IconData?), HeroContent (Element?), PlacementMargin (Thickness),
  PreferredPlacement (TeachingTipPlacementMode = Auto). HeroContent rebuilds
  on swap (simple over hot — teaching-tip hero isn't a render hot path).

GroupStyle on ListView/GridView is deferred per the spec — needs a
Reactor-shaped wrapper for the templated header/footer pair and tracked
separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 5.7 — Media + shapes init props + fluents

Spec 039 §10 / §11 / §12. New init props on six media/shape records.

ImageElement:
- OnImageOpened (Action?), OnImageFailed (Action<string>?), NineGrid
  (Thickness?). Both events route through the new EnsureImageWiring
  helper + PoolableWireFlags so a pooled Image won't double-subscribe
  across mount/unmount cycles.

WebView2Element:
- Source was already the record's positional parameter and is reconciled
  by UpdateWebView2. No change needed — verified at audit.

PathElement:
- StrokeStartLineCap / StrokeEndLineCap / StrokeDashCap (PenLineCap),
  StrokeLineJoin (PenLineJoin), StrokeMiterLimit (double = 10),
  StrokeDashOffset (double), FillRule (FillRule = EvenOdd).
- FillRule lives on the underlying PathGeometry (not Shapes.Path) so
  the reconciler propagates via `p.Data as PathGeometry`.

PipsPagerElement:
- WrapMode, MaxVisiblePips (default 5), PreviousButtonVisibility,
  NextButtonVisibility (both default Collapsed).

RefreshContainerElement:
- PullDirection (default TopToBottom); HasCallbacks now reflects
  OnRefreshRequested.

ParallaxViewElement:
- Source (UIElement?), VerticalSourceStartOffset, VerticalSourceEndOffset.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 5.8 — Universal multi-select SelectionChanged

Spec 039 §8 / §14 #4 universal gap. Adds snapshot-style
OnSelectionChanged to every collection element so Multiple / Extended
selection modes are reachable without dropping to .Set(...) +
SelectedItems iteration.

- ListViewElement / GridViewElement / ListBoxElement
  → Action<IReadOnlyList<int>>? OnSelectionChanged

- TemplatedListViewElement<T> / TemplatedGridViewElement<T> / ItemsViewElement<T>
  → Action<IReadOnlyList<T>>? OnSelectionChanged
  (typed peers materialize items from the SelectedItems indices via a new
   virtual InvokeMultiSelectionChanged on TemplatedListElementBase)

- TreeViewElement — deferred. WinUI's TreeView selection model is
  hierarchical and needs separate design (SelectionMode.Multiple over a
  tree differs in subtle ways from flat-list multi-select).

Snapshot semantics (not delta-style) match CalendarView's
OnSelectedDatesChanged from Phase 3.1 — the callback receives the FULL
current selection on every change, so component state can be a plain
IReadOnlyList without diffing.

Mount-time wiring is now unconditional for ListView/GridView/ListBox
SelectionChanged (handlers resolve via GetElementTag), so the previous
"lazy-wire on null→non-null" code in UpdateListView/UpdateGridView/
UpdateListBox is removed to avoid double-subscription. Tag refresh on
update keeps newly-attached handlers reachable.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 6.1 — rename RichText → RichTextBlock + obsolete alias

The record was already named `RichTextBlockElement`; this aligns the
factory name with the record and with WinUI's
`Microsoft.UI.Xaml.Controls.RichTextBlock`. Both `RichText(string)` and
`RichText(RichTextParagraph[])` overloads are preserved as `[Obsolete]`
forwarding aliases for one release per spec §16.4 (B). Ten sample / doc
/ test call sites migrated to the new name.

New `### Breaking changes (deferred)` section in `CHANGELOG.md` under
`## [Unreleased]` to catalog naming-alignment renames whose
`[Obsolete]` aliases come out in the next minor.

(spec 039 §1.3 / §14 #8)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 6.2 — document divergent Reactor wrappers

Add `<summary>` + `<remarks>` XML doc comments to every factory whose
name diverges from WinUI (no first-party WinUI control of the same
name): `Heading`, `SubHeading`, `Caption`, `VStack`, `HStack` (and the
`(spacing, ...)` overloads), `Flex` / `FlexRow` / `FlexColumn`,
`ListView<T>` / `GridView<T>` / `FlipView<T>` (typed/templated peers
sharing names with untyped factories), and `LazyVStack<T>` /
`LazyHStack<T>`. Each remark explains the SwiftUI / cross-platform
naming influence or the underlying WinUI primitive being wrapped.

(spec 039 §0.3)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 6.3 — document StackElement.Spacing default-8 deviation

Add `<summary>` + `<remarks>` to `StackElement.Spacing` calling out the
deliberate 8-DIP default vs WinUI `StackPanel.Spacing` default of 0.
Doc-only — value unchanged per spec 039 §0.4 / §16. Rationale: Reactor's
`VStack(a, b, c)` call shape almost always wants whitespace between
siblings; the WinUI-zero default produced visually wrong output for the
zero-arg case.

(spec 039 §0.4 / §16)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 6.4 — TextField / MaskedTextField naming rationale

Per spec 039 §16.5 the `TextField` / `MaskedTextField` rename is
explicitly out of scope (option C — keep as-is). Add an XML
`<summary>` + `<remarks>` to each factory pointing readers at the
spec sections that capture the impact analysis and decision. The
`TextField` doc anchors §3.1 / §16; `MaskedTextField` anchors §13 /
§16.3 and notes that the two renames would bundle together if ever
revisited.

(spec 039 §3.1 / §13 / §16)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 6.5 — ScrollViewer obsolete alias + doc comment

Decision: keep `ScrollView`, add `[Obsolete]` `ScrollViewer(Element)`
forwarding alias. Reactor's `ScrollViewElement` reconciles to WinUI's
legacy `Microsoft.UI.Xaml.Controls.ScrollViewer`, but WinUI 3 also
ships the newer `Microsoft.UI.Xaml.Controls.ScrollView` — the shorter,
modern name. Reactor's `ScrollView` is already consistent with that
preferred WinUI name, so the alias direction lets agents reaching for
the WPF / WinUI-legacy `ScrollViewer` spelling discover the modern one.

CHANGELOG entry under `### Breaking changes (deferred)` already in place
from Phase 6.1.

(spec 039 §6 / §16)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 6.6 — ProgressBar obsolete alias + Progress doc comment

Decision: keep `Progress` / `ProgressIndeterminate`, add `[Obsolete]`
`ProgressBar(double)` / `ProgressBar()` forwarding aliases. Reactor's
`ProgressElement` reconciles to WinUI's `ProgressBar`; Reactor names
factories by intent (`Progress`) rather than rendering shape
(`ProgressBar` includes the visual primitive in the name). Aliases let
WinUI muscle-memory callers discover the Reactor spelling without
breaking code.

Also adds `<summary>` + `<remarks>` to the `Progress` and
`ProgressIndeterminate` factories themselves; the rationale doc lives
on the primary (non-obsolete) factory.

CHANGELOG entry under `### Breaking changes (deferred)` already in place
from Phase 6.1.

(spec 039 §5 / §16)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 7.1 — draft spec 040 specialized control scrub

Schedules the follow-up specialized-control audit deferred from spec 039
§13. Draft scaffold only — five controls each get the three audit checks
(event parity, property coverage, naming alignment) as unanswered
checkbox outlines; the audit itself lands in a future change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 7.2 — specialized control event fluents

Re-runs the Phase 0.3 inventory script over src/Reactor/Controls/** and
broadens the delegate-type regex to capture one level of nested generics
(so DataGridElement<T>.OnSelectionChanged — Action<IReadOnlySet<RowKey>>?
— is now picked up). Adds the missing .SelectionChanged(...) fluent on
DataGridElement<T> plus its null-clear test; the other four specialized
controls (AutoSuggest / MaskedTextField / PropertyGrid / VirtualList)
were already covered by Phase 1's hand-written sweep.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 8.1 — ReactorGallery Button/TextField/InfoBar fluent showcases

Demonstrates the new Phase 1–5 fluents in the gallery:

- ButtonPage: .Click + .AccentButton / .SubtleButton / .TextLink
  (also satisfies the Phase 2.2 .TextLink demo deferred from §17.2).
- TextFieldPage: .NumericInput / .EmailInput / .UrlInput alongside
  .Description(...) per spec §17.3 / §5.
- InfoBarPage: all four severity fluents (.Informational / .Success /
  .Warning / .Error) per spec §17.4 — replaces the previous
  'Severity = InfoBarSeverity.X' record-with pattern.

GalleryControls.cs fully-qualifies WinUI's
Microsoft.UI.Xaml.Controls.ScrollViewer attached-property class because
the Phase 6.5 Factories.ScrollViewer() obsolete alias now shadows it
through the file's 'using static Factories' import. Pre-existing
baseline issue surfaced by the gallery build, fixed here so Phase 8
verifications run.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 8.1 — Card / type-ramp / CalendarView showcases

Three more gallery pages exercising the new Phase 5 / §17 surface:

- Layout/CardPage (new) — Card(child) preset BorderElement with an
  icon + heading + body composition so the theme-aware brushes are
  visible. Demonstrates that Card returns a BorderElement and chains
  with Padding/CornerRadius overrides (§17.5).
- Text/TypeRampPage (new) — Title / Subtitle / Body / BodyStrong /
  BodyLarge factories rendered standalone and inside a Card "article"
  composition (§17.6).
- DateAndTime/CalendarViewPage — adds a Multiple-selection demo wiring
  the new .SelectedDatesChanged(...) fluent into local state (§3.1).
  The fluent drops the leading "On"; the underlying property remains
  OnSelectedDatesChanged.

Both new pages registered in ControlRegistry + PageRouter so they're
discoverable from the gallery shell.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 8.3 — Frame navigation micro-sample

Adds the Frame.Navigated / .Navigating / .NavigationFailed sample
deferred from Phase 3.2. FrameElement bridges into WinUI by calling
the underlying Frame.Navigate(Type), which requires real Page-derived
classes — so the sample ships three trivial code-only Page subclasses
(Home, Details, Broken) alongside the demo component.

The demo wires all three fluents into a 20-entry rolling log via
UseReducer (functional setter — handlers fire after render so the
plain UseState setter would close over stale state). A "Force failure"
button navigates to the Broken page whose ctor throws, so
NavigationFailed fires with the exception captured in the log.

Re-keying the FrameElement on a tick state forces Reactor to remount
the Frame so identical-target re-navigations still raise
Navigating + Navigated (the underlying WinUI Frame coalesces
identical Navigate calls otherwise).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* feat(039): Phase 8.2 — sample apps fluent sweep (no-op verification)

Grepped each in-scope app for the .Set(c => c.OnX = ...) /
property-init OnX = pattern that the Phase 1–7 fluent surface
supersedes:

  samples/apps/chat
  samples/apps/demo-script-tool
  samples/apps/regedit
  samples/apps/wordpuzzle
  samples/apps/validation-showcase
  samples/apps/a11y-showcase

Zero hits across all six. The Set(...) escape-hatches that exist are
theme-resource templating (Set("ButtonBackground", brush)) or
style-only WinUI knobs (Padding, TextWrapping, AcceptsReturn, etc.),
none of which currently have a fluent. The OnClosed / OnItemInvoked
property-init patterns in regedit already live inside with { ... }
record-construction (not inside Set), where the fluent swap doesn't
buy anything.

Documented as no-op on the task list. No app code changes; this
commit is the task-tracker flip + 8.1 / 8.3 deferred-item
cross-references (Phase 2.2 TextLink sample, Phase 3.2 Frame sample).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 9.1 — guide updates

Add minimum-viable coverage of the spec-039 surface to the existing user
guides:

- forms.md: new "Configuring TextField" section covers
  .NumericInput / .EmailInput / .UrlInput / .PhoneInput / .SearchInput
  alongside .MaxLength / .IsSpellCheckEnabled / .CharacterCasing /
  .TextAlignment / .Description.
- styling.md: new "Named-Style Fluents" section covers .AccentButton /
  .SubtleButton / .TextLink and the four InfoBar severity helpers.
- layout.md: new Card and Type-Ramp sections with worked examples.
- navigation.md: new Frame events section (.Navigated / .Navigating /
  .NavigationFailed) plus NavigationView.SelectedTagChanged fluent.
- collections.md: new Multi-Select section covering the universal
  .SelectionChanged fluent on ListView / GridView / ListBox and the
  typed peers, including the IReadOnlyList<int> vs IReadOnlyList<T>
  signature split and the TreeView deferral note.

getting-started.md already used the post-Phase-1 fluent shapes throughout;
no edits needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 9.2 — xaml-developers cross-reference

Add an "Events: XAML Attributes Become Fluents" section to the
XAML-developers guide so people coming from XAML find the bridge
quickly. Covers the canonical mappings (Click, TextChanged,
SelectionChanged, SelectedIndexChanged, IsCheckedChanged) and the
naming convention — the fluent drops the leading On (because C#
binds delegate-property invocation in preference to extension
methods, per spec 039 §0.1), while the underlying property keeps
On so existing record-construction syntax still compiles.

docs/reference/ has no auto-generated API surface — the only
machine-derived API doc is skills/reactor.api.txt + the mirror at
plugins/reactor/skills/reactor-dsl/references/reactor.api.txt,
both regenerated on every Reactor build. No manual action needed
there.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 9.3 — spec 039 Status: Implemented

Flip the spec's status header from "In Implementation" to
"Implemented", with backlinks to the task list, the implementing
branch, and the per-phase commit history (single line, not enumerated).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 9.4 — CHANGELOG entries

Add a spec-039 block under [Unreleased] / ### Added covering the
four required subheadings:

- New fluent extensions (single bullet referring to the inventory).
- Named-style helpers (.AccentButton / .SubtleButton / .TextLink,
  InfoBar severity helpers, Card factory, type-ramp factories).
- New events exposed (CalendarView, Frame, ScrollView, Popup,
  WebView2, MediaPlayerElement, ContentDialog, Image, ComboBox,
  DataGrid, universal collection multi-select).
- New init properties (single bullet referring to spec 039 §14 #4 —
  Phase 4 / Phase 5 inventory).

Naming aliases (RichText → RichTextBlock, ScrollViewer, ProgressBar)
remain in the existing "Breaking changes (deferred)" block where
Phase 6.1 / 6.5 / 6.6 originally landed them — they're already
described there, no duplication needed.

Also flips the Phase 9 task-file checkboxes to [x] and the tracker
"Docs updated (Phase 9)" line.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 10.1 — reactor-dsl SKILL.md fluent-naming clarification

Adds a "Fluent naming convention (callbacks)" section explaining that
record `OnX` callback properties have matching `.X(...)` fluent
extensions (the leading `On` drops). Calls out the C# instance-property
vs extension-method clash that drove the split, and the null-clear
semantic.

reactor.api.txt is auto-regenerated on every Reactor build; current
copy is up-to-date.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 10.2 — reactor-recipes fluent sweep + new recipes

Updates the four target recipes and adds two new ones in both
`plugins/reactor/skills/reactor-recipes/references/` (current layout)
and `skills/recipes/` (legacy layout — still consumed by Reactor.csproj
NuGet pack at `agentkit/skills/recipes/`).

themed-card.cs:
  - Uses the new Card(child) factory (Phase 2.5) instead of hand-rolling
    Border + Theme.CardBackground + .CornerRadius(8) + .Padding(16).
  - Switches headings to the type-ramp factories (Subtitle/Caption).

form-with-validation.cs:
  - Adds an Age field demonstrating .NumericInput() + .MaxLength(3).
  - Applies .EmailInput() to the existing email field.
  - Header note covers the .Changed(...) fluent and its REPLACE
    semantic (vs. the combined-lambda pattern in the body).

list-add-delete.cs:
  - Converts the manual VStack of rows to the templated
    ListView<T>(items, keySelector, viewBuilder) factory with
    .ItemClick(item => ...) wired to the toggle reducer action.

sidebar-nav.cs:
  - Header note and inline comment document the
    .SelectedTagChanged(...) fluent and note that .WithNavigation
    occupies the same callback slot (mutually exclusive).

New: named-styles.cs:
  - Side-by-side demo of .AccentButton() / .SubtleButton() /
    .TextLink() on Button + HyperlinkButton, plus the four InfoBar
    severity fluents (.Informational / .Success / .Warning / .Error).

New: calendar-multiselect.cs:
  - CalendarViewSelectionMode.Multiple (via `with`) + .SelectedDates
    + .SelectedDatesChanged for two-way binding.

index.md updated in both layouts to reference the new recipes.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 10.{3,4,5,6,7} — additional skill fluent sweep

10.3 reactor-design: Typography table extended with the WinUI 3 ramp
factories (Title/Subtitle/Body/BodyStrong/BodyLarge) with a note
disambiguating them from the older Heading/SubHeading Reactor presets.
"Avoid Deep Nesting" example gains a Card(...) one-liner. Mirror update
applied to legacy skills/design.md.

10.4 reactor-getting-started: no-op — zero .Set(c => c.On*) or
with { On* = ... } patterns in SKILL.md.

10.5 reactor-forms: Available-input-types table extended for TextField
(+ .MaxLength(n), .NumericInput(), .EmailInput(), .Changed(handler))
and PasswordBox (+ .MaxLength(n), .PasswordChanged(handler)). New
"Named-input shapes" callout with a worked .EmailInput() chain.

10.6 reactor-commanding / reactor-navigation / reactor-input: no-op —
zero .Set(c => c.On*) or property-init callback patterns in any.

10.7 Top-level mirrors:
  - Root SKILL.md: cheatsheet adds Title/Subtitle/Body/BodyStrong/
    BodyLarge line and Card(child) line; recipe roll-call now includes
    canvas-positioning, named-styles, calendar-multiselect.
  - skills/dsl-reference.md: typography table gains the 5 WinUI ramp
    factories; layout-containers table gains a Card(child) row.
  - skills/forms.md: input-types table mirrors the reactor-forms update.
  - skills/input.md / skills/navigation.md / skills/commanding.md:
    no-op (same grep-clean result as 10.6).

Phase 10 tracker line flipped to [x].

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* test(039): Phase 11.1 — public-API surface guard test

Adds PublicApiSurfaceGuardTests under tests/Reactor.Tests/Elements/ that
walks every Element record reflectively and asserts each Action/Action<T>
callback property has a matching public extension method with a compatible
delegate-shape signature.

Two intentional property-name exceptions allowlisted with inline rationale:
VirtualListElement.Ref (ref-capture; clashes with generic .Ref<T> modifier)
and XamlHostElement.Updater (constructor-time interop hook). All other
callback properties resolve cleanly to their fluent counterpart.

Failures are collected and reported in a single readable assertion so a
future record gaining several callbacks at once surfaces every missing
fluent in one shot. Guards the spec 039 §14 #1 / §15 Q1 fluent convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* test(039): Phase 11.2 — naming-alignment guard test

Adds NamingAlignmentGuardTests under tests/Reactor.Tests/Elements/ that
loads the Reactor.xml doc-comment output and asserts each spec §0.3
divergent factory (VStack/HStack/Heading/SubHeading/Caption/Flex/FlexRow/
FlexColumn/LazyVStack/LazyHStack/ListView<T>) carries a non-empty <remarks>
explaining the WinUI deviation. Failures collected so a future rename
surfaces every regression in one shot.

ListView only requires the remark on the generic overload (TemplatedListViewElement<T>);
the untyped ListView matches WinUI's spelling and needs no rationale.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* test(039): Phase 11.3 — null-clear contract audit + missing facts

Audited EventFluentNullClearTests against the CSV inventory of all
callback properties and added the 8 facts missing for fluents landed
in Phases 5/7:

  - ItemsView.ItemInvoked / SelectionChanged
  - TemplatedGridView.ItemClick / SelectedIndexChanged / SelectionChanged
  - TemplatedFlipView.SelectedIndexChanged
  - TemplatedListView.SelectionChanged
  - PropertyGrid.RootChanged

Total null-clear facts now 92 (was 84).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* test(039): Phase 11.4 — Card + AccentButton theme-ref smoke

Adds CardThemeResolutionSmokeTests asserting Card(child) wires the
CardBackgroundFillColorDefaultBrush + CardStrokeColorDefaultBrush keys
into ThemeBindings (so render-time resolution adapts to theme switches)
and cross-checks the keys against Theme.CardBackground / Theme.CardStroke.

For .AccentButton(): asserts the OnMount action exists and (when the
compiler closure layout cooperates) that the captured style-name string
is "AccentButtonStyle".

Full Light/Dark/HighContrast flip-and-verify test deferred — needs a
theme-flip primitive on Reactor.AppTests which is a separate workstream.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* test(039): Phase 11.6 — sample-page construction smoke

Adds GallerySampleConstructionSmokeTests with one [Fact] per Phase 8
gallery page (ButtonPage / TextFieldPage / InfoBarPage / TypeRampPage /
CardPage / CalendarViewPage / FrameNavigationPage) asserting the page's
factory + fluent chain constructs without exception and that bound
callbacks reach the expected element property.

The gallery pages are internal types in a WinExe so the full mount-test
under Light/Dark/NightSky needs the Reactor.AppTests harness — deferred
with a tracked checkbox. The fixture-level construction smoke catches
the same defect class (typos, missing factories, wrong receiver type)
without the harness cost.

Phase 11.5 noted as no-op in the task file — source-gen scaffolding was
struck per Phase 0.4 / Q1; the reflective surface guard from 11.1 covers
the equivalent drift detection.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* test(039): Phase 11.7 — spec-flagged bug regression checks

Adds SpecFlaggedBugRegressionTests with named regression checkpoints for
the three spec-039 §14 bugs:

  - §3.4 AutoSuggestBox.OnSuggestionChosen reachable via record
    constructor (factory path) and via .SuggestionChosen(...) fluent
  - §14 #5 HyperlinkButton.NavigateUri fluent exists and the
    HyperlinkButton(Command) + .NavigateUri(...) doc-promise holds
  - §17.5 Card(child) theme-binding wiring (cross-reference to the
    detailed smoke in CardThemeResolutionSmokeTests)

Flips the Phase 11 checkboxes and the bottom-tracker "Tests landed
(Phase 11)" entry. Two AppTests-harness-blocked deferrals tracked
inline:
  - 11.4 real theme-flip Light/Dark/HighContrast resolution test
  - 11.6 real Phase-8 page mount-and-fire test

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 3.7 — defer niche WinUI events to spec 040

Convert the bundled "defer if too big" line to explicit [deferred]
checkboxes per item with per-control rationale (MenuFlyout cancel-args,
CommandBar lack-of-consumer, SemanticZoom/AnnotatedScrollBar not modelled,
MapControl no SDK dep). Adds §6.1 carry-over section to spec 040 capturing
the ownership transfer. Flips the §14 #3 tracker checkbox now that 3.7
is no longer ambiguous.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* build(039): regenerate reactor.api.txt after rebase onto main

Picks up upstream Viewbox.Stretch / Viewbox.StretchDirection fluents
(#310) that were dropped by the rebase conflict resolution (chose
ours-with-regen-from-build strategy).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): move Phase 9 guide edits into the pipeline source

PR review flagged that Phase 9.{1,2} edited docs/guide/*.md directly, but
those are compiled outputs — the source-of-truth is
docs/_pipeline/templates/<topic>.md.dt + docs/_pipeline/apps/<topic>/App.cs
per the AI-author skill at docs/_pipeline/ai-author-skill.md.

This commit moves each previously-inlined addition into the corresponding
template + doc-app pair and regenerates the compiled guide via
`mur docs compile`:

- forms.md.dt + apps/forms/App.cs: new TextFieldConfigDemo snippet drives
  the "Configuring TextField" section (named-input fluents + MaxLength /
  IsSpellCheckEnabled / CharacterCasing / TextAlignment / Description).
- styling.md.dt + apps/styling/App.cs: NamedStylesExample snippet drives
  the "Named-Style Fluents" section (AccentButton / SubtleButton / TextLink
  + four InfoBar severity helpers).
- layout.md.dt + apps/layout/App.cs: CardDemo + TypeRampDemo snippets drive
  the Card and Type-Ramp sections.
- navigation.md.dt + apps/navigation/App.cs: FrameEventsDemo (with a
  trivial DocsFrameDemoPage Page subclass for Frame.Navigate to target)
  and SelectedTagChangedDemo snippets drive the Frame Events and
  NavigationView.SelectedTagChanged sections.
- collections.md.dt + apps/collections/App.cs: MultiSelectDemo snippet
  drives the "Multi-Select with SelectionChanged" section.
- xaml-developers.md.dt + apps/xaml-developers/App.cs: EventsFluentExample
  snippet drives the "Events: XAML Attributes Become Fluents" section.

Net effect on the compiled output (docs/guide/*.md) vs the prior
direct-edit commits: only three files have material content diffs and
all three are *strict improvements* over the prior fragments — the
original prose code blocks contained either (a) undeclared identifiers
(`MyXamlPage`, `handler`, `bodyElement`, `nav`) or (b) buggy logic
(`indices.Select(i => contacts[i].Id)` against a typed-peer selection
callback that delivers `IReadOnlyList<T>`, not `IReadOnlyList<int>`).
The compiled snippets now come from real, building components in the
doc apps.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs(039): Phase 12.{1,2} — check off build + perf neutrality

Records the post-rebase ship-gate results: dotnet build -warnaserror clean
(NU1903 cleared by upstream #311's solution-warning sweep), startup_perf
TTFP 238.1 ms vs 230.2 ms calibrated baseline (~3%, within noise — WinUI3
baseline moved the opposite direction over the same window), stress_perf
reconcile times essentially identical (46.7 ms vs 46.3 ms at 50%,
56.8 ms vs 56.9 ms at 100%).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(039): reconciler — subscribe-before-source + uncontrolled CalendarView selection

Addresses PR #314 review feedback (Copilot inline comments on
Reconciler.Mount.cs:974/1044/3037 and Reconciler.Update.cs:3566).

Three subscribe-before-source ordering bugs — small or cached resources
can fire load/init events synchronously during the Source assignment, so
handlers attached after Source would miss the event:

- MountImage: SetElementTag + EnsureImageWiring move before image.Source
  so cached BitmapImage / SvgImageSource hits don't drop ImageOpened /
  ImageFailed.
- MountWebView2: SetElementTag + all event trampolines (NavigationStarting /
  NavigationCompleted / WebMessageReceived / CoreWebView2Initialized) move
  before webView.Source so a fast CoreWebView2 initialization can't fire
  before subscriptions land.
- MountMediaPlayerElement: SetElementTag + MediaOpened / MediaEnded /
  MediaFailed subscriptions move before player.Source so a cached URI or
  fast-failing source can't drop the initial event.

One uncontrolled-selection bug:

- UpdateCalendarView: SyncSelectedDates was called unconditionally with a
  potentially-null `n.SelectedDates`, and the diff treated null as "desired
  is empty" which cleared every user-picked date on the next render. Now
  only sync when the caller explicitly provided a SelectedDates list —
  null means "uncontrolled, leave the user's selection alone". SyncSelectedDates
  signature tightens to non-null `desired` accordingly.

All 227 element-extension tests (EventFluent / GallerySample / Phase4Init /
SpecFlagged filters) still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(039): PR #314 CR — remove ScrollViewer alias + sweep recipe/skill accuracy

Addresses the remaining Copilot inline review comments from PR #314 (after
the 4 reconciler bug fixes in b8f4d00):

API surface
- Remove the [Obsolete] Factories.ScrollViewer(Element) alias added in
  Phase 6.5. Reviewer flagged that the alias is *not* purely additive —
  under `using static Microsoft.UI.Reactor.Factories;` + `using
  Microsoft.UI.Xaml.Controls;`, the bare name `ScrollViewer` shadows
  Microsoft.UI.Xaml.Controls.ScrollViewer's attached-property type, so
  callers reaching for ScrollViewer.SetVerticalScrollMode(...) etc. have
  to fully-qualify (as samples/ReactorGallery/UserControls/GalleryControls.cs
  was doing). Discoverability win didn't justify the imposed disambiguation
  cost; alias removed. CHANGELOG + Phase 6.5 task-spec entry updated to
  record the reversal. GalleryControls.cs un-fully-qualifies its four
  ScrollViewer.Set*(...) calls.

Tests
- PublicApiSurfaceGuardTests.DelegateShapeMatches now recursively walks
  generic arguments instead of only comparing outer-generic def + arity.
  Prevents Action<IReadOnlySet<RowKey>> from matching Action<IReadOnlyList<int>>.
- ControlCatalogFixtures: catalog entry label `RichText` → `RichTextBlock`
  so the rename guard isn't undermined by the fixture.

Doc / recipe accuracy
- xaml-developers.md.dt: XAML→Reactor table corrected — TextField fluent is
  `.Changed(...)` not `.TextChanged(...)`; ComboBox XAML event is
  `SelectionChanged` (not `SelectedIndexChanged`) with a note that the
  Reactor fluent surfaces the index; CheckBox XAML uses
  `Checked`/`Unchecked` (not `IsCheckedChanged`) with a note that the
  Reactor fluent collapses the three XAML events. Recompiled.
- reactor-dsl SKILL.md: `.Click(_ => Save())` → `.Click(() => Save())`
  (Click takes parameterless Action).
- reactor-forms SKILL.md: §17.4 → §17.3 (named-input scopes live in
  §17.3; §17.4 is InfoBar severity). PasswordBox signature in the
  modifiers table matches the real factory: `(password, setPassword,
  placeholder)` + `.Header(text)` fluent (no fourth positional `header`).
- skills/recipes/named-styles.cs + plugin mirror: `.TextLink()` uses
  `TextBlockButtonStyle` (not `HyperlinkButtonStyle`).
- skills/recipes/list-add-delete.cs + plugin mirror: reverted the
  "no manual .WithKey needed" guidance and restored .WithKey(item.Id)
  on each row. The reconciler reconciles templated-list realized
  containers by index (ItemsSource = 0..N range, RefreshRealizedContainers
  matches by position), so KeySelector on the element record isn't
  consulted for diffing — on reorder/delete-from-middle, focus and
  per-row state stick to the wrong row without an explicit .WithKey.
- skills/recipes/canvas-positioning.cs mirrored from plugin copy; added
  to skills/recipes/index.md so the top-level SKILL.md cheat-sheet
  reference resolves.
- samples/ReactorGallery/.../CardPage.cs: "embedded file remains
  pure-ASCII" comment removed (the file contains a literal Fluent Icons
  glyph — comment was wrong, not the file).

Tooling
- tools/api-scrub/Build-EventFluentInventory.ps1 header comment now
  documents the `File` column added during Phase 7.2.

Spec follow-up
- docs/specs/040-...md: dead link to the not-yet-existing
  tasks/040-specialized-control-scrub-implementation.md replaced with
  prose noting the task list will be created once the audit lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 22, 2026
Resolves the 22 findings from the docking feature-branch review +
two test failures that surfaced while running the full suite.

Behavior fixes (Native docking host):
- Tear-out / FloatOp: open the floating window BEFORE removing the
  pane from the docked tree. Layout mutation + OnContentFloated fire
  only when a real ReactorWindow was produced (review #1 — the
  previous broad catch around Open turned a failed transition into a
  success-shaped event).
- Drop-overlay global Esc handler now detaches on reconciler unmount
  in addition to WinUI Unloaded (review #2).
- Floating-window observer callbacks, BeforeInsertToolWindow strategy
  hook, drag-session SessionChanged broadcast, navigator commit
  callback, and theme/resource lookup catches all surface failures via
  Debug.WriteLine or narrow to the expected exception type instead of
  swallowing everything (reviews #3, #4, #5, #7, #8).
- Splitter OnPointerCaptureLost now calls RestorePairToGrow() before
  the final ResizeDelta to converge with the normal release path
  (review #6).

Persistence:
- DockLayoutSerializer.Load now routes pre-current-schema documents
  through DockLayoutMigrationRegistry: parse to JsonNode, detect
  schema (absent $schema = v1 per §5.4.4), TryUpgrade, then
  deserialize. Adds a Load(json, registry) overload and emits a
  PII-safe schema-newer ETW category for forward-tolerant inputs
  (reviews #9 + #10).
- PreviousContainerTracker.ClearAll now actually clears by swapping
  in a fresh ConditionalWeakTable under a lock (review #11).

Surface honesty:
- DockHostModel.Floating is populated by the host renderer from a
  per-manager floating-window tracker; doc comment makes the
  initial-bounds-only limitation explicit (review #12).
- UseDockPanePersisted uses a canonical persisted-key encoder
  (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping)
  so two panes whose Key.ToString() collide get independent slots
  (review #13).
- docking.dock detects ambiguous Key.ToString() matches and returns
  an explicit ambiguous-pane error (review #18).

Test isolation:
- New DockingGlobalsCollection ([Collection("DockingGlobals")] +
  DisableParallelization=true) covers DockingStringsTests,
  DockA11yTests, and DevtoolsDockingToolsTests — three classes that
  mutate process-global state (review #14). DockA11yTests now
  restores DockingStrings.Resolver in Dispose.
- The known-failing UseEffect cleanup assertion is emitted as TAP
  "# SKIP" via a new Harness.Skip helper, with a back-flip to a real
  Check the moment the §2.25 product gap closes (review #15).
- EffectCounterComponent moved off static counters; the fixture owns
  per-run counters and passes mount/cleanup callbacks via props
  (review #16).
- EventListener category assertions in LayoutSerializerTests use a
  bounded retry helper to tolerate occasional async dispatch
  (review #17).

Documentation:
- docs/_pipeline/apps/docking/{api,overview}.md updated for the P2
  reality (core Microsoft.UI.Reactor ship vehicle,
  DockingNativeInterop.Register, deleted vendored WinUI.Dock link)
  (reviews #19, #22).
- DockingStrings.cs + dock-showcase sample comments updated to
  reflect that no .resw resource ships today; DefaultEnglish + the
  resolver are the localization surface (review #20).
- Reactor.csproj stale "stays on disk for reference" comment about
  src/Reactor.Docking.Xaml/ replaced with current state (review #21).

Tests / fluents:
- Added 22 fluent extensions in ElementExtensions.Events.cs for
  DockManager event callbacks + TabViewElement.OnTabDragStarting /
  OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the
  guard test itself is now scoped to public element records only
  (internal overlay/splitter elements aren't part of the public
  surface contract).
- Two stale Phase-1-wrapper fixture names removed from
  SelfTestFixtureRegistry.AllFixtures (they had no factory case and
  surfaced as MSTest "fixture not found" failures).
- NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays
  cut from 500ms/step to 50ms/step so the 20-step walk stays well
  inside the 15s fixture timeout under CI load; eliminates the
  cascading NRE in DragSessionConfirmMutatesLayout that was caused
  by the timed-out fixture leaving stale host state.
- Mutations_OffOwnerThread_Throw uses an explicit new Thread()
  instead of Task.Run, so the assert can never observe a thread-id
  match by chance.
- Load_MissingSchemaField_FallsBack renamed to
  Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten —
  empty {} now migrates as v1 (matches the integrated registry).

Validation:
- dotnet test tests/Reactor.Tests -p:Platform=x64
    → 8720 passed, 46 skipped, 0 failed
- dotnet test tests/Reactor.SelfTests -p:Platform=x64
    → 813 passed, 0 failed

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 22, 2026
Resolves the 22 findings from the docking feature-branch review +
two test failures that surfaced while running the full suite.

Behavior fixes (Native docking host):
- Tear-out / FloatOp: open the floating window BEFORE removing the
  pane from the docked tree. Layout mutation + OnContentFloated fire
  only when a real ReactorWindow was produced (review #1 — the
  previous broad catch around Open turned a failed transition into a
  success-shaped event).
- Drop-overlay global Esc handler now detaches on reconciler unmount
  in addition to WinUI Unloaded (review #2).
- Floating-window observer callbacks, BeforeInsertToolWindow strategy
  hook, drag-session SessionChanged broadcast, navigator commit
  callback, and theme/resource lookup catches all surface failures via
  Debug.WriteLine or narrow to the expected exception type instead of
  swallowing everything (reviews #3, #4, #5, #7, #8).
- Splitter OnPointerCaptureLost now calls RestorePairToGrow() before
  the final ResizeDelta to converge with the normal release path
  (review #6).

Persistence:
- DockLayoutSerializer.Load now routes pre-current-schema documents
  through DockLayoutMigrationRegistry: parse to JsonNode, detect
  schema (absent $schema = v1 per §5.4.4), TryUpgrade, then
  deserialize. Adds a Load(json, registry) overload and emits a
  PII-safe schema-newer ETW category for forward-tolerant inputs
  (reviews #9 + #10).
- PreviousContainerTracker.ClearAll now actually clears by swapping
  in a fresh ConditionalWeakTable under a lock (review #11).

Surface honesty:
- DockHostModel.Floating is populated by the host renderer from a
  per-manager floating-window tracker; doc comment makes the
  initial-bounds-only limitation explicit (review #12).
- UseDockPanePersisted uses a canonical persisted-key encoder
  (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping)
  so two panes whose Key.ToString() collide get independent slots
  (review #13).
- docking.dock detects ambiguous Key.ToString() matches and returns
  an explicit ambiguous-pane error (review #18).

Test isolation:
- New DockingGlobalsCollection ([Collection("DockingGlobals")] +
  DisableParallelization=true) covers DockingStringsTests,
  DockA11yTests, and DevtoolsDockingToolsTests — three classes that
  mutate process-global state (review #14). DockA11yTests now
  restores DockingStrings.Resolver in Dispose.
- The known-failing UseEffect cleanup assertion is emitted as TAP
  "# SKIP" via a new Harness.Skip helper, with a back-flip to a real
  Check the moment the §2.25 product gap closes (review #15).
- EffectCounterComponent moved off static counters; the fixture owns
  per-run counters and passes mount/cleanup callbacks via props
  (review #16).
- EventListener category assertions in LayoutSerializerTests use a
  bounded retry helper to tolerate occasional async dispatch
  (review #17).

Documentation:
- docs/_pipeline/apps/docking/{api,overview}.md updated for the P2
  reality (core Microsoft.UI.Reactor ship vehicle,
  DockingNativeInterop.Register, deleted vendored WinUI.Dock link)
  (reviews #19, #22).
- DockingStrings.cs + dock-showcase sample comments updated to
  reflect that no .resw resource ships today; DefaultEnglish + the
  resolver are the localization surface (review #20).
- Reactor.csproj stale "stays on disk for reference" comment about
  src/Reactor.Docking.Xaml/ replaced with current state (review #21).

Tests / fluents:
- Added 22 fluent extensions in ElementExtensions.Events.cs for
  DockManager event callbacks + TabViewElement.OnTabDragStarting /
  OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the
  guard test itself is now scoped to public element records only
  (internal overlay/splitter elements aren't part of the public
  surface contract).
- Two stale Phase-1-wrapper fixture names removed from
  SelfTestFixtureRegistry.AllFixtures (they had no factory case and
  surfaced as MSTest "fixture not found" failures).
- NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays
  cut from 500ms/step to 50ms/step so the 20-step walk stays well
  inside the 15s fixture timeout under CI load; eliminates the
  cascading NRE in DragSessionConfirmMutatesLayout that was caused
  by the timed-out fixture leaving stale host state.
- Mutations_OffOwnerThread_Throw uses an explicit new Thread()
  instead of Task.Run, so the assert can never observe a thread-id
  match by chance.
- Load_MissingSchemaField_FallsBack renamed to
  Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten —
  empty {} now migrates as v1 (matches the integrated registry).

Validation:
- dotnet test tests/Reactor.Tests -p:Platform=x64
    → 8720 passed, 46 skipped, 0 failed
- dotnet test tests/Reactor.SelfTests -p:Platform=x64
    → 813 passed, 0 failed

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request May 23, 2026
Resolves the 22 findings from the docking feature-branch review +
two test failures that surfaced while running the full suite.

Behavior fixes (Native docking host):
- Tear-out / FloatOp: open the floating window BEFORE removing the
  pane from the docked tree. Layout mutation + OnContentFloated fire
  only when a real ReactorWindow was produced (review #1 — the
  previous broad catch around Open turned a failed transition into a
  success-shaped event).
- Drop-overlay global Esc handler now detaches on reconciler unmount
  in addition to WinUI Unloaded (review #2).
- Floating-window observer callbacks, BeforeInsertToolWindow strategy
  hook, drag-session SessionChanged broadcast, navigator commit
  callback, and theme/resource lookup catches all surface failures via
  Debug.WriteLine or narrow to the expected exception type instead of
  swallowing everything (reviews #3, #4, #5, #7, #8).
- Splitter OnPointerCaptureLost now calls RestorePairToGrow() before
  the final ResizeDelta to converge with the normal release path
  (review #6).

Persistence:
- DockLayoutSerializer.Load now routes pre-current-schema documents
  through DockLayoutMigrationRegistry: parse to JsonNode, detect
  schema (absent $schema = v1 per §5.4.4), TryUpgrade, then
  deserialize. Adds a Load(json, registry) overload and emits a
  PII-safe schema-newer ETW category for forward-tolerant inputs
  (reviews #9 + #10).
- PreviousContainerTracker.ClearAll now actually clears by swapping
  in a fresh ConditionalWeakTable under a lock (review #11).

Surface honesty:
- DockHostModel.Floating is populated by the host renderer from a
  per-manager floating-window tracker; doc comment makes the
  initial-bounds-only limitation explicit (review #12).
- UseDockPanePersisted uses a canonical persisted-key encoder
  (pane:<typeName>|<keyText>:<userKey> with %/colon/pipe escaping)
  so two panes whose Key.ToString() collide get independent slots
  (review #13).
- docking.dock detects ambiguous Key.ToString() matches and returns
  an explicit ambiguous-pane error (review #18).

Test isolation:
- New DockingGlobalsCollection ([Collection("DockingGlobals")] +
  DisableParallelization=true) covers DockingStringsTests,
  DockA11yTests, and DevtoolsDockingToolsTests — three classes that
  mutate process-global state (review #14). DockA11yTests now
  restores DockingStrings.Resolver in Dispose.
- The known-failing UseEffect cleanup assertion is emitted as TAP
  "# SKIP" via a new Harness.Skip helper, with a back-flip to a real
  Check the moment the §2.25 product gap closes (review #15).
- EffectCounterComponent moved off static counters; the fixture owns
  per-run counters and passes mount/cleanup callbacks via props
  (review #16).
- EventListener category assertions in LayoutSerializerTests use a
  bounded retry helper to tolerate occasional async dispatch
  (review #17).

Documentation:
- docs/_pipeline/apps/docking/{api,overview}.md updated for the P2
  reality (core Microsoft.UI.Reactor ship vehicle,
  DockingNativeInterop.Register, deleted vendored WinUI.Dock link)
  (reviews #19, #22).
- DockingStrings.cs + dock-showcase sample comments updated to
  reflect that no .resw resource ships today; DefaultEnglish + the
  resolver are the localization surface (review #20).
- Reactor.csproj stale "stays on disk for reference" comment about
  src/Reactor.Docking.Xaml/ replaced with current state (review #21).

Tests / fluents:
- Added 22 fluent extensions in ElementExtensions.Events.cs for
  DockManager event callbacks + TabViewElement.OnTabDragStarting /
  OnTabDragCompleted so PublicApiSurfaceGuardTests passes; the
  guard test itself is now scoped to public element records only
  (internal overlay/splitter elements aren't part of the public
  surface contract).
- Two stale Phase-1-wrapper fixture names removed from
  SelfTestFixtureRegistry.AllFixtures (they had no factory case and
  surfaced as MSTest "fixture not found" failures).
- NativeDocking_PerGroupDropTargetVisualDemo: observer-pause delays
  cut from 500ms/step to 50ms/step so the 20-step walk stays well
  inside the 15s fixture timeout under CI load; eliminates the
  cascading NRE in DragSessionConfirmMutatesLayout that was caused
  by the timed-out fixture leaving stale host state.
- Mutations_OffOwnerThread_Throw uses an explicit new Thread()
  instead of Task.Run, so the assert can never observe a thread-id
  match by chance.
- Load_MissingSchemaField_FallsBack renamed to
  Load_MissingSchemaField_TreatedAsV1AndMigrated and rewritten —
  empty {} now migrates as v1 (matches the integrated registry).

Validation:
- dotnet test tests/Reactor.Tests -p:Platform=x64
    → 8720 passed, 46 skipped, 0 failed
- dotnet test tests/Reactor.SelfTests -p:Platform=x64
    → 813 passed, 0 failed

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request Jun 2, 2026
Code-review findings (C:\temp\reactor-advanced-win2d-review.md):

  #1 HIGH — initially paused Win2DAnimatedCanvas can never resume
    Win2DAnimatedCanvasHandler.Mount wrote ctrl.Paused = el.IsPaused, but
    Update never writes Paused (intentional: Win2D-on-WinUI-3 game-thread
    park bug). An app mounted with isPaused:true could never unpause.
    Fixed: never touch ctrl.Paused at any stage; IsPaused gates the user's
    OnUpdate delegate via InvokeUpdate. New selftest fixture
    'Win2D_AnimatedCanvas_InitialPausedResumes' locks in the invariant.

  #2 HIGH — unsynchronized Ref<T> across UI/game threads
    Rewrote UseDrawState XML doc to be honest: Ref<T> is a plain
    auto-property, has no memory barriers, does not protect compound
    mutations. New doc lists per-shape synchronization options (volatile,
    Interlocked, lock, producer/consumer queue). Updated win2d-canvas.md.dt
    threading section to match.
    Fixed the actual race in ParticleStorm: Burst is now a
    ConcurrentQueue<(x,y,n)> producer; ParticleField.Step drains the queue
    on the game thread BEFORE iterating the particle array. No more torn
    Particle structs from UI-thread mutation racing the game-thread loop.

  #3 MED — RedrawKey uses reference equality
    Win2DCanvasHandler diff was !ReferenceEquals; boxed ints differ across
    renders, so every parent re-render triggered a redundant Invalidate.
    Switched to !Equals. New selftest fixture
    'Win2D_Canvas_SameRedrawKeyNoExtraDraws' verifies the no-op behavior.

  #4 MED — docs/sample reference nonexistent '.Of(...)' API
    Updated win2d-canvas.md.dt (4 occurrences), cheat-sheet.md.dt (1),
    samples/apps/particle-storm/README.md (1) to match the actual factory
    shape: Win2DCanvas(...) / Win2DAnimatedCanvas(...) / Win2DVirtualCanvas(...)
    via 'using static Microsoft.UI.Reactor.Advanced.Factories;'.
    Recompiled docs/guide/win2d-canvas.md and docs/guide/cheat-sheet.md.

  #5 MED — missing screenshot + placeholder perf
    Removed broken ../../samples/apps/particle-storm/screenshot.png
    reference from the Win2D guide template (this was the mkdocs --strict
    failure on the CI Docs build job). Toned down the 'canonical
    performance proof' claim — Particle Storm is now described as the
    'canonical worked example' and the guide tells readers to capture
    their own FPS numbers on their own hardware.

  #6 MED — skipped placeholder tests
    Selftest coverage gap acknowledged. Added two new fixtures (above) to
    cover the two scenarios most affected by review bugs (#1 and #3).
    The headless xUnit placeholders for handler updates and device-loss
    remain skipped — those genuinely need live WinUI activation, which
    the AppTests.Host selftest tier provides.

  #7 LOW — silent catches in PackLocalCommand
    Replaced catch { /* best effort */ } with explicit Console.Error
    warnings (stale-package cleanup + HTTP-cache-clear paths). Pack-local
    still succeeds when cleanup fails, but the user sees why.

CodeQL inline findings:

  - Win2DCanvasFixtures.WaitForCollectedOrDetached: removed GC.Collect()
    calls. Visual-tree detach check is the observable invariant; weak-ref
    is a secondary signal under normal GC, not a forced collection probe.
  - Win2DVirtualCanvasHandler.Update: replaced double != check with a
    SizesEqual helper using a 0.5 DIP epsilon (below display rounding,
    above float-precision noise from layout/devicescale math).
  - PackLocalCommand / TrimAssertions / threading test Path.Combine
    warnings: not addressed (low priority, all in test/CLI code; intent
    is clear and operands are repo-internal).

CI failures (https://github.com/microsoft/microsoft-ui-reactor/actions/runs/26819092595,
                https://github.com/microsoft/microsoft-ui-reactor/actions/runs/26819092535):

  - Pack (x64 + arm64) — NU5026 'Reactor.Advanced.dll not found': the
    release workflow's 'dotnet build/pack' runs without -p:Platform, so
    MSBuild defaults to AnyCPU. Reactor.Advanced.csproj had
    Platforms='x64;ARM64' only (no AnyCPU). Added AnyCPU to match
    Reactor.csproj. Both Pack steps now resolve.
  - Docs build — mkdocs --strict failed on the broken screenshot link
    (review finding #5 above); removing the reference fixes it.

Verification:

  - dotnet build Reactor.slnx -p:Platform=x64: clean (0/0).
  - dotnet test tests/Reactor.Advanced.Tests -p:Platform=x64: 27 passed.
  - Win2D selftests (JIT): 5 fixtures, 11/11 assertions green
    (added InitialPausedResumes + SameRedrawKeyNoExtraDraws).
  - mur docs compile --topic win2d-canvas/cheat-sheet: clean.

Co-authored-by: Copilot <[email protected]>
Chris Anderson (codemonkeychris) added a commit that referenced this pull request Jun 2, 2026
* spec 053: Reactor.Advanced + Win2D canvas integration

Implements docs/specs/053-reactor-advanced-and-win2d-canvas.md across all
four phases (per the implementation tracker):

Phase 1 — Library + L0/L1
- src/Reactor.Advanced/: new sibling library, ProjectReference-only consumer
  of Reactor core (no InternalsVisibleTo). Three element/handler triples
  (Win2DCanvas / Win2DAnimatedCanvas / Win2DVirtualCanvas) plus modifiers
  (ClearColor, Paused, TargetFps, Set) and three hooks (UseDrawState,
  UseCanvasResources, UseDrawCommand).
- Per-library trim unit: Factories class with single static cctor registers
  all three handlers. Authors consume via 'using static Microsoft.UI.Reactor
  .Advanced.Factories;' alongside the core factories, calling factories by
  their natural name (Win2DCanvas(...) etc.) — matching the in-tree DSL
  pattern. Touching any factory roots all three; touching none strips all
  three (verified by AOT trim probes).
- tests/Reactor.Advanced.Tests/: 27 passing, 4 skipped-covered-by-selftests.
- tests/aot_trim_proof/Reactor.AotHelloWorld.Advanced{,.Positive}{,.TrimAssertions}/:
  negative (zero handlers when no canvas factory called) + positive
  (handlers present when Win2DCanvas(...) is called) trim probes.
- mur pack-local now emits Microsoft.UI.Reactor.Advanced.{version}.nupkg
  alongside the core package.

Phase 1 game-thread isolation fix
- Win2DAnimatedCanvas Update/Draw fire on Win2D's game thread, not the
  WinUI dispatcher. Original Reactor binding path called DependencyProperty
  APIs from the trampoline, producing RPC_E_WRONG_THREAD (0xC000027B with
  WER P7=8001010e) at AOT-published startup. Fixed by subscribing Update/
  Draw directly with a volatile per-control element holder and tracking
  unsubscribe delegates for clean Unmount.

Phase 1 IsPaused workaround
- Writing CanvasAnimatedControl.Paused causes a known Win2D-on-WinUI-3 bug:
  the game thread wakes for exactly one tick after Paused=false and then
  parks permanently. Handler now never writes ctrl.Paused — IsPaused
  instead gates the user's OnUpdate callback (simulation stops) while
  leaving OnDraw active (last frame stays visible). Authors who want true
  game-thread suspension can opt in via Setters.

Phase 2 — Particle Storm sample
- samples/apps/particle-storm/: ~50k-particle Win2D animated canvas demo
  with chase/idle physics modes, cursor-driven gravity, periodic auto-
  burst, speed-modulated palette, real wall-clock fps meter, AOT publish
  gate. Sidebar is a Component<SidebarProps> per Reactor convention.

Phase 3 — Docs + selftests + skill
- docs/_pipeline/apps/win2d-canvas/ + templates/win2d-canvas.md.dt:
  doc-app with 4 snippets + manifest, comprehensive-tier guide page.
- tests/Reactor.AppTests.Host/SelfTest/Fixtures/Win2DCanvasFixtures.cs:
  three fixtures (manual/animated/virtual canvas mount), two-place
  registration in SelfTestFixtureRegistry, all 7 assertions green under
  both JIT and AOT.
- skills/advanced.md + plugins/reactor/skills/reactor-advanced/SKILL.md:
  two-place agent skill install; bundled into the Advanced nupkg under
  agentkit/skills/reactor-advanced.md.

Supporting changes outside spec-053 scope (justified):
- src/Reactor.Analyzers{,.Internal}/, Reactor.Localization.Generator/:
  added TreatAsLocalProperty='PublishTrimmed' + PublishTrimmed=false so
  Roslyn analyzer ProjectReferences don't inherit Reactor.Advanced's
  PublishTrimmed=true (NETSDK1207 isolation).
- src/Reactor.Cli/Pack/PackLocalCommand.cs: added Advanced as a third
  pack target.

Verification gates green:
- dotnet build Reactor.slnx -p:Platform=x64 — 0/0
- dotnet test tests/Reactor.Advanced.Tests -p:Platform=x64 — 27 passed
- Win2D selftests under JIT and AOT — 7/7 assertions each
- mur pack-local — produces 3 nupkgs side-by-side
- AOT trim probes — negative shows handlers stripped; positive shows present
- src/Reactor/ unchanged (per spec section 2 Goal 5)

Co-authored-by: Copilot <[email protected]>

* docs: recompile cheat-sheet, advanced, architecture-overview after spec-053 template edits

Phase 3's full mur docs compile run hung partway, so only docs/guide/win2d-canvas.md was
regenerated in the initial PR commit. The cheat-sheet / advanced / architecture-overview
templates had spec-053 cross-link edits that hadn't been compiled through. Running each
topic individually completed cleanly.

Co-authored-by: Copilot <[email protected]>

* spec 053: address review feedback + fix CI failures

Code-review findings (C:\temp\reactor-advanced-win2d-review.md):

  #1 HIGH — initially paused Win2DAnimatedCanvas can never resume
    Win2DAnimatedCanvasHandler.Mount wrote ctrl.Paused = el.IsPaused, but
    Update never writes Paused (intentional: Win2D-on-WinUI-3 game-thread
    park bug). An app mounted with isPaused:true could never unpause.
    Fixed: never touch ctrl.Paused at any stage; IsPaused gates the user's
    OnUpdate delegate via InvokeUpdate. New selftest fixture
    'Win2D_AnimatedCanvas_InitialPausedResumes' locks in the invariant.

  #2 HIGH — unsynchronized Ref<T> across UI/game threads
    Rewrote UseDrawState XML doc to be honest: Ref<T> is a plain
    auto-property, has no memory barriers, does not protect compound
    mutations. New doc lists per-shape synchronization options (volatile,
    Interlocked, lock, producer/consumer queue). Updated win2d-canvas.md.dt
    threading section to match.
    Fixed the actual race in ParticleStorm: Burst is now a
    ConcurrentQueue<(x,y,n)> producer; ParticleField.Step drains the queue
    on the game thread BEFORE iterating the particle array. No more torn
    Particle structs from UI-thread mutation racing the game-thread loop.

  #3 MED — RedrawKey uses reference equality
    Win2DCanvasHandler diff was !ReferenceEquals; boxed ints differ across
    renders, so every parent re-render triggered a redundant Invalidate.
    Switched to !Equals. New selftest fixture
    'Win2D_Canvas_SameRedrawKeyNoExtraDraws' verifies the no-op behavior.

  #4 MED — docs/sample reference nonexistent '.Of(...)' API
    Updated win2d-canvas.md.dt (4 occurrences), cheat-sheet.md.dt (1),
    samples/apps/particle-storm/README.md (1) to match the actual factory
    shape: Win2DCanvas(...) / Win2DAnimatedCanvas(...) / Win2DVirtualCanvas(...)
    via 'using static Microsoft.UI.Reactor.Advanced.Factories;'.
    Recompiled docs/guide/win2d-canvas.md and docs/guide/cheat-sheet.md.

  #5 MED — missing screenshot + placeholder perf
    Removed broken ../../samples/apps/particle-storm/screenshot.png
    reference from the Win2D guide template (this was the mkdocs --strict
    failure on the CI Docs build job). Toned down the 'canonical
    performance proof' claim — Particle Storm is now described as the
    'canonical worked example' and the guide tells readers to capture
    their own FPS numbers on their own hardware.

  #6 MED — skipped placeholder tests
    Selftest coverage gap acknowledged. Added two new fixtures (above) to
    cover the two scenarios most affected by review bugs (#1 and #3).
    The headless xUnit placeholders for handler updates and device-loss
    remain skipped — those genuinely need live WinUI activation, which
    the AppTests.Host selftest tier provides.

  #7 LOW — silent catches in PackLocalCommand
    Replaced catch { /* best effort */ } with explicit Console.Error
    warnings (stale-package cleanup + HTTP-cache-clear paths). Pack-local
    still succeeds when cleanup fails, but the user sees why.

CodeQL inline findings:

  - Win2DCanvasFixtures.WaitForCollectedOrDetached: removed GC.Collect()
    calls. Visual-tree detach check is the observable invariant; weak-ref
    is a secondary signal under normal GC, not a forced collection probe.
  - Win2DVirtualCanvasHandler.Update: replaced double != check with a
    SizesEqual helper using a 0.5 DIP epsilon (below display rounding,
    above float-precision noise from layout/devicescale math).
  - PackLocalCommand / TrimAssertions / threading test Path.Combine
    warnings: not addressed (low priority, all in test/CLI code; intent
    is clear and operands are repo-internal).

CI failures (https://github.com/microsoft/microsoft-ui-reactor/actions/runs/26819092595,
                https://github.com/microsoft/microsoft-ui-reactor/actions/runs/26819092535):

  - Pack (x64 + arm64) — NU5026 'Reactor.Advanced.dll not found': the
    release workflow's 'dotnet build/pack' runs without -p:Platform, so
    MSBuild defaults to AnyCPU. Reactor.Advanced.csproj had
    Platforms='x64;ARM64' only (no AnyCPU). Added AnyCPU to match
    Reactor.csproj. Both Pack steps now resolve.
  - Docs build — mkdocs --strict failed on the broken screenshot link
    (review finding #5 above); removing the reference fixes it.

Verification:

  - dotnet build Reactor.slnx -p:Platform=x64: clean (0/0).
  - dotnet test tests/Reactor.Advanced.Tests -p:Platform=x64: 27 passed.
  - Win2D selftests (JIT): 5 fixtures, 11/11 assertions green
    (added InitialPausedResumes + SameRedrawKeyNoExtraDraws).
  - mur docs compile --topic win2d-canvas/cheat-sheet: clean.

Co-authored-by: Copilot <[email protected]>

* spec 053: fix release Pack CI + address new CR feedback (round 2)

CI fix — Pack (x64 + arm64) job:

  Local repro on Reactor.slnx Release build:
    src/Reactor/bin/Release/.../Reactor.dll               present (AnyCPU)
    src/Reactor/bin/ARM64/Release/.../Reactor.dll         present (ARM64)
    src/Reactor.Advanced/bin/ARM64/Release/.../*.dll      present (ARM64)
    src/Reactor.Advanced/bin/Release/.../*.dll            MISSING

  Reactor.csproj happens to land at bin/Release/ (AnyCPU) because its
  analyzer ProjectReferences (netstandard2.0 AnyCPU) force an AnyCPU
  sub-build. Reactor.Advanced has no AnyCPU-forcing consumer in the
  slnx, so the no-Platform 'dotnet build Reactor.slnx --configuration
  Release' only builds it for ARM64. The 'dotnet pack --no-build'
  Advanced step then looks at bin/Release/ and fails with NU5026.

  Added explicit 'Build Advanced (AnyCPU)' step before 'Pack Advanced
  NuGet' in .github/workflows/release.yml, mirroring the Templates
  pattern (which also passes -p:Platform=AnyCPU). The Pack step now
  uses -p:Platform=AnyCPU for symmetry.

  Verified locally that the produced nupkg contains
  lib/net10.0-windows10.0.22621/Reactor.Advanced.dll plus .pri, .xml,
  and the bundled agentkit/skills/reactor-advanced.md.

CR feedback (round 2, github-code-quality bot):

  - src/Reactor.Cli/Pack/PackLocalCommand.cs:68 — Path.Combine
    flagged. Switched to Path.Join (preserves segments even if a
    later segment is rooted; relevant defense-in-depth here).
  - src/Reactor.Cli/Pack/PackLocalCommand.cs:159 — generic catch in
    DeleteStaleNupkg. Replaced with specific catches for IOException,
    UnauthorizedAccessException, and System.Security.SecurityException
    (the three real failure modes for File.Delete).
  - src/Reactor.Advanced/Win2D/Hooks/UseCanvasResources.cs:69 —
    generic 'catch when (disposed)' on the create() failure path.
    Replaced with typed catches for OperationCanceledException and
    ObjectDisposedException (the cancellation/teardown races that
    actually happen here); other failures still propagate so real
    create() bugs aren't masked.
  - tests/aot_trim_proof/.../TrimAssertionTests.cs:56 — Path.Combine
    on appDirectoryName. Added an IsPathRooted guard (returns
    string.Empty on invalid input, matching the existing failure
    behavior) and switched to Path.Join for the combine.

Verification:

  - dotnet build Reactor.slnx -p:Platform=x64: clean (0/0).
  - dotnet test tests/Reactor.Advanced.Tests -p:Platform=x64: 27 passed.
  - Standalone pack verified: nupkg contains Reactor.Advanced.dll.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 25, 2026
Second pr-review round on PR #667. Addresses the theme-resolution findings:

H1 (correctness): the #85 effective-theme-name cache was generation-validated
plus the element's own RequestedTheme/ActualTheme DP reads, so a Default-themed
descendant of an ancestor whose RequestedTheme flips could serve a stale theme
inside the synchronous reconcile (before WinUI propagates the child's
ActualTheme). Make the name cache reconcile-scoped instead: the host bumps a
_reconcilePass once per Render() (ThemeRef.BeginReconcilePass), so every element
re-walks its ancestors at most once per render -- collapsing the dozens of
per-token walks (the #85 win) while matching the original always-walk result
exactly. This is the brief's 'resolve once per reconcile at the container'
option.

M1 (correctness): ResolveForTheme now captures the theme generation before the
uncached scan and only publishes the resolved brush when no InvalidateCache()
(e.g. from UISettings.ColorValuesChanged on a pool thread) raced it -- closing a
window where a pre-invalidation brush could be republished into the just-cleared
cache. _themeGeneration is kept solely for this guard; the per-render bump uses
the separate _reconcilePass.

Tests (additive, in-scope):
- ThemeRefCache_AncestorThemeFlipInheritedByDefaultChild selftest -- H1
  regression guard (ancestor flip + new pass re-resolves a Default child).
- ThemeRefCache_DefaultDictionaryFallback selftest -- #86 Default-dict fallback.
- ListView/GridView MultiSelection fixtures -- assert the typed copy preserves
  SelectedItems order and surfaces an empty snapshot on clear (#100).
- ObservableTreeTracker reentrancy test -- a side-effecting getter that fires
  PropertyChanged mid-walk exercises the _syncing fresh-scratch guard (#5).

Co-authored-by: Copilot <[email protected]>
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 26, 2026
Copilot round-4 review: the _syncing guard added with the #5 scratch-field reuse
was a plain bool with a non-atomic check-then-set (if (_syncing) ...; _syncing =
true;). SyncSubscriptions is normally serialized onto the UI thread by
OnNestedPropertyChanged's dispatcher marshalling, but a no-DispatcherQueue host
(_dispatcherQueue is null) runs the sync inline on each firing thread, so two
threads can enter at once. Both could then observe _syncing == false, both take
the scratch path, and Clear()/mutate the shared desiredSet/visiting/toRemove
containers concurrently — corrupting the walk.

Promote _syncing to an int and flip ownership with
Interlocked.CompareExchange(ref _syncing, 1, 0): only the caller that wins the
0->1 transition uses the scratch fields; re-entrant (same-stack) and concurrent
losers fall back to fresh allocations exactly like the original always-allocate
path. Release with Volatile.Write(ref _syncing, 0) in the finally so the next
acquiring CAS observes the cleared scratch. Single-threaded behaviour (real apps
+ all existing tests, incl. the re-entrancy fixture) is unchanged; this only
hardens the contended path. (The broader non-thread-safety of the _subscriptions
dictionary under concurrent sync is pre-existing and serialized by the dispatcher
design — out of scope for this perf change.)

Co-authored-by: Copilot <[email protected]>
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 26, 2026
Round-8 Copilot flagged (suppressed, low-confidence) that SyncCore mutates the
non-thread-safe _subscriptions Dictionary without serialization, contradicting
the file's own concurrent-entry comments. The #5 _syncing CAS isolates the
shared scratch fields but leaves _subscriptions unprotected: a no-DispatcherQueue
host runs OnNestedPropertyChanged inline on each firing thread, so two SyncCore
calls can reconcile _subscriptions concurrently and corrupt the Dictionary.

Wrap the _subscriptions reconcile in SyncCore (and the Dispose teardown) in a
scoped lock(_subscriptionsLock). Walk stays outside the lock (touches only
per-call scratch); no user code runs inside the lock (only field-event +=/-=
and Dictionary ops), so there is no re-entrancy or deadlock risk. Uncontended
cost is negligible vs the reflection Walk; the #5 allocation win is unaffected.

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant