You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b40b65f
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(mobile): each new-task draft route keeps its own flow state
The new-task flow (selected project, draft, submitting, expanded provider)
was one set of useState in the provider shared by every draft route. Each
draft route reset it in a layout effect on mount and gated its first render
on that, and a draft opened by id was bound by an effect that awaited draft
hydration and re-ran on every project list change.
Flow state now lives in a module atom keyed by the draft route (route key +
draft identity) and is pruned from the navigation state change handler when
the route leaves the stack. A new route starts fresh by key, so the reset
effect and its gate are gone. A route's draftId is resolved in render from
the hydrated drafts (new composerDraftsLoadedAtom) and loaded projects;
a draft or project that is gone sends the route back to the project picker.
Effects: NewTaskDraftRouteScreen 1 -> 0 (reset layout effect),
NewTaskDraftScreen 2 removed (selectedProjectRef sync, draft-open retry
effect). The provider keeps its draft-creation effect: the draft key must
exist before the composer mounts.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
0 commit comments