From 35978df8a325c22f4fa6281e393806eb377e9d55 Mon Sep 17 00:00:00 2001 From: Jaret Burkett Date: Mon, 2 Mar 2026 10:27:15 -0700 Subject: [PATCH] Adjust defaults for ui graph to get and show all losses --- ui/src/components/JobLossGraph.tsx | 21 +-------------------- ui/src/hooks/useJobLossLog.tsx | 3 +-- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/ui/src/components/JobLossGraph.tsx b/ui/src/components/JobLossGraph.tsx index 78a77bfb..f2a43015 100644 --- a/ui/src/components/JobLossGraph.tsx +++ b/ui/src/components/JobLossGraph.tsx @@ -79,7 +79,7 @@ export default function JobLossGraph({ job }: Props) { const [plotStride, setPlotStride] = useState(1); // show only last N points in the chart (0 = all) - const [windowSize, setWindowSize] = useState(4000); + const [windowSize, setWindowSize] = useState(0); // quick y clipping for readability const [clipOutliers, setClipOutliers] = useState(false); @@ -187,25 +187,6 @@ export default function JobLossGraph({ job }: Props) { return [lo, hi]; }, [clipOutliers, chartData, activeKeys, showSmoothed]); - const latestSummary = useMemo(() => { - // Provide a simple “latest” readout for the first active series - const firstKey = activeKeys[0]; - if (!firstKey) return null; - - const s = perSeries[firstKey]; - if (!s) return null; - - const lastRaw = s.raw.length ? s.raw[s.raw.length - 1] : null; - const lastSmooth = s.smooth.length ? s.smooth[s.smooth.length - 1] : null; - - return { - key: firstKey, - step: lastRaw?.step ?? lastSmooth?.step ?? null, - raw: lastRaw?.value ?? null, - smooth: lastSmooth?.value ?? null, - }; - }, [activeKeys, perSeries]); - return (
diff --git a/ui/src/hooks/useJobLossLog.tsx b/ui/src/hooks/useJobLossLog.tsx index a0bf27ed..59c690fd 100644 --- a/ui/src/hooks/useJobLossLog.tsx +++ b/ui/src/hooks/useJobLossLog.tsx @@ -64,8 +64,7 @@ export default function useJobLossLog(jobID: string, reloadInterval: null | numb params.since_step = lastStepByKeyRef.current[k]; } - // keep default limit from server (or set explicitly if you want) - // params.limit = 2000; + params.limit = 1000000; return apiClient .get(`/api/jobs/${jobID}/loss`, { params })