diff --git a/frontend/src/pages/AdminPipeline.tsx b/frontend/src/pages/AdminPipeline.tsx index eb7d781..f80de1f 100644 --- a/frontend/src/pages/AdminPipeline.tsx +++ b/frontend/src/pages/AdminPipeline.tsx @@ -709,6 +709,7 @@ function RunList({ videoId, videoStatus }: { videoId: string; videoStatus: strin const [loading, setLoading] = useState(true); const [expandedRunId, setExpandedRunId] = useState(null); const [showLegacy, setShowLegacy] = useState(false); + const hasAutoExpanded = useRef(false); const load = useCallback(async (silent = false) => { if (!silent) setLoading(true); @@ -716,17 +717,18 @@ function RunList({ videoId, videoStatus }: { videoId: string; videoStatus: strin const res = await fetchPipelineRuns(videoId); setRuns(res.items); setLegacyCount(res.legacy_event_count); - // Auto-expand the latest run on first load - if (!silent && res.items.length > 0 && expandedRunId === null) { + // Auto-expand the latest run only on first load + if (!hasAutoExpanded.current && res.items.length > 0) { const firstRun = res.items[0]; if (firstRun) setExpandedRunId(firstRun.id); + hasAutoExpanded.current = true; } } catch { // silently fail } finally { if (!silent) setLoading(false); } - }, [videoId, expandedRunId]); + }, [videoId]); useEffect(() => { void load();