Skip to content

fix(chat): suggestions slot projection via ngProjectAs (0.0.16)#188

Merged
blove merged 1 commit into
mainfrom
claude/chat-welcome-suggestions-projection
May 2, 2026
Merged

fix(chat): suggestions slot projection via ngProjectAs (0.0.16)#188
blove merged 1 commit into
mainfrom
claude/chat-welcome-suggestions-projection

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 2, 2026

What

Hotfix from live smoke testing 0.0.15. Suggestions projected via [chatWelcomeSuggestions] from a consumer's <chat> content slot weren't reaching the inner <chat-welcome>'s matching slot.

Root cause

Re-projecting <ng-content select="[chatWelcomeSuggestions]" /> inside the <chat-welcome> instance doesn't preserve the selector for the inner component's slot match — Angular's content projection looks at the projected element's own attributes, not at the wrapping ng-content's select.

Fix

Wrap the inner <ng-content> in <ng-container ngProjectAs="[chatWelcomeSuggestions]"> so chat-welcome's <ng-content select="[chatWelcomeSuggestions]" /> sees a matching projection target.

Live smoke verification (all features)

  • ✅ Embedded mode: welcome screen renders beacon, title ("How can I help?"), subtitle ("Ask anything to get started."), input, and 3 vertical suggestion rows
  • ✅ Suggestion click → submits message, welcome unmounts, conversation appears
  • ✅ Action buttons under assistant: regenerate, copy (with ✓ feedback), thumbs up (active state), thumbs down
  • ✅ Theme toggle: light → dark, all tokens flip
  • ✅ Popup mode: launcher visible bottom-right, Cmd+K toggles, custom header projected, conversation persists across mode switches
  • ✅ Sidebar mode: pushContent works, toggle button works
  • ✅ Custom Slots mode: renders existing conversation
  • ✅ Stop button: visible mid-stream, halts generation, reverts to send
  • ✅ Long output: 4266-char ocean-conservation prose with markdown headings + bullets + bold renders end-to-end

Versions

  • @ngaf/chat: 0.0.15 → 0.0.16

Open follow-up (not in this PR)

The optimistic user message can drop after the user clicks Stop mid-stream. Visible only on certain streams; conversation continues fine but the user pill disappears from history. Worth a separate hunt — orthogonal to welcome-screen work.

🤖 Generated with Claude Code

Live smoke testing of 0.0.15 surfaced that <chat-welcome-suggestion>
elements projected via [chatWelcomeSuggestions] from the consumer's <chat>
content slot weren't reaching the inner chat-welcome's matching slot.

Root cause: re-projecting `<ng-content select="[chatWelcomeSuggestions]" />`
inside the `<chat-welcome>` instance doesn't preserve the selector for the
inner component's slot match — Angular's content projection looks at the
projected element's own attributes, not at the wrapping ng-content's select.

Fix: wrap the ng-content in `<ng-container ngProjectAs="[chatWelcomeSuggestions]">`
so chat-welcome's `<ng-content select="[chatWelcomeSuggestions]" />` sees a
matching projection target.

Verified with the smoke harness: 3 vertical suggestion rows now render under
the input on first load. Default greeting + subtitle still render their
fallback content (we deliberately didn't re-project those — overriding via
`<chat-welcome>` directly is the path for consumers who want custom
greetings).

Bumps @ngaf/chat 0.0.15 → 0.0.16.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

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

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 2, 2026 10:20pm

Request Review

@blove blove merged commit f0906a4 into main May 2, 2026
14 checks passed
@blove blove deleted the claude/chat-welcome-suggestions-projection branch May 7, 2026 16:30
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