Skip to content

Commit 754bf99

Browse files
committed
fix(stream): only show streaming indicator before first content arrives
1 parent 7935b21 commit 754bf99

File tree

2 files changed

+12
-7
lines changed
  • apps/sim/app

2 files changed

+12
-7
lines changed

apps/sim/app/chat/components/message/message.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { memo, useMemo, useState } from 'react'
44
import { Check, Copy, File as FileIcon, FileText, Image as ImageIcon } from 'lucide-react'
55
import { Tooltip } from '@/components/emcn'
6-
import { StreamingText } from '@/components/ui'
6+
import { StreamingIndicator, StreamingText } from '@/components/ui'
77
import {
88
ChatFileDownload,
99
ChatFileDownloadAll,
@@ -191,11 +191,16 @@ export const ClientChatMessage = memo(
191191
{JSON.stringify(cleanTextContent, null, 2)}
192192
</pre>
193193
) : (
194-
<StreamingText
195-
content={cleanTextContent as string}
196-
isStreaming={!!message.isStreaming}
197-
renderer={renderMarkdown}
198-
/>
194+
<>
195+
<StreamingText
196+
content={cleanTextContent as string}
197+
isStreaming={!!message.isStreaming}
198+
renderer={renderMarkdown}
199+
/>
200+
{message.isStreaming && !(cleanTextContent as string) && (
201+
<StreamingIndicator />
202+
)}
203+
</>
199204
)}
200205
</div>
201206
</div>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/components/chat-message/chat-message.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export function ChatMessage({ message }: ChatMessageProps) {
177177
isStreaming={!!message.isStreaming}
178178
renderer={renderWordWrap}
179179
/>
180-
{message.isStreaming && <StreamingIndicator />}
180+
{message.isStreaming && !formattedContent && <StreamingIndicator />}
181181
</div>
182182
</div>
183183
)

0 commit comments

Comments
 (0)