From 50e03244d6d95128b59422b80a48848ef14d5584 Mon Sep 17 00:00:00 2001 From: PJ Date: Sat, 30 May 2026 21:48:26 +0530 Subject: [PATCH] refactor(inspect-ui): use next step's screenshot for state after Each step now has one screenshot (the moment of observation). The "state after" view of step N is the same moment as step (N+1)'s observation, so reuse that file rather than expecting a separate -after.png. --- inspect-ui/src/routes/RunDetail.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inspect-ui/src/routes/RunDetail.tsx b/inspect-ui/src/routes/RunDetail.tsx index e9c001c..055d39c 100644 --- a/inspect-ui/src/routes/RunDetail.tsx +++ b/inspect-ui/src/routes/RunDetail.tsx @@ -92,15 +92,18 @@ export default function RunDetail() { onJumpNextViolation: jumpToNextViolation, }); + // One screenshot per step depicts the UI at observation time (post-prior- + // action, post-settle). The "after" view for step N is therefore step + // (N+1)'s screenshot: the same moment, observed from the next iteration. const beforeScreenshot = useMemo(() => { if (!runId || !currentStep) return undefined; return screenshotUrl(runId, `step-${String(currentStep.step).padStart(5, "0")}.png`); }, [runId, currentStep]); const afterScreenshot = useMemo(() => { - if (!runId || !currentStep) return undefined; - return screenshotUrl(runId, `step-${String(currentStep.step).padStart(5, "0")}-after.png`); - }, [runId, currentStep]); + if (!runId || !nextStep) return undefined; + return screenshotUrl(runId, `step-${String(nextStep.step).padStart(5, "0")}.png`); + }, [runId, nextStep]); const runStartMillis = useMemo(() => { if (!run?.steps.length) return 0;