diff --git a/replay-ui/src/routes/RunDetail.tsx b/replay-ui/src/routes/RunDetail.tsx index 7529cee..c22f9b5 100644 --- a/replay-ui/src/routes/RunDetail.tsx +++ b/replay-ui/src/routes/RunDetail.tsx @@ -113,12 +113,13 @@ export default function RunDetail() { return
loading run...
; } - const violationsBefore = currentStep?.violations ?? []; - const violationsAfter = nextStep?.violations ?? violationsBefore; + // A violation belongs to the action that caused it (relocateViolationsToCause + // already anchored it to that step), so show this step's own violations in + // both panels rather than bleeding the next step's record into "after". + const stepViolations = currentStep?.violations ?? []; + const stepWitnesses = currentStep?.witnesses; const residualsBefore = currentStep?.residuals; const residualsAfter = nextStep?.residuals ?? residualsBefore; - const witnessesBefore = currentStep?.witnesses; - const witnessesAfter = nextStep?.witnesses ?? witnessesBefore; const exceptionsForStep = currentStep?.exceptions; const beforeSpace = deviceSpaceOf(currentStep?.hierarchy); const afterSpace = deviceSpaceOf(nextStep?.hierarchy ?? currentStep?.hierarchy); @@ -157,9 +158,9 @@ export default function RunDetail() { content: ( 0 ? ( + stepViolations.length > 0 ? ( - {violationsBefore.length} + {stepViolations.length} ) : undefined, content: ( 0 ? ( + stepViolations.length > 0 ? ( - {violationsAfter.length} + {stepViolations.length} ) : undefined, content: (