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` +---