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 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}