Skip to content

feat(chat): add copy message to clipboard for assistant messages - #59

Open
369795172 wants to merge 1 commit into
grapeot:masterfrom
369795172:feat/copy-message-to-clipboard
Open

feat(chat): add copy message to clipboard for assistant messages#59
369795172 wants to merge 1 commit into
grapeot:masterfrom
369795172:feat/copy-message-to-clipboard

Conversation

@369795172

Copy link
Copy Markdown

Summary

Adds a Copy message option to the assistant message context menu (⋮ → Copy message).

  • Tapping it copies all text parts of the message to the system clipboard
  • Shows a brief "Copied" toast confirmation
  • The new item appears before "Fork from here" so the most-used action is at the top

Changes

app/src/main/java/com/yage/opencode_client/ui/chat/ChatMessageContent.kt

  • Add ContentCopy icon import
  • Add ClipData, ClipboardManager, Context, Toast, LocalContext imports
  • Add val context = LocalContext.current in MessageRow
  • Add DropdownMenuItem("Copy message") as the first item in the context menu

Test plan

  • Open a chat session with assistant responses
  • Tap the ⋮ menu on any assistant message bubble
  • Verify "Copy message" appears as the first menu item
  • Tap "Copy message" → verify toast "Copied" appears
  • Paste into any text field → verify full message text is pasted correctly
  • Verify "Fork from here" still works as before

Made with Cursor

Tapping ⋮ on any assistant message now shows a "Copy message" option
that copies all text parts of the message to the system clipboard and
shows a brief "Copied" toast confirmation.

The menu item appears before "Fork from here" so the most commonly
needed action is at the top of the context menu.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant