From 72ce4420cb146ed44c3199ccdacdd50414bee907 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Tue, 24 Mar 2026 12:59:36 +0100 Subject: [PATCH] fix: advance uiStep past skipped orientation for page-split sub-sessions Page-split sub-sessions (current_step=2) had orientation marked as skipped but uiStep remained at 0 (orientation step), causing StepOrientation to render for a sub-session that has no orientation data. Now advances to uiStep=1 (deskew) when orientation is skipped. Co-Authored-By: Claude Opus 4.6 --- admin-lehrer/app/(admin)/ai/ocr-overlay/page.tsx | 1 + admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/admin-lehrer/app/(admin)/ai/ocr-overlay/page.tsx b/admin-lehrer/app/(admin)/ai/ocr-overlay/page.tsx index 5840773..52b0df2 100644 --- a/admin-lehrer/app/(admin)/ai/ocr-overlay/page.tsx +++ b/admin-lehrer/app/(admin)/ai/ocr-overlay/page.tsx @@ -136,6 +136,7 @@ export default function OcrOverlayPage() { if (uiStep < 4) uiStep = 4 } else if (dbStep >= 2) { skipIds.push('orientation') + if (uiStep < 1) uiStep = 1 // advance past skipped orientation to deskew } } } diff --git a/admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx b/admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx index 0c512a5..285e92a 100644 --- a/admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx +++ b/admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx @@ -108,6 +108,7 @@ export default function OcrPipelinePage() { } else if (dbStep >= 2) { // Page-split sub-session: parent orientation applied, skip only orientation if (!skipSteps.includes('orientation')) skipSteps.push('orientation') + if (uiStep < 1) uiStep = 1 // advance past skipped orientation to deskew } // dbStep === 1: page-split from original image, needs full pipeline }