feat(web): add copy action for assistant messages#1426
feat(web): add copy action for assistant messages#1426byrafael wants to merge 4 commits intopingdotgg:mainfrom
Conversation
- Show copy action for non-empty assistant text - Keep empty responses uncopiable and covered by tests
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
- scope the assistant message group for hover state - reveal the copy action only when hovering that message
|
My apologies. The commit messages were generated wrong 😭 |

What Changed
This adds a copy action for assistant messages in the chat timeline when the assistant text is non-empty.
The implementation reuses the existing message copy button and clipboard behavior already used elsewhere in the UI, and places the action next to the assistant message timestamp/duration metadata. Empty assistant responses still render as
(empty response)but do not expose a copy action.Tests were added to cover:
Why
Assistant responses were not directly copyable from the timeline, which made it harder to reuse agent output. This change keeps the scope tight by reusing the existing copy control rather than introducing a new interaction pattern.
Keeping empty responses uncopiable avoids copying placeholder UI text instead of real assistant content.
UI Changes
Before:
After:
^ On hover.
Video
Screen.Recording.2026-03-25.at.18.17.05.mov
Checklist
Note
Low Risk
Low risk UI-only change that conditionally exposes an existing clipboard action on assistant timeline entries; main risk is minor layout/hover behavior regressions around message metadata.
Overview
Adds a hover/focus-visible
MessageCopyButtonto assistant messages inMessagesTimeline, positioned next to the timestamp/duration metadata.The copy action only renders when the assistant message text is non-empty (including buffered text while streaming), avoiding copying the
(empty response)placeholder.Extends
MessagesTimeline.test.tsxwith coverage for copy button visibility for non-empty, empty, and streaming assistant messages.Written by Cursor Bugbot for commit 77eb6c0. This will update automatically on new commits. Configure here.
Note
Add copy button to assistant messages in chat timeline
Adds a
MessageCopyButtonto assistant messages in MessagesTimeline.tsx that appears on hover or focus near the timestamp. The button is only rendered when the message has non-empty text, hiding it for empty responses and active streaming with no buffered content.Macroscope summarized 77eb6c0.