Skip to content

Add copy button to copy the full assistant message in Studio Code#4113

Open
sejas wants to merge 3 commits into
trunkfrom
stu-1838-copy-message-button
Open

Add copy button to copy the full assistant message in Studio Code#4113
sejas wants to merge 3 commits into
trunkfrom
stu-1838-copy-message-button

Conversation

@sejas

@sejas sejas commented Jul 7, 2026

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

Proposed Changes

  • Assistant responses in the Studio Code chat can now be copied in full with one click, in both the classic desktop UI and the new agentic UI. Previously only fenced code blocks offered a copy button, so grabbing a whole answer meant manual text selection.
  • The button appears on hover (or keyboard focus) below each assistant message and copies the original markdown source. When a response is split by tool calls into several text segments, the copy still yields the complete message, not just the last fragment.
  • Copying announces "Copied" to screen readers and gives visual check-icon feedback. The code-block and message copy buttons now share one component, which also fixes a subtle timer bug where clicking copy twice in quick succession cut the "Copied" state short.

Testing Instructions

  1. Start a Studio Code session and ask something that produces a response with tool calls between paragraphs (e.g. "list my plugins, then summarize").
  2. Hover an assistant message → a copy icon appears bottom-left, aligned with the text edge; click it and paste somewhere: the full message should paste, including text from before the tool call.
  3. Ask for a response containing a code block → the existing code-block copy button still works.
  4. Repeat in the agentic UI. Verify both light and dark mode.
copy-message.mp4
Screenshot 2026-07-07 at 21 41 40

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

sejas and others added 3 commits July 7, 2026 16:08
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sejas sejas self-assigned this Jul 7, 2026
@sejas sejas requested a review from nightnei July 7, 2026 20:45
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 0856897 vs trunk

app-size

Metric trunk 0856897 Diff Change
App Size (Mac) 1412.04 MB 1412.01 MB 0.03 MB ⚪ 0.0%

site-editor

Metric trunk 0856897 Diff Change
load 748 ms 1053 ms +305 ms 🔴 40.8%

site-startup

Metric trunk 0856897 Diff Change
siteCreation 6466 ms 6559 ms +93 ms 🔴 1.4%
siteStartup 2396 ms 2399 ms +3 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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.

2 participants