From 9ea77ba157c023992724118f9f942a69e688538d Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Thu, 5 Mar 2026 15:05:48 +0100 Subject: [PATCH] fix: Abschliessen button returns to session list on last pipeline step handleNext() did nothing on the last step (early return). Now resets session, steps and navigates back to the session overview. Co-Authored-By: Claude Opus 4.6 --- admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx b/admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx index d33bfde..e21fab7 100644 --- a/admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx +++ b/admin-lehrer/app/(admin)/ai/ocr-pipeline/page.tsx @@ -165,7 +165,14 @@ export default function OcrPipelinePage() { } const handleNext = () => { - if (currentStep >= steps.length - 1) return + if (currentStep >= steps.length - 1) { + // Last step completed — return to session list + setSteps(PIPELINE_STEPS.map((s, i) => ({ ...s, status: i === 0 ? 'active' : 'pending' }))) + setCurrentStep(0) + setSessionId(null) + loadSessions() + return + } // Find the next non-skipped step const skipSteps = docTypeResult?.skip_steps || []