diff --git a/frontend/src/components/canvas/edges/index.tsx b/frontend/src/components/canvas/edges/index.tsx index c56f23f..6072b91 100644 --- a/frontend/src/components/canvas/edges/index.tsx +++ b/frontend/src/components/canvas/edges/index.tsx @@ -50,42 +50,48 @@ export function HomelableEdge({ id, source, target, sourceX, sourceY, targetX, t ...(selected ? { stroke: theme.colors.edgeSelectedColor, filter: `drop-shadow(0 0 4px ${theme.colors.edgeSelectedColor}88)` } : {}), } - // Animated dot: slightly brighter + thicker than the base edge, travels source→target - const dotColor = customColor ?? (edgeType === 'vlan' ? getVlanColor(data?.vlan_id as number | undefined) : edgeColors[edgeType as keyof typeof edgeColors] as string) - const dotWidth = ((style.strokeWidth as number ?? 2) + 1.5) * 2 + // Normalize animated value — supports legacy boolean (true → 'snake') + const animMode: 'none' | 'snake' | 'flow' = + data?.animated === true || data?.animated === 'snake' ? 'snake' : + data?.animated === 'flow' ? 'flow' : 'none' + + const animColor = customColor ?? (edgeType === 'vlan' ? getVlanColor(data?.vlan_id as number | undefined) : edgeColors[edgeType as keyof typeof edgeColors] as string) return ( <> - {data?.animated && ( + {animMode === 'snake' && ( {isBidirectional ? ( - + ) : ( - + )} )} + {animMode === 'flow' && ( + + + + )} + {data?.label && (