fix(cockpit-chat): render messages in c-messages + c-input primitive demos#466
Merged
Conversation
c-messages and c-input use <chat-message-list [agent]="agent" /> standalone (intentionally, per their docstrings, to demonstrate primitive composition). The list discovers projected `<ng-template chatMessageTemplate="...">` blocks via contentChildren; with none projected, every findTemplate call returns undefined and nothing renders. Project the minimal four templates (human, ai, tool, system) matching the defaults that the composed <chat> component provides internally. Templates use ChatMessageComponent + ChatStreamingMdComponent — the public primitives — so the demos still showcase "use the primitives directly without composition" as the docstrings intend. Unblocks Task #4's c-messages aimock e2e pilot (PR #462 was closed when this bug surfaced — the e2e was timing out waiting for assistant bubbles that never rendered). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks
blove
added a commit
that referenced
this pull request
May 19, 2026
First slice of Task #4 (aimock e2e for newly-eligible caps). Generated via scripts/generate-aimock-scaffold.ts --cap c-messages, with hand-authored fixture content and spec assertions. - 5 new e2e/ files (playwright config + global-setup-impl + tsconfig + fixtures/c-messages.json + c-messages.spec.ts). - project.json gains the e2e Nx target. - ci.yml matrix gains a c-messages entry. Two spec tests: - user message + AI response both render via submitAndWaitForResponse. - chat-message-list renders both turns (regression coverage for PR #466's primitive-demo fix). The demo was broken at the component level in PR #462 (raw ChatMessageListComponent without projected templates). PR #466 fixed that by projecting the four chat-message templates. This re-pilot verifies the aimock e2e against the fixed demo. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Both c-messages and c-input use `<chat-message-list [agent]="agent" />` standalone (intentionally, per their docstrings — to demonstrate primitive usage without the composed `` wrapper). But `ChatMessageListComponent`'s template is purely `@for + findTemplate(...)` over messages — it discovers projected `<ng-template chatMessageTemplate="...">` blocks via `contentChildren`. With none projected, every `findTemplate` returns undefined → nothing renders.
This was a production bug: the demos couldn't actually display messages. Confirmed via PR #462 e2e attempt where langgraph completed successfully but no assistant bubble ever appeared in the DOM.
Fix
Project the minimal four `ng-template chatMessageTemplate` blocks (human, ai, tool, system) — matching the defaults the composed `` component provides internally. Templates use the same public primitives (`ChatMessageComponent`, `ChatStreamingMdComponent`) so the demos still showcase the intended "compose primitives without the composition wrapper" pattern.
Unblocks
Test plan
🤖 Generated with Claude Code