RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix(web): scope answer loading placeholder to the last message (#18284)
chanxed4e1c03c098
diff --git a/web/src/components/markdown-content/index.tsx b/web/src/components/markdown-content/index.tsxindex 55f0284c1b..b4913d3441 100644--- a/web/src/components/markdown-content/index.tsx+++ b/web/src/components/markdown-content/index.tsx@@ -142,7 +142,7 @@ const MarkdownContent = ({});// let text = content;- if (text === '') {+ if (text === '' && loading) {text = t('chat.searching');}const nextText = replaceTextByOldReg(text);diff --git a/web/src/components/message-item/index.tsx b/web/src/components/message-item/index.tsxindex c56841c5a4..a51cab3246 100644--- a/web/src/components/message-item/index.tsx+++ b/web/src/components/message-item/index.tsx@@ -51,6 +51,7 @@ interface IProps extends Partial<IRemoveMessageById>, IRegenerateMessage {index: number;showLikeButton?: boolean;showLoudspeaker?: boolean;+ isLast?: boolean;}const MessageItem = ({@@ -68,6 +69,7 @@ const MessageItem = ({showLoudspeaker = true,visibleAvatar = true,nickname,+ isLast = false,}: IProps) => {const { theme } = useTheme();const isAssistant = item.role === MessageType.Assistant;@@ -164,7 +166,7 @@ const MessageItem = ({{ '!bg-bg-card': !isAssistant },)}>- {sendLoading && isEmpty(messageContent) ? (+ {sendLoading && isLast && isEmpty(messageContent) ? (<LoadingDots className="text-text-secondary" />) : (<MarkdownContentdiff --git a/web/src/pages/next-chats/chat/chat-box/next-multiple-chat-box.tsx b/web/src/pages/next-chats/chat/chat-box/next-multiple-chat-box.tsxindex 288c48f14d..d806586cbd 100644--- a/web/src/pages/next-chats/chat/chat-box/next-multiple-chat-box.tsx+++ b/web/src/pages/next-chats/chat/chat-box/next-multiple-chat-box.tsx@@ -304,6 +304,7 @@ const ChatCard = forwardRef(function ChatCard(reference={messageReferences.get(message) ?? EmptyReference}// clickDocumentButton={clickDocumentButton}index={i}+ isLast={i === derivedMessages.length - 1}removeMessageById={removeMessageById}regenerateMessage={regenerateMessage}sendLoading={sendLoading}diff --git a/web/src/pages/next-chats/chat/chat-box/single-chat-box.tsx b/web/src/pages/next-chats/chat/chat-box/single-chat-box.tsxindex dd1208d62b..95adb6f8b0 100644--- a/web/src/pages/next-chats/chat/chat-box/single-chat-box.tsx+++ b/web/src/pages/next-chats/chat/chat-box/single-chat-box.tsx@@ -101,6 +101,7 @@ export function SingleChatBox({ conversation }: IProps) {reference={messageReferences.get(message) ?? EmptyReference}clickDocumentButton={clickDocumentButton}index={i}+ isLast={i === messages.length - 1}removeMessageById={removeMessageById}regenerateMessage={regenerateMessage}sendLoading={sendLoading}diff --git a/web/src/pages/next-chats/share/index.tsx b/web/src/pages/next-chats/share/index.tsxindex 6da219fb41..75d50d307b 100644--- a/web/src/pages/next-chats/share/index.tsx+++ b/web/src/pages/next-chats/share/index.tsx@@ -88,6 +88,7 @@ const ChatContainer = () => {derivedMessages?.length - 1 === i}index={i}+ isLast={i === derivedMessages.length - 1}clickDocumentButton={clickDocumentButton}showLikeButton={false}showLoudspeaker={false}