fix(chat): suppress duplicate typing-indicator while bubble streams; add c-a2ui welcome chips#461
Merged
Merged
Conversation
…dd a2ui welcome chips
Two related demo-polish fixes uncovered while running c-a2ui locally:
1. **Double loading affordance.** During every assistant turn the user
saw BOTH the AI bubble's pulsing caret (`.chat-message__caret`) AND
the floor `<chat-typing-indicator>` simultaneously. Both communicate
the same thing ("agent is working"); two of them reads as visual
noise.
Fix: a new `currentAssistantStreaming()` computed on ChatComponent
returns true when the latest message is an assistant message AND the
agent is loading — i.e. exactly the condition under which the bubble
caret is rendering. The `@if (pinned())` guard on the typing
indicator now also requires `!currentAssistantStreaming()`, so the
caret and the dots no longer overlap. The typing indicator still
shows in its original spot when there's no streaming assistant bubble
yet (the moment between user submit and the first AI message append).
2. **c-a2ui had no welcome chips.** The other cockpit chat caps
(generative-ui, interrupts, subagents, tool-calls) ship two
suggestion chips so a first-time visitor doesn't have to type
anything to see the demo. c-a2ui shipped none. Add 'LAX → JFK' and
'SFO → SEA' chips matching the existing pattern.
Verified locally via chrome MCP: the c-a2ui welcome screen now shows
both chips; clicking 'LAX → JFK' fires the prompt and during the
~15-20s gpt-5 structured-output wait the user sees exactly one loading
affordance instead of two.
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
Two related demo-polish fixes uncovered while testing the modify-search prefill (PR #454) locally.
1. Double loading affordance
During every assistant turn, users saw BOTH the AI bubble's pulsing caret (
.chat-message__caret) AND the floor<chat-typing-indicator>simultaneously. Both communicate the same thing — "agent is working" — and showing two reads as visual noise rather than richer feedback.Fix: new
currentAssistantStreaming()computed onChatComponentreturns true when the latest message is an assistant message AND the agent is loading — exactly the condition under which the bubble caret renders. The@if (pinned())guard on the typing indicator now also requires!currentAssistantStreaming(), so the caret and the dots no longer overlap.The typing indicator still appears in its original spot when there's no streaming assistant bubble yet (the moment between user submit and the first AI message append) — so the "I sent something" feedback isn't lost.
2. c-a2ui had no welcome chips
The other cockpit chat caps (
generative-ui,interrupts,subagents,tool-calls) ship two suggestion chips so a first-time visitor doesn't have to type anything to see the demo.c-a2uishipped none — visitors landed on a blank'How can I help?'screen with no hint that they should type a booking prompt.Fix: add
'LAX → JFK'and'SFO → SEA'chips matching the existing pattern.Files
cockpit/chat/a2ui/angular/src/app/a2ui.component.ts— add welcome chipslibs/chat/src/lib/compositions/chat/chat.component.ts— suppress typing-indicator when current AI bubble is streamingTest plan
npx nx run chat:build— green (includes the regression test asserting no<chat-genui-skeleton>in this composition)npx nx run chat:test— greennpx nx run cockpit-chat-a2ui-angular:build— greenNot in scope
build_formrenders anything (because gpt-5 structured-output doesn't stream tokens) is a separate, larger issue. The chat-lib has a<chat-genui-skeleton>primitive but it's deliberately not mounted inchat.component.ts(there's a spec regression test enforcing this — the skeleton was moved out of the bubble intending to land in an outer slot that was never built). Worth a separate spec.🤖 Generated with Claude Code