diff --git a/src/lib/components/CustomEdge.svelte b/src/lib/components/CustomEdge.svelte index d19d72b..799d412 100644 --- a/src/lib/components/CustomEdge.svelte +++ b/src/lib/components/CustomEdge.svelte @@ -5,6 +5,7 @@ type EdgeValidationStatus = { hasError: boolean; hasWarning: boolean; + isDead: boolean; }; let { id, sourceX, sourceY, targetX, targetY, selected }: EdgeProps = $props(); @@ -17,13 +18,16 @@ const hasError = $derived(!!validationStatus?.hasError); const hasWarning = $derived(!hasError && !!validationStatus?.hasWarning); + const isDead = $derived(!!validationStatus?.isDead); const edgeStyle = $derived( hasError ? 'stroke: #ef4444; stroke-width: 2px;' : hasWarning ? 'stroke: #f59e0b; stroke-width: 2px;' - : undefined + : isDead + ? 'stroke: #9ca3af; stroke-width: 1.5px; stroke-dasharray: 6 4; opacity: 0.5;' + : undefined ); const [edgePath] = $derived( diff --git a/src/lib/components/NodeUI.svelte b/src/lib/components/NodeUI.svelte index 16582c9..59f94c1 100644 --- a/src/lib/components/NodeUI.svelte +++ b/src/lib/components/NodeUI.svelte @@ -18,6 +18,7 @@ validationStatus?: { hasError: boolean; hasWarning: boolean; + isDead: boolean; issues: Issue[]; } | null; }>(); @@ -51,6 +52,7 @@ const hasWarning = $derived(!hasError && !!validationStatus?.hasWarning); // Normalise issues so the template never sees `undefined` const issues = $derived(validationStatus?.issues ?? []); + const isDead = $derived(validationStatus ? !!validationStatus?.isDead : true); {#if isEndNode} @@ -64,14 +66,19 @@ isConnectable={true} /> {/each} -