State Management
Task Draft Store
The 800+ line Zustand store powering the commitment wizard state machine.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
The 800+ line Zustand store powering the commitment wizard state machine.
type TaskDraft = {
id: string;
assigner_id: string | null;
assignee_id: string | null;
title: string;
description?: string;
visibility: "private" | "public" | "partner_only";
recurrence: Recurrence;
conditions: Condition[];
config: TaskConfig;
penalty?: PenaltyConfig;
penalty_waiver?: WaiverConfig;
cameraTarget: CameraTarget | null;
isAccountabilityPrefilled: boolean;
};
| Action | Purpose |
|---|---|
| setRecurrence(updates) | Intelligent recurrence logic that auto-switches between once and weekly based on day selection |
| setSlotLocation(index, loc) | Attaches a location condition to a specific time slot |
| setSlotBlocklist(index, list) | Attaches an app blocklist to a specific time slot |
| setSlotRule(index, rule) | Attaches a verification rule to a specific time slot |
| setBlocklist(updates) | Sets the global digital commitment condition |
| setLocation(updates) | Sets the global location condition |
| resetDraft() | Clears all state back to defaults for a new commitment |