New Mission
Five steps to a long-term commitment
Overview
A five-step flow that mirrors the onboarding profile wizard structurally — same StepHeader, same staggered transitions — but with mission-specific fields. Step 1: free-form mission text ('Become a better person'). Step 2: a category chip picker (BUSINESS, HEALTH, CONTENT CREATION, etc.). Step 3: duration picker (30 / 60 / 90 days, or custom). Step 4: improvements multi-select (CONSISTENCY, FOCUS, DISCIPLINE, etc., pick 3+). Step 5: the VisionBoard — three images selected from the device's photo library, each uploaded to Convex storage and linked by storageId.
How it works
Each step is its own block inside one screen; they don't unmount, they just animate translucent based on `step` index. This keeps the keyboard state stable across step changes.
The category and improvement chips are uppercase-only and use IBM Plex Mono. Selection writes to local state arrays.
The duration step computes `daysLeft` and `startDate` on submission — `startDate` is today in the agent's timezone, `daysLeft` is the chosen duration.
VisionBoard step uses `expo-image-picker` to grab up to three images. Each picked image is uploaded via the `files.generateUploadUrl` mutation (returns a pre-signed Convex storage URL), and we keep the returned storageIds in state.
On submit we call `missions.create` with `{ mission, category, duration, daysLeft, startDate, improvements, visionImageIds }`. The mutation flips this to the active mission, instantiates a default 'FOUNDATION' checkpoint, and writes an `activity` row of type `mission_created`.
Successful create routes to `/mission-announcement`, a celebration screen that plays a staggered reveal of the mission text, the agent code, and the start date — then drops the agent back to the missions tab with the new card front-and-center.
Key decisions
Vision board is mandatory, not optional
Three images. Not zero, not one. Picking the images forces a moment of visual commitment — the agent literally has to find or take three pictures of what success looks like. Those images are reused as the backdrop on the mission detail screen, so they become unavoidable.
Free-form mission text, not a template
We considered making mission text a dropdown ('Lose weight', 'Learn React', etc.). But generic phrasing kills ownership. The text is free-form, the category is the constraint. 'Become a better person' is a real mission someone wrote.
Convex storage instead of a CDN
Three images per mission is small. Convex storage gives us per-user authenticated reads via the same Clerk identity, no S3 setup, no signed URL bookkeeping. The tradeoff is we're not bandwidth-optimized — but for vision boards, fidelity beats CDN latency.
