Skip to content

feat(web): add a copy button to user messages - #1112

Merged
wbxl2000 merged 2 commits into
mainfrom
feat/web-copy-user-message
Jun 25, 2026
Merged

feat(web): add a copy button to user messages#1112
wbxl2000 merged 2 commits into
mainfrom
feat/web-copy-user-message

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

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

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Mirror the assistant per-message copy button on user turns, copying the message text with the same checkmark feedback.
@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0ad05ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@0ad05ee
npx https://pkg.pr.new/@moonshot-ai/kimi-code@0ad05ee

commit: 0ad05ee

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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.
@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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] {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge 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 👍 / 👎.

@wbxl2000
wbxl2000 merged commit 6a97d0b into main Jun 25, 2026
9 checks passed
@wbxl2000
wbxl2000 deleted the feat/web-copy-user-message branch June 25, 2026 17:01
@github-actions github-actions Bot mentioned this pull request Jun 25, 2026
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