Fix session resume: auto-open most advanced sub-session on parent click
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 26s
CI / test-go-edu-search (push) Successful in 26s
CI / test-python-klausur (push) Failing after 1m46s
CI / test-python-agent-core (push) Successful in 37s
CI / test-nodejs-website (push) Successful in 15s
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 26s
CI / test-go-edu-search (push) Successful in 26s
CI / test-python-klausur (push) Failing after 1m46s
CI / test-python-agent-core (push) Successful in 37s
CI / test-nodejs-website (push) Successful in 15s
When reopening a parent session that has page-split sub-sessions, the UI was showing the parent's pipeline step (always step 1/Orientation) instead of navigating to the sub-sessions. Now automatically opens the most advanced sub-session, matching the behavior of handleOrientationComplete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,12 @@ export default function OcrPipelinePage() {
|
|||||||
if (data.sub_sessions && data.sub_sessions.length > 0) {
|
if (data.sub_sessions && data.sub_sessions.length > 0) {
|
||||||
setSubSessions(data.sub_sessions)
|
setSubSessions(data.sub_sessions)
|
||||||
setParentSessionId(sid)
|
setParentSessionId(sid)
|
||||||
|
// Parent has sub-sessions — open the most advanced one automatically
|
||||||
|
const sorted = [...data.sub_sessions].sort(
|
||||||
|
(a: SubSession, b: SubSession) => (b.current_step || 0) - (a.current_step || 0),
|
||||||
|
)
|
||||||
|
openSession(sorted[0].id, true)
|
||||||
|
return
|
||||||
} else if (data.parent_session_id) {
|
} else if (data.parent_session_id) {
|
||||||
// This is a sub-session — keep parent info but don't reset sub-session list
|
// This is a sub-session — keep parent info but don't reset sub-session list
|
||||||
setParentSessionId(data.parent_session_id)
|
setParentSessionId(data.parent_session_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user