Skip to content

fix(cockpit-chat): render messages in c-messages + c-input primitive demos#466

Merged
blove merged 1 commit into
mainfrom
claude/fix-primitive-demos
May 19, 2026
Merged

fix(cockpit-chat): render messages in c-messages + c-input primitive demos#466
blove merged 1 commit into
mainfrom
claude/fix-primitive-demos

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 19, 2026

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

  • CI Cockpit — build / test (component builds clean).
  • CI Cockpit — build all examples (both demos build).
  • Reviewer: open `npx nx serve cockpit-chat-messages-angular` locally; send "hello" → user + assistant bubbles render (was: silent failure).
  • Reviewer: open `npx nx serve cockpit-chat-input-angular` locally; same check.

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

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

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment May 19, 2026 5:12pm

Request Review

@blove blove merged commit d583530 into main May 19, 2026
18 checks passed
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>
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