From 845e39969ead44799c3026fdf305b2f7aeca813e Mon Sep 17 00:00:00 2001 From: arc53-machine <232052973+arc53-machine@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:21:28 +0100 Subject: [PATCH] Link only citations that have a source card to jump to A pill for [N] beyond the answer's sources, or on an answer whose sources are hidden, scrolled to nothing. --- frontend/src/conversation/AnswerFlow.tsx | 4 ++++ frontend/src/conversation/ConversationBubble.tsx | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/frontend/src/conversation/AnswerFlow.tsx b/frontend/src/conversation/AnswerFlow.tsx index 03d76a81..a7fb4ce4 100644 --- a/frontend/src/conversation/AnswerFlow.tsx +++ b/frontend/src/conversation/AnswerFlow.tsx @@ -26,6 +26,8 @@ type AnswerFlowProps = { // Absent on reload, where the order is synthesized from the flat fields. segments?: AnswerSegment[]; isStreaming?: boolean; + /** How many sources the answer can cite; see `MarkdownAnswer`. */ + sourceCount?: number; agentId?: string; /** Set when the bubble already carries its own progress UI (a research run). */ suppressStatusLine?: boolean; @@ -51,6 +53,7 @@ export default function AnswerFlow({ toolCalls, segments, isStreaming, + sourceCount, agentId, suppressStatusLine, artifacts, @@ -136,6 +139,7 @@ export default function AnswerFlow({ ); } else { + const showSources = !( + DisableSourceFE || + type === 'ERROR' || + sources?.length === 0 || + sources?.some((source) => source.link === 'None') + ); bubble = (
- {DisableSourceFE || - type === 'ERROR' || - sources?.length === 0 || - sources?.some((source) => source.link === 'None') + {!showSources ? null : sources && ( // Stretched, not shrink-to-fit: the grid below sizes off this box, @@ -446,6 +449,9 @@ const ConversationBubble = forwardRef< toolCalls={toolCalls} segments={segments} isStreaming={isStreaming} + // A citation pill jumps to a source card, so an answer whose + // sources are not shown has nothing to cite. + sourceCount={showSources ? (sources?.length ?? 0) : 0} agentId={agentId} // A research run already narrates itself above; the status line // would be a second live indicator away from the point of action.