From 1ce154fa71c1264f319eb1c571664f17f284b57a Mon Sep 17 00:00:00 2001 From: ruitanglin Date: Fri, 6 Feb 2026 15:15:45 +0800 Subject: [PATCH] fix(citations): only render citation badges for links in citationMap Project URLs and regular links should be rendered as plain underlined links, not as citation badges. Only links that are actual citations (present in citationMap) should be rendered as badges. Co-authored-by: Cursor --- .../workspace/messages/message-list-item.tsx | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/frontend/src/components/workspace/messages/message-list-item.tsx b/frontend/src/components/workspace/messages/message-list-item.tsx index 96049ae..51323a2 100644 --- a/frontend/src/components/workspace/messages/message-list-item.tsx +++ b/frontend/src/components/workspace/messages/message-list-item.tsx @@ -77,8 +77,8 @@ export function MessageListItem({ /** * Custom link component that handles citations and external links - * For AI messages: external links (http/https) are rendered as CitationLink badges - * For human messages: links are rendered as plain text/links + * Only links that are in citationMap are rendered as CitationLink badges + * Other links (project URLs, regular links) are rendered as plain links */ function MessageLink({ href, @@ -91,27 +91,11 @@ function MessageLink({ }) { if (!href) return {children}; - // Human messages: render links as plain underlined text - if (isHuman) { - return ( - - {children} - - ); - } - const citation = citationMap.get(href); - // Check if it's an external link (http/https) - const isExternalLink = href.startsWith("http://") || href.startsWith("https://"); - - // AI messages: external links use CitationLink for consistent styling during streaming - if (isExternalLink) { + // Only render as CitationLink badge if it's a citation (in citationMap) + // This ensures project URLs and regular links are not rendered as badges + if (citation && !isHuman) { return ( {children} @@ -119,10 +103,12 @@ function MessageLink({ ); } - // Internal/anchor links use simple anchor tag + // All other links (including project URLs) render as plain links return ( {children}