From 3453ba7492b9ea27181d5ba53ad1b1ec298165be Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Wed, 21 Jan 2026 12:58:47 -0300 Subject: [PATCH] chore: mark US-025 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 fbb4b22..92d4e6e 100644 --- a/prd.json +++ b/prd.json @@ -447,7 +447,7 @@ "Verify in browser using dev-browser skill" ], "priority": 25, - "passes": false, + "passes": true, "notes": "" }, { diff --git a/progress.txt b/progress.txt index 58c6e86..6249903 100644 --- a/progress.txt +++ b/progress.txt @@ -374,3 +374,16 @@ - Add button styled with border-dashed for visual distinction from action buttons - Handles update dynamically via React Flow re-render when options array changes --- + +## 2026-01-21 - US-025 +- What was implemented: Custom VariableNode component for setting/modifying story variables +- Files changed: + - src/components/editor/nodes/VariableNode.tsx - new custom node component with orange styling, editable variable name, operation dropdown, and numeric value input + - src/app/editor/[projectId]/FlowchartEditor.tsx - imported and registered VariableNode in nodeTypes +- **Learnings for future iterations:** + - VariableNode follows same pattern as DialogueNode: NodeProps typing, useReactFlow() for updates + - Use parseFloat() with fallback to 0 for number input handling: `parseFloat(e.target.value) || 0` + - Operation dropdown uses select element with options for 'set', 'add', 'subtract' + - Type assertion needed for select value: `e.target.value as 'set' | 'add' | 'subtract'` + - Use `??` (nullish coalescing) for number defaults instead of `||` to allow 0 values: `data.value ?? 0` +---