From 2c2e712ba8e4ae5c6bc4af92157a31a7bfcc0b54 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 15 Jun 2026 15:16:42 +0200 Subject: [PATCH] feat(workflows): Implement core workflow editor components (canvas, inspector, palette) --- src/workflows/NodeInspector.jsx | 65 ++++++++ src/workflows/NodePalette.jsx | 22 +++ src/workflows/WorkflowCanvas.jsx | 45 +++++ src/workflows/WorkflowEditor.jsx | 193 ++++++++++++++++++++++ src/workflows/WorkflowList.jsx | 24 +++ src/workflows/WorkflowNode.jsx | 19 +++ src/workflows/WorkflowRunInspector.jsx | 19 +++ src/workflows/WorkflowValidationPanel.jsx | 15 ++ src/workflows/WorkflowsArea.jsx | 78 +++++++++ 9 files changed, 480 insertions(+) create mode 100644 src/workflows/NodeInspector.jsx create mode 100644 src/workflows/NodePalette.jsx create mode 100644 src/workflows/WorkflowCanvas.jsx create mode 100644 src/workflows/WorkflowEditor.jsx create mode 100644 src/workflows/WorkflowList.jsx create mode 100644 src/workflows/WorkflowNode.jsx create mode 100644 src/workflows/WorkflowRunInspector.jsx create mode 100644 src/workflows/WorkflowValidationPanel.jsx create mode 100644 src/workflows/WorkflowsArea.jsx diff --git a/src/workflows/NodeInspector.jsx b/src/workflows/NodeInspector.jsx new file mode 100644 index 0000000..22ec067 --- /dev/null +++ b/src/workflows/NodeInspector.jsx @@ -0,0 +1,65 @@ +import React from 'react' + +const CONDITION_OPERATIONS = ['equals', 'not_equals', 'exists', 'greater_than', 'less_than', 'contains', 'array_not_empty', 'score_at_least'] + +export default function NodeInspector({ node, tools, onChange, onDelete, readOnly }) { + const [configText, setConfigText] = React.useState('{}') + const [configError, setConfigError] = React.useState('') + + React.useEffect(() => { + setConfigText(JSON.stringify(node?.data?.config || {}, null, 2)) + setConfigError('') + }, [node]) + + if (!node) return
Select a node to edit it.
+ const nodeType = node.data.nodeType + const patchConfig = (config) => onChange({ ...node, data: { ...node.data, config, tool: config.tool || '' } }) + return ( +
+
+ {node.id} + {!readOnly && } +
+ + {nodeType === 'tool' && ( + + )} + {nodeType === 'condition' && ( + + )} +