Skip to content

Commit c90f8e0

Browse files
committed
Hide copy button when user message has no text content [codecane]
Skip rendering the copy button for messages with empty content (e.g., image-only messages) since there is nothing to copy.
1 parent 6d9cc40 commit c90f8e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/src/components/blocks/user-content-copy.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const UserContentWithCopyButton = memo(
3535
? trimTrailingNewlines(content)
3636
: content.trim()
3737

38-
if (!showCopyButton) {
38+
const hasContent = normalizedContent.length > 0
39+
40+
if (!showCopyButton || !hasContent) {
3941
return (
4042
<text
4143
key={`message-content-${messageId}`}

0 commit comments

Comments
 (0)