Skip to content

Turn meetings into live agent loops. Record, transcribe, and analyze meetings with real-time AI intelligence — before, during, and after calls.

feat: UI improvements

Om Gated97776bf1e3a
diff --git a/src/main/ipc/permissions.ts b/src/main/ipc/permissions.ts
index cc9f980..64cde2c 100644
--- a/src/main/ipc/permissions.ts
+++ b/src/main/ipc/permissions.ts
@@ -80,13 +80,12 @@ export function setupPermissionHandlers(): void {
});
ipcMain.handle('check-notification-permission', async (): Promise<boolean> => {
+ // Main process can't reliably read per-origin Notification.permission.
+ // Renderer checks real permission state; this handler is only a fallback.
if (process.platform !== 'darwin') return true;
- // On macOS, check if notifications are enabled
- // Notification.isSupported() checks if the system supports notifications
- // We return true if supported, as macOS doesn't have a direct API to check permission
- const { Notification } = await import('electron');
- return Notification.isSupported();
+ logger.debug('Notification permission check fallback used');
+ return false;
});
ipcMain.handle('request-notification-permission', async (): Promise<boolean> => {
diff --git a/src/main/services/copilot/nudge-engine.service.ts b/src/main/services/copilot/nudge-engine.service.ts
index 032c264..7c448fc 100644
--- a/src/main/services/copilot/nudge-engine.service.ts
+++ b/src/main/services/copilot/nudge-engine.service.ts
@@ -14,7 +14,6 @@ const log = logger.child({ module: 'nudge-engine' });
// Types
export type NudgeType =
- | 'monologue'
| 'talk_ratio'
| 'next_steps'
| 'questions'
@@ -47,19 +46,6 @@ const NUDGE_TEMPLATES: Record<NudgeType, Array<{
actionLabel?: string;
actionType?: Nudge['actionType'];
}>> = {
- monologue: [
- {
- message: "You've been speaking for a while — a question could help engage them",
- severity: 'medium',
- actionLabel: 'Suggest question',
- actionType: 'ask_question',
- },
- {
- message: 'Extended speaking stretch detected — consider a pause point',
- severity: 'low',
- actionType: 'pause',
- },
- ],
talk_ratio: [
{
message: 'Talk ratio is leaning towards you — balance with more listening',
@@ -133,7 +119,6 @@ export class NudgeEngineService {
// Priority-ordered checks
const nudge =
- this.checkMonologue(metrics) ||
this.checkTalkRatio(metrics) ||
this.checkQuestions(metrics, callDuration) ||
this.checkPace(metrics) ||
@@ -150,16 +135,6 @@ export class NudgeEngineService {
return null;
}
- /**
- * Check for monologue
- */
- private checkMonologue(metrics: ConversationMetrics): Nudge | null {
- if (metrics.monologueDetected || metrics.longestMonologue > 60) {
- return this.createNudge('monologue');
- }
- return null;
- }
-
/**
* Check talk ratio
*/
diff --git a/src/main/services/markdown-export.service.ts b/src/main/services/markdown-export.service.ts
index 760e36e..cb4ed12 100644
--- a/src/main/services/markdown-export.service.ts
+++ b/src/main/services/markdown-export.service.ts
@@ -278,14 +278,6 @@ function generateMetricsMarkdown(data: MeetingExportData): string {
lines.push('');
lines.push(`- **Words per minute:** ${data.metrics.pace}`);
lines.push('');
-
- lines.push('## Engagement');
- lines.push('');
- lines.push(`- **Questions asked:** ${data.metrics.questionsAsked}`);
- if (data.metrics.monologueDetected) {
- lines.push(`- **Monologue detected:** Yes`);
- }
- lines.push('');
} else {
lines.push('*No metrics available*');
}
diff --git a/src/preload/index.ts b/src/preload/index.ts
index be22f64..019bb69 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -10,6 +10,15 @@ import type {
UpcomingMeeting,
} from '../shared/types/calendar.types';
+type NotificationGlobalShim = {
+ permission?: 'default' | 'granted' | 'denied';
+ requestPermission?: () => Promise<'default' | 'granted' | 'denied'>;
+};
+
+function getNotificationGlobal(): NotificationGlobalShim | undefined {
+ return (globalThis as unknown as { Notification?: NotificationGlobalShim }).Notification;
+}
+
// Copilot event types
export interface CopilotTranscriptSegment {
id: string;
@@ -341,10 +350,28 @@ const api: IpcApi = {
checkMicPermission: () => ipcRenderer.invoke('check-mic-permission'),
checkScreenPermission: () => ipcRenderer.invoke('check-screen-permission'),
checkAccessibilityPermission: () => ipcRenderer.invoke('check-accessibility-permission'),
- checkNotificationPermission: () => ipcRenderer.invoke('check-notification-permission'),
+ checkNotificationPermission: async () => {
+ const notificationApi = getNotificationGlobal();
+ if (notificationApi?.permission) {
+ return notificationApi.permission === 'granted';
+ }
+
+ return ipcRenderer.invoke('check-notification-permission');
+ },
requestMicPermission: () => ipcRenderer.invoke('request-mic-permission'),
requestScreenPermission: () => ipcRenderer.invoke('request-screen-permission'),
- requestNotificationPermission: () => ipcRenderer.invoke('request-notification-permission'),
+ requestNotificationPermission: async () => {
+ const notificationApi = getNotificationGlobal();
+ if (notificationApi?.permission) {
+ if (notificationApi.permission === 'granted') return true;
+ if (notificationApi.permission === 'default' && notificationApi.requestPermission) {
+ const result = await notificationApi.requestPermission();
+ return result === 'granted';
+ }
+ }
+
+ return ipcRenderer.invoke('request-notification-permission');
+ },
openSystemSettings: (pane: string) => ipcRenderer.invoke('open-system-settings', pane),
getStatus: (): Promise<PermissionStatus> => ipcRenderer.invoke('get-permission-status'),
},
diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx
index 36fec72..0ee0ec1 100644
--- a/src/renderer/App.tsx
+++ b/src/renderer/App.tsx
@@ -14,7 +14,15 @@ import { usePermissions } from './hooks/usePermissions';
import { useGlobalRecorderEvents } from './hooks/useGlobalRecorderEvents';
import { useCopilot } from './hooks/useCopilot';
import { ErrorToast } from './components/ui/error-toast';
-import { AlertCircle, Loader2 } from 'lucide-react';
+import { AlertCircle, Loader2, AlertTriangle } from 'lucide-react';
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogDescription,
+ DialogFooter,
+} from './components/ui/dialog';
import {
NudgeToast,
CallSummaryView,
@@ -22,15 +30,14 @@ import {
import { useCopilotStore } from './stores/copilot.store';
import { useMeetingSetupStore } from './stores/meeting-setup.store';
import { useSessionLifecycle, resetAllSessionStores } from './hooks/useSessionLifecycle';
-import { MCPServersPanel } from './components/settings/MCPServersPanel';
-import { CalendarPanel } from './components/settings/CalendarPanel';
-import { WorkflowsPanel } from './components/settings/WorkflowsPanel';
+import { SettingsView } from './components/settings/SettingsView';
import { CalendarAuthBanner } from './components/calendar';
import { MeetingSetupFlow } from './components/meeting-setup';
import { StepIndicators } from './components/auth/AuthView';
import { CalendarSetupView } from './components/auth/CalendarSetupView';
import { RecordingPreferencesView } from './components/auth/RecordingPreferencesView';
import { RecordingHeader, MetricsBar, LiveAssistPanel, MeetingAgendaPanel } from './components/recording';
+import { useNotificationPermission } from './hooks/useNotificationPermission';
type Tab = 'home' | 'history' | 'settings';
@@ -117,32 +124,11 @@ function NotificationIcon({ color = "#969696" }: { color?: string }) {
function PermissionsView({ onContinue }: { onContinue: () => void }) {
const { status, requestMicPermission, openSettings, checkPermissions } = usePermissions();
const configStore = useConfigStore();
- const [notificationsEnabled, setNotificationsEnabled] = React.useState(false);
-
- // Check notification permission on mount
- React.useEffect(() => {
- const checkNotifications = async () => {
- try {
- const enabled = await window.electronAPI.permissions.checkNotificationPermission();
- setNotificationsEnabled(enabled);
- } catch {
- // Ignore errors
- }
- };
- checkNotifications();
- }, []);
+ const { enabled: notificationsEnabled, openSettings: openNotificationSettings } =
+ useNotificationPermission();
const handleToggleNotifications = async () => {
- await window.electronAPI.permissions.openSystemSettings('notifications');
- // Re-check permission after a delay
- setTimeout(async () => {
- try {
- const enabled = await window.electronAPI.permissions.checkNotificationPermission();
- setNotificationsEnabled(enabled);
- } catch {
- // Ignore errors
- }
- }, 1000);
+ await openNotificationSettings();
};
const allGranted = status.microphone && status.screen;
@@ -496,106 +482,6 @@ function RecordingView({ onBack }: RecordingViewProps) {
);
}
-interface SettingsViewProps {
- initialTab?: 'account' | 'calendar' | 'mcpServers' | 'workflows' | null;
- onClearInitialTab?: () => void;
-}
-
-function SettingsView({ initialTab, onClearInitialTab }: SettingsViewProps) {
- const [activeSettingsTab, setActiveSettingsTab] = useState<
- 'account' | 'calendar' | 'mcpServers' | 'workflows'
- >(initialTab || 'account');
- const configStore = useConfigStore();
-
- // Apply initial tab when it changes
- React.useEffect(() => {
- if (initialTab) {
- setActiveSettingsTab(initialTab);
- onClearInitialTab?.();
- }
- }, [initialTab, onClearInitialTab]);
-
- const settingsTabs = [
- { id: 'account' as const, label: 'Account' },
- { id: 'calendar' as const, label: 'Calendar' },
- { id: 'mcpServers' as const, label: 'MCP Servers' },
- { id: 'workflows' as const, label: 'Workflows' },
- ];
-
- return (
- <div className="h-full overflow-auto bg-[#f7f7f7] p-[24px]">
- <div className="max-w-[720px] mx-auto">
- {/* Settings Tabs */}
- <div className="flex gap-[4px] p-[4px] bg-white border border-[#ededf3] rounded-[12px] w-fit mb-[24px]">
- {settingsTabs.map((tab) => (
- <button
- key={tab.id}
- onClick={() => setActiveSettingsTab(tab.id)}
- className={`px-[16px] py-[8px] text-[14px] font-medium rounded-[8px] transition-colors ${
- activeSettingsTab === tab.id
- ? 'bg-[#ec5b16] text-white'
- : 'text-[#464646] hover:bg-[#f7f7f7]'
- }`}
- >
- {tab.label}
- </button>
- ))}
- </div>
-
- {/* Tab Content */}
- <div className="space-y-[16px]">
- {activeSettingsTab === 'account' && (
- <div className="space-y-[16px]">
- {/* Account Card */}
- <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
- <div className="px-[20px] py-[16px] border-b border-[#ededf3]">
- <h3 className="text-[16px] font-semibold text-[#141420]">Account</h3>
- </div>
- <div className="px-[20px] py-[16px] space-y-[16px]">
- <div>
- <p className="text-[13px] text-[#969696] mb-[4px]">Name</p>
- <p className="text-[14px] font-medium text-[#141420]">
- {configStore.userName || 'Not set'}
- </p>
- </div>
- <div>
- <p className="text-[13px] text-[#969696] mb-[4px]">API Key</p>
- <p className="text-[13px] font-mono text-[#464646]">
- {configStore.apiKey ? `${configStore.apiKey.slice(0, 8)}...` : 'Not set'}
- </p>
- </div>
- </div>
- </div>
-
- {/* About Card */}
- <div className="bg-white border border-[#ededf3] rounded-[12px] shadow-[0px_1.272px_15.267px_0px_rgba(0,0,0,0.05)]">
- <div className="px-[20px] py-[16px] border-b border-[#ededf3]">
- <h3 className="text-[16px] font-semibold text-[#141420]">About</h3>
- </div>
- <div className="px-[20px] py-[16px] space-y-[8px]">
- <p className="text-[14px] text-[#464646] leading-[20px]">
- Call.md is a desktop app for recording meetings with real-time
- transcription and AI-powered insights.
- </p>
- <p className="text-[13px] text-[#969696]">
- Built with Electron, React, and VideoDB.
- </p>
- </div>
- </div>
- </div>
- )}
-
- {activeSettingsTab === 'calendar' && <CalendarPanel />}
-
- {activeSettingsTab === 'mcpServers' && <MCPServersPanel />}
-
- {activeSettingsTab === 'workflows' && <WorkflowsPanel />}
- </div>
- </div>
- </div>
- );
-}
-
export function App() {
const [activeTab, setActiveTab] = useState<Tab>('home');
const [showRecordingPrefs, setShowRecordingPrefs] = useState(false);
@@ -607,11 +493,66 @@ export function App() {
// Recording ID to navigate to after recording ends
const [pendingRecordingNavigation, setPendingRecordingNavigation] = useState<number | null>(null);
// Settings tab to show when navigating to settings
- const [initialSettingsTab, setInitialSettingsTab] = useState<'account' | 'calendar' | 'mcpServers' | 'workflows' | null>(null);
+ const [initialSettingsTab, setInitialSettingsTab] = useState<'account' | 'notifications' | 'mcpServers' | 'workflows' | null>(null);
+ // Pending tab change when user needs to confirm discarding meeting setup
+ const [pendingTabChange, setPendingTabChange] = useState<Tab | null>(null);
const configStore = useConfigStore();
const sessionStore = useSessionStore();
const meetingSetupStore = useMeetingSetupStore();
+
+ // Check if meeting setup has any user-entered data
+ const hasMeetingSetupData = () => {
+ return (
+ meetingSetupStore.name.trim().length > 0 ||
+ meetingSetupStore.description.trim().length > 0 ||
+ meetingSetupStore.questions.length > 0 ||
+ meetingSetupStore.checklist.length > 0
+ );
+ };
+
+ // Handle tab change with meeting setup check
+ const handleTabChange = (tab: Tab) => {
+ // If we're in meeting setup mode and trying to navigate away
+ if (showMeetingSetup && activeTab === 'home' && tab !== 'home') {
+ if (hasMeetingSetupData()) {
+ // Has data - show confirmation
+ setPendingTabChange(tab);
+ return;
+ }
+ // No data - just close and navigate
+ setShowMeetingSetup(false);
+ meetingSetupStore.reset();
+ }
+
+ // If clicking home while meeting setup is showing (no data), clear it
+ if (showMeetingSetup && tab === 'home') {
+ if (!hasMeetingSetupData()) {
+ setShowMeetingSetup(false);
+ meetingSetupStore.reset();
+ }
+ // If has data and clicking home, just show the dashboard
+ setShowMeetingSetup(false);
+ meetingSetupStore.reset();
+ }
+
+ setActiveTab(tab);
+ };
+
+ // Confirm discarding meeting setup and navigate
+ const confirmDiscardMeetingSetup = () => {
+ if (pendingTabChange) {
+ setShowMeetingSetup(false);
+ meetingSetupStore.reset();
+ setActiveTab(pendingTabChange);
+ setPendingTabChange(null);
+ }
+ };
+
+ // Cancel discarding meeting setup
+ const cancelDiscardMeetingSetup = () => {
+ setPendingTabChange(null);
+ };
const { status: sessionStatus, startRecording, stopRecording } = useSession();
const { allGranted, loading: permissionsLoading, checkPermissions } = usePermissions();
const { prepareNewSession, prepareNewSessionWithInfo, waitForIdle } = useSessionLifecycle();
@@ -891,7 +832,7 @@ export function App() {
{/* Main layout below titlebar */}
<div className="flex flex-1 overflow-hidden">
{isAuthenticated && !isSetupFlow && (
- <NewSidebar activeTab={activeTab} onTabChange={setActiveTab} />
+ <NewSidebar activeTab={activeTab} onTabChange={handleTabChange} />
)}
<div className="flex-1 overflow-hidden">{renderContent()}</div>
</div>
@@ -903,6 +844,41 @@ export function App() {
onDismiss={handleDismissError}
position="bottom"
/>
+
+ {/* Discard Meeting Setup Confirmation Dialog */}
+ <Dialog open={pendingTabChange !== null} onOpenChange={(open) => !open && cancelDiscardMeetingSetup()}>
+ <DialogContent className="max-w-[400px]">
+ <DialogHeader>
+ <div className="flex items-center gap-[12px]">
+ <div className="w-[40px] h-[40px] bg-[rgba(209,36,47,0.1)] rounded-[10px] flex items-center justify-center">
+ <AlertTriangle className="w-[20px] h-[20px] text-[#d1242f]" />
+ </div>
+ <div>
+ <DialogTitle className="text-[16px] font-semibold text-[#141420]">
+ Discard meeting setup?
+ </DialogTitle>
+ </div>
+ </div>
+ <DialogDescription className="text-[14px] text-[#464646] mt-[12px]">
+ You have unsaved changes in your meeting setup. If you leave now, your progress will be lost.
+ </DialogDescription>
+ </DialogHeader>
+ <DialogFooter className="flex gap-[8px] mt-[16px]">
+ <button
+ onClick={cancelDiscardMeetingSetup}
+ className="flex-1 px-[16px] py-[10px] border border-[#ededf3] rounded-[10px] text-[14px] font-medium text-[#464646] hover:bg-[#f7f7f7] transition-colors"
+ >
+ Keep editing
+ </button>
+ <button
+ onClick={confirmDiscardMeetingSetup}
+ className="flex-1 px-[16px] py-[10px] bg-[#d1242f] hover:bg-[#b91c1c] rounded-[10px] text-[14px] font-medium text-white transition-colors"
+ >
+ Discard
+ </button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
</div>
);
}
diff --git a/src/renderer/components/history/HistoryView.tsx b/src/renderer/components/history/HistoryView.tsx
index b11503c..da6bea3 100644
--- a/src/renderer/components/history/HistoryView.tsx
+++ b/src/renderer/components/history/HistoryView.tsx
@@ -127,7 +127,7 @@ export function HistoryView({ initialSelectedRecordingId, onClearInitialSelectio
<RefreshCw className="h-6 w-6 animate-spin text-[#969696]" />
</div>
) : filteredRecordings.length === 0 ? (
- <div className="flex flex-col items-center justify-center h-48 text-[#6b6b6b]">
+ <div className="flex flex-col items-center justify-center h-full text-[#6b6b6b]">
<Inbox className="h-12 w-12 mb-3 text-[#c0c0c0]" />
{searchQuery ? (
<>
diff --git a/src/renderer/components/home/HomeView.tsx b/src/renderer/components/home/HomeView.tsx
index a6be363..6ff415d 100644
--- a/src/renderer/components/home/HomeView.tsx
+++ b/src/renderer/components/home/HomeView.tsx
@@ -14,6 +14,7 @@ import { Loader2 } from 'lucide-react';
import { trpc } from '../../api/trpc';
import { useMCP } from '../../hooks/useMCP';
import { useSessionStore } from '../../stores/session.store';
+import { useNotificationPermission } from '../../hooks/useNotificationPermission';
import { RecordingCard } from '../history/RecordingCard';
import { RecordingDetailPage } from '../history/RecordingDetailPage';
import type { UpcomingMeeting } from '../../../shared/types/calendar.types';
@@ -254,6 +255,64 @@ function GoogleIcon() {
);
}
+// Confirmation Dialog Component
+function ConfirmationDialog({
+ isOpen,
+ title,
+ message,
+ confirmText,
+ cancelText,
+ onConfirm,
+ onCancel,
+ variant = 'danger',
+}: {
+ isOpen: boolean;
+ title: string;
+ message: string;
+ confirmText: string;
+ cancelText: string;
+ onConfirm: () => void;
+ onCancel: () => void;
+ variant?: 'danger' | 'default';
+}) {
+ if (!isOpen) return null;
+
+ return (
+ <div className="fixed inset-0 z-50 flex items-center justify-center">
+ {/* Backdrop */}
+ <div
+ className="absolute inset-0 bg-black/40"
+ onClick={onCancel}
+ />
+ {/* Dialog */}
+ <div className="relative bg-white rounded-[16px] p-[24px] w-[400px] shadow-[0px_4px_24px_0px_rgba(0,0,0,0.15)] flex flex-col gap-[20px]">
+ <div className="flex flex-col gap-[8px]">
+ <h3 className="text-[18px] font-semibold text-[#141420]">{title}</h3>
+ <p className="text-[14px] text-[#464646] leading-[20px]">{message}</p>
+ </div>
+ <div className="flex gap-[12px] justify-end">
+ <button
+ onClick={onCancel}
+ className="px-[16px] py-[10px] rounded-[10px] border border-[#e4e4ec] text-[14px] font-medium text-[#464646] hover:bg-[#f7f7f7] transition-colors"
+ >
+ {cancelText}
+ </button>
+ <button
+ onClick={onConfirm}
+ className={`px-[16px] py-[10px] rounded-[10px] text-[14px] font-medium text-white transition-colors ${
+ variant === 'danger'
+ ? 'bg-[#dc2626] hover:bg-[#b91c1c]'
+ : 'bg-[#ec5b16] hover:bg-[#d4510f]'
+ }`}
+ >
+ {confirmText}
+ </button>
+ </div>
+ </div>
+ </div>
+ );
+}
+
// Toggle Component
function Toggle({
enabled,
@@ -426,7 +485,7 @@ function WorkflowItem({
interface HomeViewProps {
onStartRecording: () => void;
onNavigateToHistory: () => void;
- onNavigateToSettings: (tab?: 'account' | 'calendar' | 'mcpServers' | 'workflows') => void;
+ onNavigateToSettings: (tab?: 'account' | 'notifications' | 'mcpServers' | 'workflows') => void;
}
interface WorkflowData {
@@ -442,7 +501,9 @@ export function HomeView({ onStartRecording, onNavigateToHistory, onNavigateToSe
const [upcomingEvents, setUpcomingEvents] = useState<UpcomingMeeting[]>([]);
const [eventNotifications, setEventNotifications] = useState<Record<string, boolean>>({});
const [workflows, setWorkflows] = useState<WorkflowData[]>([]);
- const [notificationsEnabled, setNotificationsEnabled] = useState(false);
+ const [showDisconnectConfirm, setShowDisconnectConfirm] = useState(false);
+ const { enabled: notificationsEnabled, openSettings: openNotificationSettings } =
+ useNotificationPermission();
// Auto-hide scrollbars
const leftScrollbar = useAutoHideScrollbar();
@@ -524,31 +585,8 @@ export function HomeView({ onStartRecording, onNavigateToHistory, onNavigateToSe
return () => unsubscribe();
}, []);
- // Check notification permission
- useEffect(() => {
- const checkNotifications = async () => {
- try {
- const enabled = await window.electronAPI.permissions.checkNotificationPermission();
- setNotificationsEnabled(enabled);
- } catch {
- // Ignore errors
- }
- };
- checkNotifications();
- }, []);
-
const handleToggleNotifications = async () => {
- // Open system settings for notifications
- await window.electronAPI.permissions.openSystemSettings('notifications');
- // Re-check permission after a delay (user may have changed it)
- setTimeout(async () => {
- try {
- const enabled = await window.electronAPI.permissions.checkNotificationPermission();
- setNotificationsEnabled(enabled);
- } catch {
- // Ignore errors
- }
- }, 1000);
+ await openNotificationSettings();
};
// Load workflows
@@ -586,6 +624,7 @@ export function HomeView({ onStartRecording, onNavigateToHistory, onNavigateToSe
await window.electronAPI.calendar.signOut();
setCalendarStatus('disconnected');
setUpcomingEvents([]);
+ setShowDisconnectConfirm(false);
} catch {
// Ignore errors
}
@@ -732,7 +771,7 @@ export function HomeView({ onStartRecording, onNavigateToHistory, onNavigateToSe
<span className="flex-1 text-[18px] font-medium text-black">Today</span>
{calendarStatus === 'connected' && (
<button
- onClick={handleDisconnectCalendar}
+ onClick={() => setShowDisconnectConfirm(true)}
className="flex items-center gap-[4px] text-[14px] font-semibold text-[#ec5b16] hover:opacity-80"
>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -892,6 +931,18 @@ export function HomeView({ onStartRecording, onNavigateToHistory, onNavigateToSe
)}
</div>
</div>
+
+ {/* Disconnect Calendar Confirmation Dialog */}
+ <ConfirmationDialog
+ isOpen={showDisconnectConfirm}
+ title="Disconnect Calendar"
+ message="Are you sure you want to disconnect your Google Calendar? You won't receive meeting reminders until you reconnect."
+ confirmText="Disconnect"
+ cancelText="Cancel"
+ onConfirm={handleDisconnectCalendar}
+ onCancel={() => setShowDisconnectConfirm(false)}
+ variant="danger"
+ />
</div>
);
}
diff --git a/src/renderer/components/meeting-setup/ChecklistStep.tsx b/src/renderer/components/meeting-setup/ChecklistStep.tsx
index 8574e33..6759050 100644
--- a/src/renderer/components/meeting-setup/ChecklistStep.tsx
+++ b/src/renderer/components/meeting-setup/ChecklistStep.tsx
@@ -160,7 +160,7 @@ export function ChecklistStep({
{/* Skip and Record button */}
<button
type="button"
- onClick={onSkip}
+ onClick={() => onSkip()}
disabled={isDisabled}
className="w-full flex items-center justify-center gap-[6px] px-[20px] py-[12px] bg-transparent border border-dashed border-[#c0c0c8] rounded-[12px] text-[14px] font-medium text-[#464646] hover:border-[#ec5b16] hover:text-[#ec5b16] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
>
diff --git a/src/renderer/components/meeting-setup/QuestionsStep.tsx b/src/renderer/components/meeting-setup/QuestionsStep.tsx
index 599934d..53ce4f7 100644
--- a/src/renderer/components/meeting-setup/QuestionsStep.tsx
+++ b/src/renderer/components/meeting-setup/QuestionsStep.tsx
@@ -259,7 +259,7 @@ export function QuestionsStep({
{/* Skip and Record button */}
<button
type="button"
- onClick={onSkip}
+ onClick={() => onSkip()}
disabled={isDisabled}
className="w-full flex items-center justify-center gap-[6px] px-[20px] py-[12px] bg-transparent border border-dashed border-[#c0c0c8] rounded-[12px] text-[14px] font-medium text-[#464646] hover:border-[#ec5b16] hover:text-[#ec5b16] disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
>
diff --git a/src/renderer/components/settings/NotificationsPanel.tsx b/src/renderer/components/settings/NotificationsPanel.tsx
new file mode 100644
index 0000000..afd092c
--- /dev/null
+++ b/src/renderer/components/settings/NotificationsPanel.tsx
@@ -0,0 +1,269 @@
+/**
+ * Notifications Panel Component
+ *
+ * Settings panel for managing notification preferences.
+ * Handles notification timing and recording behavior settings.
+ */
+
+import React, { useState, useEffect } from 'react';
+import { Bell, Loader2 } from 'lucide-react';
+import { trpc } from '../../api/trpc';
+import { useNotificationPermission } from '../../hooks/useNotificationPermission';
+
+type RecordingBehavior = 'always_ask' | 'default_record' | 'no_notification';
+
+// Toggle Component
+function Toggle({
+ enabled,
+ onChange,
+ disabled = false,
+}: {
+ enabled: boolean;
+ onChange: (enabled: boolean) => void;
+ disabled?: boolean;
+}) {
+ return (
+ <button
+ onClick={() => !disabled && onChange(!enabled)}
+ disabled={disabled}
+ className={`w-[38px] h-[22px] rounded-full relative transition-colors ${
+ enabled ? 'bg-[#ec5b16]' : 'bg-[#e4e4ec]'
+ } ${disabled ? 'opacity-50 cursor-not-allowed' : ''}`}
+ >
+ <div
+ className={`absolute size-[18px] bg-white rounded-full top-[2px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.15)] transition-all ${
+ enabled ? 'left-[18px]' : 'left-[2px]'
+ }`}
+ />
+ </button>
+ );
+}
+
+// Recording icon
+function RecordIcon() {
+ return (
+ <svg width="18" height="18" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="10" cy="10" r="7.5" stroke="#ec5b16" strokeWidth="1.5" />
+ <circle cx="10" cy="10" r="3" fill="#ec5b16" />
+ </svg>
+ );
+}
+
+// Settings Card wrapper
+function SettingsCard({
+ children,
+ className = '',
+}: {
+ children: React.ReactNode;
+ className?: string;
+}) {
+ return (
+ <div
+ className={`bg-white border border-[#e4e4ec] rounded-[14px] overflow-hidden ${className}`}
+ >
+ {children}
+ </div>
+ );
+}
+
+// Card header
+function CardHeader({ title, description }: { title: string; description?: string }) {
+ return (
+ <div className="px-[20px] py-[16px] border-b border-[#ededf3]">
+ <h3 className="text-[16px] font-semibold text-[#141420] leading-[22.5px]">
+ {title}
+ </h3>
+ {description && (
+ <p className="text-[13px] text-[#969696] mt-[4px]">{description}</p>
+ )}
+ </div>
+ );
+}
+
+export function NotificationsPanel() {
+ // System notification permission
+ const { enabled: systemNotificationsEnabled, openSettings: openNotificationSettings } =
+ useNotificationPermission();
+
+ // Preferences state
+ const [notifyMinutes, setNotifyMinutes] = useState<number>(2);
+ const [recordingBehavior, setRecordingBehavior] = useState<RecordingBehavior>('always_ask');
+ const [isSavingPrefs, setIsSavingPrefs] = useState(false);
+
+ const preferencesQuery = trpc.settings.getCalendarPreferences.useQuery();
+ const updatePreferences = trpc.settings.updateCalendarPreferences.useMutation();
+
+ // Load preferences when query completes
+ useEffect(() => {
+ if (preferencesQuery.data) {
+ setNotifyMinutes(preferencesQuery.data.notifyMinutesBefore ?? 2);
+ setRecordingBehavior(preferencesQuery.data.recordingBehavior ?? 'always_ask');
+ }
+ }, [preferencesQuery.data]);
+
+ const handleNotifyMinutesChange = async (minutes: number) => {
+ setNotifyMinutes(minutes);
+ setIsSavingPrefs(true);
+ try {
+ await updatePreferences.mutateAsync({ notifyMinutesBefore: minutes });
+ } catch (err) {
+ console.error('Failed to update notification timing:', err);
+ } finally {
+ setIsSavingPrefs(false);
+ }
+ };
+
+ const handleRecordingBehaviorChange = async (behavior: RecordingBehavior) => {
+ setRecordingBehavior(behavior);
+ setIsSavingPrefs(true);
+ try {
+ await updatePreferences.mutateAsync({ recordingBehavior: behavior });
+ } catch (err) {
+ console.error('Failed to update recording behavior:', err);
+ } finally {
+ setIsSavingPrefs(false);
+ }
+ };
+
+ const notifyOptions = [
+ { value: 1, label: '1 min' },
+ { value: 2, label: '2 mins' },
+ { value: 5, label: '5 mins' },
+ ];
+
+ const behaviorOptions: { value: RecordingBehavior; title: string; description: string }[] = [
+ {
+ value: 'always_ask',
+ title: 'Ask me every time',
+ description: "You'll get a notification to confirm before each meeting",
+ },
+ {
+ value: 'default_record',
+ title: 'Record all meetings',
+ description: 'Automatically join and record every calendar event',
+ },
+ {
+ value: 'no_notification',
+ title: 'Start recording via app only',
+ description: 'Only records when you manually start a session',
+ },
+ ];
+
+ return (
+ <div className="flex flex-col gap-[20px]">
+ {/* System Notifications Card */}
+ <SettingsCard>
+ <CardHeader
+ title="System Notifications"
+ description="Allow Call.md to send desktop notifications"
+ />
+ <div className="px-[20px] py-[16px]">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center gap-[12px]">
+ <div className="w-[36px] h-[36px] bg-[#f7f7f7] rounded-[10px] flex items-center justify-center">
+ <Bell className="w-[18px] h-[18px] text-[#464646]" />
+ </div>
+ <div>
+ <p className="text-[14px] font-medium text-[#141420]">
+ Desktop Notifications
+ </p>
+ <p className="text-[12px] text-[#969696]">
+ {systemNotificationsEnabled ? 'Enabled' : 'Disabled in System Preferences'}
+ </p>
+ </div>
+ </div>
+ <Toggle
+ enabled={systemNotificationsEnabled}
+ onChange={() => openNotificationSettings()}
+ />
+ </div>
+ </div>
+ </SettingsCard>
+
+ {/* Meeting Notifications Card */}
+ <SettingsCard>
+ <CardHeader
+ title="Meeting Notifications"
+ description="Configure when and how you want to be notified about meetings"
+ />
+ <div className="px-[20px] py-[20px] space-y-[24px]">
+ {/* Notify before meetings */}
+ <div className="space-y-[10px]">
+ <div className="flex items-center gap-[8px]">
+ <Bell className="h-[18px] w-[18px] text-[#464646]" />
+ <span className="text-[14px] font-medium text-[#141420]">
+ Notify me before meetings
+ </span>
+ {isSavingPrefs && (
+ <Loader2 className="h-[14px] w-[14px] text-[#969696] animate-spin ml-auto" />
+ )}
+ </div>
+ <div className="flex gap-[8px]">
+ {notifyOptions.map((option) => (
+ <button
+ key={option.value}
+ onClick={() => handleNotifyMinutesChange(option.value)}
+ disabled={isSavingPrefs}
+ className={`flex-1 py-[11px] rounded-[8px] text-[13px] font-medium leading-[19.5px] transition-colors disabled:opacity-60 ${
+ notifyMinutes === option.value
+ ? 'bg-[rgba(236,91,22,0.05)] border border-[#ec5b16] text-[#ec5b16]'
+ : 'border border-[rgba(150,150,150,0.3)] text-[#464646] hover:bg-gray-50'
+ }`}
+ >
+ {option.label}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ {/* Recording behavior */}
+ <div className="space-y-[10px]">
+ <div className="flex items-center gap-[8px]">
+ <RecordIcon />
+ <span className="text-[14px] font-medium text-[#141420]">
+ Default recording behavior
+ </span>
+ </div>
+ <div className="flex flex-col gap-[8px]">
+ {behaviorOptions.map((option) => (
+ <button
+ key={option.value}
+ onClick={() => handleRecordingBehaviorChange(option.value)}
+ disabled={isSavingPrefs}
+ className={`w-full flex items-center gap-[12px] px-[17px] py-[15px] rounded-[10px] text-left transition-colors disabled:opacity-60 ${
+ recordingBehavior === option.value
+ ? 'bg-[rgba(236,91,22,0.05)] border border-[#ec5b16]'
+ : 'border border-[#e0e0e8] hover:bg-gray-50'
+ }`}
+ >
+ <div className="flex-1 flex flex-col gap-[2px]">
+ <span className="text-[14px] font-medium text-[#141420]">
+ {option.title}
+ </span>
+ <span className="text-[12px] font-normal text-[#464646]">
+ {option.description}
+ </span>
+ </div>
+ {/* Radio indicator */}
+ <div
+ className={`w-[18px] h-[18px] rounded-[9px] border-2 flex items-center justify-center shrink-0 ${
+ recordingBehavior === option.value
+ ? 'border-[#ec5b16]'
+ : 'border-[#e0e0e8]'
+ }`}
+ >
+ {recordingBehavior === option.value && (
+ <div className="w-[8px] h-[8px] rounded-[4px] bg-[#ec5b16]" />
+ )}
+ </div>
+ </button>
+ ))}
+ </div>
+ </div>
+ </div>
+ </SettingsCard>
+ </div>
+ );
+}
+
+export default NotificationsPanel;
diff --git a/src/renderer/components/settings/SettingsView.tsx b/src/renderer/components/settings/SettingsView.tsx
new file mode 100644
index 0000000..799ccb4
--- /dev/null
+++ b/src/renderer/components/settings/SettingsView.tsx
@@ -0,0 +1,440 @@
+/**
+ * Settings View Component
+ *
+ * Main settings page with tabs for Account, Notifications, MCP Servers, and Workflows.
+ * Redesigned based on Figma specs.
+ */
+
+import React, { useState, useEffect } from 'react';
+import {
+ Calendar,
+ Eye,
+ EyeOff,
+ Copy,
+ Pencil,
+ LogOut,
+ Check,
+ Loader2,
+ AlertCircle,
+} from 'lucide-react';
+import { useConfigStore } from '../../stores/config.store';
+import { MCPServersPanel } from './MCPServersPanel';
+import { NotificationsPanel } from './NotificationsPanel';
+import { WorkflowsPanel } from './WorkflowsPanel';
+
+type SettingsTab = 'account' | 'notifications' | 'mcpServers' | 'workflows';
+
+interface SettingsViewProps {
+ initialTab?: SettingsTab | null;
+ onClearInitialTab?: () => void;
+}
+
+// Tab navigation component
+function SettingsTabs({
+ activeTab,
+ onTabChange,
+}: {
+ activeTab: SettingsTab;
+ onTabChange: (tab: SettingsTab) => void;
+}) {
+ const tabs: { id: SettingsTab; label: string }[] = [
+ { id: 'account', label: 'Account' },
+ { id: 'notifications', label: 'Notifications' },
+ { id: 'mcpServers', label: 'MCP Servers' },
+ { id: 'workflows', label: 'Workflows' },
+ ];
+
+ return (
+ <div className="bg-[#f7f7f7] flex gap-[10px] p-[4px] rounded-[14px] w-full">
+ {tabs.map((tab) => (
+ <button
+ key={tab.id}
+ onClick={() => onTabChange(tab.id)}
+ className={`flex-1 px-[16px] py-[12px] rounded-[12px] text-[14px] font-medium transition-all ${
+ activeTab === tab.id
+ ? 'bg-[#ff4000] text-white font-semibold shadow-[0px_1px_2px_0px_rgba(0,0,0,0.05)]'
+ : 'text-[#464646] hover:bg-[#efefef]'
+ }`}
+ >
+ {tab.label}
+ </button>
+ ))}
+ </div>
+ );
+}
+
+// Settings Card wrapper
+function SettingsCard({
+ children,
+ className = '',
+}: {
+ children: React.ReactNode;
+ className?: string;
+}) {
+ return (
+ <div
+ className={`bg-white border border-[#e4e4ec] rounded-[14px] overflow-hidden ${className}`}
+ >
+ {children}
+ </div>
+ );
+}
+
+// Card header
+function CardHeader({ title }: { title: string }) {
+ return (
+ <div className="px-[20px] py-[16px] border-b border-[#ededf3]">
+ <h3 className="text-[16px] font-semibold text-[#141420] leading-[22.5px]">
+ {title}
+ </h3>
+ </div>
+ );
+}
+
+// Card row
+function CardRow({
+ label,
+ children,
+ hasBorder = true,
+}: {
+ label: string;
+ children: React.ReactNode;
+ hasBorder?: boolean;
+}) {
+ return (
+ <div
+ className={`flex items-center justify-between px-[20px] py-[14px] ${
+ hasBorder ? 'border-b border-[#ededf3]' : ''
+ }`}
+ >
+ <span className="text-[14px] font-medium text-[#464646]">{label}</span>
+ <div className="flex items-center gap-[8px]">{children}</div>
+ </div>
+ );
+}
+
+// Google Calendar icon SVG
+function GoogleCalendarIcon() {
+ return (
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M13.5 2.25H4.5C3.67157 2.25 3 2.92157 3 3.75V14.25C3 15.0784 3.67157 15.75 4.5 15.75H13.5C14.3284 15.75 15 15.0784 15 14.25V3.75C15 2.92157 14.3284 2.25 13.5 2.25Z" stroke="#4285F4" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
+ <path d="M12 1.5V3" stroke="#4285F4" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
+ <path d="M6 1.5V3" stroke="#4285F4" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
+ <path d="M3 6H15" stroke="#4285F4" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
+ <rect x="5.25" y="8.25" width="2.25" height="2.25" rx="0.5" fill="#EA4335"/>
+ <rect x="7.875" y="8.25" width="2.25" height="2.25" rx="0.5" fill="#FBBC05"/>
+ <rect x="10.5" y="8.25" width="2.25" height="2.25" rx="0.5" fill="#34A853"/>
+ <rect x="5.25" y="10.875" width="2.25" height="2.25" rx="0.5" fill="#4285F4"/>
+ </svg>
+ );
+}
+
+// Calendar icon for empty state
+function CalendarEmptyIcon() {
+ return (
+ <div className="w-[50px] h-[50px] bg-[rgba(255,64,0,0.1)] border border-[rgba(236,91,22,0.13)] rounded-[8px] flex items-center justify-center">
+ <Calendar className="w-[25px] h-[25px] text-[#ec5b16]" />
+ </div>
+ );
+}
+
+// Logout icon SVG
+function LogoutIcon() {
+ return (
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M7.5 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V4.16667C2.5 3.72464 2.67559 3.30072 2.98816 2.98816C3.30072 2.67559 3.72464 2.5 4.16667 2.5H7.5" stroke="#d1242f" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
+ <path d="M13.333 14.1667L17.4997 10L13.333 5.83337" stroke="#d1242f" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
+ <path d="M17.5 10H7.5" stroke="#d1242f" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
+ </svg>
+ );
+}
+
+// Account Panel Component
+function AccountPanel() {
+ const configStore = useConfigStore();
+ const [showApiKey, setShowApiKey] = useState(false);
+ const [isEditingApiKey, setIsEditingApiKey] = useState(false);
+ const [newApiKey, setNewApiKey] = useState('');
+ const [isSaving, setIsSaving] = useState(false);
+ const [copySuccess, setCopySuccess] = useState(false);
+
+ // Calendar state
+ const [calendarStatus, setCalendarStatus] = useState<'disconnected' | 'connecting' | 'connected' | 'error'>('disconnected');
+ const [isLoadingCalendar, setIsLoadingCalendar] = useState(true);
+
+ // Check calendar auth status on mount
+ useEffect(() => {
+ checkCalendarStatus();
+
+ // Listen for auth required
+ const unsubAuthRequired = window.electronAPI.calendarOn.onAuthRequired(() => {
+ setCalendarStatus('error');
+ });
+
+ return () => {
+ unsubAuthRequired();
+ };
+ }, []);
+
+ const checkCalendarStatus = async () => {
+ setIsLoadingCalendar(true);
+ try {
+ const result = await window.electronAPI.calendar.isSignedIn();
+ if (result.success && result.isSignedIn) {
+ setCalendarStatus('connected');
+ // Could store email if available
+ } else {
+ setCalendarStatus('disconnected');
+ }
+ } catch (err) {
+ setCalendarStatus('error');
+ } finally {
+ setIsLoadingCalendar(false);
+ }
+ };
+
+ const handleConnectCalendar = async () => {
+ setCalendarStatus('connecting');
+ try {
+ const result = await window.electronAPI.calendar.signIn();
+ if (result.success) {
+ setCalendarStatus('connected');
+ } else {
+ setCalendarStatus('error');
+ }
+ } catch (err) {
+ setCalendarStatus('error');
+ }
+ };
+
+ const handleDisconnectCalendar = async () => {
+ try {
+ await window.electronAPI.calendar.signOut();
+ setCalendarStatus('disconnected');
+ } catch (err) {
+ // Ignore error
+ }
+ };
+
+ const maskApiKey = (key: string) => {
+ if (!key) return '';
+ if (key.length <= 8) return key;
+ return `${key.slice(0, 8)} •••••••`;
+ };
+
+ const handleCopyApiKey = async () => {
+ if (configStore.apiKey) {
+ await navigator.clipboard.writeText(configStore.apiKey);
+ setCopySuccess(true);
+ setTimeout(() => setCopySuccess(false), 2000);
+ }
+ };
+
+ const handleSaveApiKey = async () => {
+ if (!newApiKey.trim()) return;
+ setIsSaving(true);
+ try {
+ configStore.setConfig({ apiKey: newApiKey.trim() });
+ setIsEditingApiKey(false);
+ setNewApiKey('');
+ } catch (err) {
+ console.error('Failed to save API key:', err);
+ } finally {
+ setIsSaving(false);
+ }
+ };
+
+ const handleCancelEdit = () => {
+ setIsEditingApiKey(false);
+ setNewApiKey('');
+ };
+
+ const handleLogout = () => {
+ configStore.clearAuth();
+ };
+
+ return (
+ <div className="flex flex-col gap-[20px]">
+ {/* Account Card */}
+ <SettingsCard>
+ <CardHeader title="Account" />
+
+ {/* Name Row */}
+ <CardRow label="Name">
+ <span className="text-[14px] font-medium text-black">
+ {configStore.userName || 'Not set'}
+ </span>
+ </CardRow>
+
+ {/* API Key Row */}
+ <CardRow label="API Key" hasBorder={false}>
+ {isEditingApiKey ? (
+ <>
+ <input
+ type="text"
+ value={newApiKey}
+ onChange={(e) => setNewApiKey(e.target.value)}
+ placeholder="Paste new API key"
+ className="w-[200px] px-[12px] py-[6px] bg-[#f7f7f7] border border-[#e9e9e9] rounded-[8px] text-[13px] text-[#141420] placeholder:text-[#969696] outline-none focus:border-[#ec5b16]"
+ />
+ <button
+ onClick={handleSaveApiKey}
+ disabled={isSaving || !newApiKey.trim()}
+ className="px-[10px] py-[6px] bg-[#ff4000] hover:bg-[#e63900] disabled:opacity-50 rounded-[8px] text-[13px] font-medium text-white transition-colors"
+ >
+ {isSaving ? <Loader2 className="w-[14px] h-[14px] animate-spin" /> : 'Save'}
+ </button>
+ <button
+ onClick={handleCancelEdit}
+ className="px-[10px] py-[6px] bg-[#f0f0f5] border border-[#efefef] rounded-[8px] text-[13px] font-medium text-[#464646] hover:bg-[#e8e8ed] transition-colors"
+ >
+ Cancel
+ </button>
+ </>
+ ) : (
+ <>
+ <span className="text-[14px] font-medium text-black font-mono">
+ {showApiKey
+ ? configStore.apiKey || 'Not set'
+ : maskApiKey(configStore.apiKey || '')}
+ </span>
+ <button
+ onClick={() => setShowApiKey(!showApiKey)}
+ className="p-[6px] bg-[#f0f0f5] border border-[#efefef] rounded-[8px] hover:bg-[#e8e8ed] transition-colors"
+ title={showApiKey ? 'Hide API key' : 'Show API key'}
+ >
+ {showApiKey ? (
+ <EyeOff className="w-[16px] h-[16px] text-[#464646]" />
+ ) : (
+ <Eye className="w-[16px] h-[16px] text-[#464646]" />
+ )}
+ </button>
+ <button
+ onClick={handleCopyApiKey}
+ className="p-[6px] bg-[#f0f0f5] border border-[#efefef] rounded-[8px] hover:bg-[#e8e8ed] transition-colors"
+ title={copySuccess ? 'Copied!' : 'Copy API key'}
+ >
+ {copySuccess ? (
+ <Check className="w-[16px] h-[16px] text-[#059669]" />
+ ) : (
+ <Copy className="w-[16px] h-[16px] text-[#464646]" />
+ )}
+ </button>
+ <button
+ onClick={() => setIsEditingApiKey(true)}
+ className="flex items-center gap-[4px] px-[10px] py-[6px] bg-[#f0f0f5] border border-[#efefef] rounded-[8px] hover:bg-[#e8e8ed] transition-colors"
+ >
+ <Pencil className="w-[16px] h-[16px] text-[#ff4000]" />
+ <span className="text-[13px] font-medium text-[#ff4000]">Change</span>
+ </button>
+ </>
+ )}
+ </CardRow>
+ </SettingsCard>
+
+ {/* Calendar Connection Card */}
+ <SettingsCard>
+ <CardHeader title="Calendar Connection" />
+ <div className="flex flex-col items-center gap-[14px] py-[21px]">
+ {isLoadingCalendar ? (
+ <Loader2 className="w-[32px] h-[32px] text-[#ec5b16] animate-spin" />
+ ) : calendarStatus === 'connected' ? (
+ <>
+ <div className="flex items-center gap-[8px] p-[12px] bg-[#ecfdf5] rounded-[10px]">
+ <Check className="w-[18px] h-[18px] text-[#059669]" />
+ <span className="text-[14px] font-medium text-[#059669]">
+ Calendar connected
+ </span>
+ </div>
+ <button
+ onClick={handleDisconnectCalendar}
+ className="px-[25px] py-[13px] bg-white border border-[#d0d0d8] rounded-[12px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.06)] text-[14px] font-medium text-[#464646] hover:bg-[#f7f7f7] transition-colors"
+ >
+ Disconnect Calendar
+ </button>
+ </>
+ ) : (
+ <>
+ <CalendarEmptyIcon />
+ <p className="text-[13px] text-[#969696] text-center max-w-[320px]">
+ Connect calendars to auto-detect meetings
+ </p>
+ <button
+ onClick={handleConnectCalendar}
+ disabled={calendarStatus === 'connecting'}
+ className="flex items-center gap-[8px] px-[25px] py-[13px] bg-white border border-[#d0d0d8] rounded-[12px] shadow-[0px_1px_3px_0px_rgba(0,0,0,0.06)] text-[14px] font-medium text-black hover:bg-[#f7f7f7] transition-colors disabled:opacity-50"
+ >
+ {calendarStatus === 'connecting' ? (
+ <Loader2 className="w-[18px] h-[18px] animate-spin" />
+ ) : (
+ <GoogleCalendarIcon />
+ )}
+ <span>Connect Google Calendar</span>
+ </button>
+ </>
+ )}
+ </div>
+ </SettingsCard>
+
+ {/* Log out Button */}
+ <button
+ onClick={handleLogout}
+ className="flex items-center justify-center gap-[8px] w-full px-[17px] py-[11px] bg-[rgba(209,36,47,0.06)] border border-[rgba(209,36,47,0.19)] rounded-[10px] hover:bg-[rgba(209,36,47,0.1)] transition-colors"
+ >
+ <LogoutIcon />
+ <span className="text-[14px] font-semibold text-[#d1242f]">Log out</span>
+ </button>
+ </div>
+ );
+}
+
+export function SettingsView({ initialTab, onClearInitialTab }: SettingsViewProps) {
+ const [activeTab, setActiveTab] = useState<SettingsTab>(initialTab || 'account');
+
+ // Apply initial tab when it changes
+ useEffect(() => {
+ if (initialTab) {
+ setActiveTab(initialTab);
+ onClearInitialTab?.();
+ }
+ }, [initialTab, onClearInitialTab]);
+
+ const renderTabContent = () => {
+ switch (activeTab) {
+ case 'account':
+ return <AccountPanel />;
+ case 'notifications':
+ return <NotificationsPanel />;
+ case 'mcpServers':
+ return <MCPServersPanel />;
+ case 'workflows':
+ return <WorkflowsPanel />;
+ default:
+ return null;
+ }
+ };
+
+ return (
+ <div className="h-full overflow-auto bg-white">
+ <div className="flex items-start justify-center pt-[40px] pb-[24px] px-[60px]">
+ <div className="flex-1 max-w-[660px] flex flex-col gap-[30px]">
+ {/* Title */}
+ <h1 className="text-[24px] font-semibold text-[#141420] tracking-[-0.17px]">
+ Settings
+ </h1>
+
+ {/* Content */}
+ <div className="flex flex-col gap-[24px]">
+ {/* Tab Navigation */}
+ <SettingsTabs activeTab={activeTab} onTabChange={setActiveTab} />
+
+ {/* Tab Content */}
+ {renderTabContent()}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+export default SettingsView;
diff --git a/src/renderer/hooks/useNotificationPermission.ts b/src/renderer/hooks/useNotificationPermission.ts
new file mode 100644
index 0000000..83efa4c
--- /dev/null
+++ b/src/renderer/hooks/useNotificationPermission.ts
@@ -0,0 +1,95 @@
+import { useCallback, useEffect, useRef, useState } from 'react';
+
+function getNotificationPermission(): NotificationPermission | null {
+ if (typeof window === 'undefined' || typeof window.Notification === 'undefined') {
+ return null;
+ }
+
+ return window.Notification.permission;
+}
+
+export function useNotificationPermission() {
+ const [enabled, setEnabled] = useState(false);
+ const [loading, setLoading] = useState(true);
+ const mountedRef = useRef(true);
+
+ useEffect(() => {
+ return () => {
+ mountedRef.current = false;
+ };
+ }, []);
+
+ const checkPermission = useCallback(async () => {
+ const permission = getNotificationPermission();
+
+ if (permission !== null) {
+ if (mountedRef.current) {
+ setEnabled(permission === 'granted');
+ setLoading(false);
+ }
+ return permission === 'granted';
+ }
+
+ try {
+ const supported = await window.electronAPI.permissions.checkNotificationPermission();
+ if (mountedRef.current) {
+ setEnabled(supported);
+ }
+ return supported;
+ } catch {
+ return false;
+ } finally {
+ if (mountedRef.current) {
+ setLoading(false);
+ }
+ }
+ }, []);
+
+ useEffect(() => {
+ checkPermission();
+ }, [checkPermission]);
+
+ useEffect(() => {
+ const onFocus = () => {
+ checkPermission();
+ };
+
+ const onVisibility = () => {
+ if (document.visibilityState === 'visible') {
+ checkPermission();
+ }
+ };
+
+ window.addEventListener('focus', onFocus);
+ document.addEventListener('visibilitychange', onVisibility);
+
+ const interval = window.setInterval(() => {
+ if (document.visibilityState === 'visible') {
+ checkPermission();
+ }
+ }, 3000);
+
+ return () => {
+ window.removeEventListener('focus', onFocus);
+ document.removeEventListener('visibilitychange', onVisibility);
+ window.clearInterval(interval);
+ };
+ }, [checkPermission]);
+
+ const openSettings = useCallback(async () => {
+ await window.electronAPI.permissions.openSystemSettings('notifications');
+
+ const pollCount = 20;
+ for (let i = 0; i < pollCount; i += 1) {
+ await new Promise((resolve) => window.setTimeout(resolve, 500));
+ await checkPermission();
+ }
+ }, [checkPermission]);
+
+ return {
+ enabled,
+ loading,
+ checkPermission,
+ openSettings,
+ };
+}