From 1b3bc87af897a6552f0ae11e515f2f1084d6e328 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 28 Mar 2026 18:45:30 +0000 Subject: [PATCH 1/2] feat(web): open chat links in new tab with external link icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add custom anchor renderer to MarkdownRenderer component - Set target='_blank' and rel='noopener noreferrer' on all links - Display subtle ExternalLinkIcon (↗) after link text - Icon uses opacity-60 for muted appearance in both themes Fixes SOU-822 Co-authored-by: Michael Sukkarieh --- .../components/chatThread/markdownRenderer.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/web/src/features/chat/components/chatThread/markdownRenderer.tsx b/packages/web/src/features/chat/components/chatThread/markdownRenderer.tsx index b7e5daeb5..d6bec965d 100644 --- a/packages/web/src/features/chat/components/chatThread/markdownRenderer.tsx +++ b/packages/web/src/features/chat/components/chatThread/markdownRenderer.tsx @@ -5,7 +5,7 @@ import { SearchQueryParams } from '@/lib/types'; import { cn, createPathWithQueryParams } from '@/lib/utils'; import type { Element, Root } from "hast"; import { Schema as SanitizeSchema } from 'hast-util-sanitize'; -import { CopyIcon, SearchIcon } from 'lucide-react'; +import { CopyIcon, ExternalLinkIcon, SearchIcon } from 'lucide-react'; import type { Heading, Nodes } from "mdast"; import { findAndReplace } from 'mdast-util-find-and-replace'; import { useRouter } from 'next/navigation'; @@ -171,6 +171,21 @@ const MarkdownRendererComponent = forwardRef { + return ( + + {children} + + + ); + }, []); + const renderCode = useCallback(({ className, children, node, ...rest }: React.JSX.IntrinsicElements['code'] & { node?: Element }) => { const text = children?.toString().trimEnd() ?? ''; @@ -239,6 +254,7 @@ const MarkdownRendererComponent = forwardRef {content} From ea8f59f8bb5948abca8ed87c36897ac82c91a684 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 28 Mar 2026 19:23:11 +0000 Subject: [PATCH 2/2] docs: add changelog entry for external link icon feature Co-authored-by: Michael Sukkarieh --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3a20f55e..f60e5d076 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Links in Ask Sourcebot chat responses now open in a new tab with a subtle external link icon indicator. [#1059](https://github.com/sourcebot-dev/sourcebot/pull/1059) + ## [4.16.3] - 2026-03-27 ### Added