diff --git a/docs/webui.md b/docs/webui.md
index 89f905caa..043629b07 100644
--- a/docs/webui.md
+++ b/docs/webui.md
@@ -457,11 +457,14 @@ private, trusted network.
### Links and website previews
-HTTP(S) links in replies have a **Link actions** menu: right-click the link,
-press Shift+F10 while it is focused, or touch and hold it. There is no persistent
-action button beside the link. Scrolling or a short tap does not open the menu.
-You can copy the link, open it in a browser tab, or preview it beside the current
-conversation.
+HTTP(S) links in replies have a **Link actions** menu: right-click the link or
+press Shift+F10 while it is focused. Touch and hold keeps the browser's native
+link menu. For in-app actions on touch devices, open the message's existing
+**Message actions → View links** entry. It lists only the web links rendered in
+that message, not URLs inside code blocks or file references. Choose a link to
+copy it, open it externally, or preview it beside the current conversation.
+There is no persistent action button beside each link and no custom long-press
+gesture to interfere with scrolling or text selection.
Ordinary clicks still open links in a browser tab. File and session links keep
their own behavior.
diff --git a/webui/src/components/MessageBubble.tsx b/webui/src/components/MessageBubble.tsx
index 0697cf464..5b9e5d1f5 100644
--- a/webui/src/components/MessageBubble.tsx
+++ b/webui/src/components/MessageBubble.tsx
@@ -14,6 +14,7 @@ import {
CircleAlert,
Clock3,
Copy,
+ Link2,
Quote,
Wrench,
} from "lucide-react";
@@ -131,6 +132,7 @@ interface MessageBlockMenuActionsProps {
isTurnStreaming?: boolean;
onForkFromHere?: () => void;
activity?: MessageBlockMenuActivity;
+ onViewLinks?: () => void;
}
/** Actions and metadata shown after opening a visual message block's context panel. */
@@ -139,6 +141,7 @@ export function MessageBlockMenuActions({
isTurnStreaming = false,
onForkFromHere,
activity,
+ onViewLinks,
}: MessageBlockMenuActionsProps) {
const { t } = useTranslation();
const content = message.role === "assistant"
@@ -274,6 +277,10 @@ export function MessageBlockMenuActions({
) : null}
) : null}
+ {onViewLinks ? : null}
, open: boolean) {
+ const [links, setLinks] = useState([]);
+ useLayoutEffect(() => {
+ const element = root.current;
+ if (!open || !element) return;
+ const collect = () => {
+ const unique = new Map();
+ element.querySelectorAll("[data-assistant-selectable] a[data-web-link]").forEach((anchor) => {
+ const href = anchor.getAttribute("href") ?? "";
+ const url = parseWebLink(href);
+ if (url && !unique.has(url.href)) {
+ unique.set(url.href, { href, title: anchor.textContent?.trim() || href });
+ }
+ });
+ setLinks(Array.from(unique.values()));
+ };
+ collect();
+ // Markdown is lazy-loaded; collect again when its real links appear/change.
+ const observer = new MutationObserver(collect);
+ observer.observe(element, { subtree: true, childList: true, characterData: true, attributes: true, attributeFilter: ["href"] });
+ return () => observer.disconnect();
+ }, [root, open]);
+ return links;
+}
+
+const itemClassName = `${floatingItemClassName} ${floatingItemFocusClassName} w-full min-h-11 text-start hover:bg-muted/70`;
+
+/** A drill-in inside the existing message popover, not another floating layer. */
+export function MessageLinksMenu({ links, onBack, onClose }: {
+ links: MessageWebLink[];
+ onBack: () => void;
+ onClose: () => void;
+}) {
+ const { t } = useTranslation();
+ const openPreview = useContext(WebPreviewContext);
+ const [selected, setSelected] = useState(links.length === 1 ? links[0].href : null);
+ const active = links.find((link) => link.href === selected);
+ const backRef = useRef(null);
+ useLayoutEffect(() => { backRef.current?.focus({ preventScroll: true }); }, [selected]);
+ return