Эх сурвалжийг харах

fix: give a disabled node its own look, distinct from skipped

A disabled node's canvas style and icon were identical to a skipped
one, and the "off" badge on the read-only snapshot view was never
wired up at all - viewing a past execution showed no indication that
a node had been turned off, historically or otherwise. Disabled now
gets its own icon (Ban) and a dashed border, matching the same dashed
language already used for a currently-disabled node while editing, so
"switched off by the author" reads the same way whether you're editing
live or reviewing a past run. Skipped keeps its own icon (SkipForward)
so "on a branch not taken" stays visually distinct from both.

Also wire the workflow snapshot's per-node disabled flag into the
viewed canvas - it was being dropped entirely, so a node's off-state at
execution time never showed up while viewing that execution.
fszontagh 1 сар өмнө
parent
commit
90865f3396

+ 19 - 3
webui/src/components/workflow/WorkflowNode.tsx

@@ -1,5 +1,5 @@
 import { Handle, Position, NodeProps } from 'reactflow'
-import { Play, CheckCircle, XCircle, Loader2 } from 'lucide-react'
+import { Play, CheckCircle, XCircle, Loader2, SkipForward, Ban } from 'lucide-react'
 import { NodeIcon } from './NodeIcon'
 import { NodeOutput, DynamicOutputs } from '../../api/workflows'
 import { PinnedDataBadge } from './PinnedDataBadge'
@@ -20,6 +20,8 @@ export interface IterationResult {
   status: 'completed' | 'failed' | 'skipped' | 'disabled'
   output?: any
   error?: string
+  startedAt?: number
+  completedAt?: number
 }
 
 // Calculate handle position for multiple outputs (horizontal distribution for bottom handles)
@@ -95,9 +97,14 @@ export function WorkflowNode({ data, selected }: NodeProps) {
       case 'failed':
         return { borderColor: '#ef4444', backgroundColor: 'var(--node-failed-bg, #fef2f2)' }
       case 'skipped':
+        // A branch not taken: still part of the flow, just not this time.
         return { borderColor: '#9ca3af', backgroundColor: 'var(--node-skipped-bg, #f3f4f6)' }
       case 'disabled':
-        return { borderColor: '#9ca3af', backgroundColor: 'var(--node-skipped-bg, #f3f4f6)' }
+        // Switched off by the author - never ran at all. Dashed border
+        // matches the design-time "off" styling below, so the same visual
+        // language reads the same way whether you're editing or reviewing
+        // a past run.
+        return { borderColor: '#9ca3af', backgroundColor: 'var(--node-skipped-bg, #f3f4f6)', borderStyle: 'dashed' }
       default:
         return {}
     }
@@ -113,8 +120,17 @@ export function WorkflowNode({ data, selected }: NodeProps) {
       case 'failed':
         return <XCircle className="w-4 h-4 text-red-500" />
       case 'skipped':
+        return (
+          <span title="Skipped: on a branch not taken">
+            <SkipForward className="w-4 h-4 text-gray-400 dark:text-gray-500" />
+          </span>
+        )
       case 'disabled':
-        return <span className="w-4 h-4 text-gray-400 dark:text-gray-500">⊘</span>
+        return (
+          <span title="Disabled: switched off by the author">
+            <Ban className="w-4 h-4 text-gray-400 dark:text-gray-500" />
+          </span>
+        )
       default:
         return null
     }