Skip to content

feat(addie): add "Copy response" button to web chat interface#4269

Draft
bokelley wants to merge 1 commit intomainfrom
claude/issue-4266-addie-copy-response-button
Draft

feat(addie): add "Copy response" button to web chat interface#4269
bokelley wants to merge 1 commit intomainfrom
claude/issue-4266-addie-copy-response-button

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 8, 2026

Closes #4266

Adds a "Copy" button to each Addie assistant message bubble in the web chat UI. Clicking it writes the raw markdown response to the clipboard and briefly shows "Copied!" for 1.5 s. Works on desktop and mobile (always-visible, not hover-only), sits in the existing feedback bar alongside the thumbs-up/down controls.

Non-breaking justification: Purely additive UI change to server/public/chat.html. No protocol surface touched; no schema changes; changeset is --empty. Existing messages, feedback UI, and streaming behavior are unaffected — the copy button only appends to the feedback container after finalization.

Scope note: The issue requested a "plain text vs markdown toggle." That is explicitly out of scope here. Practitioners copying schema examples, bid request snippets, or certification content want the raw markdown intact (fences, list syntax, field names). A toggle adds decision friction at exactly the wrong moment and would require fragile round-trip DOM parsing. If the need resurfaces, it should be a follow-up issue.

Implementation notes:

  • createFeedbackUI(messageId, rawContent) — new optional rawContent param; copy button is appended via createElement (never via innerHTML), so no CodeQL XSS vector.
  • fallbackCopy() — textarea-based execCommand fallback for non-HTTPS or older browser contexts, with finally cleanup to ensure the element is always removed.
  • Both call sites updated: addMessage passes content (raw markdown param); finalizeStreamingMessage passes fullContent.
  • CSS uses only design-system CSS variables (var(--color-border), var(--color-brand), var(--color-success-*)); margin-left: auto; flex-shrink: 0 right-aligns the button in the flex feedback row.

Pre-PR review:

  • code-reviewer: approved — finally block for textarea cleanup added; no XSS path; pre-existing build errors confirmed unrelated to this diff. Nit: post-copy state transition is duplicated across both clipboard paths (not fixed — extraction would be premature abstraction for two callers).
  • internal-tools-strategist: approved — flex alignment correct for the feedback row layout; both rendering paths (history load and streaming finalization) covered; copy and feedback states fully independent.

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See #3121
for context.

Session: https://claude.ai/code/session_01UoAgNhNUnrKHaXAZqHjHyg


Generated by Claude Code

@bokelley bokelley added the claude-triaged Issue has been triaged by the Claude Code triage routine. Remove to re-triage. label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-triaged Issue has been triaged by the Claude Code triage routine. Remove to re-triage.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Copy response" button to Addie chat interface

2 participants