Skip to content

fix(chat): suppress duplicate typing-indicator while bubble streams; add c-a2ui welcome chips#461

Merged
blove merged 2 commits into
mainfrom
claude/c-a2ui-chip-and-indicator
May 19, 2026
Merged

fix(chat): suppress duplicate typing-indicator while bubble streams; add c-a2ui welcome chips#461
blove merged 2 commits into
mainfrom
claude/c-a2ui-chip-and-indicator

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 19, 2026

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 on ChatComponent returns 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-a2ui shipped 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 chips
  • libs/chat/src/lib/compositions/chat/chat.component.ts — suppress typing-indicator when current AI bubble is streaming

Test plan

  • npx nx run chat:build — green (includes the regression test asserting no <chat-genui-skeleton> in this composition)
  • npx nx run chat:test — green
  • npx nx run cockpit-chat-a2ui-angular:build — green
  • Chrome MCP smoke: c-a2ui welcome screen shows both chips; clicking 'LAX → JFK' fires the prompt; during the ~15-20s gpt-5 structured-output wait the user sees exactly one loading affordance (the bubble caret), not two; form renders correctly
  • CI

Not in scope

  • The 10-30s "void" before c-a2ui's build_form renders 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 in chat.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.
  • The LLM occasionally picks the wrong destination from a prompt like "LAX to JFK" (sets Destination=LAX). Build-form prompt-engineering issue, not a chat-lib concern.

🤖 Generated with Claude Code

…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>
@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 4:08pm

Request Review

@blove blove merged commit 6bfab2e into main May 19, 2026
2 checks passed
@blove blove deleted the claude/c-a2ui-chip-and-indicator branch May 19, 2026 16:10
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