From b47e37f39bc575ff49e30fa4c114573672fdb4ec Mon Sep 17 00:00:00 2001 From: Woody Date: Wed, 29 Apr 2026 10:39:01 +0800 Subject: [PATCH] fix: use absolute backend URL for highlight API calls - Vite dev server doesn't proxy /api/v1/v2/ paths to backend - Changed fetch URL and getHighlightUrl to use http://localhost:8000 - Fixed inline citation highlight URLs in buildCitationUrl - Cleaned up debug code --- frontend/src/components/ResponsePanel.tsx | 9 +++++---- frontend/src/utils/citationParser.ts | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/ResponsePanel.tsx b/frontend/src/components/ResponsePanel.tsx index 1c643cd..24432a0 100644 --- a/frontend/src/components/ResponsePanel.tsx +++ b/frontend/src/components/ResponsePanel.tsx @@ -7,7 +7,8 @@ import { processCitations, processCitationsForSubq, extractCitedSources } from ' import { bulletizeMarkdown } from '../utils/citationParser' function getHighlightUrl(document_id: string, chunk_index: number, sub_question: string): string { - return `/api/v1/v2/highlights?document_id=${encodeURIComponent(document_id)}&chunk_index=${chunk_index}&sub_question=${encodeURIComponent(sub_question)}` + const base = 'http://localhost:8000/api/v1/v2' + return `${base}/highlights?document_id=${encodeURIComponent(document_id)}&chunk_index=${chunk_index}&sub_question=${encodeURIComponent(sub_question)}` } interface ResponsePanelProps { @@ -171,7 +172,7 @@ function SubQuestionSections({ useEffect(() => { if (!answer || isLoading || !subQuestionSources.length) return - + const targets: Array<{ document_id: string chunk_index: number @@ -200,7 +201,7 @@ function SubQuestionSections({ setHighlightStatus('loading') - fetch('/api/v1/v2/highlights/batch', { + fetch('http://localhost:8000/api/v1/v2/highlights/batch', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ targets }), @@ -433,7 +434,7 @@ function FlatResponse({ return (
-
+