diff --git a/frontend/src/components/ResponsePanel.tsx b/frontend/src/components/ResponsePanel.tsx index 4a726db..1c643cd 100644 --- a/frontend/src/components/ResponsePanel.tsx +++ b/frontend/src/components/ResponsePanel.tsx @@ -167,6 +167,7 @@ function SubQuestionSections({ }) { const [copied, setCopied] = useState(false) const [highlightReadyKeys, setHighlightReadyKeys] = useState>(new Set()) + const [highlightStatus, setHighlightStatus] = useState<'loading' | 'done' | ''>('') useEffect(() => { if (!answer || isLoading || !subQuestionSources.length) return @@ -197,6 +198,8 @@ function SubQuestionSections({ if (targets.length === 0) return + setHighlightStatus('loading') + fetch('/api/v1/v2/highlights/batch', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -210,6 +213,8 @@ function SubQuestionSections({ keys.add(`${t.document_id}_${t.chunk_index}_${encodeURIComponent(t.sub_question_text)}`) }) setHighlightReadyKeys(keys) + setHighlightStatus('done') + setTimeout(() => setHighlightStatus(''), 4000) } }) .catch((err) => { @@ -276,6 +281,24 @@ function SubQuestionSections({ return (
+ {highlightStatus !== '' && ( +
+ {highlightStatus === 'loading' && ( + + + Preparing highlights... + + )} + {highlightStatus === 'done' && 'Highlights ready'} +
+ )}