From e9916d9897982d4dd78917aa091118b1ddd4aedb Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Wed, 21 Jan 2026 14:44:11 -0300 Subject: [PATCH] feat: [US-026] - Add variable node from toolbar Co-Authored-By: Claude Opus 4.5 --- src/app/editor/[projectId]/FlowchartEditor.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/editor/[projectId]/FlowchartEditor.tsx b/src/app/editor/[projectId]/FlowchartEditor.tsx index 8567611..1942a47 100644 --- a/src/app/editor/[projectId]/FlowchartEditor.tsx +++ b/src/app/editor/[projectId]/FlowchartEditor.tsx @@ -116,8 +116,19 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) { }, [getViewportCenter, setNodes]) const handleAddVariable = useCallback(() => { - // TODO: Implement in US-026 - }, []) + const position = getViewportCenter() + const newNode: Node = { + id: nanoid(), + type: 'variable', + position, + data: { + variableName: '', + operation: 'set', + value: 0, + }, + } + setNodes((nodes) => [...nodes, newNode]) + }, [getViewportCenter, setNodes]) const handleSave = useCallback(() => { // TODO: Implement in US-034