Skip to content

fix(chat): typing-indicator centered + caret delayed for short streams#180

Merged
blove merged 1 commit into
mainfrom
claude/chat-typing-centered-caret-delay
May 2, 2026
Merged

fix(chat): typing-indicator centered + caret delayed for short streams#180
blove merged 1 commit into
mainfrom
claude/chat-typing-centered-caret-delay

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 2, 2026

Embed-mode polish from live smoke-testing

Issue 1: Typing dots flash at far left

`chat-typing-indicator` rendered at `x=0 + 24px padding` while messages live in a centered column (`max-width: var(--ngaf-chat-max-width); margin: 0 auto`). On "hello" → response, dots appeared far-left, then content rendered in the centered column → visible horizontal shift.

Fix: same max-width + margin auto on the typing-indicator's host so the dots sit in the same column as messages.

Issue 2: Caret flickers for very short responses

For quick replies ("hello" → "Hello! How can I assist you today?" finishes in ~140ms), `data-streaming=true` only stays for that duration → the pulsing caret showed for ~140ms and disappeared. Awkward.

Fix: 300ms delay on the caret fade-in. Quick streams (under ~300ms total) never reveal the caret. Longer streams still get the smooth 2s cubic-bezier pulse copied from copilotkit.

Verified live (with both 0.0.13 chat + 0.0.9 langgraph)

  • ✅ Typing dots position at `x=540` (same as message column)
  • ✅ Caret invisible for 'hello' response
  • ✅ No DOM teardown / role flicker / page scroll

Versions

  • `@ngaf/chat`: 0.0.12 → 0.0.13

🤖 Generated with Claude Code

…rt streams

Two embed-mode polish fixes from live smoke-testing:

1. chat-typing-indicator was rendering at the chat-scroll's left edge
   (x=0 + 24px padding) while messages live in a centered column
   (max-width: var(--ngaf-chat-max-width); margin: 0 auto). The dots
   would flash at the far-left position, then content would suddenly
   appear in the centered column — visible horizontal shift.
   Adding the same max-width + margin auto to chat-typing-indicator
   locks the dots into the same column as messages.

2. Caret animation now has a 300ms fade-in delay before its pulse
   loop starts. Quick LLM responses ("hello" → "Hello! How can I
   assist you today?" finishes in ~140ms) never reach the delay
   threshold, so the caret stays invisible. Longer streams still
   get the smooth pulse from copilotkit's 2s cubic-bezier curve.

Bumps @ngaf/chat 0.0.12 → 0.0.13.

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 4:15pm

Request Review

@blove blove merged commit 37a6158 into main May 2, 2026
14 checks passed
@blove blove deleted the claude/chat-typing-centered-caret-delay 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