From 4355601bdb86abea97665281123b0ff1a8323d28 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Wed, 21 Jan 2026 12:54:18 -0300 Subject: [PATCH] feat: [US-023] - Add choice node from toolbar Co-Authored-By: Claude Opus 4.5 --- src/app/editor/[projectId]/FlowchartEditor.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app/editor/[projectId]/FlowchartEditor.tsx b/src/app/editor/[projectId]/FlowchartEditor.tsx index ba5a02c..7031f8b 100644 --- a/src/app/editor/[projectId]/FlowchartEditor.tsx +++ b/src/app/editor/[projectId]/FlowchartEditor.tsx @@ -97,8 +97,21 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) { }, [getViewportCenter, setNodes]) const handleAddChoice = useCallback(() => { - // TODO: Implement in US-023 - }, []) + const position = getViewportCenter() + const newNode: Node = { + id: nanoid(), + type: 'choice', + position, + data: { + prompt: '', + options: [ + { id: nanoid(), label: '' }, + { id: nanoid(), label: '' }, + ], + }, + } + setNodes((nodes) => [...nodes, newNode]) + }, [getViewportCenter, setNodes]) const handleAddVariable = useCallback(() => { // TODO: Implement in US-026