Revert "fix: show only last received loading message on workflow creation (#282)"

This reverts commit 5a74215af1.
This commit is contained in:
Dani Akash
2026-01-29 21:29:40 +05:30
parent 5a74215af1
commit 89a53eec5e
2 changed files with 9 additions and 16 deletions

View File

@@ -162,7 +162,9 @@ export const GraphChat: FC<GraphChatProps> = ({
value={input}
onChange={(e) => onInputChange(e.target.value)}
onKeyDown={handleKeyDown}
placeholder={'Describe your workflow...'}
placeholder={
'Visit Amazon and add sensodyne toothpaste to the cart.'
}
rows={1}
/>
{status === 'streaming' ? (

View File

@@ -1,5 +1,4 @@
import type { UIMessage } from 'ai'
import { compact } from 'es-toolkit/compat'
import { Bot } from 'lucide-react'
import { type FC, Fragment, type RefObject } from 'react'
import {
@@ -65,17 +64,13 @@ export const ChatMessages: FC<ChatMessagesProps> = ({
isLastMessage,
isStreaming,
)
const toolBatches =
segments?.filter((s) => s.type === 'tool-batch') ?? []
const toolBatches = segments.filter((s) => s.type === 'tool-batch')
const lastToolBatchKey = toolBatches[toolBatches.length - 1]?.key
const messageText =
segments
?.filter((each) => each.type === 'text')
?.map((each) => each.text)
?.join('\n\n') ?? ''
const lastText = compact(messageText.split('\n\n')).at(-1) ?? ''
const messageText = segments
?.filter((each) => each.type === 'text')
?.map((each) => each.text)
?.join('\n\n')
const likeAction = () => onClickLike(message.id)
const dislikeAction = (comment?: string) =>
@@ -85,11 +80,7 @@ export const ChatMessages: FC<ChatMessagesProps> = ({
<Fragment key={message.id}>
<Message from={message.role}>
<MessageContent>
{message.role === 'assistant' ? (
<MessageResponse key={message.id}>
{lastText}
</MessageResponse>
) : action ? (
{action ? (
<UserActionMessage action={action} />
) : (
segments.map((segment) => {