Skip to content

feat: track habits with daily check-ins and streaks - #49

Merged
AmrMsCLL merged 1 commit into
mainfrom
feat/habits
Oct 5, 2026
Merged

AmrMsCLL merged 1 commit into
mainfrom
feat/habits

Conversation

@AmrMsCLL

@AmrMsCLL AmrMsCLL commented Oct 5, 2026

Copy link
Copy Markdown
Member

Stacked on #48. This is 11f of as2026-10-05-strata-phase-11-next-batch-2.md.

What changes

  • Each space has a Habits tab. Editors add, rename and delete habits. A habit's goal is every day, or 1 to 6 days a week.
  • Every member checks in for themselves, today or yesterday, in their own time zone. Viewers can check in too, since a check-in is only their own record.
  • Streaks count consecutive days for daily habits, and consecutive weeks that met the goal for weekly ones. The current week counts once its goal is met. Each row shows the last seven days.
  • New Habits Home widget (habits) lists your habits across spaces, with the same check-in controls.

Migration

20261005140000_habits creates habits (id, space_id, name, per_week, position, created_at) and habit_check_ins (habit_id, user_id, day, created_at, primary key on all three). Both cascade from spaces, habits and users.

API

  • GET/POST /spaces/:id/habits, GET /me/habits, PATCH/DELETE /habits/:id
  • PUT/DELETE /habits/:id/check-ins/:day
  • Dashboard widget types gain habits.

Verification

  • Server: test/habit-streaks.spec.ts (3 passed) and test/integration/habits.spec.ts (1 passed).
  • Frontend: test/habits.spec.tsx (2 passed) and test/routes.spec.tsx.
  • Lint and build pass. Checked on the local stack: adding habits and checking in for today and yesterday.

@github-actions github-actions Bot added the size/xl Over 600 changed lines, excluding lockfiles label Oct 5, 2026
@AmrMsCLL
AmrMsCLL force-pushed the feat/dashboard-context branch from e7453d3 to ea9f43a Compare October 5, 2026 19:05
Base automatically changed from feat/dashboard-context to main October 5, 2026 19:05
@AmrMsCLL
AmrMsCLL merged commit a57d5a2 into main Oct 5, 2026
6 checks passed
@AmrMsCLL
AmrMsCLL deleted the feat/habits branch October 5, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl Over 600 changed lines, excluding lockfiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant