Summary
GitHub/Duolingo-style streak freeze: let users protect their streak for one day (e.g. weekends, sick days) without breaking it.
What to build
- New Supabase table:
streak_freezes(id, user_id, freeze_date, used_at)
- New API:
POST /api/streak/freeze — inserts a freeze for today; user can only hold 1 unused freeze at a time
GET /api/streak/freeze — returns whether user has a freeze available
- Update
GET /api/metrics/streak to treat a freeze date as an "active day" when computing streak
- Update
StreakTracker.tsx:
- Show "Freeze available" or "No freeze" status
- Button to "Use freeze" (calls
POST /api/streak/freeze)
Supabase migration needed
CREATE TABLE streak_freezes (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
user_id uuid REFERENCES users(id),
freeze_date date NOT NULL,
used_at timestamptz
);
Acceptance criteria
Difficulty
Advanced — requires DB, multiple API changes, and component update.
Summary
GitHub/Duolingo-style streak freeze: let users protect their streak for one day (e.g. weekends, sick days) without breaking it.
What to build
streak_freezes(id, user_id, freeze_date, used_at)POST /api/streak/freeze— inserts a freeze for today; user can only hold 1 unused freeze at a timeGET /api/streak/freeze— returns whether user has a freeze availableGET /api/metrics/streakto treat a freeze date as an "active day" when computing streakStreakTracker.tsx:POST /api/streak/freeze)Supabase migration needed
Acceptance criteria
supabase/migrations/Difficulty
Advanced — requires DB, multiple API changes, and component update.