Skip to content

Add assistant response copy action with copy format setting#1477

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

Add assistant response copy action with copy format setting#1477
leonardoxr wants to merge 12 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-to-plain-text transformation in the chat timeline, and adjusts virtualization height estimation based on that UI. Also updates DrainableWorker transactional primitives, which could impact async queue/drain behavior if the new Effect APIs behave differently.

Overview
Adds a dedicated “Copy response” button for completed assistant messages in the chat timeline, with the copied content derived from a new assistantResponseCopyFormat client setting.

Introduces assistantMessageCopy utilities to resolve assistant copy text as raw markdown or a deterministic plain-text rendering (via unified/remark-* with LRU caching), updates timeline virtualization height estimation to account for the extra action row, and extends settings UI + legacy localStorage migration to support the new preference.

Refactors MessageCopyButton to support dynamic text and customizable labels, expands unit/browser coverage for copy behavior and height estimation, and updates DrainableWorker to use newer Effect transaction/retry APIs.

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

Note

Add copy action for assistant responses with markdown or plain-text format setting

  • Adds a hover-visible 'Copy response' button to assistant message rows in MessagesTimeline, copying content as raw markdown or rendered plain text based on a user setting.
  • Adds assistantResponseCopyFormat to ClientSettingsSchema (defaulting to 'markdown') and a settings UI in the General panel to switch between 'Raw markdown' and 'Rendered plain text'.
  • Implements markdownToPlainText in assistantMessageCopy.ts using unified + remark-parse + remark-gfm with an LRU cache to avoid repeated parsing.
  • The copy button is hidden during streaming and when plain-text resolution produces an empty result; row height estimation in timelineHeight.ts adjusts accordingly.
  • MessageCopyButton is extended to accept a lazy text resolver function and updates its label/aria state to reflect copied status.

Macroscope summarized 314644c.

@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: 98714d79-81d8-4e98-96f5-763e78bf9b44

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.

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: 48038957c0

ℹ️ 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: 05ec87d8fd

ℹ️ 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".

@leonardoxr
Copy link
Copy Markdown
Author

@juliusmarminge
Hello, there! first pr ever on a public repo.

I was pondering if i should've skipped the setting, to make it smaller. but I'm hoping for feedback.

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