/** * NotificationsSection - Notification settings including triggers and ignored repositories. */ import { api } from '@renderer/api'; import { RepositoryDropdown, SelectedRepositoryItem, } from '@renderer/components/common/RepositoryDropdown'; import { ExternalLink } from 'lucide-react'; import { SettingRow, SettingsSectionHeader, SettingsSelect, SettingsToggle } from '../components'; import { NotificationTriggerSettings } from '../NotificationTriggerSettings'; import type { RepositoryDropdownItem, SafeConfig } from '../hooks/useSettingsConfig'; import type { NotificationTrigger } from '@renderer/types/data'; // Snooze duration options const SNOOZE_OPTIONS = [ { value: 15, label: '15 minutes' }, { value: 30, label: '30 minutes' }, { value: 60, label: '1 hour' }, { value: 120, label: '2 hours' }, { value: 240, label: '4 hours' }, { value: -1, label: 'Until tomorrow' }, ] as const; interface NotificationsSectionProps { readonly safeConfig: SafeConfig; readonly saving: boolean; readonly isSnoozed: boolean; readonly ignoredRepositoryItems: RepositoryDropdownItem[]; readonly excludedRepositoryIds: string[]; readonly onNotificationToggle: ( key: | 'enabled' | 'soundEnabled' | 'includeSubagentErrors' | 'notifyOnLeadInbox' | 'notifyOnUserInbox' | 'notifyOnClarifications', value: boolean ) => void; readonly onSnooze: (minutes: number) => Promise; readonly onClearSnooze: () => Promise; readonly onAddIgnoredRepository: (item: RepositoryDropdownItem) => Promise; readonly onRemoveIgnoredRepository: (repositoryId: string) => Promise; readonly onAddTrigger: (trigger: Omit) => Promise; readonly onUpdateTrigger: ( triggerId: string, updates: Partial ) => Promise; readonly onRemoveTrigger: (triggerId: string) => Promise; } export const NotificationsSection = ({ safeConfig, saving, isSnoozed, ignoredRepositoryItems, excludedRepositoryIds, onNotificationToggle, onSnooze, onClearSnooze, onAddIgnoredRepository, onRemoveIgnoredRepository, onAddTrigger, onUpdateTrigger, onRemoveTrigger, }: NotificationsSectionProps): React.JSX.Element => { return (
{/* Task Completion Notifications */}

Get native OS notifications when Claude finishes tasks — sounds, banners, and Dock/taskbar badges. Works on macOS, Linux, and Windows.

{/* Notification Triggers */} {/* Notification Settings */} onNotificationToggle('enabled', v)} disabled={saving} /> onNotificationToggle('soundEnabled', v)} disabled={saving || !safeConfig.notifications.enabled} /> onNotificationToggle('includeSubagentErrors', v)} disabled={saving || !safeConfig.notifications.enabled} /> onNotificationToggle('notifyOnLeadInbox', v)} disabled={saving || !safeConfig.notifications.enabled} /> onNotificationToggle('notifyOnUserInbox', v)} disabled={saving || !safeConfig.notifications.enabled} /> onNotificationToggle('notifyOnClarifications', v)} disabled={saving || !safeConfig.notifications.enabled} />
{isSnoozed ? ( ) : ( v !== 0 && onSnooze(v)} disabled={saving || !safeConfig.notifications.enabled} dropUp /> )}

Notifications from these repositories will be ignored

{ignoredRepositoryItems.length > 0 ? (
{ignoredRepositoryItems.map((item) => ( onRemoveIgnoredRepository(item.id)} disabled={saving} /> ))}
) : (

No repositories ignored

)}
); };