diff --git a/studio-v2/app/vocab-worksheet/page.tsx b/studio-v2/app/vocab-worksheet/page.tsx index db7b645..58579fd 100644 --- a/studio-v2/app/vocab-worksheet/page.tsx +++ b/studio-v2/app/vocab-worksheet/page.tsx @@ -891,7 +891,7 @@ export default function VocabWorksheetPage() { -
+
{/* OCR Settings Panel */} {showSettings && (
@@ -1428,9 +1428,18 @@ export default function VocabWorksheetPage() { const processedPageIndices = selectedPages.length > 0 ? selectedPages : [...new Set(vocabulary.map(v => (v.source_page || 1) - 1))].sort((a, b) => a - b) + + // Use blob URLs if available, otherwise fall back to direct API URLs + const apiBase = getApiBase() const thumbsToShow = processedPageIndices - .filter(idx => idx >= 0 && idx < pagesThumbnails.length) - .map(idx => ({ idx, src: pagesThumbnails[idx] })) + .filter(idx => idx >= 0) + .map(idx => ({ + idx, + src: (idx < pagesThumbnails.length && pagesThumbnails[idx]) + ? pagesThumbnails[idx] + : session ? `${apiBase}/api/v1/vocab/sessions/${session.id}/pdf-thumbnail/${idx}?hires=true` : null, + })) + .filter(t => t.src !== null) as { idx: number; src: string }[] if (thumbsToShow.length > 0) { return thumbsToShow.map(({ idx, src }) => (