Skip to main content

Commitment Wizard

The commitment wizard uses a Hub-and-Spoke architecture rather than a traditional linear step-by-step flow. The user starts at a central hub screen and branches out to specialized spoke screens to configure individual aspects of their commitment.

Hub-and-Spoke Architecture


The Hub — final.tsx

The hub screen (final.tsx) serves as both the commitment summary and the commit trigger:
  • Reads the full TaskDraft from useTaskDraftStore to display a live preview of all configured conditions
  • Shows attached time slots, locations, blocklists, penalties, and waivers
  • Contains the “Commit” button that triggers the Triple-Write Orchestrator
  • Gates submission behind the 8-point permission audit

Layout-Level Preset Hydration

The (create-commit)/_layout.tsx calls usePresetHydration() at mount time. This one-shot hook fetches all saved presets from the Convex backend and populates usePresetStore.

Spoke Screens


State Flow

As the user navigates between spokes, all changes are written to useTaskDraftStore in real-time. No data touches the database until the final “Commit” action. This allows the user to freely navigate back and forth between spokes without data loss.