feat: Implement page-split step with auto-detection and sub-session naming

StepPageSplit now:
- Auto-calls POST /page-split on step entry
- Shows oriented image + detection result
- If double page: creates sub-sessions named "Title — S. 1/2"
- If single page: green badge "keine Trennung noetig"
- Manual "Weiter" button (no auto-advance)

Also:
- StepOrientation wrapper simplified (no page-split in orientation)
- StepUpload passes name back via onUploaded(sid, name)
- page.tsx: after page-split "Weiter" switches to first sub-session
- useKombiPipeline exposes setSessionName

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-26 17:56:45 +01:00
parent 469f09d1e1
commit 9f68bd3425
5 changed files with 179 additions and 90 deletions

View File

@@ -40,9 +40,9 @@ function OcrKombiContent() {
deleteSession,
renameSession,
updateCategory,
handleOrientationComplete,
handleSessionChange,
setSessionId,
setSessionName,
setSubSessions,
setParentSessionId,
setIsGroundTruth,
@@ -54,8 +54,9 @@ function OcrKombiContent() {
return (
<StepUpload
sessionId={sessionId}
onUploaded={(sid) => {
onUploaded={(sid, name) => {
setSessionId(sid)
setSessionName(name)
loadSessions()
}}
onNext={handleNext}
@@ -65,7 +66,7 @@ function OcrKombiContent() {
return (
<StepOrientation
sessionId={sessionId}
onNext={handleOrientationComplete}
onNext={() => handleNext()}
onSessionList={() => { loadSessions(); handleNewSession() }}
/>
)
@@ -73,10 +74,19 @@ function OcrKombiContent() {
return (
<StepPageSplit
sessionId={sessionId}
onNext={handleNext}
sessionName={sessionName}
onNext={() => {
// If sub-sessions were created, switch to the first one
if (subSessions.length > 0) {
setSessionId(subSessions[0].id)
setSessionName(subSessions[0].name)
}
handleNext()
}}
onSubSessionsCreated={(subs) => {
setSubSessions(subs)
if (sessionId) setParentSessionId(sessionId)
loadSessions()
}}
/>
)

View File

@@ -356,6 +356,7 @@ export function useKombiPipeline() {
setSessionId,
setSubSessions,
setParentSessionId,
setSessionName,
setIsGroundTruth,
}
}