From 7a76697f95a82c5e27ef5c38a93d22939c178e3c Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Wed, 18 Mar 2026 07:43:44 +0100 Subject: [PATCH] fix: always re-run structure detection instead of using cached result The frontend was checking for an existing structure_result and reusing it, which meant the backend fix (passing word_boxes to graphic detection) never had a chance to run on existing sessions. Co-Authored-By: Claude Opus 4.6 --- .../ocr-pipeline/StepStructureDetection.tsx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/admin-lehrer/components/ocr-pipeline/StepStructureDetection.tsx b/admin-lehrer/components/ocr-pipeline/StepStructureDetection.tsx index 73f2e48..56d261d 100644 --- a/admin-lehrer/components/ocr-pipeline/StepStructureDetection.tsx +++ b/admin-lehrer/components/ocr-pipeline/StepStructureDetection.tsx @@ -36,18 +36,7 @@ export function StepStructureDetection({ sessionId, onNext }: StepStructureDetec setError(null) try { - // Check if session already has structure result - const sessionRes = await fetch(`${KLAUSUR_API}/api/v1/ocr-pipeline/sessions/${sessionId}`) - if (sessionRes.ok) { - const sessionData = await sessionRes.json() - if (sessionData.structure_result) { - setResult(sessionData.structure_result) - setOverlayTs(Date.now()) - setDetecting(false) - return - } - } - + // Always re-run detection to pick up latest word_result from OCR step const res = await fetch(`${KLAUSUR_API}/api/v1/ocr-pipeline/sessions/${sessionId}/detect-structure`, { method: 'POST', })