From d1c8075da25275423cd408f86ab4b887830674e5 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Tue, 3 Mar 2026 17:31:55 +0100 Subject: [PATCH] fix: three OCR pipeline UX improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Rename Step 6 label to "Korrektur" (was "OCR-Zeichenkorrektur") 2. Move _fix_character_confusion from pipeline Step 1 into llm_review_entries_streaming so corrections are visible in the UI: char changes (| → I, 1 → I, 8 → B) are now emitted as a batch event right after the meta event, appearing in the corrections list 3. StepReconstruction: all cells (including empty) are now rendered as editable inputs — removed filter that hid empty cells from the editor Co-Authored-By: Claude Sonnet 4.6 --- .../components/ocr-pipeline/StepLlmReview.tsx | 4 +- .../ocr-pipeline/StepReconstruction.tsx | 10 ++--- klausur-service/backend/cv_vocab_pipeline.py | 42 +++++++++++++++++-- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/admin-lehrer/components/ocr-pipeline/StepLlmReview.tsx b/admin-lehrer/components/ocr-pipeline/StepLlmReview.tsx index 494b37a..18eedc2 100644 --- a/admin-lehrer/components/ocr-pipeline/StepLlmReview.tsx +++ b/admin-lehrer/components/ocr-pipeline/StepLlmReview.tsx @@ -387,7 +387,7 @@ export function StepLlmReview({ sessionId, onNext }: StepLlmReviewProps) {

- Schritt 6: OCR-Zeichenkorrektur + Schritt 6: Korrektur

{status === 'ready' && `${vocabEntries.length} Eintraege bereit zur Pruefung`} @@ -405,7 +405,7 @@ export function StepLlmReview({ sessionId, onNext }: StepLlmReviewProps) { {status === 'ready' && ( )} {status === 'running' && ( diff --git a/admin-lehrer/components/ocr-pipeline/StepReconstruction.tsx b/admin-lehrer/components/ocr-pipeline/StepReconstruction.tsx index 32ff351..1b7695f 100644 --- a/admin-lehrer/components/ocr-pipeline/StepReconstruction.tsx +++ b/admin-lehrer/components/ocr-pipeline/StepReconstruction.tsx @@ -35,8 +35,7 @@ export function StepReconstruction({ sessionId, onNext }: StepReconstructionProp const [undoStack, setUndoStack] = useState([]) const [redoStack, setRedoStack] = useState([]) - // All cells including empty ones (for empty field highlighting) - const [allCells, setAllCells] = useState([]) + // (allCells removed — cells now contains all cells including empty ones) const containerRef = useRef(null) const imageRef = useRef(null) @@ -82,8 +81,7 @@ export function StepReconstruction({ sessionId, onNext }: StepReconstructionProp colIndex: c.col_index, })) - setAllCells(allEditableCells) - setCells(allEditableCells.filter(c => c.text.trim() !== '')) + setCells(allEditableCells) setEditedTexts(new Map()) setUndoStack([]) setRedoStack([]) @@ -191,7 +189,7 @@ export function StepReconstruction({ sessionId, onNext }: StepReconstructionProp const emptyCellIds = useMemo(() => { const required = new Set(['column_en', 'column_de']) const ids = new Set() - for (const cell of allCells) { + for (const cell of cells) { if (required.has(cell.colType) && !cell.text.trim()) { ids.add(cell.cellId) } @@ -429,7 +427,7 @@ export function StepReconstruction({ sessionId, onNext }: StepReconstructionProp /> {/* Empty field markers */} - {showEmptyHighlight && allCells + {showEmptyHighlight && cells .filter(c => emptyCellIds.has(c.cellId)) .map(cell => (