Agent pane: copy button in an expanded card's top-right corner
Leo, 2026-10-29 (relayed as ask-82a27334b2): "wouldnt it be a little copy symbol on the top right within this card?"
What
An expanded message or prompt card gets a small copy button in its top-right corner, inside the card:
- It is always faintly visible (45%) and goes to full opacity when the card is hovered.
- Clicking it copies the card's raw text (a prompt's Markdown source, a message's words) and shows a check for
COPIED_MS(1.2 s). If the clipboard refuses, no check shows. - Its hover and press highlight is the button's own 22px box, never the row or the card.
There is one component, CardCopy.tsx. It extends the transcript's existing CopyButton (code blocks, ShellBlock, tool output) with an optional "Copied" word, so it is not a parallel copy button. Wired into:
- a started sub-session's prompt card (
SubsessionCallCardStartedCard, the card in the reference) - a wait's or list's finished reply card (
SubsessionCallCardSessionCards) - another agent's message (
IncomingMessageCardIncomingMessageLine)
Tool output already had its own copy in its block's header (ShellBlock / CopyControls), so it is unchanged.
Raw stays. Raw shows the MCP call's request and response JSON, which is not the same text as the prompt the copy button copies. So copy does not make Raw redundant, and no other capability is removed.
Gallery (agent-pane.card-copy)
Three looks, each at rest, hovered and copied, on the sub-session prompt card and the incoming-message card:
- A
faint(selected): a 14px glyph at 45% that becomes a check. - B
quiet: a 12px glyph at 30%. Hard to find on the glass. - C
word: "Copied" beside the check. Wider, and it pushes the first line.
Before / after
Linux gallery (agent-pane.card-copy, variant faint, dark, public fixture), from gallery-advisory run 41044181331 at 556dc32. Before: base has no corner icon on these cards (the card-copy gallery entry is new in this PR, so base has no matching shot); the card was otherwise identical, with Raw at the bottom.
| Sub-session prompt card | Incoming message card | |
|---|---|---|
| Hovered (icon full opacity) | ![]() | ![]() |
| Copied (check, resets after 1.2 s) | ![]() | ![]() |
Risk
risk:low/normal UI. The button floats inside the existing .cv-disclosure__panel, so the panel's height can change when the first line wraps around it; model.ts row estimates for these panels are unaffected (they are estimated only while closed). There is no new timer beyond CopyButton's existing COPIED_MS timeout, which is cleared on unmount. The composer, Session Info, the sidebar and menus are untouched, and so is the header of StartedSessionCard.
Tests
webviews/test/card-corner-copy.test.tsx checks that copy writes the raw Markdown, the check shows and resets after COPIED_MS, a refused copy shows no check, the word look, an empty text draws nothing, and the sub-session card draws the copy first in its panel with Raw still present.
Changelog
Added: a copy button in the top-right corner of expanded sub-session prompts and agent messages in the transcript.
Agent session: agent session
š¤ Generated with Claude Code



