mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
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.
This commit is contained in:
1 parent
fb69c1b774
commit
50e03244d6
1 file changed
+6
-3
@@ -92,15 +92,18 @@ export default function RunDetail() {
|
|||||||
onJumpNextViolation: jumpToNextViolation,
|
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(() => {
|
const beforeScreenshot = useMemo(() => {
|
||||||
if (!runId || !currentStep) return undefined;
|
if (!runId || !currentStep) return undefined;
|
||||||
return screenshotUrl(runId, `step-${String(currentStep.step).padStart(5, "0")}.png`);
|
return screenshotUrl(runId, `step-${String(currentStep.step).padStart(5, "0")}.png`);
|
||||||
}, [runId, currentStep]);
|
}, [runId, currentStep]);
|
||||||
|
|
||||||
const afterScreenshot = useMemo(() => {
|
const afterScreenshot = useMemo(() => {
|
||||||
if (!runId || !currentStep) return undefined;
|
if (!runId || !nextStep) return undefined;
|
||||||
return screenshotUrl(runId, `step-${String(currentStep.step).padStart(5, "0")}-after.png`);
|
return screenshotUrl(runId, `step-${String(nextStep.step).padStart(5, "0")}.png`);
|
||||||
}, [runId, currentStep]);
|
}, [runId, nextStep]);
|
||||||
|
|
||||||
const runStartMillis = useMemo(() => {
|
const runStartMillis = useMemo(() => {
|
||||||
if (!run?.steps.length) return 0;
|
if (!run?.steps.length) return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user