+ {/* User-visible text */}
+ {!isUser ? (
+
+ {message.blocks.length > 0 ? renderTextBlocks(message.blocks) : (
+
+
+ {autoFormatText(message.content)}
+
+
+ )}
+
+ ) : (
+ message.blocks.length > 0 ? renderTextBlocks(message.blocks) : (
+
+
+ {autoFormatText(message.content)}
+
+
+ )
+ )}
+
+ {/* Inline images */}
+ {renderImageBlocks(message.blocks)}
+
+ {/* Streaming indicator */}
+ {message.isStreaming && (() => {
+ const hasVisibleContent = message.content?.trim();
+ if (!hasVisibleContent) {
+ return
;
+ }
+ return (
+
+
+
+
+
+ );
+ })()}
+
+ {/* Tool calls & thinking (inline) */}
+ {!isUser &&
}
+
+ {/* Raw JSON viewer */}
+ {showRawJson &&
}
+
{/* Action buttons — bottom-right toolbar, inside the bubble */}
{!isUser && !message.isStreaming && getPlainText(message).trim() && (
@@ -553,51 +598,6 @@ export const ChatMessageComponent = memo(function ChatMessageComponent({ message
setShowRawJson(o => !o)} />
- {/* Retry button moved into the action toolbar below */}
- {/* User-visible text */}
- {!isUser ? (
-
- {message.blocks.length > 0 ? renderTextBlocks(message.blocks) : (
-
-
- {autoFormatText(message.content)}
-
-
- )}
-
- ) : (
- message.blocks.length > 0 ? renderTextBlocks(message.blocks) : (
-
-
- {autoFormatText(message.content)}
-
-
- )
- )}
-
- {/* Inline images */}
- {renderImageBlocks(message.blocks)}
-
- {/* Streaming indicator */}
- {message.isStreaming && (() => {
- const hasVisibleContent = message.content?.trim();
- if (!hasVisibleContent) {
- return
;
- }
- return (
-
-
-
-
-
- );
- })()}
-
- {/* Tool calls & thinking (inline) */}
- {!isUser &&
}
-
- {/* Raw JSON viewer */}
- {showRawJson &&
}
{(message.timestamp || wasWebhookMessage || isBookmarked) && (