* fix(chat): repair message rendering broken by ng-content in @switch (0.0.4)
Found via fresh-install smoke test against @ngaf/chat@0.0.3. Multiple
critical UX bugs that shipped to npm:
1. Message content never rendered. chat-message used `<ng-content/>`
inside `@switch @case` blocks; Angular's content projection is
resolved at view-creation, so projected text/templates never
reached the per-role slots. Result: empty user bubbles and empty
assistant bodies. Fix: single root-level `<ng-content/>` slot,
role-driven CSS class on the body wrapper. Caret + controls
visibility now driven by `data-streaming` / `data-current` /
`data-role` host attributes + CSS, not @switch.
2. Empty state had no default content and didn't hide. The
`[chatEmptyState]` slot in `<chat>` had no fallback, so
first-time consumers saw a blank tall area. Even worse, the
`[hidden]` attribute on the empty container was overridden by
`display: flex` so the empty state stayed visible after
messages existed. Fix: provide default fallback content in the
ng-content slot (How can I help? / Ask anything to get started)
and add `.chat-empty[hidden] { display: none; }` rule.
3. Input textarea didn't clear on submit. The new chat-input pill
used a getter/setter proxy (messageTextProxy) for ngModel
two-way binding, but ngModel doesn't reactively re-read
getters when the underlying signal changes. Setting
`messageText.set('')` after submit didn't update the textarea.
Fix: switch to `[ngModel]="messageText()"` +
`(ngModelChange)="messageText.set($event)"` — signal-native
binding that updates reactively.
Fixes validated end-to-end against a fresh `ng new` consumer with
no Tailwind, no postcss, no global stylesheet. Embedded mode
renders user bubble + streaming markdown assistant correctly;
popup mode opens with full conversation; empty state shows with
default content and hides cleanly.
Bumps @ngaf/chat to 0.0.4.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(release): bump @ngaf/chat to 0.0.4
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(chat): make marked a required peer dep, drop optional flag
Smoke-test investigation: when consumers skipped marked (which the
docs called "optional"), the chat rendered raw markdown source
("## Hello!", "**fake**", etc.) since the fallback only does
HTML-escape + \n→<br>. Unusable.
Decision: marked is now required. The defense-in-depth plain-text
fallback in renderMarkdown stays for resilience but the install
contract is "you ship marked alongside chat."
Updates installation.mdx + quickstart.mdx to reflect the change:
install command becomes \`npm install @ngaf/chat marked\` and the
peer-deps table marks marked as Required.
No version bump — lands as part of the same 0.0.4 patch.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>