Restore Copy Link in chat link context menu#4161
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 |
ApprovabilityVerdict: Approved This PR adds a "Copy Link" option to the external link context menu by extracting the menu logic into a new testable module. The change is self-contained, includes comprehensive unit tests, and the author has recent commits to this code area. You can customize Macroscope's approvability policy. Learn more. |
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 1f0312f. Configure here.
Dismissing prior approval to re-evaluate 2cf6538
2cf6538 to
d7370cb
Compare
|
please enable maintainer edits or cherry pick |
|
@juliusmarminge enabled |

What Changed
Why
The renderer-owned chat link menu replaced Electron's native link menu but omitted its copy action, so there was no way to copy a link without opening it.
Fixes #4155.
UI Changes
Before
After
Interaction
Watch the six-second interaction video
The screenshots and video were captured from an actual authenticated T3 Code Dev build using an isolated test home and neutral example.com content.
Checklist
Note
Low Risk
Localized chat UI refactor with injected clipboard/shell APIs and tests; no auth or data-layer changes.
Overview
Restores Copy Link on right-click for HTTP(S) links in chat markdown by moving the custom context menu into
externalLinkContextMenu.tsand wiring Copy Link throughwriteTextToClipboard.The menu still offers open in integrated browser and open in system browser; failures keep the existing markdown action reporting with per-action operation names (including
copy-link). The custom menu only intercepts context menu for valid web URLs (resolveExternalWebLinkHost); fragment and non-HTTP links fall through to the default browser menu again.Adds unit tests for menu items, each action, cancellation, host resolution, and error paths.
Reviewed by Cursor Bugbot for commit 6f56bf5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Restore Copy Link option in chat external link context menu
showExternalLinkContextMenuandresolveExternalWebLinkHost.writeTextToClipboard.show-link-context-menu,open-link-in-preview, etc.).Macroscope summarized 6f56bf5.