Skip to content

Commit 67b9a56

Browse files
fahchenclaude
andcommitted
fix(dashboard): firing edge keeps its pre-firing color; accent fills as overlay
Single-path firing animation made the edge VANISH at progress=0 (strokeDashoffset=1 = 100% invisible), then the accent filled into emptiness, then snapped back. User watched the edge disappear before the fill started. OrthogonalEdgeImpl firing branch now renders two stacked paths: - Base BaseEdge with the existing edge style (cf-border-strong for default, cf-accent-tint for enabled-input arcs) + arrow marker. Always full opacity — the static color stays visible throughout the animation. - Overlay <path> with cf-accent stroke, pathLength=1, strokeDasharray=1, strokeDashoffset=1-progress, pointerEvents:none. Grows from invisible (progress=0) to fully covering (progress=1). After animation ends the overlay is gone; the base stroke remains. Non-firing branch unchanged. Test assertions look at edge data only, not DOM paths; 172/172 vitest. mix precommit shows 1 unrelated TelemetryBridgeTest flake (pre-existing, documented). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent fd95c2d commit 67b9a56

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

dashboard/ui/src/components/NetDiagram.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -593,26 +593,28 @@ function OrthogonalEdgeImpl({ data, markerEnd, style }: EdgeProps) {
593593
return <BaseEdge path={path} markerEnd={markerEnd} style={style} />
594594
}
595595

596-
// Two-phase fire paint: pathLength="1" normalises the stroke math so a single
597-
// `strokeDasharray=1` + `strokeDashoffset=1-progress` fills the path from
598-
// start to end regardless of pixel length.
599-
const firingStyle: CSSProperties = {
596+
// Base path keeps the edge's pre-firing color visible throughout the
597+
// animation; overlay path paints `cf-accent` on top, growing from 0..1 via
598+
// `pathLength="1"` + `strokeDasharray=1` + `strokeDashoffset=1-progress`.
599+
const overlayStyle: CSSProperties = {
600600
...style,
601601
stroke: "var(--color-cf-accent)",
602-
strokeWidth: 2,
603602
strokeDasharray: 1,
604-
strokeDashoffset: 1 - progress
603+
strokeDashoffset: 1 - progress,
604+
pointerEvents: "none"
605605
}
606606
return (
607-
<path
608-
d={path}
609-
className="react-flow__edge-path"
610-
fill="none"
611-
markerEnd={markerEnd}
612-
pathLength={1}
613-
style={firingStyle}
614-
data-testid="cf-edge-firing-path"
615-
/>
607+
<g data-testid="cf-edge-firing-path">
608+
<BaseEdge path={path} markerEnd={markerEnd} style={style} />
609+
<path
610+
d={path}
611+
className="react-flow__edge-path"
612+
fill="none"
613+
pathLength={1}
614+
style={overlayStyle}
615+
data-testid="cf-edge-firing-overlay"
616+
/>
617+
</g>
616618
)
617619
}
618620

0 commit comments

Comments
 (0)