Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions components/chat-message-display.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,9 @@ export function ChatMessageDisplay({
)
}

const lastMessage = messages.length > 0 ? messages[messages.length - 1] : null
const isLastMessageFromAssistant = lastMessage?.role === 'assistant'

return (
<ScrollArea className="h-full w-full scrollbar-thin">
{messages.length === 0 ? (
Expand Down Expand Up @@ -1355,6 +1358,20 @@ export function ChatMessageDisplay({
</div>
)
})}

{/* UX Improvement: Show a "Generating diagram..." indicator during streaming pauses */}
{isLastMessageFromAssistant && status === 'streaming' && (
<div className="flex w-full justify-start animate-message-in">
<div className="max-w-[85%]">
<div className="bg-muted/60 text-foreground rounded-2xl rounded-bl-md px-4 py-3 mt-4">
<div className="flex items-center gap-2 text-sm text-muted-foreground">
<div className="h-4 w-4 border-2 border-primary border-t-transparent rounded-full animate-spin" />
<span>Generating diagram...</span>
</div>
</div>
</div>
</div>
)}
</div>
)}
<div ref={messagesEndRef} />
Expand Down