fix(FN-001): fix stale goal and unable to type in Plan Mission With AI modal (#36)

Split the combined useEffect that handled both auto-start and
persisted-goal restoration into two separate effects:

- Goal restoration: depends only on [isOpen], runs once on modal open
- Auto-start: keeps handleStartInterview dep for initialGoalProp flow

Previously the single effect depended on handleStartInterview, which
recreates on every missionGoal change. Every keystroke re-triggered
the effect, which read the stale persisted value from localStorage
and overwrote user input — making the textarea uneditable and showing
stale data from the last planned mission.

Co-authored-by: AI <ai@runfusion.ai>

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Timothy Laurent
2026-05-04 21:32:41 -07:00
parent 54f2832691
commit b061e2bfe6
3 changed files with 54 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": patch
---
Fix Plan Mission With AI modal: stale goal text and unable to type in textarea. The persisted-goal restoration effect depended on `handleStartInterview`, which recreates on every keystroke via `missionGoal` — causing the effect to re-fire and overwrite user input with stale localStorage data on each character typed.