From 09327c2410c6f4c4ca8731cf2180aaa8d8db1d5e Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Wed, 21 Jan 2026 12:53:14 -0300 Subject: [PATCH] chore: mark US-022 as complete and update progress log Co-Authored-By: Claude Opus 4.5 --- prd.json | 2 +- progress.txt | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/prd.json b/prd.json index b3c4dbf..08a1af4 100644 --- a/prd.json +++ b/prd.json @@ -390,7 +390,7 @@ "Verify in browser using dev-browser skill" ], "priority": 22, - "passes": false, + "passes": true, "notes": "" }, { diff --git a/progress.txt b/progress.txt index a5e94de..f430ba4 100644 --- a/progress.txt +++ b/progress.txt @@ -338,3 +338,16 @@ - Node creation pattern: create Node object with { id, type, position, data }, then add to state via setNodes - React Flow nodes are draggable by default, no extra configuration needed --- + +## 2026-01-21 - US-022 +- What was implemented: Custom ChoiceNode component for displaying branching decisions +- Files changed: + - src/components/editor/nodes/ChoiceNode.tsx - new custom node component with green styling, editable prompt, and dynamic option handles + - src/app/editor/[projectId]/FlowchartEditor.tsx - registered ChoiceNode as custom node type +- **Learnings for future iterations:** + - ChoiceNode follows same pattern as DialogueNode: NodeProps typing, useReactFlow() for updates + - Dynamic handles positioned using style={{ left: `${((index + 1) / (options.length + 1)) * 100}%` }} for even spacing + - Handle id format for options: 'option-0', 'option-1', etc. (matching the index) + - Each option needs a unique id (string) and label (string) per the ChoiceOption type + - updateOptionLabel callback pattern: find option by id, map over options array to update matching one +---