Skip to content

fix(frontend): show Thinking… placeholder between Send and first SSE event#128

Merged
warren618 merged 1 commit into
mainfrom
fix/agent-pre-stream-loading-indicator
May 18, 2026
Merged

fix(frontend): show Thinking… placeholder between Send and first SSE event#128
warren618 merged 1 commit into
mainfrom
fix/agent-pre-stream-loading-indicator

Conversation

@warren618
Copy link
Copy Markdown
Collaborator

Summary

Closes #127.

Agent.tsx's live streaming area only rendered when streamingText was non-empty or toolCalls had at least one entry. The window between handleSubmit flipping status to "streaming" and the first SSE event arriving left the chat body visually blank, so on slow networks or during long agent "thinking" time the UI appeared unresponsive.

Adds a Thinking… placeholder that renders exactly during that gap and disappears the instant either streaming-state source becomes non-empty.

Change

  • frontend/src/pages/Agent.tsx: new conditional block before the existing live streaming area, gated on status === "streaming" && !streamingText && toolCalls.length === 0. Reuses the existing AgentAvatar, Loader2 spinner, and muted-foreground typography for visual consistency.

Test plan

  • npx tsc --noEmit clean
  • State-machine trace verified (idle → streaming → first event → streaming text/tool, and 90s safety-timeout reset all transition cleanly)
  • Manual smoke: send a prompt with a slow provider; spinner should appear immediately and seamlessly hand off when first token / tool call lands

…event

Closes #127

Before this change, the live streaming area in Agent.tsx only rendered
when streamingText was non-empty or toolCalls had at least one entry.
The gap between handleSubmit setting status="streaming" and the first
SSE event arriving left the chat area visually blank, making the UI
look unresponsive on slow networks or long agent "thinking" time.

Add a Thinking… placeholder that renders exactly during that gap
(status === "streaming" && !streamingText && toolCalls.length === 0)
and is implicitly hidden once the first SSE event populates either
streaming state.
@warren618 warren618 merged commit 7ef726f into main May 18, 2026
1 check passed
@warren618 warren618 deleted the fix/agent-pre-stream-loading-indicator branch May 18, 2026 07:29
ykykj pushed a commit to ykykj/Vibe-Trading that referenced this pull request May 23, 2026
…event (HKUDS#128)

Closes HKUDS#127

Before this change, the live streaming area in Agent.tsx only rendered
when streamingText was non-empty or toolCalls had at least one entry.
The gap between handleSubmit setting status="streaming" and the first
SSE event arriving left the chat area visually blank, making the UI
look unresponsive on slow networks or long agent "thinking" time.

Add a Thinking… placeholder that renders exactly during that gap
(status === "streaming" && !streamingText && toolCalls.length === 0)
and is implicitly hidden once the first SSE event populates either
streaming state.
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.

feat: add loading indicator for session chat between send and first SSE event

1 participant