feat(web): add a copy button to user messages - #1112
Conversation
Mirror the assistant per-message copy button on user turns, copying the message text with the same checkmark feedback.
🦋 Changeset detectedLatest commit: 0ad05ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8dd5b0563
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| </svg> | ||
| <span class="cpbtn-text">{{ t('filePreview.copy') }}</span> | ||
| </button> | ||
| <button v-if="turn.role === 'user' && turn.id !== streamingTurnId && turn.text.trim().length > 0" class="cpbtn" @click="copyUserMessage(turn)" tabindex="-1"> |
There was a problem hiding this comment.
Add the user copy affordance to bubble layout
This button is only rendered in ChatPane's desktop v-else branch. When ChatPane is used with bubble=true—mobile/modern conversations via ConversationPane.vue:213/:bubble="bubble" at ConversationPane.vue:1012, and the side chat via SideChatPanel.vue:124—the template takes the earlier v-if="childBubble" branch, where user turns still have no copy control. As a result the new feature is unavailable in those web chat contexts even though assistant copying already exists there.
Useful? React with 👍 / 👎.
Move the copy button out of the line-number role row into the modern bubble meta row, grouped with the undo and time buttons, with matching styling and tooltip.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ad05ee5c0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| /* Custom tooltip for the undo button: appears faster than the native title | ||
| tooltip and avoids duplicating the browser's long default delay. */ | ||
| .u-edit[data-tooltip] { | ||
| .u-meta [data-tooltip] { |
There was a problem hiding this comment.
Preserve the desktop undo tooltip
When childBubble is false, the desktop line-layout undo button still sets data-tooltip but lives in .ln-edit-wrap, not .u-meta, so narrowing these tooltip rules to .u-meta [data-tooltip] removes all pseudo-element styling from that existing control. In the classic desktop chat layout, hovering or focusing the latest user message's undo button no longer shows the translated undo tooltip; keep the original .u-edit[data-tooltip] coverage, or add a separate selector, while adding the copy tooltip.
Useful? React with 👍 / 👎.
Related Issue
N/A — no linked issue.
Problem
Assistant messages have a per-message copy button, but user messages do not, so there is no quick way to copy the text of a message you sent.
What changed
Add a copy button to the modern user-message meta row, alongside the undo and time buttons. It copies the user turn's text with the same checkmark confirmation as the assistant copy button.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.