Fix: The form waiting for input is not displayed in the dialog message. #12129 (#12130)

### What problem does this PR solve?
Fix: The form waiting for input is not displayed in the dialog message.
#12129

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-12-23 17:59:55 +08:00
committed by GitHub
parent a958ddb27a
commit 033029eaa1

View File

@ -134,6 +134,51 @@ function MessageItem({
},
[currentEventListWithoutMessageById, loading],
);
const renderContent = useCallback(() => {
/* Show message content if there's any text besides the download */
if (pdfDownloadInfo) {
return null;
}
return (
<div
className={cn({
[theme === 'dark' ? styles.messageTextDark : styles.messageText]:
isAssistant,
[styles.messageUserText]: !isAssistant,
'bg-bg-card': !isAssistant,
})}
>
{item.data ? (
children
) : sendLoading && isEmpty(messageContent) ? (
<>{!isShare && 'running...'}</>
) : (
<MarkdownContent
loading={loading}
content={messageContent}
reference={reference}
clickDocumentButton={clickDocumentButton}
></MarkdownContent>
)}
</div>
);
}, [
children,
clickDocumentButton,
isAssistant,
isShare,
item.data,
loading,
messageContent,
pdfDownloadInfo,
reference,
sendLoading,
theme,
]);
return (
<div
className={classNames(styles.messageItem, {
@ -239,6 +284,7 @@ function MessageItem({
/>
</div>
)}
{/* Show PDF download button if download info is present */}
{pdfDownloadInfo && (
<PDFDownloadButton
@ -247,31 +293,8 @@ function MessageItem({
/>
)}
{/* Show message content if there's any text besides the download */}
{messageContent && (
<div
className={cn({
[theme === 'dark'
? styles.messageTextDark
: styles.messageText]: isAssistant,
[styles.messageUserText]: !isAssistant,
'bg-bg-card': !isAssistant,
})}
>
{item.data ? (
children
) : sendLoading && isEmpty(messageContent) ? (
<>{!isShare && 'running...'}</>
) : (
<MarkdownContent
loading={loading}
content={messageContent}
reference={reference}
clickDocumentButton={clickDocumentButton}
></MarkdownContent>
)}
</div>
)}
{renderContent()}
{isAssistant && referenceDocuments.length > 0 && (
<ReferenceDocumentList
list={referenceDocuments}