feat: scheduled habits, push notifications & Google Calendar sync#189
Open
Dimsum-art wants to merge 2 commits intodohsimpson:mainfrom
Open
feat: scheduled habits, push notifications & Google Calendar sync#189Dimsum-art wants to merge 2 commits intodohsimpson:mainfrom
Dimsum-art wants to merge 2 commits intodohsimpson:mainfrom
Conversation
Add gamified social challenges with goals, leaderboards, real-time chat, and stats — ported from APE's Supabase-based model to HabitTrove's JSON file persistence. Includes per-challenge file storage with atomic writes, 5s polling chat, period-key completion system, multi-step creation wizard, join-by-code, and i18n for 10 languages plus Dutch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Data model: adds ScheduleType, time-blocked fields (startTime/endTime), per-habit notificationsEnabled, googleCalendarEventId, NotificationSettings, GoogleCalendarSettings, PushSubscriptionsData to types.ts - Utilities: getEffectiveScheduleType() and isTimeBlocked() helpers - Atoms: weekStartAtom, weeklyHabitsAtom, BrowserSettings.calendarView - Weekly Agenda: WeeklyAgenda, AgendaAllDayRow, AgendaTimeSlot components with time grid, all-day band, mobile day-switcher, week navigation - Habit editor: schedule type toggle, time inputs, notification toggle, counter targetCompletions raised to 100 - HabitItem: counter +/- UX, time display, GCal sync badge - DailyOverview: inline quick-increment for counter habits - HabitCalendar: time-blocked display and startTime sort - Push notifications: persistent per-user subscriptions (data/pushSubscriptions.json), server-side notification-checker.ts, 5-min cron, NotificationPermission component, enhanced service worker (tag, habitId, deep links) - Google Calendar: OAuth2 client, sync engine (create/update/delete events, RRULE passthrough, extendedProperties.private.habitId), OAuth callback route, HMAC-signed completion URL route, server actions (connect/disconnect/triggerSync), 15-min cron, settings card, useHabits sync on save/delete - i18n: WeeklyAgenda, Notifications, GoogleCalendar namespaces in all 10 locales Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
all-day(default, backward-compatible) ortime-blockedwithstartTime/endTime; counter habits support up to 100 daily completions with +/- UX and progress bardata/pushSubscriptions.json; server-side checker runs every 5 min via cron; time-blocked habits notified at startTime, all-day habits at 08:00/12:00/18:00; auto-cancelled on completionGOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRETenv varsNew environment variables (optional)
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETCOMPLETE_HMAC_SECRETBackward compatibility
All new Habit fields (
scheduleType,startTime,endTime,notificationsEnabled,googleCalendarEventId) are optional — existing habits work identically without migration.Test plan
GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET) — verify GCal event created on habit save, deleted on habit delete🤖 Generated with Claude Code