This commit is contained in:
2026-03-28 00:24:18 -03:00
parent 49da927da0
commit f6ef95ebea
6 changed files with 176 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ import { ref, computed, watch } from 'vue'
import type { Ref } from 'vue'
import type { DataSource } from 'mpr-ui-framework'
import { usePipelineStore } from '../stores/pipeline'
import { useStageRegistry } from './useStageRegistry'
interface CheckpointFrame {
seq: number
@@ -65,19 +66,17 @@ export function useCheckpointLoader(
currentFrameRef.value = frame.seq
}
const { checkpointStageFor } = useStageRegistry()
// Auto-load checkpoint when entering editor mode
watch(
() => [pipeline.layoutMode, pipeline.editorStage, jobId.value] as const,
([mode, stage, job]) => {
if (mode === 'bbox_editor' && stage && job) {
const stageMap: Record<string, string> = {
detect_edges: 'filter_scenes',
detect_contours: 'detect_edges',
detect_color: 'detect_contours',
merge_regions: 'detect_color',
const cpStage = checkpointStageFor(stage)
if (cpStage) {
loadCheckpoint(job, cpStage)
}
const cpStage = stageMap[stage] ?? 'filter_scenes'
loadCheckpoint(job, cpStage)
}
},
{ immediate: true },