fix(chat): preserve markdown when copying messages - #6903
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Copy is limited to top-level orchestrator text via
Reviewed by Cursor Bugbot for commit 8696252. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR preserves Markdown when copying assistant messages and serializes visible workspace resources as portable
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/copyable-markdown.ts | Serializes renderable chat content and workspace resources into copyable Markdown, including refreshed canonical file IDs and encoded fallback references. |
| packages/emcn/src/hooks/use-copy-to-clipboard.ts | Adds promise-backed clipboard writes while preserving an immediate writeText fallback for browsers without the required ClipboardItem APIs. |
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/mention/sim-link.ts | Centralizes escaping and safe URI encoding/decoding for portable mention links. |
| apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx | Connects assistant-message copying to visible content extraction, workspace-file resolution, and the new Markdown serializer. |
Reviews (12): Last reviewed commit: "Merge remote-tracking branch 'origin/sta..." | Re-trigger Greptile
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e066200. Configure here.
e066200 to
d409b0d
Compare
|
@cursor review |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 78219f8. Configure here.
|
@cursor review |
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0ee0b5c. Configure here.
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 851e2f0. Configure here.
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 941f44d. Configure here.
|
@cursor review |
|
@greptile review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e0b6404. Configure here.
94d32d9 to
8696252
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8696252. Configure here.
| <MessageActions | ||
| content={message.content} | ||
| getCopyContent={getCopyContent} | ||
| hasCopyContent={Boolean(getOrchestratorMessageText(blocks, message.content).trim())} |
There was a problem hiding this comment.
Copy button ignores prepared content
Medium Severity
hasCopyContent is derived from raw orchestrator text before toCopyableMarkdown, while the click path bails out when the prepared markdown is empty. The Copy control can therefore appear for content that only yields stripable tags or unresolved non-text segments, and a click writes nothing with no feedback.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8696252. Configure here.


Summary
Copy message now copies the complete top-level orchestrator response as Markdown, including fenced code blocks and language labels. Thinking, tool calls, subagent output, and other internal structured content remain excluded.
This is the first PR in a two-part stack. #6956 adds portable workspace-resource links on top of this Markdown copy behavior.
Type of Change
Testing
apps/simtype-check passedReviewers should verify that a response with prose before and after a fenced code block pastes as the same Markdown, while thinking/tool/subagent content does not appear.
Checklist
Screenshots/Videos
Not applicable. The visible UI is unchanged; the clipboard payload is covered by focused tests.
Post-Deploy Monitoring & Validation