feat: add weekly summary notifications

Adds Sunday weekly recap push notifications summarizing couple match
activity. Includes edge function, migration, notification preference
toggle, and mobile notification handling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jjbruntonandClaude Opus 4.5 committed 2026-01-31 21:56:32 +00:00
1 parent e380c0a31c
commit 25db338861
5 files changed
+244 -2

No files matched your search

@@ -38,6 +38,7 @@ export const NotificationSettings: React.FC<NotificationSettingsProps> = ({
onPackChangesToggle: (value: boolean) => updatePreference('pack_changes_enabled', value),
onNewPacksToggle: (value: boolean) => updatePreference('new_packs_enabled', value),
onStreakMilestonesToggle: (value: boolean) => updatePreference('streak_milestones_enabled', value),
onWeeklySummaryToggle: (value: boolean) => updatePreference('weekly_summary_enabled', value),
}), [updatePreference]);
return (
@@ -133,6 +134,17 @@ export const NotificationSettings: React.FC<NotificationSettingsProps> = ({
onValueChange={handlers.onStreakMilestonesToggle}
disabled={isUpdating}
/>
<View style={styles.itemDivider} />
<SwitchItem
icon="calendar-outline"
label="Weekly Recap"
description="Sunday summary of your weekly matches"
value={preferences.weekly_summary_enabled}
onValueChange={handlers.onWeeklySummaryToggle}
disabled={isUpdating}
/>
</>
)}
</SettingsSection>
+2 -2
View File
@@ -19,7 +19,7 @@ Notifications.setNotificationHandler({
// Types
export interface NotificationData {
type: "match" | "message" | "match_digest" | "partner_activity" | "nudge";
type: "match" | "message" | "match_digest" | "partner_activity" | "nudge" | "weekly_summary";
match_id?: string;
message_id?: string;
count?: number;
@@ -231,7 +231,7 @@ export function handleNotificationResponse(
return;
}
if (data.type === "match_digest") {
if (data.type === "match_digest" || data.type === "weekly_summary") {
router.push("/(app)/matches");
return;
}
@@ -11,6 +11,7 @@ export interface NotificationPreferences {
pack_changes_enabled: boolean;
new_packs_enabled: boolean;
streak_milestones_enabled: boolean;
weekly_summary_enabled: boolean;
created_at: string;
updated_at: string;
}