diff --git a/frontend/src/components/ResponsePanel.tsx b/frontend/src/components/ResponsePanel.tsx index c55edca..609cd1d 100644 --- a/frontend/src/components/ResponsePanel.tsx +++ b/frontend/src/components/ResponsePanel.tsx @@ -70,13 +70,18 @@ function SubQuestionSection({ index, subQuestion, answerSection, + allSubQuestionSources, }: { index: number subQuestion: SubQuestionSources answerSection: string + allSubQuestionSources: SubQuestionSources[] }) { const [expanded, setExpanded] = useState(false) - const processedAnswer = processCitationsForSubq(answerSection, [subQuestion], 0) + // Look up citations across ALL sub-questions' sources because the LLM + // may cite chunks from other sub-questions' contexts. + const allSources = allSubQuestionSources.flatMap(sq => sq.sources) + const processedAnswer = processCitations(answerSection, allSources) return (
))}