fix(frontend): show Thinking… placeholder between Send and first SSE event#128
Merged
Merged
Conversation
…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.
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.
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
Closes #127.
Agent.tsx's live streaming area only rendered whenstreamingTextwas non-empty ortoolCallshad at least one entry. The window betweenhandleSubmitflippingstatusto"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 onstatus === "streaming" && !streamingText && toolCalls.length === 0. Reuses the existingAgentAvatar,Loader2spinner, and muted-foreground typography for visual consistency.Test plan
npx tsc --noEmitclean