Skip to content

feat(react): render generated UI carried by a message in the transcript - #1604

Merged
blove merged 2 commits into
mainfrom
blove/react-transcript-generative-ui
Nov 15, 2026
Merged

blove merged 2 commits into
mainfrom
blove/react-transcript-generative-ui

Conversation

@blove

@blove blove commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What

Angular chat classifies each assistant message's content and renders a json-render spec or A2UI surfaces inside the transcript. React MessageList and Chat only rendered Markdown, so a spec message showed as raw JSON. React already had the pieces (RenderSpec, A2uiSurface, createA2uiSurfaces, GenerativeUiSkeleton) but nothing composed them into the message list.

This adds an opt-in generativeUi option to MessageList and Chat. Nothing changes without it.

const generativeUi: MessageGenerativeUi = { registry };
<Chat session={session} generativeUi={generativeUi} />;
  • registry (plus functions, fallback): an assistant message whose content is a json-render spec renders through RenderSpec in place of its text. While it streams, GenerativeUiSkeleton stands in until the root element has arrived; then each element appears as its JSON finishes, and views get loading until the message completes. The spec's own state feeds bindings, and a { "statePath": … } prop is read as a state binding (as the Angular normaliser does).
  • renderA2ui: content after the ---a2ui_JSON--- marker is handed to an app function as { messageId, source, streaming, skeleton }. Half a marker mid-stream renders nothing rather than flashing as text.
  • skeletonLabel replaces the placeholder text.
  • Finished content that is not a spec stays text. A view that throws gives way to the message text (or the skeleton while streaming) instead of taking the transcript down.
  • A message shown as a surface gets no built-in message actions. A custom renderMessage keeps full ownership.

The chat entry does not import the A2UI entry or packages; verify-boundaries.mjs passes.

Left for later

  • A ready-made per-message A2UI accumulator. Today the app parses the envelopes and owns the store; libs/react/src/a2ui/message-surface.spec.tsx shows that composition working end to end with A2uiSurface. Shipping it means a JSONL envelope reader that does not pull the optional @threadplane/a2ui peer into a runtime import, so it is its own PR.
  • Events, handlers and state writes from a spec in the transcript (the tree is read-only, like RenderSpec today).
  • The "Details" source disclosure under a surface, and live surfaces from partial tool arguments.

Verification

  • New specs: libs/react/src/chat/message-list-generative-ui.spec.tsx (13) and libs/react/src/a2ui/message-surface.spec.tsx (1).
  • Mutation check: with the generativeUi branch in message-list.tsx disabled, 7 of the 14 fail; restored, all pass.
  • npx nx run-many -t test,type-tests,lint,build -p react,content,core
  • node scripts/react-parity/verify-packages.mjs
  • node scripts/react-parity/inventory.mjs --check --drift warn
  • node scripts/react-parity/verify-boundaries.mjs
  • node --test scripts/react-parity/{verify-packages,runtime-consumer,inventory}.spec.mjs (169 pass)

All run on this branch after merging main at #1601. Not run: verify-langgraph-candidate.mjs (no fixture or entry import change), and no browser check of the styles.

🤖 Generated with Claude Code

MessageList and Chat take an opt-in generativeUi option. With a registry, an
assistant message whose content is a json-render spec renders through
RenderSpec in place of its text, element by finished element, with the
GenerativeUiSkeleton until the root element has arrived. With renderA2ui,
content after the A2UI marker is handed to the application together with the
placeholder. A view that throws gives way to the message text.
@vercel

vercel Bot commented Nov 15, 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 15, 2026 5:51pm UTC

Request Review

@blove
blove added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 245b332 Nov 15, 2026
90 checks passed
@blove
blove deleted the blove/react-transcript-generative-ui branch November 15, 2026 23:05

This branch was successfully deployed

1 active deployment
Preview – threadplane — 503b4fae Deployed Nov 15, 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