Skip to content

feat(react): run actions and write state from spec surfaces in the transcript - #1617

Queued
blove wants to merge 1 commit into
mainfrom
blove/react-transcript-interactive-specs
Queued

blove wants to merge 1 commit into
mainfrom
blove/react-transcript-interactive-specs

Conversation

@blove

@blove blove commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Summary

A json-render spec carried by an assistant message rendered read-only in the React transcript (#1604), while RenderSpec itself gained actions and state writes in #1605. This connects the two, opt-in, through generativeUi on MessageList and Chat:

  • handlers: the actions a spec's on bindings may run. A binding naming an action that was not supplied does nothing.
  • store: one application-owned state owner shared by every spec, in place of each spec's own state.
  • onRenderEvent: reports each action, state write and reported result as { messageId, event } (new exported type MessageRenderEvent).

With any of the three set, views get emit and set. Without store, each message keeps state of its own, seeded from its spec's state once that finishes streaming and dropped with its row, so two messages carrying the same spec do not share edits. This matches the Angular chat, which passes only an explicit consumer store and otherwise lets each surface seed its own.

A registry alone behaves exactly as before: read-only.

renderable() now keeps an element's on bindings, which it previously dropped.

Verification

  • npx nx run-many -t test,type-tests,lint,build -p react,content,core: passed (81 React test files, 1391 tests).
  • Mutation check: with the interactive branch disabled, 5 of the 6 new specs fail (the sixth asserts the read-only default); restored, all pass.
  • node scripts/react-parity/verify-packages.mjs: passed.
  • node scripts/react-parity/verify-boundaries.mjs: passed (the chat entry now imports @threadplane/content/render-state at runtime).
  • node scripts/react-parity/inventory.mjs --check --drift warn: passed (baseline drift is informational).
  • node --test scripts/react-parity/{verify-packages,runtime-consumer,inventory}.spec.mjs: 169 pass.
  • node scripts/react-parity/verify-langgraph-candidate.mjs: rerun in progress when this was opened; result to follow in a comment.

Not checked in a browser.

🤖 Generated with Claude Code

…anscript

A spec carried by an assistant message rendered read-only. generativeUi on
MessageList and Chat now takes handlers, store and onRenderEvent. With any of
them the tree is interactive: handlers run the actions a spec names, each
message keeps state of its own seeded from its spec, or every spec shares the
store the application passes, and onRenderEvent reports each event with the
ID of its message. A registry alone stays read-only.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Nov 16, 2026 6:17am UTC

Request Review

@blove
blove enabled auto-merge November 16, 2026 05:50
@blove

blove commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

node scripts/react-parity/verify-langgraph-candidate.mjs passed on this commit after an Angular build (mode verified-candidate, 27 Angular browser scenarios).

🤖 Posted by Claude Code

This branch was successfully deployed

1 active deployment
Preview – threadplane — 11a91960 Deployed Nov 16, 2026 by vercel[bot]
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