## Context Closes #53741 Right-clicking on a link in any Markdown view showed no way to copy the URL. The right-click handler already detected links for left-click navigation, but the context menu was never extended to surface a link-specific action. Video of the manual test below : [Screencast from 2026-04-13 00-29-49.webm](https://github.com/user-attachments/assets/fbde09ab-78da-4366-b1e0-e15e0d43442b) ## How to Review - **`crates/markdown/src/markdown.rs`** — Added a `context_menu_link: Option<SharedString>` field to `Markdown`. Added `capture_for_context_menu(link)` (replaces the old `capture_selection_for_context_menu`) which saves both selected text and the hovered link together. Added a `context_menu_link()` accessor. Updated the capture-phase right-click handler to detect the link under the cursor via `rendered_text.link_for_source_index`. Added a `event.button != MouseButton::Right` guard to the bubble-phase `MouseDownEvent` handler to prevent selection logic from running on right-click. - **`crates/agent_ui/src/conversation_view/thread_view.rs`** — In `render_message_context_menu`, after computing `has_selection`, also reads `context_menu_link` from the same markdown chunks. Adds a "Copy Link" entry with a separator at the top of the menu when a link URL is present. - **`crates/markdown_preview/src/markdown_preview_view.rs`** — Wraps the markdown element in a `right_click_menu` with a "Copy Link" entry (when a link is present). Edit: There was a mention of a "Copy" and "Copy as Markdown" buttons. After discussion, it was decided that I would re-add them fully fleshed out in a separate PR ## Self-Review Checklist - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the UI/UX checklist - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Added "Copy Link" to the right-click context menu when clicking on a link in Markdown views (agent panel and Markdown preview)
3 files changedLine totals unavailable