fix: hide thinking indicator for empty thinking content (#11874)
fix: hide thinking indicator when thinking content is empty Check that resolved thinking content has non-whitespace characters before rendering the ThinkingBlockPeek component, preventing empty or whitespace-only thinking blocks from showing in the chat UI.
This commit is contained in:
parent
e8c88f416f
commit
af4563b7b1
2 changed files with 6 additions and 2 deletions
|
|
@ -85,7 +85,7 @@ export default function StepContainer(props: StepContainerProps) {
|
|||
</pre>
|
||||
) : (
|
||||
<>
|
||||
{props.item.reasoning?.text && (
|
||||
{props.item.reasoning?.text?.trim() && (
|
||||
<ThinkingBlockPeek
|
||||
content={props.item.reasoning.text}
|
||||
index={props.index}
|
||||
|
|
|
|||
|
|
@ -393,10 +393,14 @@ export function Chat() {
|
|||
}
|
||||
|
||||
if (message.role === "thinking") {
|
||||
const thinkingContent = renderChatMessage(message);
|
||||
if (!thinkingContent?.trim()) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div className={isBeforeLatestSummary ? "opacity-50" : ""}>
|
||||
<ThinkingBlockPeek
|
||||
content={renderChatMessage(message)}
|
||||
content={thinkingContent}
|
||||
redactedThinking={message.redactedThinking}
|
||||
index={index}
|
||||
prevItem={index > 0 ? history[index - 1] : null}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue