diff options
| author | soryu <soryu@soryu.co> | 2026-02-13 20:31:35 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-13 20:31:35 +0000 |
| commit | dedbfe509ddbfdc7a0e49e2f1ba98d060229e751 (patch) | |
| tree | 1d1f8d2af26306709b6b04c5bd52ba51fe09fbaf | |
| parent | 5edaf1228b4e48a441b98c49f58de312b7924ed6 (diff) | |
| download | soryu-makima/makima-system--fix-directive-update-goal-stale-sta-f858f6bd.tar.gz soryu-makima/makima-system--fix-directive-update-goal-stale-sta-f858f6bd.zip | |
feat: makima system: Fix directive update goal stale state bugmakima/makima-system--fix-directive-update-goal-stale-sta-f858f6bd
| -rw-r--r-- | makima/frontend/src/components/directives/DirectiveDetail.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/makima/frontend/src/components/directives/DirectiveDetail.tsx b/makima/frontend/src/components/directives/DirectiveDetail.tsx index 369cdaa..491307b 100644 --- a/makima/frontend/src/components/directives/DirectiveDetail.tsx +++ b/makima/frontend/src/components/directives/DirectiveDetail.tsx @@ -60,6 +60,12 @@ export function DirectiveDetail({ const prevHadRunningRef = useRef(false); const badge = STATUS_BADGE[directive.status] || STATUS_BADGE.draft; + // Sync goalText when directive changes (fixes stale state when switching directives) + useEffect(() => { + setGoalText(directive.goal); + setEditingGoal(false); + }, [directive.id, directive.goal]); + const completedSteps = directive.steps.filter((s) => s.status === "completed").length; const totalSteps = directive.steps.length; const progress = totalSteps > 0 ? Math.round((completedSteps / totalSteps) * 100) : 0; |
