diff --git a/client/src/components/Chat/Messages/Content/ContentParts.tsx b/client/src/components/Chat/Messages/Content/ContentParts.tsx index 14883b4b94..6158665102 100644 --- a/client/src/components/Chat/Messages/Content/ContentParts.tsx +++ b/client/src/components/Chat/Messages/Content/ContentParts.tsx @@ -7,10 +7,11 @@ import type { Agents, } from 'librechat-data-provider'; import { MessageContext, SearchContext } from '~/Providers'; +import { EditTextPart, EmptyText } from './Parts'; import MemoryArtifacts from './MemoryArtifacts'; import Sources from '~/components/Web/Sources'; import { mapAttachments } from '~/utils/map'; -import { EditTextPart } from './Parts'; +import Container from './Container'; import Part from './Part'; type ContentPartsProps = { @@ -95,11 +96,19 @@ const ContentParts = memo( ); } + /** Show cursor placeholder when content is empty but actively submitting */ + const showEmptyCursor = content.length === 0 && effectiveIsSubmitting; + return ( <> + {showEmptyCursor && ( + + + + )} {content.map((part, idx) => { if (!part) { return null; diff --git a/client/src/hooks/Chat/useChatFunctions.ts b/client/src/hooks/Chat/useChatFunctions.ts index c717209ec5..ad1e0dd2e6 100644 --- a/client/src/hooks/Chat/useChatFunctions.ts +++ b/client/src/hooks/Chat/useChatFunctions.ts @@ -295,12 +295,9 @@ export default function useChatFunctions({ }, ]; } else { - initialResponse.content = [ - { - type: ContentTypes.TEXT, - text: '', - }, - ]; + // Don't pre-initialize content type - let incoming delta events + // create content parts dynamically (supports think, text, etc.) + initialResponse.content = []; } } setShowStopButton(true);