feat(calendar): add event notifications with alert evaluation

Add client-side calendar event notification system that evaluates JMAP
CalendarEventAlert triggers and displays toast notifications when alert
times are reached. Includes configurable notification sound, acknowledged
alert persistence, and proactive event fetching for background alerts.
Also mounts ToastContainer globally to fix silent toast failures.
This commit is contained in:
Matthieu MALVACHE
2026-02-16 23:49:35 +01:00
committed by Matthieu MALVACHE
parent 73612313c0
commit fea21d5bcd
24 changed files with 949 additions and 47 deletions
+23 -2
View File
@@ -3,7 +3,7 @@
import { useTranslations } from 'next-intl';
import { useCalendarStore, CalendarViewMode } from '@/stores/calendar-store';
import { useSettingsStore } from '@/stores/settings-store';
import { SettingsSection, SettingItem, Select, RadioGroup } from './settings-section';
import { SettingsSection, SettingItem, Select, RadioGroup, ToggleSwitch } from './settings-section';
export function CalendarSettings() {
const t = useTranslations('calendar.settings');
@@ -11,7 +11,7 @@ export function CalendarSettings() {
const tDays = useTranslations('calendar.days');
const { viewMode, setViewMode } = useCalendarStore();
const { timeFormat, firstDayOfWeek, updateSetting } = useSettingsStore();
const { timeFormat, firstDayOfWeek, calendarNotificationsEnabled, calendarNotificationSound, updateSetting } = useSettingsStore();
return (
<SettingsSection title={t('title')}>
@@ -50,6 +50,27 @@ export function CalendarSettings() {
/>
</SettingItem>
<SettingItem
label={t('notifications_enabled')}
description={t('notifications_enabled_desc')}
>
<ToggleSwitch
checked={calendarNotificationsEnabled}
onChange={(checked) => updateSetting('calendarNotificationsEnabled', checked)}
/>
</SettingItem>
<SettingItem
label={t('notification_sound')}
description={t('notification_sound_desc')}
>
<ToggleSwitch
checked={calendarNotificationSound}
onChange={(checked) => updateSetting('calendarNotificationSound', checked)}
disabled={!calendarNotificationsEnabled}
/>
</SettingItem>
</SettingsSection>
);
}