Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

feat: add Integrations tab with Google Calendar multi-account support

Gabriel Stein58aad3dea638
diff --git a/package-lock.json b/package-lock.json
index b794dbdc5..6ccbf23cb 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2486,22 +2486,6 @@
}
}
},
- "node_modules/@neondatabase/auth-ui/node_modules/better-sqlite3": {
- "version": "12.6.2",
- "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.6.2.tgz",
- "integrity": "sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA==",
- "hasInstallScript": true,
- "license": "MIT",
- "optional": true,
- "peer": true,
- "dependencies": {
- "bindings": "^1.5.0",
- "prebuild-install": "^7.1.1"
- },
- "engines": {
- "node": "20.x || 22.x || 23.x || 24.x || 25.x"
- }
- },
"node_modules/@neondatabase/auth-ui/node_modules/lucide-react": {
"version": "0.555.0",
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.555.0.tgz",
@@ -2511,54 +2495,6 @@
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
- "node_modules/@neondatabase/auth-ui/node_modules/pg": {
- "version": "8.18.0",
- "resolved": "https://registry.npmjs.org/pg/-/pg-8.18.0.tgz",
- "integrity": "sha512-xqrUDL1b9MbkydY/s+VZ6v+xiMUmOUk7SS9d/1kpyQxoJ6U9AO1oIJyUWVZojbfe5Cc/oluutcgFG4L9RDP1iQ==",
- "license": "MIT",
- "optional": true,
- "peer": true,
- "dependencies": {
- "pg-connection-string": "^2.11.0",
- "pg-pool": "^3.11.0",
- "pg-protocol": "^1.11.0",
- "pg-types": "2.2.0",
- "pgpass": "1.0.5"
- },
- "engines": {
- "node": ">= 16.0.0"
- },
- "optionalDependencies": {
- "pg-cloudflare": "^1.3.0"
- },
- "peerDependencies": {
- "pg-native": ">=3.0.1"
- },
- "peerDependenciesMeta": {
- "pg-native": {
- "optional": true
- }
- }
- },
- "node_modules/@neondatabase/auth-ui/node_modules/pg-pool": {
- "version": "3.11.0",
- "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.11.0.tgz",
- "integrity": "sha512-MJYfvHwtGp870aeusDh+hg9apvOe2zmpZJpyt+BMtzUWlVqbhFmMK6bOBXLBUPd7iRtIF9fZplDc7KrPN3PN7w==",
- "license": "MIT",
- "optional": true,
- "peer": true,
- "peerDependencies": {
- "pg": ">=8.0"
- }
- },
- "node_modules/@neondatabase/auth-ui/node_modules/pg-protocol": {
- "version": "1.11.0",
- "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.11.0.tgz",
- "integrity": "sha512-pfsxk2M9M3BuGgDOfuy37VNRRX3jmKgMjcvAcWqNDpZSf4cUmv8HSOl5ViRQFsfARFn0KuUQTgLxVMbNq5NW3g==",
- "license": "MIT",
- "optional": true,
- "peer": true
- },
"node_modules/@neondatabase/auth-ui/node_modules/zod": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
diff --git a/src/App.jsx b/src/App.jsx
index aa791bb51..8cb9cedb0 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -79,7 +79,6 @@ export default function App() {
const { hotkey } = useHotkey();
const { isDragging, handleMouseDown, handleMouseUp } = useWindowDrag();
-
const [dragStartPos, setDragStartPos] = useState(null);
const [hasDragged, setHasDragged] = useState(false);
diff --git a/src/assets/icons/google-calendar.svg b/src/assets/icons/google-calendar.svg
new file mode 100644
index 000000000..680639ba0
--- /dev/null
+++ b/src/assets/icons/google-calendar.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
+ <rect x="3" y="3" width="18" height="18" rx="2.5" fill="#fff"/>
+ <path d="M3 5.5C3 4.12 4.12 3 5.5 3H8V7H3V5.5Z" fill="#4285F4"/>
+ <rect x="8" y="3" width="8" height="4" fill="#EA4335"/>
+ <path d="M16 3h2.5C19.88 3 21 4.12 21 5.5V7h-5V3Z" fill="#EA4335"/>
+ <rect x="3" y="7" width="5" height="5" fill="#4285F4"/>
+ <rect x="8" y="7" width="8" height="5" fill="#fff"/>
+ <rect x="16" y="7" width="5" height="5" fill="#FBBC04"/>
+ <path d="M3 12v6.5C3 19.88 4.12 21 5.5 21H8v-9H3Z" fill="#34A853"/>
+ <rect x="8" y="12" width="8" height="9" fill="#188038"/>
+ <path d="M16 12v9h2.5c1.38 0 2.5-1.12 2.5-2.5V12h-5Z" fill="#34A853"/>
+ <text x="12" y="15.5" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-size="7" font-weight="700" fill="#4285F4">31</text>
+</svg>
diff --git a/src/components/CalendarSettings.tsx b/src/components/CalendarSettings.tsx
deleted file mode 100644
index e9cf5a3a9..000000000
--- a/src/components/CalendarSettings.tsx
+++ /dev/null
@@ -1,354 +0,0 @@
-import React, { useState, useEffect, useCallback } from "react";
-import { useTranslation } from "react-i18next";
-import { Calendar, LogOut, RefreshCw, Loader2 } from "lucide-react";
-import { SettingsRow } from "./ui/SettingsSection";
-import { Button } from "./ui/button";
-import { Badge } from "./ui/badge";
-import { Toggle } from "./ui/toggle";
-import { useSettingsStore } from "../stores/settingsStore";
-import type { GoogleCalendar, CalendarEvent } from "../types/calendar";
-
-function SettingsPanel({
- children,
- className = "",
-}: {
- children: React.ReactNode;
- className?: string;
-}) {
- return (
- <div
- className={`rounded-lg border border-border/50 dark:border-border-subtle/70 bg-card/50 dark:bg-surface-2/50 backdrop-blur-sm divide-y divide-border/30 dark:divide-border-subtle/50 ${className}`}
- >
- {children}
- </div>
- );
-}
-
-function SettingsPanelRow({
- children,
- className = "",
-}: {
- children: React.ReactNode;
- className?: string;
-}) {
- return <div className={`px-4 py-3 ${className}`}>{children}</div>;
-}
-
-function SectionHeader({ title, description }: { title: string; description?: string }) {
- return (
- <div className="mb-3">
- <h3 className="text-xs font-semibold text-foreground tracking-tight">{title}</h3>
- {description && (
- <p className="text-xs text-muted-foreground/80 mt-0.5 leading-relaxed">{description}</p>
- )}
- </div>
- );
-}
-
-function formatEventTime(startTime: string): string {
- const date = new Date(startTime);
- const now = new Date();
- const tomorrow = new Date(now);
- tomorrow.setDate(tomorrow.getDate() + 1);
-
- const timeStr = new Intl.DateTimeFormat(undefined, {
- hour: "numeric",
- minute: "2-digit",
- }).format(date);
-
- if (date.toDateString() === now.toDateString()) {
- return `Today ${timeStr}`;
- }
- if (date.toDateString() === tomorrow.toDateString()) {
- return `Tomorrow ${timeStr}`;
- }
- return new Intl.DateTimeFormat(undefined, {
- weekday: "short",
- hour: "numeric",
- minute: "2-digit",
- }).format(date);
-}
-
-export default function CalendarSettings() {
- const { t } = useTranslation();
- const {
- gcalConnected,
- gcalEmail,
- setGcalConnected,
- setGcalEmail,
- meetingProcessDetection,
- meetingAudioDetection,
- setMeetingProcessDetection,
- setMeetingAudioDetection,
- } = useSettingsStore();
- const [calendars, setCalendars] = useState<GoogleCalendar[]>([]);
- const [upcomingEvents, setUpcomingEvents] = useState<CalendarEvent[]>([]);
- const [isConnecting, setIsConnecting] = useState(false);
- const [isDisconnecting, setIsDisconnecting] = useState(false);
- const [isSyncing, setIsSyncing] = useState(false);
-
- const loadData = useCallback(async () => {
- if (!gcalConnected) return;
- try {
- const [calsResult, eventsResult] = await Promise.all([
- window.electronAPI?.gcalGetCalendars?.(),
- window.electronAPI?.gcalGetUpcomingEvents?.(60),
- ]);
- if (calsResult?.calendars) setCalendars(calsResult.calendars);
- if (eventsResult?.events) setUpcomingEvents(eventsResult.events);
- } catch {
- // non-fatal
- }
- }, [gcalConnected]);
-
- useEffect(() => {
- loadData();
- }, [loadData]);
-
- useEffect(() => {
- const unsubConnection = window.electronAPI?.onGcalConnectionChanged?.(
- (data: { connected: boolean; email: string | null }) => {
- setGcalConnected(data.connected);
- setGcalEmail(data.email ?? "");
- if (data.connected) loadData();
- }
- );
- const unsubSync = window.electronAPI?.onGcalEventsSynced?.(() => {
- loadData();
- });
- return () => {
- unsubConnection?.();
- unsubSync?.();
- };
- }, [loadData, setGcalConnected, setGcalEmail]);
-
- const handleConnect = useCallback(async () => {
- setIsConnecting(true);
- try {
- const result = await window.electronAPI?.gcalStartOAuth?.();
- if (result?.success) {
- setGcalConnected(true);
- setGcalEmail(result.email ?? "");
- }
- } finally {
- setIsConnecting(false);
- }
- }, [setGcalConnected, setGcalEmail]);
-
- const handleDisconnect = useCallback(async () => {
- setIsDisconnecting(true);
- try {
- await window.electronAPI?.gcalDisconnect?.();
- setGcalConnected(false);
- setGcalEmail("");
- setCalendars([]);
- setUpcomingEvents([]);
- } finally {
- setIsDisconnecting(false);
- }
- }, [setGcalConnected, setGcalEmail]);
-
- const handleSync = useCallback(async () => {
- setIsSyncing(true);
- try {
- await window.electronAPI?.gcalSyncEvents?.();
- await loadData();
- } finally {
- setIsSyncing(false);
- }
- }, [loadData]);
-
- const handleToggleCalendar = useCallback(async (calendarId: string, isSelected: boolean) => {
- setCalendars((prev) =>
- prev.map((c) => (c.id === calendarId ? { ...c, is_selected: isSelected ? 1 : 0 } : c))
- );
- try {
- await window.electronAPI?.gcalSetCalendarSelection?.(calendarId, isSelected);
- } catch {
- setCalendars((prev) =>
- prev.map((c) => (c.id === calendarId ? { ...c, is_selected: isSelected ? 0 : 1 } : c))
- );
- }
- }, []);
-
- if (!gcalConnected) {
- return (
- <div className="space-y-5">
- <SectionHeader title={t("calendar.title")} />
-
- <SettingsPanel>
- <SettingsPanelRow>
- <SettingsRow
- label={t("calendar.status")}
- description={t("calendar.notConnectedDescription")}
- >
- <Badge variant="outline">{t("calendar.disconnected")}</Badge>
- </SettingsRow>
- </SettingsPanelRow>
- </SettingsPanel>
-
- <div className="rounded-lg border border-primary/20 dark:border-primary/15 bg-primary/3 dark:bg-primary/6 p-4">
- <div className="flex items-start gap-3">
- <div className="w-8 h-8 rounded-md bg-primary/10 dark:bg-primary/15 flex items-center justify-center shrink-0 mt-0.5">
- <Calendar className="w-4 h-4 text-primary" />
- </div>
- <div className="min-w-0 flex-1 space-y-2.5">
- <div>
- <p className="text-xs font-medium text-foreground">
- {t("calendar.connectCta.title")}
- </p>
- <p className="text-xs text-muted-foreground leading-relaxed mt-0.5">
- {t("calendar.connectCta.description")}
- </p>
- </div>
- <Button onClick={handleConnect} disabled={isConnecting} size="sm" className="w-full">
- {isConnecting ? (
- <>
- <Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin" />
- {t("calendar.connecting")}
- </>
- ) : (
- <>
- <Calendar className="mr-1.5 h-3.5 w-3.5" />
- {t("calendar.connect")}
- </>
- )}
- </Button>
- </div>
- </div>
- </div>
- </div>
- );
- }
-
- return (
- <div className="space-y-5">
- <SectionHeader title={t("calendar.title")} />
-
- <SettingsPanel>
- <SettingsPanelRow>
- <div className="flex items-center gap-3">
- <div className="w-10 h-10 rounded-full bg-primary/10 dark:bg-primary/15 flex items-center justify-center shrink-0">
- <Calendar className="w-5 h-5 text-primary" />
- </div>
- <div className="min-w-0 flex-1">
- <p className="text-xs font-medium text-foreground truncate">{gcalEmail}</p>
- </div>
- <Badge variant="success">{t("calendar.connected")}</Badge>
- </div>
- </SettingsPanelRow>
- </SettingsPanel>
-
- <SettingsPanel>
- <SettingsPanelRow>
- <div className="flex items-center gap-2">
- <Button variant="outline" size="sm" onClick={handleSync} disabled={isSyncing}>
- <RefreshCw className={`mr-1.5 h-3.5 w-3.5 ${isSyncing ? "animate-spin" : ""}`} />
- {isSyncing ? t("calendar.syncing") : t("calendar.sync")}
- </Button>
- <Button
- variant="outline"
- size="sm"
- onClick={handleDisconnect}
- disabled={isDisconnecting}
- className="text-destructive border-destructive/30 hover:bg-destructive/10 hover:border-destructive/50"
- >
- <LogOut className="mr-1.5 h-3.5 w-3.5" />
- {isDisconnecting ? t("calendar.disconnecting") : t("calendar.disconnect")}
- </Button>
- </div>
- </SettingsPanelRow>
- </SettingsPanel>
-
- {calendars.length > 0 && (
- <div>
- <SectionHeader title={t("calendar.calendarsTitle")} />
- <SettingsPanel>
- {calendars.map((cal) => (
- <SettingsPanelRow key={cal.id}>
- <div className="flex items-center justify-between gap-4">
- <div className="flex items-center gap-2 min-w-0 flex-1">
- {cal.background_color && (
- <span
- className="w-2.5 h-2.5 rounded-full shrink-0"
- style={{ backgroundColor: cal.background_color }}
- />
- )}
- <span className="text-xs font-medium text-foreground truncate">
- {cal.summary}
- </span>
- </div>
- <Toggle
- checked={cal.is_selected === 1}
- onChange={(checked) => handleToggleCalendar(cal.id, checked)}
- />
- </div>
- </SettingsPanelRow>
- ))}
- </SettingsPanel>
- </div>
- )}
-
- {upcomingEvents.length > 0 && (
- <div>
- <SectionHeader title={t("calendar.upcomingTitle")} />
- <SettingsPanel>
- {upcomingEvents.slice(0, 3).map((event) => (
- <SettingsPanelRow key={event.id}>
- <div className="flex items-center justify-between gap-3">
- <span className="text-xs font-medium text-foreground truncate min-w-0 flex-1">
- {event.summary || "—"}
- </span>
- <span className="text-xs text-muted-foreground shrink-0">
- {formatEventTime(event.start_time)}
- </span>
- </div>
- </SettingsPanelRow>
- ))}
- </SettingsPanel>
- </div>
- )}
-
- <div>
- <SectionHeader
- title={t("calendar.detection.title")}
- description={t("calendar.detection.description")}
- />
- <SettingsPanel>
- <SettingsPanelRow>
- <SettingsRow
- label={t("calendar.detection.processDetection")}
- description={t("calendar.detection.processDescription")}
- >
- <Toggle
- checked={meetingProcessDetection}
- onChange={(checked) => {
- setMeetingProcessDetection(checked);
- window.electronAPI?.meetingDetectionSetPreferences?.({
- processDetection: checked,
- });
- }}
- />
- </SettingsRow>
- </SettingsPanelRow>
- <SettingsPanelRow>
- <SettingsRow
- label={t("calendar.detection.audioDetection")}
- description={t("calendar.detection.audioDescription")}
- >
- <Toggle
- checked={meetingAudioDetection}
- onChange={(checked) => {
- setMeetingAudioDetection(checked);
- window.electronAPI?.meetingDetectionSetPreferences?.({
- audioDetection: checked,
- });
- }}
- />
- </SettingsRow>
- </SettingsPanelRow>
- </SettingsPanel>
- </div>
- </div>
- );
-}
diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsx
index 994fda34d..a6ad9407b 100644
--- a/src/components/ControlPanel.tsx
+++ b/src/components/ControlPanel.tsx
@@ -30,6 +30,7 @@ const ReferralModal = React.lazy(() => import("./ReferralModal"));
const PersonalNotesView = React.lazy(() => import("./notes/PersonalNotesView"));
const DictionaryView = React.lazy(() => import("./DictionaryView"));
const UploadAudioView = React.lazy(() => import("./notes/UploadAudioView"));
+const IntegrationsView = React.lazy(() => import("./IntegrationsView"));
export default function ControlPanel() {
const { t } = useTranslation();
@@ -578,6 +579,11 @@ export default function ControlPanel() {
/>
</Suspense>
)}
+ {activeView === "integrations" && (
+ <Suspense fallback={null}>
+ <IntegrationsView />
+ </Suspense>
+ )}
</div>
</main>
</div>
diff --git a/src/components/ControlPanelSidebar.tsx b/src/components/ControlPanelSidebar.tsx
index 6d9d2049d..25b346036 100644
--- a/src/components/ControlPanelSidebar.tsx
+++ b/src/components/ControlPanelSidebar.tsx
@@ -4,6 +4,7 @@ import {
NotebookPen,
BookOpen,
Upload,
+ Blocks,
Gift,
Settings,
HelpCircle,
@@ -15,7 +16,7 @@ import { useTranslation } from "react-i18next";
import { cn } from "./lib/utils";
import SupportDropdown from "./ui/SupportDropdown";
-export type ControlPanelView = "home" | "personal-notes" | "dictionary" | "upload";
+export type ControlPanelView = "home" | "personal-notes" | "dictionary" | "upload" | "integrations";
interface ControlPanelSidebarProps {
activeView: ControlPanelView;
@@ -74,6 +75,7 @@ export default function ControlPanelSidebar({
{ id: "personal-notes", label: t("sidebar.notes"), icon: NotebookPen },
{ id: "upload", label: t("sidebar.upload"), icon: Upload },
{ id: "dictionary", label: t("sidebar.dictionary"), icon: BookOpen },
+ { id: "integrations", label: t("sidebar.integrations"), icon: Blocks },
];
return (
diff --git a/src/components/IntegrationsView.tsx b/src/components/IntegrationsView.tsx
new file mode 100644
index 000000000..d8edaea92
--- /dev/null
+++ b/src/components/IntegrationsView.tsx
@@ -0,0 +1,212 @@
+import { useState, useEffect, useCallback } from "react";
+import { useTranslation } from "react-i18next";
+import { Loader2, Plus, X } from "lucide-react";
+import { Button } from "./ui/button";
+import { Badge } from "./ui/badge";
+import { useSettingsStore } from "../stores/settingsStore";
+import { useUsage } from "../hooks/useUsage";
+import googleCalendarIcon from "../assets/icons/google-calendar.svg";
+
+function SettingsPanel({ children }: { children: React.ReactNode }) {
+ return (
+ <div className="rounded-lg border border-border/50 dark:border-border-subtle/70 bg-card/50 dark:bg-surface-2/50 backdrop-blur-sm divide-y divide-border/30 dark:divide-border-subtle/50">
+ {children}
+ </div>
+ );
+}
+
+function SettingsPanelRow({
+ children,
+ className = "",
+}: {
+ children: React.ReactNode;
+ className?: string;
+}) {
+ return <div className={`px-4 py-3 ${className}`}>{children}</div>;
+}
+
+const PLAN_TIERS = [
+ { nameKey: "integrations.plan.free", limitKey: "integrations.plan.freeLimit", id: "free" },
+ {
+ nameKey: "integrations.plan.essential",
+ limitKey: "integrations.plan.essentialLimit",
+ id: "essential",
+ },
+ { nameKey: "integrations.plan.pro", limitKey: "integrations.plan.proLimit", id: "pro" },
+] as const;
+
+export default function IntegrationsView() {
+ const { t } = useTranslation();
+ const { gcalAccounts, setGcalAccounts } = useSettingsStore();
+ const [isConnecting, setIsConnecting] = useState(false);
+ const [disconnectingEmail, setDisconnectingEmail] = useState<string | null>(null);
+ const usage = useUsage();
+
+ const currentPlan = usage?.isSubscribed ? "pro" : usage?.isTrial ? "essential" : "free";
+ const hasAccounts = gcalAccounts.length > 0;
+
+ const handleConnect = useCallback(async () => {
+ setIsConnecting(true);
+ try {
+ const result = await window.electronAPI?.gcalStartOAuth?.();
+ if (result?.success && result.email) {
+ const current = useSettingsStore.getState().gcalAccounts;
+ setGcalAccounts([
+ ...current.filter((a) => a.email !== result.email),
+ { email: result.email },
+ ]);
+ }
+ } finally {
+ setIsConnecting(false);
+ }
+ }, [setGcalAccounts]);
+
+ const handleDisconnect = useCallback(
+ async (email: string) => {
+ if (!window.confirm(t("integrations.googleCalendar.disconnectConfirm", { email }))) return;
+ setDisconnectingEmail(email);
+ try {
+ await window.electronAPI?.gcalDisconnect?.(email);
+ const current = useSettingsStore.getState().gcalAccounts;
+ setGcalAccounts(current.filter((a) => a.email !== email));
+ } finally {
+ setDisconnectingEmail(null);
+ }
+ },
+ [setGcalAccounts, t]
+ );
+
+ useEffect(() => {
+ const unsub = window.electronAPI?.onGcalConnectionChanged?.(
+ (data: {
+ accounts?: Array<{ email: string }>;
+ connected?: boolean;
+ email?: string | null;
+ }) => {
+ if (data.accounts) {
+ setGcalAccounts(data.accounts);
+ } else if (data.connected && data.email) {
+ const current = useSettingsStore.getState().gcalAccounts;
+ setGcalAccounts([
+ ...current.filter((a) => a.email !== data.email),
+ { email: data.email },
+ ]);
+ }
+ }
+ );
+ return () => unsub?.();
+ }, [setGcalAccounts]);
+
+ return (
+ <div className="max-w-lg mx-auto w-full px-6 py-6 space-y-6">
+ <div>
+ <h2 className="text-base font-semibold text-foreground">{t("integrations.title")}</h2>
+ <p className="text-xs text-muted-foreground/70 mt-0.5">{t("integrations.description")}</p>
+ </div>
+
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <div className="flex items-center gap-3">
+ <div className="w-9 h-9 rounded-lg bg-white dark:bg-surface-raised shadow-[0_0_0_1px_rgba(0,0,0,0.04)] dark:shadow-none dark:border dark:border-white/5 flex items-center justify-center shrink-0">
+ <img src={googleCalendarIcon} alt="" className="w-5 h-5" />
+ </div>
+ <div className="flex-1 min-w-0">
+ <p className="text-xs font-semibold text-foreground">
+ {t("integrations.googleCalendar.title")}
+ </p>
+ <p className="text-xs text-muted-foreground/70 mt-0.5 leading-relaxed">
+ {t("integrations.googleCalendar.description")}
+ </p>
+ </div>
+ {!hasAccounts && (
+ <Button
+ size="sm"
+ onClick={handleConnect}
+ disabled={isConnecting}
+ className="shrink-0"
+ >
+ {isConnecting ? (
+ <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ ) : (
+ t("integrations.googleCalendar.connect")
+ )}
+ </Button>
+ )}
+ {hasAccounts && (
+ <Badge variant="success" className="shrink-0">
+ {t("integrations.googleCalendar.connected")}
+ </Badge>
+ )}
+ </div>
+ </SettingsPanelRow>
+
+ {hasAccounts &&
+ gcalAccounts.map((account) => (
+ <SettingsPanelRow key={account.email}>
+ <div className="group flex items-center gap-3 pl-12">
+ <span className="text-xs text-muted-foreground truncate flex-1">
+ {account.email}
+ </span>
+ <button
+ onClick={() => handleDisconnect(account.email)}
+ disabled={disconnectingEmail === account.email}
+ className="opacity-0 group-hover:opacity-100 p-1 rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-all disabled:opacity-50"
+ aria-label={t("integrations.googleCalendar.disconnect")}
+ >
+ {disconnectingEmail === account.email ? (
+ <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ ) : (
+ <X className="h-3.5 w-3.5" />
+ )}
+ </button>
+ </div>
+ </SettingsPanelRow>
+ ))}
+
+ {hasAccounts && (
+ <SettingsPanelRow>
+ <button
+ onClick={handleConnect}
+ disabled={isConnecting}
+ className="flex items-center gap-2 pl-12 text-xs text-primary hover:text-primary/80 transition-colors disabled:opacity-50"
+ >
+ {isConnecting ? (
+ <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ ) : (
+ <Plus className="h-3.5 w-3.5" />
+ )}
+ {t("integrations.googleCalendar.addAnother")}
+ </button>
+ </SettingsPanelRow>
+ )}
+ </SettingsPanel>
+
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <p className="text-xs font-semibold text-foreground">{t("integrations.plan.title")}</p>
+ </SettingsPanelRow>
+ {PLAN_TIERS.map((tier) => {
+ const isCurrent = tier.id === currentPlan;
+ return (
+ <SettingsPanelRow
+ key={tier.id}
+ className={isCurrent ? "bg-primary/5 dark:bg-primary/8" : ""}
+ >
+ <div className="flex items-center justify-between">
+ <div className="flex items-center gap-2">
+ <span className="text-xs font-medium text-foreground">{t(tier.nameKey)}</span>
+ {isCurrent && (
+ <Badge variant="default" className="text-[10px] px-1.5 py-0">
+ {t("integrations.plan.current")}
+ </Badge>
+ )}
+ </div>
+ <span className="text-xs text-muted-foreground">{t(tier.limitKey)}</span>
+ </div>
+ </SettingsPanelRow>
+ );
+ })}
+ </SettingsPanel>
+ </div>
+ );
+}
diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx
index 344c14a88..b1f889b7a 100644
--- a/src/components/SettingsModal.tsx
+++ b/src/components/SettingsModal.tsx
@@ -7,7 +7,6 @@ import {
UserCircle,
Wrench,
Keyboard,
- Calendar,
CreditCard,
Shield,
} from "lucide-react";
@@ -65,13 +64,6 @@ export default function SettingsModal({ open, onOpenChange, initialSection }: Se
description: t("settingsModal.sections.hotkeys.description"),
group: t("settingsModal.groups.app"),
},
- {
- id: "calendar",
- label: t("settingsModal.sections.calendar.label"),
- icon: Calendar,
- description: t("settingsModal.sections.calendar.description"),
- group: t("settingsModal.groups.app"),
- },
{
id: "transcription",
label: t("settingsModal.sections.transcription.label"),
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index 51073a90b..891249474 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -51,7 +51,6 @@ import { getPlatform, getCachedPlatform } from "../utils/platform";
import { getDefaultHotkey, formatHotkeyLabel } from "../utils/hotkeys";
import { ActivationModeSelector } from "./ui/ActivationModeSelector";
import { Toggle } from "./ui/toggle";
-import CalendarSettings from "./CalendarSettings";
import DeveloperSection from "./DeveloperSection";
import LanguageSelector from "./ui/LanguageSelector";
import { Skeleton } from "./ui/skeleton";
@@ -69,7 +68,6 @@ export type SettingsSectionType =
| "plansBilling"
| "general"
| "hotkeys"
- | "calendar"
| "transcription"
| "intelligence"
| "privacyData"
@@ -1763,9 +1761,6 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
</div>
);
- case "calendar":
- return <CalendarSettings />;
-
case "transcription":
return (
<TranscriptionSection
diff --git a/src/helpers/database.js b/src/helpers/database.js
index 061149c04..5063a6530 100644
--- a/src/helpers/database.js
+++ b/src/helpers/database.js
@@ -144,7 +144,7 @@ class DatabaseManager {
this.db.exec(`
CREATE TABLE IF NOT EXISTS google_calendar_tokens (
id INTEGER PRIMARY KEY AUTOINCREMENT,
- google_email TEXT NOT NULL,
+ google_email TEXT NOT NULL UNIQUE,
access_token TEXT NOT NULL,
refresh_token TEXT NOT NULL,
expires_at INTEGER NOT NULL,
@@ -154,6 +154,27 @@ class DatabaseManager {
)
`);
+ // Migration: add UNIQUE constraint to google_email if table already existed without it
+ try {
+ const tableInfo = this.db.pragma("index_list('google_calendar_tokens')");
+ const hasUniqueEmail = tableInfo.some((idx) => {
+ if (!idx.unique) return false;
+ const cols = this.db.pragma(`index_info('${idx.name}')`);
+ return cols.length === 1 && cols[0].name === "google_email";
+ });
+ if (!hasUniqueEmail) {
+ this.db.exec(
+ "CREATE UNIQUE INDEX IF NOT EXISTS idx_google_calendar_tokens_email ON google_calendar_tokens(google_email)"
+ );
+ }
+ } catch (err) {
+ debugLogger.error(
+ "Migration: google_email unique index",
+ { error: err.message },
+ "database"
+ );
+ }
+
this.db.exec(`
CREATE TABLE IF NOT EXISTS google_calendars (
id TEXT PRIMARY KEY,
@@ -162,10 +183,17 @@ class DatabaseManager {
background_color TEXT,
is_selected INTEGER NOT NULL DEFAULT 1,
sync_token TEXT,
+ account_email TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
)
`);
+ try {
+ this.db.exec("ALTER TABLE google_calendars ADD COLUMN account_email TEXT");
+ } catch (err) {
+ if (!err.message.includes("duplicate column")) throw err;
+ }
+
this.db.exec(`
CREATE TABLE IF NOT EXISTS calendar_events (
id TEXT PRIMARY KEY,
@@ -589,9 +617,15 @@ class DatabaseManager {
saveGoogleTokens(tokens) {
try {
if (!this.db) throw new Error("Database not initialized");
- this.db.prepare("DELETE FROM google_calendar_tokens").run();
const stmt = this.db.prepare(
- "INSERT INTO google_calendar_tokens (google_email, access_token, refresh_token, expires_at, scope) VALUES (?, ?, ?, ?, ?)"
+ `INSERT INTO google_calendar_tokens (google_email, access_token, refresh_token, expires_at, scope)
+ VALUES (?, ?, ?, ?, ?)
+ ON CONFLICT(google_email) DO UPDATE SET
+ access_token = excluded.access_token,
+ refresh_token = excluded.refresh_token,
+ expires_at = excluded.expires_at,
+ scope = excluded.scope,
+ updated_at = CURRENT_TIMESTAMP`
);
stmt.run(
tokens.google_email,
@@ -617,6 +651,66 @@ class DatabaseManager {
}
}
+ getGoogleTokensByEmail(email) {
+ try {
+ if (!this.db) throw new Error("Database not initialized");
+ return (
+ this.db.prepare("SELECT * FROM google_calendar_tokens WHERE google_email = ?").get(email) ||
+ null
+ );
+ } catch (error) {
+ debugLogger.error("Error getting Google tokens by email", { error: error.message }, "gcal");
+ throw error;
+ }
+ }
+
+ getAllGoogleTokens() {
+ try {
+ if (!this.db) throw new Error("Database not initialized");
+ return this.db.prepare("SELECT * FROM google_calendar_tokens").all();
+ } catch (error) {
+ debugLogger.error("Error getting all Google tokens", { error: error.message }, "gcal");
+ throw error;
+ }
+ }
+
+ getGoogleAccounts() {
+ try {
+ if (!this.db) throw new Error("Database not initialized");
+ return this.db
+ .prepare("SELECT google_email AS email FROM google_calendar_tokens ORDER BY created_at ASC")
+ .all();
+ } catch (error) {
+ debugLogger.error("Error getting Google accounts", { error: error.message }, "gcal");
+ throw error;
+ }
+ }
+
+ removeGoogleAccount(email) {
+ try {
+ if (!this.db) throw new Error("Database not initialized");
+ const transaction = this.db.transaction(() => {
+ const calendarIds = this.db
+ .prepare("SELECT id FROM google_calendars WHERE account_email = ?")
+ .all(email)
+ .map((c) => c.id);
+ if (calendarIds.length > 0) {
+ const placeholders = calendarIds.map(() => "?").join(", ");
+ this.db
+ .prepare(`DELETE FROM calendar_events WHERE calendar_id IN (${placeholders})`)
+ .run(...calendarIds);
+ }
+ this.db.prepare("DELETE FROM google_calendars WHERE account_email = ?").run(email);
+ this.db.prepare("DELETE FROM google_calendar_tokens WHERE google_email = ?").run(email);
+ });
+ transaction();
+ return { success: true };
+ } catch (error) {
+ debugLogger.error("Error removing Google account", { error: error.message }, "gcal");
+ throw error;
+ }
+ }
+
deleteGoogleTokens() {
try {
if (!this.db) throw new Error("Database not initialized");
@@ -628,14 +722,26 @@ class DatabaseManager {
}
}
- saveGoogleCalendars(calendars) {
+ saveGoogleCalendars(calendars, accountEmail = null) {
try {
if (!this.db) throw new Error("Database not initialized");
const stmt = this.db.prepare(
- "INSERT INTO google_calendars (id, summary, description, background_color) VALUES (?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET summary = excluded.summary, description = excluded.description, background_color = excluded.background_color"
+ `INSERT INTO google_calendars (id, summary, description, background_color, account_email)
+ VALUES (?, ?, ?, ?, ?)
+ ON CONFLICT(id) DO UPDATE SET
+ summary = excluded.summary,
+ description = excluded.description,
+ background_color = excluded.background_color,
+ account_email = excluded.account_email`
);
for (const cal of calendars) {
- stmt.run(cal.id, cal.summary, cal.description || null, cal.background_color || null);
+ stmt.run(
+ cal.id,
+ cal.summary,
+ cal.description || null,
+ cal.background_color || null,
+ accountEmail
+ );
}
return { success: true };
} catch (error) {
@@ -644,9 +750,14 @@ class DatabaseManager {
}
}
- getGoogleCalendars() {
+ getGoogleCalendars(accountEmail = null) {
try {
if (!this.db) throw new Error("Database not initialized");
+ if (accountEmail) {
+ return this.db
+ .prepare("SELECT * FROM google_calendars WHERE account_email = ?")
+ .all(accountEmail);
+ }
return this.db.prepare("SELECT * FROM google_calendars").all();
} catch (error) {
debugLogger.error("Error getting Google calendars", { error: error.message }, "gcal");
@@ -667,9 +778,14 @@ class DatabaseManager {
}
}
- getSelectedCalendars() {
+ getSelectedCalendars(accountEmail = null) {
try {
if (!this.db) throw new Error("Database not initialized");
+ if (accountEmail) {
+ return this.db
+ .prepare("SELECT * FROM google_calendars WHERE is_selected = 1 AND account_email = ?")
+ .all(accountEmail);
+ }
return this.db.prepare("SELECT * FROM google_calendars WHERE is_selected = 1").all();
} catch (error) {
debugLogger.error("Error getting selected calendars", { error: error.message }, "gcal");
diff --git a/src/helpers/googleCalendarManager.js b/src/helpers/googleCalendarManager.js
index 6cf0a04ee..e3c6e5718 100644
--- a/src/helpers/googleCalendarManager.js
+++ b/src/helpers/googleCalendarManager.js
@@ -10,6 +10,7 @@ class GoogleCalendarManager {
this.databaseManager = databaseManager;
this.windowManager = windowManager;
this.oauth = new GoogleCalendarOAuth(databaseManager);
+ this.accounts = new Map();
this.syncInterval = null;
this.nextMeetingTimer = null;
this.meetingEndTimer = null;
@@ -20,7 +21,8 @@ class GoogleCalendarManager {
}
start() {
- if (!this.isConnected()) return;
+ this._loadAccounts();
+ if (this.accounts.size === 0) return;
this.syncEvents()
.then(() => this.scheduleNextMeeting())
@@ -28,11 +30,7 @@ class GoogleCalendarManager {
debugLogger.error("Initial calendar sync failed", { error: err.message }, "gcal")
);
- this.syncInterval = setInterval(() => {
- this.syncEvents()
- .then(() => this.scheduleNextMeeting())
- .catch((err) => debugLogger.error("Calendar sync failed", { error: err.message }, "gcal"));
- }, this.SYNC_INTERVAL_MS);
+ this._startSyncInterval();
}
stop() {
@@ -52,52 +50,84 @@ class GoogleCalendarManager {
}
isConnected() {
- return !!this.databaseManager.getGoogleTokens();
+ return this.accounts.size > 0;
+ }
+
+ addAccount(email) {
+ this.accounts.set(email, { email });
+ }
+
+ removeAccount(email) {
+ this.accounts.delete(email);
+ this.databaseManager.removeGoogleAccount(email);
+ this._broadcastAccountsChanged();
+
+ if (this.accounts.size === 0) {
+ this.stop();
+ this.notifiedMeetings.clear();
+ }
}
async startOAuth() {
const result = await this.oauth.startOAuthFlow();
- await this.fetchCalendars();
+ this.addAccount(result.email);
+
+ await this.fetchCalendars(result.email);
await this.syncEvents();
this.scheduleNextMeeting();
+ this._startSyncInterval();
+ this._broadcastAccountsChanged();
- if (this.syncInterval) clearInterval(this.syncInterval);
- this.syncInterval = setInterval(() => {
- this.syncEvents()
- .then(() => this.scheduleNextMeeting())
- .catch((err) => debugLogger.error("Calendar sync failed", { error: err.message }, "gcal"));
- }, this.SYNC_INTERVAL_MS);
-
- this.broadcastToWindows("gcal-connection-changed", { connected: true, email: result.email });
return result;
}
- disconnect() {
- this.stop();
- this.databaseManager.clearCalendarData();
- this.notifiedMeetings.clear();
- this.broadcastToWindows("gcal-connection-changed", { connected: false, email: null });
+ disconnect(email) {
+ if (email) {
+ this.removeAccount(email);
+ } else {
+ this.stop();
+ this.accounts.clear();
+ this.databaseManager.clearCalendarData();
+ this.notifiedMeetings.clear();
+ this._broadcastAccountsChanged();
+ }
}
getConnectionStatus() {
- const tokens = this.databaseManager.getGoogleTokens();
+ const accounts = this.databaseManager.getGoogleAccounts();
return {
- connected: !!tokens,
- email: tokens?.google_email || null,
- expiresAt: tokens?.expires_at || null,
+ connected: accounts.length > 0,
+ accounts,
+ // Backwards compat
+ email: accounts[0]?.email || null,
};
}
- async fetchCalendars() {
- const data = await this._apiGet("/users/me/calendarList");
- const calendars = (data.items || []).map((item) => ({
- id: item.id,
- summary: item.summary,
- description: item.description || null,
- background_color: item.backgroundColor || null,
- }));
- this.databaseManager.saveGoogleCalendars(calendars);
- return calendars;
+ getAccounts() {
+ return this.databaseManager.getGoogleAccounts();
+ }
+
+ async fetchCalendars(accountEmail = null) {
+ const emails = accountEmail ? [accountEmail] : this._getAccountEmails();
+ const allCalendars = [];
+
+ for (const email of emails) {
+ try {
+ const data = await this._apiGet("/users/me/calendarList", email);
+ const calendars = (data.items || []).map((item) => ({
+ id: item.id,
+ summary: item.summary,
+ description: item.description || null,
+ background_color: item.backgroundColor || null,
+ }));
+ this.databaseManager.saveGoogleCalendars(calendars, email);
+ allCalendars.push(...calendars);
+ } catch (err) {
+ debugLogger.error("Error fetching calendars", { email, error: err.message }, "gcal");
+ }
+ }
+
+ return allCalendars;
}
async syncEvents() {
@@ -110,10 +140,7 @@ class GoogleCalendarManager {
} catch (err) {
debugLogger.error(
"Error syncing calendar",
- {
- calendarId: calendar.id,
- error: err.message,
- },
+ { calendarId: calendar.id, error: err.message },
"gcal"
);
}
@@ -124,6 +151,7 @@ class GoogleCalendarManager {
}
async _syncCalendar(calendar) {
+ const accountEmail = calendar.account_email;
const params = new URLSearchParams({
singleEvents: "true",
orderBy: "startTime",
@@ -141,7 +169,8 @@ class GoogleCalendarManager {
let data;
try {
data = await this._apiGet(
- `/calendars/${encodeURIComponent(calendar.id)}/events?${params.toString()}`
+ `/calendars/${encodeURIComponent(calendar.id)}/events?${params.toString()}`,
+ accountEmail
);
} catch (err) {
// 410 Gone means syncToken is invalid; fall back to full sync
@@ -153,7 +182,8 @@ class GoogleCalendarManager {
timeMax: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(),
});
data = await this._apiGet(
- `/calendars/${encodeURIComponent(calendar.id)}/events?${fullParams.toString()}`
+ `/calendars/${encodeURIComponent(calendar.id)}/events?${fullParams.toString()}`,
+ accountEmail
);
} else {
throw err;
@@ -316,8 +346,34 @@ class GoogleCalendarManager {
});
}
- async _apiGet(path) {
- const accessToken = await this.oauth.getValidAccessToken();
+ _loadAccounts() {
+ const accounts = this.databaseManager.getGoogleAccounts();
+ this.accounts.clear();
+ for (const account of accounts) {
+ this.accounts.set(account.email, { email: account.email });
+ }
+ }
+
+ _getAccountEmails() {
+ return Array.from(this.accounts.keys());
+ }
+
+ _startSyncInterval() {
+ if (this.syncInterval) clearInterval(this.syncInterval);
+ this.syncInterval = setInterval(() => {
+ this.syncEvents()
+ .then(() => this.scheduleNextMeeting())
+ .catch((err) => debugLogger.error("Calendar sync failed", { error: err.message }, "gcal"));
+ }, this.SYNC_INTERVAL_MS);
+ }
+
+ _broadcastAccountsChanged() {
+ const accounts = this.getAccounts();
+ this.broadcastToWindows("gcal-connection-changed", { accounts });
+ }
+
+ async _apiGet(path, accountEmail = null) {
+ const accessToken = await this.oauth.getValidAccessToken(accountEmail);
const urlString = path.startsWith("http") ? path : `${CALENDAR_API_BASE}${path}`;
const url = new URL(urlString);
diff --git a/src/helpers/googleCalendarOAuth.js b/src/helpers/googleCalendarOAuth.js
index 60c4c26e5..f6565c9a4 100644
--- a/src/helpers/googleCalendarOAuth.js
+++ b/src/helpers/googleCalendarOAuth.js
@@ -170,9 +170,12 @@ class GoogleCalendarOAuth {
return this._httpsPost(GOOGLE_TOKEN_URL, body);
}
- async getValidAccessToken() {
- const tokens = this.databaseManager.getGoogleTokens();
- if (!tokens) throw new Error("No Google tokens found");
+ async getValidAccessToken(accountEmail = null) {
+ const tokens = accountEmail
+ ? this.databaseManager.getGoogleTokensByEmail(accountEmail)
+ : this.databaseManager.getGoogleTokens();
+ if (!tokens)
+ throw new Error(`No Google tokens found${accountEmail ? ` for ${accountEmail}` : ""}`);
const fiveMinutes = 5 * 60 * 1000;
if (tokens.expires_at - fiveMinutes < Date.now()) {
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index f30ffa5f2..fd66c9a0a 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -1792,7 +1792,10 @@ class IPCHandlers {
if (!tokenResponse.ok) {
const err = await tokenResponse.json().catch(() => ({}));
- return { success: false, error: err.error || `Token request failed: ${tokenResponse.status}` };
+ return {
+ success: false,
+ error: err.error || `Token request failed: ${tokenResponse.status}`,
+ };
}
const { clientSecret } = await tokenResponse.json();
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index ca88e8bb5..ee06ab098 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1477,6 +1477,7 @@
"upgradeTitle": "Auf Pro upgraden",
"upgradeDescription": "Unbegrenzte Transkriptionen und mehr.",
"learnMore": "Mehr erfahren",
+ "integrations": "Integrationen",
"defaultUser": "Benutzer",
"notSignedIn": "Nicht angemeldet"
},
@@ -1555,5 +1556,31 @@
"redirectTitle": "Weiterleitung zur App...",
"closeTab": "Du kannst diesen Tab schließen."
}
+ },
+ "integrations": {
+ "title": "Integrationen",
+ "description": "Verbinde Dienste, um deinen Workflow zu verbessern",
+ "googleCalendar": {
+ "title": "Google Calendar",
+ "description": "Verbinde deinen Kalender, um Besprechungsnotizen zu aktivieren. OpenWhispr erkennt Meetings und zeichnet mit Sprechererkennung auf — automatisch.",
+ "connect": "Google Calendar verbinden",
+ "connecting": "Verbinde...",
+ "connected": "Verbunden",
+ "addAnother": "Weiteren Kalender hinzufügen",
+ "disconnect": "Trennen",
+ "disconnectConfirm": "{{email}} trennen?",
+ "disconnectDescription": "Besprechungsnotizen werden von diesem Kalender nicht mehr aufgezeichnet."
+ },
+ "plan": {
+ "title": "Dein Plan",
+ "current": "Aktuell",
+ "free": "Kostenlos",
+ "freeLimit": "5 Meetings / Monat",
+ "essential": "Essential",
+ "essentialLimit": "20 Meetings / Monat",
+ "pro": "Pro",
+ "proLimit": "Unbegrenzt",
+ "upgrade": "Upgrade"
+ }
}
}
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 680745e79..adb344b6e 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -847,10 +847,6 @@
"description": "Dictation hotkey & activation",
"label": "Hotkeys"
},
- "calendar": {
- "label": "Calendar",
- "description": "Google Calendar integration"
- },
"transcription": {
"description": "Speech-to-text engine",
"label": "Transcription"
@@ -1277,6 +1273,7 @@
"upgradeTitle": "Upgrade to Pro",
"upgradeDescription": "Unlimited transcriptions and premium features.",
"learnMore": "Learn more",
+ "integrations": "Integrations",
"defaultUser": "User",
"notSignedIn": "Not signed in"
},
@@ -1590,5 +1587,31 @@
"redirectTitle": "Redirecting to app...",
"closeTab": "You can close this tab."
}
+ },
+ "integrations": {
+ "title": "Integrations",
+ "description": "Connect services to supercharge your workflow",
+ "googleCalendar": {
+ "title": "Google Calendar",
+ "description": "Connect your calendar to activate meeting notes. OpenWhispr detects meetings and records with speaker diarization — automatically.",
+ "connect": "Connect Google Calendar",
+ "connecting": "Connecting...",
+ "connected": "Connected",
+ "addAnother": "Add another calendar",
+ "disconnect": "Disconnect",
+ "disconnectConfirm": "Disconnect {{email}}?",
+ "disconnectDescription": "Meeting notes will no longer be recorded from this calendar."
+ },
+ "plan": {
+ "title": "Your Plan",
+ "current": "Current",
+ "free": "Free",
+ "freeLimit": "5 meetings / month",
+ "essential": "Essential",
+ "essentialLimit": "20 meetings / month",
+ "pro": "Pro",
+ "proLimit": "Unlimited",
+ "upgrade": "Upgrade"
+ }
}
}
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index 12b26d403..4e407a644 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -1481,6 +1481,7 @@
"upgradeTitle": "Mejorar a Pro",
"upgradeDescription": "Transcripciones ilimitadas y más.",
"learnMore": "Más información",
+ "integrations": "Integraciones",
"defaultUser": "Usuario",
"notSignedIn": "Sin sesión iniciada"
},
@@ -1559,5 +1560,31 @@
"redirectTitle": "Redirigiendo a la app...",
"closeTab": "Puedes cerrar esta pestaña."
}
+ },
+ "integrations": {
+ "title": "Integraciones",
+ "description": "Conecta servicios para potenciar tu flujo de trabajo",
+ "googleCalendar": {
+ "title": "Google Calendar",
+ "description": "Conecta tu calendario para activar notas de reuniones. OpenWhispr detecta reuniones y graba con diarización de hablantes — automáticamente.",
+ "connect": "Conectar Google Calendar",
+ "connecting": "Conectando...",
+ "connected": "Conectado",
+ "addAnother": "Añadir otro calendario",
+ "disconnect": "Desconectar",
+ "disconnectConfirm": "¿Desconectar {{email}}?",
+ "disconnectDescription": "Ya no se grabarán notas de reuniones de este calendario."
+ },
+ "plan": {
+ "title": "Tu Plan",
+ "current": "Actual",
+ "free": "Gratis",
+ "freeLimit": "5 reuniones / mes",
+ "essential": "Essential",
+ "essentialLimit": "20 reuniones / mes",
+ "pro": "Pro",
+ "proLimit": "Ilimitado",
+ "upgrade": "Mejorar"
+ }
}
}
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index a3495765b..cf32d2ff3 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1246,6 +1246,7 @@
"upgradeTitle": "Passer à Pro",
"upgradeDescription": "Transcriptions illimitées et fonctionnalités premium.",
"learnMore": "En savoir plus",
+ "integrations": "Intégrations",
"defaultUser": "Utilisateur",
"notSignedIn": "Non connecté"
},
@@ -1559,5 +1560,31 @@
"redirectTitle": "Redirection vers l'app...",
"closeTab": "Vous pouvez fermer cet onglet."
}
+ },
+ "integrations": {
+ "title": "Intégrations",
+ "description": "Connectez des services pour booster votre productivité",
+ "googleCalendar": {
+ "title": "Google Calendar",
+ "description": "Connectez votre calendrier pour activer les notes de réunion. OpenWhispr détecte vos réunions et enregistre avec diarisation — automatiquement.",
+ "connect": "Connecter Google Calendar",
+ "connecting": "Connexion...",
+ "connected": "Connecté",
+ "addAnother": "Ajouter un autre calendrier",
+ "disconnect": "Déconnecter",
+ "disconnectConfirm": "Déconnecter {{email}} ?",
+ "disconnectDescription": "Les notes de réunion ne seront plus enregistrées depuis ce calendrier."
+ },
+ "plan": {
+ "title": "Votre forfait",
+ "current": "Actuel",
+ "free": "Gratuit",
+ "freeLimit": "5 réunions / mois",
+ "essential": "Essential",
+ "essentialLimit": "20 réunions / mois",
+ "pro": "Pro",
+ "proLimit": "Illimité",
+ "upgrade": "Passer au supérieur"
+ }
}
}
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index e7377b6bb..bd966c66b 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1481,6 +1481,7 @@
"upgradeTitle": "Passa a Pro",
"upgradeDescription": "Trascrizioni illimitate e funzionalità avanzate.",
"learnMore": "Scopri di più",
+ "integrations": "Integrazioni",
"defaultUser": "Utente",
"notSignedIn": "Non hai effettuato l'accesso"
},
@@ -1559,5 +1560,31 @@
"redirectTitle": "Reindirizzamento all'app...",
"closeTab": "Puoi chiudere questa scheda."
}
+ },
+ "integrations": {
+ "title": "Integrazioni",
+ "description": "Collega servizi per potenziare il tuo flusso di lavoro",
+ "googleCalendar": {
+ "title": "Google Calendar",
+ "description": "Collega il tuo calendario per attivare le note delle riunioni. OpenWhispr rileva le riunioni e registra con diarizzazione dei parlanti — automaticamente.",
+ "connect": "Collega Google Calendar",
+ "connecting": "Connessione...",
+ "connected": "Connesso",
+ "addAnother": "Aggiungi un altro calendario",
+ "disconnect": "Disconnetti",
+ "disconnectConfirm": "Disconnettere {{email}}?",
+ "disconnectDescription": "Le note delle riunioni non saranno più registrate da questo calendario."
+ },
+ "plan": {
+ "title": "Il tuo Piano",
+ "current": "Attuale",
+ "free": "Gratis",
+ "freeLimit": "5 riunioni / mese",
+ "essential": "Essential",
+ "essentialLimit": "20 riunioni / mese",
+ "pro": "Pro",
+ "proLimit": "Illimitato",
+ "upgrade": "Aggiorna"
+ }
}
}
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index ee705c13e..0a210dfcf 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1477,6 +1477,7 @@
"upgradeTitle": "Pro にアップグレード",
"upgradeDescription": "無制限の文字起こしと最新の AI モデルをご利用いただけます。",
"learnMore": "詳しく見る",
+ "integrations": "連携",
"defaultUser": "ユーザー",
"notSignedIn": "未サインイン"
},
@@ -1555,5 +1556,31 @@
"redirectTitle": "アプリにリダイレクト中...",
"closeTab": "このタブを閉じてください。"
}
+ },
+ "integrations": {
+ "title": "連携",
+ "description": "サービスを接続してワークフローを強化",
+ "googleCalendar": {
+ "title": "Google カレンダー",
+ "description": "カレンダーを接続して会議メモを有効にします。OpenWhisprが会議を検出し、話者分離付きで自動的に録音します。",
+ "connect": "Google カレンダーを接続",
+ "connecting": "接続中...",
+ "connected": "接続済み",
+ "addAnother": "別のカレンダーを追加",
+ "disconnect": "切断",
+ "disconnectConfirm": "{{email}} を切断しますか?",
+ "disconnectDescription": "このカレンダーからの会議メモは記録されなくなります。"
+ },
+ "plan": {
+ "title": "プラン",
+ "current": "現在",
+ "free": "無料",
+ "freeLimit": "月5回の会議",
+ "essential": "Essential",
+ "essentialLimit": "月20回の会議",
+ "pro": "Pro",
+ "proLimit": "無制限",
+ "upgrade": "アップグレード"
+ }
}
}
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index 2aeb1a095..e3adb8bf4 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1481,6 +1481,7 @@
"upgradeTitle": "Fazer upgrade para Pro",
"upgradeDescription": "Transcrições ilimitadas e recursos avançados.",
"learnMore": "Saiba mais",
+ "integrations": "Integrações",
"defaultUser": "Usuário",
"notSignedIn": "Não conectado"
},
@@ -1559,5 +1560,31 @@
"redirectTitle": "Redirecionando para o app...",
"closeTab": "Você pode fechar esta aba."
}
+ },
+ "integrations": {
+ "title": "Integrações",
+ "description": "Conecte serviços para turbinar seu fluxo de trabalho",
+ "googleCalendar": {
+ "title": "Google Calendar",
+ "description": "Conecte seu calendário para ativar notas de reunião. O OpenWhispr detecta reuniões e grava com diarização de falantes — automaticamente.",
+ "connect": "Conectar Google Calendar",
+ "connecting": "Conectando...",
+ "connected": "Conectado",
+ "addAnother": "Adicionar outro calendário",
+ "disconnect": "Desconectar",
+ "disconnectConfirm": "Desconectar {{email}}?",
+ "disconnectDescription": "As notas de reunião não serão mais gravadas deste calendário."
+ },
+ "plan": {
+ "title": "Seu Plano",
+ "current": "Atual",
+ "free": "Grátis",
+ "freeLimit": "5 reuniões / mês",
+ "essential": "Essential",
+ "essentialLimit": "20 reuniões / mês",
+ "pro": "Pro",
+ "proLimit": "Ilimitado",
+ "upgrade": "Atualizar"
+ }
}
}
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index fc0de034e..c0f8a7f4f 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1481,6 +1481,7 @@
"upgradeTitle": "Перейдите на Pro",
"upgradeDescription": "Безлимитные транскрипции, транскрипция в реальном времени и многое другое.",
"learnMore": "Узнать больше",
+ "integrations": "Интеграции",
"defaultUser": "Пользователь",
"notSignedIn": "Не авторизован"
},
@@ -1559,5 +1560,31 @@
"redirectTitle": "Перенаправление в приложение...",
"closeTab": "Можете закрыть эту вкладку."
}
+ },
+ "integrations": {
+ "title": "Интеграции",
+ "description": "Подключите сервисы для улучшения рабочего процесса",
+ "googleCalendar": {
+ "title": "Google Calendar",
+ "description": "Подключите календарь для активации заметок встреч. OpenWhispr определяет встречи и записывает с диаризацией говорящих — автоматически.",
+ "connect": "Подключить Google Calendar",
+ "connecting": "Подключение...",
+ "connected": "Подключено",
+ "addAnother": "Добавить ещё один календарь",
+ "disconnect": "Отключить",
+ "disconnectConfirm": "Отключить {{email}}?",
+ "disconnectDescription": "Заметки встреч больше не будут записываться из этого календаря."
+ },
+ "plan": {
+ "title": "Ваш план",
+ "current": "Текущий",
+ "free": "Бесплатный",
+ "freeLimit": "5 встреч / месяц",
+ "essential": "Essential",
+ "essentialLimit": "20 встреч / месяц",
+ "pro": "Pro",
+ "proLimit": "Безлимитно",
+ "upgrade": "Улучшить"
+ }
}
}
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index 70ed09139..bc6d4651c 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1477,6 +1477,7 @@
"upgradeTitle": "升级到 Pro",
"upgradeDescription": "无限转录、实时转录等更多功能。",
"learnMore": "了解更多",
+ "integrations": "集成",
"defaultUser": "用户",
"notSignedIn": "未登录"
},
@@ -1555,5 +1556,31 @@
"redirectTitle": "正在跳转到应用...",
"closeTab": "您可以关闭此标签页。"
}
+ },
+ "integrations": {
+ "title": "集成",
+ "description": "连接服务以增强您的工作流程",
+ "googleCalendar": {
+ "title": "Google 日历",
+ "description": "连接日历以启用会议笔记。OpenWhispr 会自动检测会议并进行说话人分离录音。",
+ "connect": "连接 Google 日历",
+ "connecting": "连接中...",
+ "connected": "已连接",
+ "addAnother": "添加其他日历",
+ "disconnect": "断开",
+ "disconnectConfirm": "断开 {{email}}?",
+ "disconnectDescription": "将不再从此日历记录会议笔记。"
+ },
+ "plan": {
+ "title": "您的方案",
+ "current": "当前",
+ "free": "免费",
+ "freeLimit": "每月5次会议",
+ "essential": "Essential",
+ "essentialLimit": "每月20次会议",
+ "pro": "Pro",
+ "proLimit": "无限",
+ "upgrade": "升级"
+ }
}
}
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 7e1d69212..eeb50d962 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1477,6 +1477,7 @@
"upgradeTitle": "升級至 Pro",
"upgradeDescription": "無限轉錄、即時轉錄等更多功能。",
"learnMore": "瞭解更多",
+ "integrations": "整合",
"defaultUser": "使用者",
"notSignedIn": "尚未登入"
},
@@ -1555,5 +1556,31 @@
"redirectTitle": "正在跳轉到應用程式...",
"closeTab": "您可以關閉此分頁。"
}
+ },
+ "integrations": {
+ "title": "整合",
+ "description": "連接服務以增強您的工作流程",
+ "googleCalendar": {
+ "title": "Google 日曆",
+ "description": "連接日曆以啟用會議筆記。OpenWhispr 會自動偵測會議並進行說話者分離錄音。",
+ "connect": "連接 Google 日曆",
+ "connecting": "連接中...",
+ "connected": "已連接",
+ "addAnother": "新增其他日曆",
+ "disconnect": "中斷連接",
+ "disconnectConfirm": "中斷 {{email}} 的連接?",
+ "disconnectDescription": "將不再從此日曆記錄會議筆記。"
+ },
+ "plan": {
+ "title": "您的方案",
+ "current": "目前",
+ "free": "免費",
+ "freeLimit": "每月5次會議",
+ "essential": "Essential",
+ "essentialLimit": "每月20次會議",
+ "pro": "Pro",
+ "proLimit": "無限",
+ "upgrade": "升級"
+ }
}
}
diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.ts
index 4c19de687..518638a0a 100644
--- a/src/stores/settingsStore.ts
+++ b/src/stores/settingsStore.ts
@@ -5,6 +5,7 @@ import { hasStoredByokKey } from "../utils/byokDetection";
import { ensureAgentNameInDictionary } from "../utils/agentName";
import logger from "../utils/logger";
import type { LocalTranscriptionProvider } from "../types/electron";
+import type { GoogleCalendarAccount } from "../types/calendar";
import type {
TranscriptionSettings,
ReasoningSettings,
@@ -55,13 +56,12 @@ const BOOLEAN_SETTINGS = new Set([
"telemetryEnabled",
"audioCuesEnabled",
"floatingIconAutoHide",
- "gcalConnected",
"meetingProcessDetection",
"meetingAudioDetection",
"isSignedIn",
]);
-const ARRAY_SETTINGS = new Set(["customDictionary"]);
+const ARRAY_SETTINGS = new Set(["customDictionary", "gcalAccounts"]);
const LANGUAGE_MIGRATIONS: Record<string, string> = { zh: "zh-CN" };
@@ -87,6 +87,7 @@ export interface SettingsState
isSignedIn: boolean;
audioCuesEnabled: boolean;
floatingIconAutoHide: boolean;
+ gcalAccounts: GoogleCalendarAccount[];
gcalConnected: boolean;
gcalEmail: string;
meetingProcessDetection: boolean;
@@ -132,8 +133,7 @@ export interface SettingsState
setTelemetryEnabled: (value: boolean) => void;
setAudioCuesEnabled: (value: boolean) => void;
setFloatingIconAutoHide: (enabled: boolean) => void;
- setGcalConnected: (value: boolean) => void;
- setGcalEmail: (value: string) => void;
+ setGcalAccounts: (accounts: GoogleCalendarAccount[]) => void;
setMeetingProcessDetection: (value: boolean) => void;
setMeetingAudioDetection: (value: boolean) => void;
setIsSignedIn: (value: boolean) => void;
@@ -247,8 +247,20 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
telemetryEnabled: readBoolean("telemetryEnabled", false),
audioCuesEnabled: readBoolean("audioCuesEnabled", true),
floatingIconAutoHide: readBoolean("floatingIconAutoHide", false),
- gcalConnected: readBoolean("gcalConnected", false),
- gcalEmail: readString("gcalEmail", ""),
+ ...(() => {
+ let accounts: GoogleCalendarAccount[] = [];
+ try {
+ const parsed = JSON.parse(readString("gcalAccounts", "[]"));
+ if (Array.isArray(parsed)) accounts = parsed;
+ } catch {
+ /* use empty default */
+ }
+ return {
+ gcalAccounts: accounts,
+ gcalConnected: accounts.length > 0,
+ gcalEmail: accounts[0]?.email ?? "",
+ };
+ })(),
meetingProcessDetection: readBoolean("meetingProcessDetection", true),
meetingAudioDetection: readBoolean("meetingAudioDetection", true),
isSignedIn: readBoolean("isSignedIn", false),
@@ -384,8 +396,14 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
}
},
- setGcalConnected: createBooleanSetter("gcalConnected"),
- setGcalEmail: createStringSetter("gcalEmail"),
+ setGcalAccounts: (accounts: GoogleCalendarAccount[]) => {
+ if (isBrowser) localStorage.setItem("gcalAccounts", JSON.stringify(accounts));
+ useSettingsStore.setState({
+ gcalAccounts: accounts,
+ gcalConnected: accounts.length > 0,
+ gcalEmail: accounts[0]?.email ?? "",
+ });
+ },
setMeetingProcessDetection: createBooleanSetter("meetingProcessDetection"),
setMeetingAudioDetection: createBooleanSetter("meetingAudioDetection"),
@@ -627,6 +645,14 @@ export async function initializeSettings(): Promise<void> {
useSettingsStore.setState({ [key]: value });
+ if (key === "gcalAccounts" && Array.isArray(value)) {
+ const accounts = value as GoogleCalendarAccount[];
+ useSettingsStore.setState({
+ gcalConnected: accounts.length > 0,
+ gcalEmail: accounts[0]?.email ?? "",
+ });
+ }
+
if (key === "uiLanguage" && typeof value === "string") {
void i18n.changeLanguage(value);
}
diff --git a/src/types/calendar.ts b/src/types/calendar.ts
index 8fe4c01a8..329c34763 100644
--- a/src/types/calendar.ts
+++ b/src/types/calendar.ts
@@ -21,6 +21,10 @@ export interface CalendarEvent {
attendees_count: number;
}
+export interface GoogleCalendarAccount {
+ email: string;
+}
+
export interface CalendarConnectionStatus {
connected: boolean;
email: string | null;
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 8a72ba2a3..8a8ee8ee9 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -899,8 +899,12 @@ declare global {
// Google Calendar
gcalStartOAuth?: () => Promise<{ success: boolean; email?: string; error?: string }>;
- gcalDisconnect?: () => Promise<{ success: boolean; error?: string }>;
- gcalGetConnectionStatus?: () => Promise<{ connected: boolean; email: string | null }>;
+ gcalDisconnect?: (email?: string) => Promise<{ success: boolean; error?: string }>;
+ gcalGetConnectionStatus?: () => Promise<{
+ connected: boolean;
+ accounts: Array<{ email: string }>;
+ email: string | null;
+ }>;
gcalGetCalendars?: () => Promise<{ success: boolean; calendars: any[] }>;
gcalSetCalendarSelection?: (
calendarId: string,