fix(chat,examples-chat): wire a2uiBasicCatalog so A2UI surfaces render#227
Merged
Conversation
…lly render Phase 4 (PR #226) shipped a working python graph that produces an AIMessage with the ---a2ui_JSON--- wire-format prefix; the chat composition's content classifier correctly identifies the message as a2ui and parses the surface (size=1). However, the template gates the final mount on `@if (classified.type() === 'a2ui' && views(); as catalog)` — without a `views` ViewRegistry, the surface never reaches the DOM and the message renders as a tool-call card instead of a Card with the declared TextField / ChoicePicker / Button. Two changes: 1. **chat-popup + chat-sidebar**: forward a `views` input through to the inner `<chat>`. They wrapped `<chat [agent]>` directly with no way to pass A2UI catalog through, leaving popup/sidebar consumers unable to render surfaces even after wiring. 2. **examples/chat/angular**: import `a2uiBasicCatalog` from `@ngaf/chat` in all three mode components and pass the result as `[views]`. The demo now renders the feedback Card on the render_demo_form path in /embed, /popup, and /sidebar. Verified live: clicking the welcome suggestion produces the AI tool call → ToolMessage("rendered") → AIMessage with prefix + JSONL → the chat-message bubble mounts <a2ui-surface> with <a2ui-card>, <a2ui-text-field>, <a2ui-choice-picker>, <a2ui-button>. The Card title "Quick feedback" displays as designed. Lint + build + tests for both chat lib and examples-chat-angular all pass. A separate lib-level gap (a2ui:datamodel:* emit events have no consumer wiring up to the surface store) prevents form input from back-propagating to the dataModel; that's outside Phase 4 scope and will be tracked separately. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 4 (PR #226) shipped a working python graph that produces an AIMessage with the `---a2ui_JSON---` wire-format prefix; the chat composition's content classifier correctly identifies the message as A2UI and parses the surface. However, the template gates the final mount on `@if (classified.type() === 'a2ui' && views(); as catalog)` — without a `views` ViewRegistry, the surface never reaches the DOM and the message renders as a tool-call card instead of the Card with the declared TextField / ChoicePicker / Button.
Two changes:
Verification
Live smoke against the workspace examples/chat demo after the fix:
Out of scope
Form input → dataModel back-propagation (Finding K): the A2UI text-field emits `a2ui:datamodel:/path:value` events when the user types, but no consumer in libs/chat or libs/render parses these events and updates the surface store. The form's required-name validation thus never sees the typed value, leaving Submit disabled. This is a separate lib-level gap — to be tracked in a follow-up issue.
Test plan
🤖 Generated with Claude Code