Feat: If the interval between two outputs exceeds 600ms, a loading state is displayed at the end. (#16861)

### Summary

Feat: If the interval between two outputs exceeds 600ms, a loading state
is displayed at the end.
This commit is contained in:
balibabu
2026-07-13 18:02:29 +08:00
committed by GitHub
parent 8bc18154d2
commit 45862bf95d
7 changed files with 99 additions and 11 deletions

View File

@@ -1,18 +1,17 @@
import { MessageType } from '@/constants/chat';
import { IRegenerateMessage, IRemoveMessageById } from '@/hooks/logic-hooks';
import {
IMessage,
IReference,
IReferenceChunk,
UploadResponseDataType,
} from '@/interfaces/database/chat';
import classNames from 'classnames';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { IRegenerateMessage, IRemoveMessageById } from '@/hooks/logic-hooks';
import { cn } from '@/lib/utils';
import classNames from 'classnames';
import { isEmpty } from 'lodash';
import { memo, useCallback, useMemo } from 'react';
import { DocumentDownloadButton } from '../document-download-button';
import { LoadingDots } from '../loading-dots';
import MarkdownContent from '../markdown-content';
import { ReferenceDocumentList } from '../next-message-item/reference-document-list';
import { ReferenceImageList } from '../next-message-item/reference-image-list';
@@ -54,7 +53,6 @@ const MessageItem = ({
visibleAvatar = true,
nickname,
}: IProps) => {
const { t } = useTranslation();
const { theme } = useTheme();
const isAssistant = item.role === MessageType.Assistant;
const isUser = item.role === MessageType.User;
@@ -151,7 +149,7 @@ const MessageItem = ({
)}
>
{sendLoading && isEmpty(messageContent) ? (
t('common.running')
<LoadingDots className="text-text-secondary" />
) : (
<MarkdownContent
loading={loading}