mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-24 06:34:46 +08:00
fix(citations): improve citation link rendering and copy behavior
- Use citation.title for display text in CitationLink to ensure correct titles show during streaming (instead of generic "Source" text) - Render all external links as CitationLink badges for consistent styling during streaming output - Add removeAllCitations when copying message content to clipboard - Simplify citations_format prompt for cleaner AI output Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -309,6 +309,11 @@ export const CitationLink = ({
|
||||
children,
|
||||
}: CitationLinkProps) => {
|
||||
const domain = extractDomainFromUrl(href);
|
||||
|
||||
// Priority: citation.title > domain
|
||||
// When citation has title, use it for consistent display
|
||||
// This ensures correct title shows even during streaming when children might be generic
|
||||
const displayText = citation?.title || domain;
|
||||
|
||||
return (
|
||||
<InlineCitationCard>
|
||||
@@ -324,7 +329,7 @@ export const CitationLink = ({
|
||||
variant="secondary"
|
||||
className="hover:bg-secondary/80 mx-0.5 cursor-pointer gap-1 rounded-full px-2 py-0.5 text-xs font-normal"
|
||||
>
|
||||
{children ?? domain}
|
||||
{displayText}
|
||||
<ExternalLinkIcon className="size-3" />
|
||||
</Badge>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user