diff --git a/admin-lehrer/components/ocr-kombi/StepAnsicht.tsx b/admin-lehrer/components/ocr-kombi/StepAnsicht.tsx index becd9d3..841a4e1 100644 --- a/admin-lehrer/components/ocr-kombi/StepAnsicht.tsx +++ b/admin-lehrer/components/ocr-kombi/StepAnsicht.tsx @@ -110,8 +110,19 @@ export function StepAnsicht({ sessionId, onNext }: StepAnsichtProps) { boxIdx++ } - // Skip rows that fall inside a box boundary - const insideBox = boxBounds.some((bb) => ry >= bb.yStart && ry <= bb.yEnd) + // Skip rows only if they fall FULLY inside a box (both Y and X overlap). + // Small boxes (e.g. on the right half) don't cover left-side content rows. + const rowCells = contentZone!.cells.filter((c) => c.row_index === row.index) + const rowXMin = rowCells.length > 0 + ? Math.min(...rowCells.map((c) => c.bbox_px?.x ?? contentZone!.bbox_px.x)) + : contentZone!.bbox_px.x + const insideBox = boxBounds.some((bb) => { + if (ry < bb.yStart || ry > bb.yEnd) return false + // Check horizontal overlap: row must be mostly inside box x-range + const boxXMin = bb.zone.bbox_px.x + const boxXMax = boxXMin + bb.zone.bbox_px.w + return rowXMin >= boxXMin - 20 && rowXMin <= boxXMax + }) if (!insideBox) { currentRows.push(row) }