fix: /new modal path picker not applying on web + persist “new session” draft state locally
#309
+200
−62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context / Problem
/newmodal uses nested routes (/new/pick/path,/new/pick/machine) to select machine/path./newmodal — it would snap back to the original value.Root cause
/newvia module-level mutable callbacks exported from the/newroute module./newinstance.Fix 1: Replace callback bridge with navigation params
CommonActions.setParams) targeting the previous route./newlistens to the returned params viauseLocalSearchParams()and updatesselectedMachineId/selectedPathaccordingly.Fix 2: Persist the
/newdraft locally (lightweight, no UI changes)new-session-draft-v1.updatedAt./newinitializes from this draft when opened, auto-saves changes with a small debounce, and clears the draft after successful session creation.Files touched
sources/app/(app)/new/index.tsx: remove callback bridge, apply param-driven updates, load/save/clear new-session draft.sources/app/(app)/new/pick/machine.tsx: set previous route params instead of calling callbacks.sources/app/(app)/new/pick/path.tsx: set previous route params instead of calling callbacks.sources/sync/persistence.ts: add MMKV helpers + types for new-session draft.How to test
http://localhost:3005/new/newupdates to the selected path./new→ prompt + selections are restored.