Skip to content

Add assistant response copy action with copy format setting#1477

Open
leonardoxr wants to merge 8 commits intopingdotgg:mainfrom
leonardoxr:issue-1455-assistant-response-copy
Open

Add assistant response copy action with copy format setting#1477
leonardoxr wants to merge 8 commits intopingdotgg:mainfrom
leonardoxr:issue-1455-assistant-response-copy

Conversation

@leonardoxr
Copy link
Copy Markdown

@leonardoxr leonardoxr commented Mar 28, 2026

Summary

  • add a dedicated copy action for completed assistant responses in the chat timeline
  • add a client-only assistant response copy format setting with markdown and plain-text modes
  • keep code-block copy behavior unchanged
  • add markdown-to-plain-text serialization and regression coverage

Validation

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run test -- src/lib/assistantMessageCopy.test.ts src/components/chat/MessagesTimeline.test.tsx in apps/web
  • bun run test:browser -- src/components/ChatView.browser.tsx -t "copies the raw assistant markdown by default|copies assistant responses as plain text when the setting is enabled|keeps markdown code-block copy scoped to the code block" in apps/web

Assets

Chat before

Chat before

Chat after

Chat after

Settings before

Settings before

Settings after

Settings after

Interaction details

Assistant copy action focused

Plain-text assistant copy setting selected

Issue: #1455

Closes #1455


Note

Medium Risk
Adds new clipboard-copy behavior and markdown parsing dependencies, and updates timeline virtualization height estimation based on a new client setting; regressions could affect chat rendering/scrolling or copy output.

Overview
Adds a copy button for completed assistant messages in the chat timeline, gated to non-streaming responses with copyable content, and wires it into ChatView via a new client-only assistantResponseCopyFormat setting (markdown default or plain-text).

Introduces assistantMessageCopy to resolve copy text (raw markdown or normalized plain text) using unified/remark-parse/remark-gfm with an LRU cache, and updates MessageCopyButton to support lazy text and accessible labels.

Updates timeline height estimation/virtualization to account for the new assistant action row and to re-measure when the copy format setting changes, and adds unit + browser tests plus a settings UI control to configure/reset the format.

Written by Cursor Bugbot for commit 4803895. This will update automatically on new commits. Configure here.

Note

Add assistant response copy button with configurable markdown or plain-text copy format

  • Adds a 'Copy response' button on completed assistant messages in MessagesTimeline, visible on hover/focus, that writes to the clipboard.
  • Introduces a new assistantResponseCopyFormat client setting ('markdown' or 'plain-text', defaulting to 'markdown') configurable from the chat settings page.
  • Adds assistantMessageCopy.ts which converts markdown to plain text using unified + remark-parse with custom renderers for GFM elements; results are LRU-cached (500 entries, ~5MB cap).
  • Updates estimateTimelineMessageHeight to use a taller base height (96px vs 78px) for completed assistant messages that have copy-worthy content, keeping virtualization accurate.
  • Behavioral Change: assistant message rows are taller by default for completed messages once the copy control is shown.

Macroscope summarized 4803895.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f4d462d5-81a7-4acd-9f2f-f2264891ff9c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

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

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: ee80eb6417

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

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

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: 00f34deb78

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

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

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: 45a53c262a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

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

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: 3f2e028d99

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add copy action for assistant responses

1 participant