Skip to content

Add copy button to user prompts#557

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1779926732-user-copy-button
Open

Add copy button to user prompts#557
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1779926732-user-copy-button

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented May 28, 2026

Summary

Closes #556. Adds a copy button to user prompts in the chat thread, matching the existing copy behavior on AI responses.

Changes:

  • UnifiedChat.tsx: Added a CopyButton below each user message bubble. Uses Tailwind's group/user + group-hover/user:opacity-100 for hover-to-reveal on desktop, and always-visible on mobile (via useIsMobile hook). Added getUserMessageText() helper to extract text content from message parts.
  • _auth.chat.$chatId.tsx: Added the same copy button to user messages in the archived chat view, with identical hover/mobile behavior.

Review & Testing Checklist for Human

  • Hover over a user prompt on desktop — copy button should appear below the bubble (right-aligned)
  • Move mouse away — copy button should disappear
  • Click the copy button — text should be copied to clipboard and icon should briefly change to a checkmark
  • On mobile (or narrow viewport), the copy button should always be visible without hover
  • Verify the copy button also works on archived chat messages at /chat/:chatId

Notes

  • Reuses the existing CopyButton component and useCopyToClipboard hook — no new dependencies added
  • The button styling matches the existing assistant response copy button (same size, icon, colors)

Link to Devin session: https://app.devin.ai/sessions/62aaa677e1fe4029ae7ff95ccecfa509
Requested by: @marksftw


Open in Devin Review

- Add copy button below user message bubbles in the main chat (UnifiedChat)
- Add copy button below user message bubbles in archived chat view
- On desktop: button appears on hover via group-hover
- On mobile: button is always visible
- Reuses existing CopyButton component and useCopyToClipboard hook
- Uses Tailwind group/user modifier for scoped hover behavior

Co-Authored-By: marks <markskram@protonmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying maple with  Cloudflare Pages  Cloudflare Pages

Latest commit: cb794b6
Status: ✅  Deploy successful!
Preview URL: https://26fe5e5b.maple-ca8.pages.dev
Branch Preview URL: https://devin-1779926732-user-copy-b.maple-ca8.pages.dev

View logs

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@marksftw
Copy link
Copy Markdown
Contributor

Works well on Chrome and Safari for both Desktop and mobile.

@marksftw marksftw requested a review from AnthonyRonning May 28, 2026 17:24
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.

Add a copy button to user prompts

1 participant