Skip to content

fix(chat): scope copy button to message content bubble only - #87

Merged
Sahil5963 merged 1 commit into
YourGPT:betafrom
Gourav-InfoTech:fix/copyButton
Apr 15, 2026
Merged

fix(chat): scope copy button to message content bubble only#87
Sahil5963 merged 1 commit into
YourGPT:betafrom
Gourav-InfoTech:fix/copyButton

Conversation

@Gourav-InfoTech

Copy link
Copy Markdown
Contributor

Description

Fixes the copy button appearing on all assistant message types. It now only appears on messages with text content, positioned inside the content bubble, and copies exactly the displayed text.

Changes

  • Moved FloatingActions (copy button) inside a relative wrapper around MessageContent so it is scoped to the text bubble
  • Copy button no longer renders on messages that have only tool executions (no text content)
  • Copy action now uses cleanContent (follow-up questions and "Sources:" lines stripped) instead of raw message.content, matching what is actually visible
  • Added copyContent prop to FloatingActions to control copied text and button visibility

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

  • I've tested this locally

Manual test cases:

  • Text-only assistant message → copy button appears on hover inside the bubble, copies correctly
  • Message with only tool calls (no text) → copy button does not appear
  • Message with both text and tool calls → copy button appears on the text bubble only
  • Copied text does not include follow-up question markers or "Sources:" lines

Checklist

  • My code follows the project's style guidelines
  • New and existing tests pass locally

Move the copy action inside the csdk-message-content wrapper so it only
appears on messages with text content, and copies the clean displayed
text (follow-ups and sources stripped) rather than raw message.content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown

@Gourav-InfoTech is attempting to deploy a commit to the Delta4 Infotech Team on Vercel.

A member of the Team first needs to authorize it.

@Sahil5963
Sahil5963 merged commit a06a986 into YourGPT:beta Apr 15, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants