Skip to content

docs: under-the-hood guide to the V1 Protocol + extension cookbook#444

Merged
codemonkeychris merged 1 commit into
mainfrom
docs/v1-protocol-extension-guide
May 29, 2026
Merged

docs: under-the-hood guide to the V1 Protocol + extension cookbook#444
codemonkeychris merged 1 commit into
mainfrom
docs/v1-protocol-extension-guide

Conversation

@codemonkeychris
Copy link
Copy Markdown
Collaborator

Summary

  • Two new comprehensive-tier pages in the Under-the-hood track:
    • docs/_pipeline/templates/v1-protocol.md.dt (order 33.5) — reference for the V1 handler protocol: dispatch model, IElementHandler contract, ref-struct contexts + ReactorBinding, mount-then-subscribe ordering invariant, full ChildrenStrategy survey (11 shapes), pool integration, echo suppression, element-identity tag pattern, descriptors as declarative sugar, the complete PropEntry builder vocabulary, registration variants.
    • docs/_pipeline/templates/extending-reactor-controls.md.dt (order 33.7) — cookbook. End-to-end walkthrough of porting WinUI RatingControl as a StarMeterElement descriptor: element record → descriptor-vs-handler choice → prop wiring → events → children strategy → registration. Locks in the perf bar (pool reuse, echo suppression, callback-gated subscription) external authors should hit.
  • Two compilable doc apps under docs/_pipeline/apps/ with working custom-control extensions (LedIndicatorElement, StarMeterElement).
  • Five small <snippet:...> markers added in src/Reactor/Core/V1Protocol/ so the reference page can cite the authoritative source for the handler contract, MountContext, ChildrenStrategy, the adapter's Mount body, and the descriptor interpreter. Framework rebuilds clean.
  • Generated outputs included so the docset is publishable from this PR (docs/guide/v1-protocol.md, docs/guide/extending-reactor-controls.md, docs/guide/images/{v1-protocol,extending-reactor-controls}/*.png).

Audience and framing

The intended reader is anyone extending Reactor with a new native control (third-party WinUI control, custom Control subclass, or built-in not yet in the catalog), or anyone debugging why an existing element does not update the way it should. Prose is written to reflect the post-cleanup state the user asked for — V1 is the only protocol, RegisterHandler is GA, no [Experimental] surface, no UseV1Protocol flag mentioned, no Path-B-delegate handlers as a stable shape. The doc apps still call AppContext.SetSwitch(\"Reactor.UseV1Protocol\", true) today because that switch is still required at the codebase's current state; that line goes away with the cleanup.

Validation

  • mur docs compile --validate-only --topic v1-protocol — passes (one non-fatal warning about winui-ref not being declared, which is correct — these are Reactor-original concept pages, not transparent wrappers).
  • mur docs compile --validate-only --topic extending-reactor-controls — passes (same non-fatal warning).
  • mur docs compile --topic <each> — both topics emit their .md + screenshot; no other topics rebuilt.
  • Both screenshots show the custom V1 controls actually rendering: 4 LEDs (2 on, 2 dimmed) at level=2, and a RatingControl at 3.5 stars with the configured caption.
  • Both doc apps build clean (Release/x64).
  • src/Reactor/Reactor.csproj rebuilds clean with the source markers in place.

Comprehensive-tier checklist (per ai-author-skill.md §6)

  • ≥80-word mental-model lead paragraph ✓ (both pages)
  • ≥3 resolved snippet refs ✓ (v1-protocol: 7, extending: 4)
  • ≥1 screenshot ✓ (one each)
  • Reference table ✓ (multiple per page)
  • ## Patterns
  • ## Common Mistakes
  • ## Tips
  • ## Next Steps with ≥3 links ✓ (5 each)
  • ≥1 ai:caveat block ✓ (one each)
  • ≥5 inline cross-links ✓ (v1-protocol: 9, extending: 14)

Test plan

  • CI green on this branch
  • Reviewer skim of docs/guide/v1-protocol.md and docs/guide/extending-reactor-controls.md to sanity-check the prose against the implementation
  • (Optional) reviewer runs mur docs compile --topic v1-protocol / --topic extending-reactor-controls locally and diffs the output against the committed docs/guide/* artifacts

🤖 Generated with Claude Code

Two new comprehensive-tier pages in the Under-the-hood track (Section 9
of the docset):

- docs/_pipeline/templates/v1-protocol.md.dt (order 33.5) — reference
  for the V1 handler protocol. Dispatch model, IElementHandler contract,
  ref-struct contexts + ReactorBinding, the mount-then-subscribe
  ordering invariant, ChildrenStrategy survey (11 shapes), pool
  integration, echo suppression / WriteSuppressed, element-identity
  tag pattern, descriptors as declarative sugar, full PropEntry
  builder vocabulary, registration variants. Patterns, Common
  Mistakes, Tips, Next Steps.

- docs/_pipeline/templates/extending-reactor-controls.md.dt
  (order 33.7) — cookbook. Walks through porting WinUI RatingControl
  as a new StarMeterElement descriptor end-to-end: element record →
  descriptor-vs-handler decision → prop wiring → events → children
  strategy → registration → use. Locks in the perf bar (pool reuse,
  echo suppression, static trampolines) external authors should hit.

Each page ships with a compilable doc app:

- docs/_pipeline/apps/v1-protocol/ — LedIndicatorElement custom
  element registered via a ControlDescriptor (joint-field OneWay
  over Border.Background).

- docs/_pipeline/apps/extending-reactor-controls/ — StarMeterElement
  custom element wrapping WinUI RatingControl with Controlled +
  OneWay + OneWayConditional props and a gated callback subscription.

Prose is written to reflect the post-cleanup state (non-V1 paths
removed): V1 is the only protocol, RegisterHandler is GA, no
[Experimental] surface, no UseV1Protocol flag mentioned, no
Path-B-delegate handlers as a stable shape. The doc apps still call
AppContext.SetSwitch today because that's what V1 dispatch requires
in the current codebase — that line goes away with the cleanup.

Five small <snippet:...> markers added in src/Reactor/Core/V1Protocol/
so the reference page can cite the authoritative source for the
handler contract, MountContext, ChildrenStrategy survey, the adapter
Mount body, and the descriptor's interpretation phase ordering.
Framework still builds clean.

Generated outputs included so the docset is publishable from this PR:

- docs/guide/v1-protocol.md
- docs/guide/extending-reactor-controls.md
- docs/guide/images/v1-protocol/led-indicator.png
- docs/guide/images/extending-reactor-controls/star-meter.png

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codemonkeychris codemonkeychris merged commit c14d172 into main May 29, 2026
24 of 25 checks passed
@codemonkeychris codemonkeychris deleted the docs/v1-protocol-extension-guide branch May 29, 2026 04:32
codemonkeychris added a commit that referenced this pull request May 29, 2026
…Protocol" (#448)

The two pages added in #444 (the protocol reference + the extension
cookbook) were never added to the mkdocs `nav:` tree, so they published
but were unreachable from the site navigation. Wire both into the
"Under the Hood" section.

Rename the reference page from the internal "V1 Protocol" label to the
clearer "Control Reconciler Protocol" (reader-visible only):
- template v1-protocol.md.dt -> control-reconciler-protocol.md.dt, which
  drives the generated output filename
- page title/H1, nav label, and the 8 cross-links + link text from the
  cookbook page
- internal slugs left as-is (doc-app folder, image paths, the
  src/Reactor/Core/V1Protocol namespace) since they are not reader-visible

Recompiled the docset (no screenshots), which refreshes generated output
that had drifted from source:
- threading-and-dispatch.md: echo-suppression snippet picks up the
  EchoSuppressScopeDepth path
- skills/reactor.api.txt (both copies) regenerated: adds the
  ItemsRepeater<T> factory overloads and the V1UnmountDisposition enum

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant