Add assistant response copy action with copy format setting#1477
Add assistant response copy action with copy format setting#1477leonardoxr wants to merge 12 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
|
@juliusmarminge I was pondering if i should've skipped the setting, to make it smaller. but I'm hoping for feedback. |

Summary
Validation
bun fmtbun lintbun typecheckbun run test -- src/lib/assistantMessageCopy.test.ts src/components/chat/MessagesTimeline.test.tsxinapps/webbun 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"inapps/webAssets
Chat before
Chat after
Settings before
Settings after
Interaction details
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
DrainableWorkertransactional 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
assistantResponseCopyFormatclient setting.Introduces
assistantMessageCopyutilities to resolve assistant copy text as raw markdown or a deterministic plain-text rendering (viaunified/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
MessageCopyButtonto support dynamic text and customizable labels, expands unit/browser coverage for copy behavior and height estimation, and updatesDrainableWorkerto 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
MessagesTimeline, copying content as raw markdown or rendered plain text based on a user setting.assistantResponseCopyFormattoClientSettingsSchema(defaulting to'markdown') and a settings UI in the General panel to switch between 'Raw markdown' and 'Rendered plain text'.markdownToPlainTextinassistantMessageCopy.tsusingunified+remark-parse+remark-gfmwith an LRU cache to avoid repeated parsing.timelineHeight.tsadjusts accordingly.MessageCopyButtonis extended to accept a lazytextresolver function and updates its label/aria state to reflect copied status.Macroscope summarized 314644c.