Skip to content

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

feat(desktop): add notification settings with granular controls (#781)

Alcahest19b066c8b31a
diff --git a/preload.js b/preload.js
index 8448dcaa6..9f69254dd 100644
--- a/preload.js
+++ b/preload.js
@@ -846,6 +846,8 @@ contextBridge.exposeInMainWorld("electronAPI", {
meetingDetectionGetPreferences: () => ipcRenderer.invoke("meeting-detection-get-preferences"),
meetingDetectionSetPreferences: (prefs) =>
ipcRenderer.invoke("meeting-detection-set-preferences", prefs),
+ syncNotificationPreferences: (prefs) =>
+ ipcRenderer.invoke("sync-notification-preferences", prefs),
setSpeakerDiarizationEnabled: (enabled) =>
ipcRenderer.invoke("meeting-set-speaker-diarization-enabled", { enabled }),
setMeetingSessionSpeakerConfig: (config) =>
diff --git a/src/components/AcceptInvitationModal.tsx b/src/components/AcceptInvitationModal.tsx
index ea19ab201..16f7fadc0 100644
--- a/src/components/AcceptInvitationModal.tsx
+++ b/src/components/AcceptInvitationModal.tsx
@@ -61,7 +61,9 @@ export default function AcceptInvitationModal({ token, onClose, isSignedIn, onSi
setActive(result.workspace_id);
toast({
title: t("workspaces.accept.successTitle"),
- description: preview ? t("workspaces.accept.successDescription", { name: preview.workspace_name }) : undefined,
+ description: preview
+ ? t("workspaces.accept.successDescription", { name: preview.workspace_name })
+ : undefined,
});
onClose();
} catch (err) {
@@ -95,9 +97,7 @@ export default function AcceptInvitationModal({ token, onClose, isSignedIn, onSi
</DialogDescription>
)}
{error && <DialogDescription className="text-destructive">{error}</DialogDescription>}
- {loading && (
- <DialogDescription>{t("workspaces.accept.loading")}</DialogDescription>
- )}
+ {loading && <DialogDescription>{t("workspaces.accept.loading")}</DialogDescription>}
</DialogHeader>
<DialogFooter>
<Button variant="ghost" onClick={handleDecline} disabled={accepting}>
diff --git a/src/components/ControlPanelSidebar.tsx b/src/components/ControlPanelSidebar.tsx
index 21b7d2b55..bf4a9a44d 100644
--- a/src/components/ControlPanelSidebar.tsx
+++ b/src/components/ControlPanelSidebar.tsx
@@ -256,9 +256,7 @@ export default function ControlPanelSidebar({
{WORKSPACES_ENABLED && isSignedIn && (
<button
- onClick={() =>
- activeWorkspace ? setInviteOpen(true) : setCreateWorkspaceOpen(true)
- }
+ onClick={() => (activeWorkspace ? setInviteOpen(true) : setCreateWorkspaceOpen(true))}
aria-label={
activeWorkspace ? t("sidebar.inviteTeammate") : t("sidebar.createWorkspace")
}
diff --git a/src/components/InviteTeammateDialog.tsx b/src/components/InviteTeammateDialog.tsx
index 8e18b5faf..924da2637 100644
--- a/src/components/InviteTeammateDialog.tsx
+++ b/src/components/InviteTeammateDialog.tsx
@@ -98,9 +98,7 @@ export default function InviteTeammateDialog({
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-md">
<DialogHeader>
- <DialogTitle>
- {t("workspaces.invite.title", { workspace: workspaceName })}
- </DialogTitle>
+ <DialogTitle>{t("workspaces.invite.title", { workspace: workspaceName })}</DialogTitle>
<DialogDescription>{t("workspaces.invite.description")}</DialogDescription>
</DialogHeader>
<form onSubmit={handleSubmit} className="space-y-4">
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index 698374251..e53e440a1 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -708,6 +708,14 @@ export default function SettingsPage({
setTranscriptionMode,
remoteTranscriptionUrl,
setRemoteTranscriptionUrl,
+ notificationsEnabled,
+ setNotificationsEnabled,
+ notifyMeetingDetection,
+ setNotifyMeetingDetection,
+ notifyCalendarReminders,
+ setNotifyCalendarReminders,
+ notifyUpdates,
+ setNotifyUpdates,
audioCuesEnabled,
setAudioCuesEnabled,
pauseMediaOnDictation,
@@ -978,6 +986,15 @@ export default function SettingsPage({
loadAutoStart();
}, [platform]);
+ useEffect(() => {
+ window.electronAPI?.syncNotificationPreferences?.({
+ notificationsEnabled,
+ notifyMeetingDetection,
+ notifyCalendarReminders,
+ notifyUpdates,
+ });
+ }, [notificationsEnabled, notifyMeetingDetection, notifyCalendarReminders, notifyUpdates]);
+
const handleAutoStartChange = async (enabled: boolean) => {
if (window.electronAPI?.setAutoStartEnabled) {
try {
@@ -2357,6 +2374,67 @@ export default function SettingsPage({
</SettingsPanel>
</div>
+ {/* Notifications */}
+ <div>
+ <SectionHeader
+ title={t("settingsPage.general.notifications.title")}
+ description={t("settingsPage.general.notifications.description")}
+ />
+ <SettingsPanel>
+ <SettingsPanelRow>
+ <SettingsRow
+ label={t("settingsPage.general.notifications.disableAll")}
+ description={t("settingsPage.general.notifications.disableAllDescription")}
+ >
+ <Toggle
+ checked={!notificationsEnabled}
+ onChange={(v) => setNotificationsEnabled(!v)}
+ />
+ </SettingsRow>
+ </SettingsPanelRow>
+ <SettingsPanelRow>
+ <SettingsRow
+ label={t("settingsPage.general.notifications.meetingDetection")}
+ description={t(
+ "settingsPage.general.notifications.meetingDetectionDescription"
+ )}
+ >
+ <Toggle
+ checked={notifyMeetingDetection}
+ onChange={setNotifyMeetingDetection}
+ disabled={!notificationsEnabled}
+ />
+ </SettingsRow>
+ </SettingsPanelRow>
+ <SettingsPanelRow>
+ <SettingsRow
+ label={t("settingsPage.general.notifications.calendarReminders")}
+ description={t(
+ "settingsPage.general.notifications.calendarRemindersDescription"
+ )}
+ >
+ <Toggle
+ checked={notifyCalendarReminders}
+ onChange={setNotifyCalendarReminders}
+ disabled={!notificationsEnabled}
+ />
+ </SettingsRow>
+ </SettingsPanelRow>
+ <SettingsPanelRow>
+ <SettingsRow
+ label={t("settingsPage.general.notifications.updates")}
+ description={t("settingsPage.general.notifications.updatesDescription")}
+ >
+ <Toggle
+ checked={notifyUpdates}
+ onChange={setNotifyUpdates}
+ disabled={!notificationsEnabled}
+ />
+ </SettingsRow>
+ </SettingsPanelRow>
+ </SettingsPanel>
+ </div>
+
{/* Meeting Detection */}
<div>
<SectionHeader
diff --git a/src/components/WorkspaceSwitcher.tsx b/src/components/WorkspaceSwitcher.tsx
index 63f154bea..49a906d31 100644
--- a/src/components/WorkspaceSwitcher.tsx
+++ b/src/components/WorkspaceSwitcher.tsx
@@ -29,9 +29,7 @@ export default function WorkspaceSwitcher({ userName }: { userName?: string | nu
const [createOpen, setCreateOpen] = useState(false);
const label = active ? active.name : t("workspaces.switcher.personal");
- const initials = active
- ? workspaceInitials(active.name)
- : (userName?.[0]?.toUpperCase() ?? "P");
+ const initials = active ? workspaceInitials(active.name) : (userName?.[0]?.toUpperCase() ?? "P");
return (
<>
diff --git a/src/components/notes/NoteEditor.tsx b/src/components/notes/NoteEditor.tsx
index 2ec45cd00..92d420caf 100644
--- a/src/components/notes/NoteEditor.tsx
+++ b/src/components/notes/NoteEditor.tsx
@@ -980,11 +980,7 @@ export default function NoteEditor({
/>
)}
{SHARING_ENABLED && note.cloud_id && (
- <ShareNoteDialog
- open={shareDialogOpen}
- onOpenChange={setShareDialogOpen}
- note={note}
- />
+ <ShareNoteDialog open={shareDialogOpen} onOpenChange={setShareDialogOpen} note={note} />
)}
</div>
);
diff --git a/src/components/notes/ShareNoteDialog.tsx b/src/components/notes/ShareNoteDialog.tsx
index b3648e833..ce5978ba9 100644
--- a/src/components/notes/ShareNoteDialog.tsx
+++ b/src/components/notes/ShareNoteDialog.tsx
@@ -13,16 +13,9 @@ import { cn } from "../lib/utils";
import ShareVisibilityMenu from "./ShareVisibilityMenu";
import { useAuth } from "../../hooks/useAuth";
import { NoteSharingService } from "../../services/NoteSharingService.js";
-import {
- setShareCache,
- updateShareCache,
- useShareCacheEntry,
-} from "../../stores/noteStore";
+import { setShareCache, updateShareCache, useShareCacheEntry } from "../../stores/noteStore";
import { useLocalStorage } from "../../hooks/useLocalStorage";
-import {
- emailDomain,
- isPersonalEmailDomain,
-} from "../../utils/personalEmailDomains";
+import { emailDomain, isPersonalEmailDomain } from "../../utils/personalEmailDomains";
import type {
NoteItem,
NoteShareInvitation,
@@ -40,11 +33,7 @@ interface ShareNoteDialogProps {
note: NoteItem;
}
-export default function ShareNoteDialog({
- open,
- onOpenChange,
- note,
-}: ShareNoteDialogProps) {
+export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDialogProps) {
const { user } = useAuth();
const ownerName: string | null = user?.name ?? null;
const ownerEmail: string = user?.email ?? "";
@@ -143,7 +132,7 @@ export default function ShareNoteDialog({
? entry?.share.domain_allowlist.length
? entry.share.domain_allowlist
: [ownerDomain]
- : entry?.share.domain_allowlist ?? [],
+ : (entry?.share.domain_allowlist ?? []),
},
invitations: entry?.invitations ?? [],
rawToken: entry?.rawToken ?? null,
@@ -305,9 +294,7 @@ export default function ShareNoteDialog({
</Button>
</div>
- {inputError && (
- <p className="text-xs text-red-500/90 -mt-1">{inputError}</p>
- )}
+ {inputError && <p className="text-xs text-red-500/90 -mt-1">{inputError}</p>}
{/* Members list */}
<div className="flex flex-col gap-1.5 mt-1">
@@ -366,7 +353,11 @@ export default function ShareNoteDialog({
{/* Footer: visibility + copy link */}
<div className="flex items-center gap-2 pt-3 mt-1 border-t border-border/60">
<ShareVisibilityMenu
- value={(share?.visibility ?? "invited") === "private" ? "invited" : (share?.visibility ?? "invited")}
+ value={
+ (share?.visibility ?? "invited") === "private"
+ ? "invited"
+ : (share?.visibility ?? "invited")
+ }
ownerDomain={ownerDomain}
showDomainOption={Boolean(showDomainOption)}
disabled={!isOwner || loading || savingVisibility}
diff --git a/src/components/settings/WorkspaceBillingTab.tsx b/src/components/settings/WorkspaceBillingTab.tsx
index 2638dbc80..7b5ed85f0 100644
--- a/src/components/settings/WorkspaceBillingTab.tsx
+++ b/src/components/settings/WorkspaceBillingTab.tsx
@@ -105,10 +105,7 @@ export default function WorkspaceBillingTab({ workspace }: Props) {
</span>
</div>
<div className="h-1.5 rounded-full bg-foreground/5 dark:bg-white/5 overflow-hidden">
- <div
- className="h-full bg-primary/70 dark:bg-primary/80"
- style={{ width: `${pct}%` }}
- />
+ <div className="h-full bg-primary/70 dark:bg-primary/80" style={{ width: `${pct}%` }} />
</div>
</div>
diff --git a/src/components/settings/WorkspaceMembersTab.tsx b/src/components/settings/WorkspaceMembersTab.tsx
index 2a3e5bc91..0debf7b5e 100644
--- a/src/components/settings/WorkspaceMembersTab.tsx
+++ b/src/components/settings/WorkspaceMembersTab.tsx
@@ -119,10 +119,7 @@ export default function WorkspaceMembersTab({ workspace }: Props) {
<div className="rounded-lg border border-border/50 dark:border-border-subtle/70 divide-y divide-border/30 dark:divide-border-subtle/50 bg-card/50 dark:bg-surface-2/50">
{members.map((member) => (
- <div
- key={member.user_id}
- className="flex items-center gap-3 px-4 h-14"
- >
+ <div key={member.user_id} className="flex items-center gap-3 px-4 h-14">
{member.image ? (
<img
src={member.image}
diff --git a/src/components/settings/WorkspaceSection.tsx b/src/components/settings/WorkspaceSection.tsx
index f9bd813e9..03f8d7b1e 100644
--- a/src/components/settings/WorkspaceSection.tsx
+++ b/src/components/settings/WorkspaceSection.tsx
@@ -45,9 +45,7 @@ export default function WorkspaceSection({ initialSubTab }: Props) {
useWorkspaceStore();
const [tab, setTab] = useLocalStorage<WorkspaceTab>(
"settings.workspaceTab",
- (SUB_TABS.includes(initialSubTab as WorkspaceTab)
- ? (initialSubTab as WorkspaceTab)
- : "members")
+ SUB_TABS.includes(initialSubTab as WorkspaceTab) ? (initialSubTab as WorkspaceTab) : "members"
);
const [createOpen, setCreateOpen] = useState(false);
@@ -117,9 +115,7 @@ export default function WorkspaceSection({ initialSubTab }: Props) {
"hover:bg-foreground/5 dark:hover:bg-white/5 focus-visible:ring-1 focus-visible:ring-primary/30"
)}
>
- <h2 className="text-sm font-semibold text-foreground truncate">
- {workspace.name}
- </h2>
+ <h2 className="text-sm font-semibold text-foreground truncate">{workspace.name}</h2>
<span className="text-xs text-muted-foreground">▾</span>
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
@@ -160,9 +156,7 @@ export default function WorkspaceSection({ initialSubTab }: Props) {
className={cn(
"px-3 h-8 text-xs font-medium outline-none transition-colors relative",
"focus-visible:ring-1 focus-visible:ring-primary/30 rounded-md",
- tab === id
- ? "text-foreground"
- : "text-muted-foreground hover:text-foreground"
+ tab === id ? "text-foreground" : "text-muted-foreground hover:text-foreground"
)}
>
{t(`settingsPage.workspace.tab.${id}`)}
diff --git a/src/components/settings/WorkspaceTeamsTab.tsx b/src/components/settings/WorkspaceTeamsTab.tsx
index 0fc3a3e9e..cd5b18c09 100644
--- a/src/components/settings/WorkspaceTeamsTab.tsx
+++ b/src/components/settings/WorkspaceTeamsTab.tsx
@@ -7,13 +7,7 @@ import { Button } from "../ui/button";
import { Input } from "../ui/input";
import { Label } from "../ui/label";
import { useToast } from "../ui/useToast";
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogFooter,
-} from "../ui/dialog";
+import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "../ui/dialog";
import type { Workspace, Team } from "../../types/electron";
interface Props {
diff --git a/src/components/ui/Toast.tsx b/src/components/ui/Toast.tsx
index d4355ef3b..f0715c013 100644
--- a/src/components/ui/Toast.tsx
+++ b/src/components/ui/Toast.tsx
@@ -29,7 +29,7 @@ export const ToastProvider: React.FC<{ children: React.ReactNode }> = ({ childre
}, []);
const toast = React.useCallback(
- (props: Omit<ToastProps, "id">) => {
+ (props: Omit<ToastProps, "id">): string => {
const id = Math.random().toString(36).substring(2, 11);
const newToast: ToastState = { ...props, id, createdAt: Date.now() };
diff --git a/src/components/ui/useToast.ts b/src/components/ui/useToast.ts
index 19223bb89..08fe09c7a 100644
--- a/src/components/ui/useToast.ts
+++ b/src/components/ui/useToast.ts
@@ -11,7 +11,7 @@ export interface ToastProps {
}
export interface ToastContextType {
- toast: (props: Omit<ToastProps, "id">) => void;
+ toast: (props: Omit<ToastProps, "id">) => string;
dismiss: (id?: string) => void;
toastCount: number;
}
diff --git a/src/helpers/googleCalendarManager.js b/src/helpers/googleCalendarManager.js
index c5cc35687..bd094555f 100644
--- a/src/helpers/googleCalendarManager.js
+++ b/src/helpers/googleCalendarManager.js
@@ -296,14 +296,17 @@ class GoogleCalendarManager {
this.activeMeeting = event;
this.notifiedMeetings.add(event.id);
- const notif = new Notification({
- title: event.summary || "Meeting",
- body: "Meeting starting now",
- });
- notif.on("click", () => {
- this.broadcastToWindows("gcal-start-recording", { event });
- });
- notif.show();
+ const nPrefs = this.windowManager?.notificationPrefs || {};
+ if (nPrefs.notificationsEnabled !== false && nPrefs.notifyCalendarReminders !== false) {
+ const notif = new Notification({
+ title: event.summary || "Meeting",
+ body: "Meeting starting now",
+ });
+ notif.on("click", () => {
+ this.broadcastToWindows("gcal-start-recording", { event });
+ });
+ notif.show();
+ }
this.broadcastToWindows("gcal-meeting-starting", { event });
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 795f93906..18e3ff72f 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -7212,6 +7212,29 @@ class IPCHandlers {
}
});
+ const NOTIFICATION_PREF_KEYS = new Set([
+ "notificationsEnabled",
+ "notifyMeetingDetection",
+ "notifyCalendarReminders",
+ "notifyUpdates",
+ ]);
+
+ ipcMain.handle("sync-notification-preferences", async (_event, prefs) => {
+ try {
+ if (!prefs || typeof prefs !== "object") {
+ return { success: false, error: "Invalid preferences" };
+ }
+ for (const [k, v] of Object.entries(prefs)) {
+ if (NOTIFICATION_PREF_KEYS.has(k)) {
+ this.windowManager.notificationPrefs[k] = !!v;
+ }
+ }
+ return { success: true };
+ } catch (error) {
+ return { success: false, error: error.message };
+ }
+ });
+
ipcMain.handle("meeting-set-speaker-diarization-enabled", async (_event, payload) => {
try {
this.speakerDiarizationEnabled = payload?.enabled !== false;
diff --git a/src/helpers/meetingDetectionEngine.js b/src/helpers/meetingDetectionEngine.js
index 1b3ac9a26..c42a0fb87 100644
--- a/src/helpers/meetingDetectionEngine.js
+++ b/src/helpers/meetingDetectionEngine.js
@@ -141,14 +141,19 @@ class MeetingDetectionEngine {
detection.event = event;
}
- this.windowManager.showMeetingNotification({
- detectionId,
- source,
- key,
- title,
- body,
- event,
- });
+ const nPrefs = this.windowManager.notificationPrefs || {};
+ if (nPrefs.notificationsEnabled !== false && nPrefs.notifyMeetingDetection !== false) {
+ this.windowManager.showMeetingNotification({
+ detectionId,
+ source,
+ key,
+ title,
+ body,
+ event,
+ });
+ } else {
+ debugLogger.info("Meeting notification suppressed by user preference", {}, "meeting");
+ }
this.broadcastToWindows("meeting-detected", {
detectionId,
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index b25ea7375..deb25cc67 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -28,6 +28,12 @@ class WindowManager {
this.transcriptionPreviewWindow = null;
this.updateNotificationWindow = null;
this._updateNotificationDismissed = false;
+ this.notificationPrefs = {
+ notificationsEnabled: true,
+ notifyMeetingDetection: true,
+ notifyCalendarReminders: true,
+ notifyUpdates: true,
+ };
this.tray = null;
this.hotkeyManager = new HotkeyManager();
this.dragManager = new DragManager();
diff --git a/src/hooks/useSettings.ts b/src/hooks/useSettings.ts
index 2fb2aee66..29d706225 100644
--- a/src/hooks/useSettings.ts
+++ b/src/hooks/useSettings.ts
@@ -259,6 +259,14 @@ function useSettingsInternal() {
setTheme: store.setTheme,
activationMode: store.activationMode,
setActivationMode: store.setActivationMode,
+ notificationsEnabled: store.notificationsEnabled,
+ setNotificationsEnabled: store.setNotificationsEnabled,
+ notifyMeetingDetection: store.notifyMeetingDetection,
+ setNotifyMeetingDetection: store.setNotifyMeetingDetection,
+ notifyCalendarReminders: store.notifyCalendarReminders,
+ setNotifyCalendarReminders: store.setNotifyCalendarReminders,
+ notifyUpdates: store.notifyUpdates,
+ setNotifyUpdates: store.setNotifyUpdates,
audioCuesEnabled: store.audioCuesEnabled,
setAudioCuesEnabled: store.setAudioCuesEnabled,
pauseMediaOnDictation: store.pauseMediaOnDictation,
diff --git a/src/lib/features.ts b/src/lib/features.ts
index 3a221a391..262872849 100644
--- a/src/lib/features.ts
+++ b/src/lib/features.ts
@@ -1,5 +1,3 @@
-export const WORKSPACES_ENABLED =
- import.meta.env.VITE_WORKSPACES_ENABLED === "true";
+export const WORKSPACES_ENABLED = import.meta.env.VITE_WORKSPACES_ENABLED === "true";
-export const SHARING_ENABLED =
- import.meta.env.VITE_SHARING_ENABLED === "true";
+export const SHARING_ENABLED = import.meta.env.VITE_SHARING_ENABLED === "true";
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index dfadc9ef8..4a15c87f2 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1304,6 +1304,18 @@
"pauseMediaDescription": "Musik beim Starten der Diktat automatisch pausieren",
"title": "Soundeffekte"
},
+ "notifications": {
+ "title": "Benachrichtigungen",
+ "description": "Legen Sie fest, welche Benachrichtigungen OpenWhispr anzeigen darf",
+ "disableAll": "Alle Benachrichtigungen deaktivieren",
+ "disableAllDescription": "Alles stummschalten außer Fehlermeldungen",
+ "meetingDetection": "Meeting-Erkennung",
+ "meetingDetectionDescription": "Benachrichtigen, wenn ein Meeting erkannt wird, um die Aufnahme zu starten",
+ "calendarReminders": "Kalendererinnerungen",
+ "calendarRemindersDescription": "Benachrichtigen, wenn ein geplantes Meeting bald beginnt",
+ "updates": "App-Updates",
+ "updatesDescription": "Benachrichtigen, wenn eine neue Version verfügbar ist"
+ },
"clipboard": {
"title": "Zwischenablage",
"autoPaste": "Automatisches Einfügen",
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 3904f1971..657224626 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -1485,6 +1485,18 @@
"pauseMediaDescription": "Automatically pause music when dictation starts",
"title": "Sound Effects"
},
+ "notifications": {
+ "title": "Notifications",
+ "description": "Control which notifications OpenWhispr can show",
+ "disableAll": "Disable all notifications",
+ "disableAllDescription": "Silence everything except error messages",
+ "meetingDetection": "Meeting detection",
+ "meetingDetectionDescription": "Notify when a meeting is detected so you can start recording",
+ "calendarReminders": "Calendar reminders",
+ "calendarRemindersDescription": "Notify when a scheduled meeting is about to start",
+ "updates": "App updates",
+ "updatesDescription": "Notify when a new version is available"
+ },
"clipboard": {
"title": "Clipboard",
"autoPaste": "Automatic pasting",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index 17568c558..e0bd83a87 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -1352,6 +1352,18 @@
"pauseMediaDescription": "Pausar la música automáticamente al iniciar el dictado",
"title": "Efectos de sonido"
},
+ "notifications": {
+ "title": "Notificaciones",
+ "description": "Controla qué notificaciones puede mostrar OpenWhispr",
+ "disableAll": "Desactivar todas las notificaciones",
+ "disableAllDescription": "Silenciar todo excepto los mensajes de error",
+ "meetingDetection": "Detección de reuniones",
+ "meetingDetectionDescription": "Notificar cuando se detecta una reunión para iniciar la grabación",
+ "calendarReminders": "Recordatorios del calendario",
+ "calendarRemindersDescription": "Notificar cuando una reunión programada está a punto de comenzar",
+ "updates": "Actualizaciones",
+ "updatesDescription": "Notificar cuando hay una nueva versión disponible"
+ },
"clipboard": {
"title": "Portapapeles",
"autoPaste": "Pegado automático",
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 8b1152000..3515b3758 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1352,6 +1352,18 @@
"pauseMediaDescription": "Mettre automatiquement la musique en pause au début de la dictée",
"title": "Effets sonores"
},
+ "notifications": {
+ "title": "Notifications",
+ "description": "Choisissez les notifications qu'OpenWhispr peut afficher",
+ "disableAll": "Désactiver toutes les notifications",
+ "disableAllDescription": "Tout couper sauf les messages d'erreur",
+ "meetingDetection": "Détection de réunion",
+ "meetingDetectionDescription": "Prévenir quand une réunion est détectée pour lancer l'enregistrement",
+ "calendarReminders": "Rappels de calendrier",
+ "calendarRemindersDescription": "Prévenir quand une réunion planifiée va commencer",
+ "updates": "Mises à jour",
+ "updatesDescription": "Prévenir quand une nouvelle version est disponible"
+ },
"clipboard": {
"title": "Presse-papiers",
"autoPaste": "Collage automatique",
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 6e32ed96a..2298659a4 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1304,6 +1304,18 @@
"pauseMediaDescription": "Metti automaticamente in pausa la musica quando inizia la dettatura",
"title": "Effetti sonori"
},
+ "notifications": {
+ "title": "Notifiche",
+ "description": "Scegli quali notifiche OpenWhispr può mostrare",
+ "disableAll": "Disattiva tutte le notifiche",
+ "disableAllDescription": "Silenzia tutto tranne i messaggi di errore",
+ "meetingDetection": "Rilevamento riunioni",
+ "meetingDetectionDescription": "Avvisa quando viene rilevata una riunione per avviare la registrazione",
+ "calendarReminders": "Promemoria calendario",
+ "calendarRemindersDescription": "Avvisa quando una riunione programmata sta per iniziare",
+ "updates": "Aggiornamenti app",
+ "updatesDescription": "Avvisa quando è disponibile una nuova versione"
+ },
"clipboard": {
"title": "Appunti",
"autoPaste": "Incollaggio automatico",
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index 599c96785..2fd0ac9f7 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1304,6 +1304,18 @@
"pauseMediaDescription": "ディクテーション開始時に音楽を自動的に一時停止",
"title": "サウンドエフェクト"
},
+ "notifications": {
+ "title": "通知",
+ "description": "OpenWhispr が表示できる通知を設定します",
+ "disableAll": "すべての通知を無効にする",
+ "disableAllDescription": "エラーメッセージ以外をすべて消音にする",
+ "meetingDetection": "会議の検出",
+ "meetingDetectionDescription": "会議が検出されたときに通知して録音を開始できるようにする",
+ "calendarReminders": "カレンダーリマインダー",
+ "calendarRemindersDescription": "予定された会議がまもなく始まるときに通知する",
+ "updates": "アプリの更新",
+ "updatesDescription": "新しいバージョンが利用可能になったときに通知する"
+ },
"clipboard": {
"title": "クリップボード",
"autoPaste": "自動貼り付け",
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index a660ff660..32dc7a39e 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1276,6 +1276,18 @@
"pauseMediaDescription": "Pausar a música automaticamente ao iniciar o ditado",
"title": "Efeitos sonoros"
},
+ "notifications": {
+ "title": "Notificações",
+ "description": "Controle quais notificações o OpenWhispr pode mostrar",
+ "disableAll": "Desativar todas as notificações",
+ "disableAllDescription": "Silenciar tudo exceto mensagens de erro",
+ "meetingDetection": "Detecção de reuniões",
+ "meetingDetectionDescription": "Notificar quando uma reunião for detectada para iniciar a gravação",
+ "calendarReminders": "Lembretes do calendário",
+ "calendarRemindersDescription": "Notificar quando uma reunião agendada está prestes a começar",
+ "updates": "Atualizações do app",
+ "updatesDescription": "Notificar quando uma nova versão estiver disponível"
+ },
"clipboard": {
"title": "Área de transferência",
"autoPaste": "Colagem automática",
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index 10ab9d9c5..1ed086a2b 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1304,6 +1304,18 @@
"pauseMediaDescription": "Автоматически приостанавливать музыку при начале диктовки",
"title": "Звуковые эффекты"
},
+ "notifications": {
+ "title": "Уведомления",
+ "description": "Настройте, какие уведомления может показывать OpenWhispr",
+ "disableAll": "Отключить все уведомления",
+ "disableAllDescription": "Отключить всё, кроме сообщений об ошибках",
+ "meetingDetection": "Обнаружение встреч",
+ "meetingDetectionDescription": "Уведомлять при обнаружении встречи для начала записи",
+ "calendarReminders": "Напоминания календаря",
+ "calendarRemindersDescription": "Уведомлять, когда запланированная встреча скоро начнётся",
+ "updates": "Обновления приложения",
+ "updatesDescription": "Уведомлять о доступности новой версии"
+ },
"clipboard": {
"title": "Буфер обмена",
"autoPaste": "Автоматическая вставка",
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index eb7683415..c3abc9c8e 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1072,12 +1072,7 @@
"annualEquivalent": "$16.67",
"includesPrefix": "所有 Pro 功能 +",
"badge": "最受欢迎",
- "features": [
- "无限会议录制",
- "代理模式",
- "与您的数据对话",
- "优先支持"
- ],
+ "features": ["无限会议录制", "代理模式", "与您的数据对话", "优先支持"],
"cta": "开始使用",
"switchToAnnual": "切换为年付"
},
@@ -1304,6 +1299,18 @@
"pauseMediaDescription": "开始听写时自动暂停音乐",
"title": "音效"
},
+ "notifications": {
+ "title": "通知",
+ "description": "设置 OpenWhispr 可以显示哪些通知",
+ "disableAll": "禁用所有通知",
+ "disableAllDescription": "静音除错误消息外的所有内容",
+ "meetingDetection": "会议检测",
+ "meetingDetectionDescription": "检测到会议时通知您以便开始录音",
+ "calendarReminders": "日历提醒",
+ "calendarRemindersDescription": "预定会议即将开始时通知您",
+ "updates": "应用更新",
+ "updatesDescription": "有新版本可用时通知您"
+ },
"clipboard": {
"title": "剪贴板",
"autoPaste": "自动粘贴",
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 942f1cc59..a1c45e26f 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1072,12 +1072,7 @@
"annualEquivalent": "$16.67",
"includesPrefix": "所有 Pro 功能 +",
"badge": "最熱門",
- "features": [
- "無限會議錄製",
- "代理模式",
- "與您的資料對話",
- "優先支援"
- ],
+ "features": ["無限會議錄製", "代理模式", "與您的資料對話", "優先支援"],
"cta": "開始使用",
"switchToAnnual": "切換為年付"
},
@@ -1304,6 +1299,18 @@
"pauseMediaDescription": "開始聽寫時自動暫停音樂",
"title": "音效"
},
+ "notifications": {
+ "title": "通知",
+ "description": "設定 OpenWhispr 可以顯示哪些通知",
+ "disableAll": "停用所有通知",
+ "disableAllDescription": "靜音除錯誤訊息外的所有內容",
+ "meetingDetection": "會議偵測",
+ "meetingDetectionDescription": "偵測到會議時通知您以便開始錄音",
+ "calendarReminders": "行事曆提醒",
+ "calendarRemindersDescription": "預定會議即將開始時通知您",
+ "updates": "應用程式更新",
+ "updatesDescription": "有新版本可用時通知您"
+ },
"clipboard": {
"title": "剪貼簿",
"autoPaste": "自動貼上",
diff --git a/src/services/NoteSharingService.ts b/src/services/NoteSharingService.ts
index 6a4eb3f1e..850b3bc41 100644
--- a/src/services/NoteSharingService.ts
+++ b/src/services/NoteSharingService.ts
@@ -1,9 +1,5 @@
import { cloudGet, cloudPost, cloudPatch, cloudDelete } from "./cloudApi.js";
-import type {
- NoteShareInvitation,
- ShareSettings,
- ShareVisibility,
-} from "../types/electron";
+import type { NoteShareInvitation, ShareSettings, ShareVisibility } from "../types/electron";
export interface ShareStateResponse {
share: ShareSettings;
@@ -63,9 +59,7 @@ async function inviteEmails(
}
async function revokeInvite(cloudNoteId: string, invitationId: string): Promise<void> {
- await cloudDelete(
- sharePath(cloudNoteId, `/invitations/${encodeURIComponent(invitationId)}`)
- );
+ await cloudDelete(sharePath(cloudNoteId, `/invitations/${encodeURIComponent(invitationId)}`));
}
async function resendInvite(
diff --git a/src/services/WorkspacesService.ts b/src/services/WorkspacesService.ts
index 10bec45ef..cd8be8fca 100644
--- a/src/services/WorkspacesService.ts
+++ b/src/services/WorkspacesService.ts
@@ -33,9 +33,7 @@ async function remove(workspaceId: string): Promise<void> {
}
async function listMembers(workspaceId: string): Promise<WorkspaceMember[]> {
- const res = await cloudGet<DataWrap<WorkspaceMember[]>>(
- `/api/workspaces/${workspaceId}/members`
- );
+ const res = await cloudGet<DataWrap<WorkspaceMember[]>>(`/api/workspaces/${workspaceId}/members`);
return res.data;
}
diff --git a/src/stores/noteStore.ts b/src/stores/noteStore.ts
index ecab6c8b4..23df641a6 100644
--- a/src/stores/noteStore.ts
+++ b/src/stores/noteStore.ts
@@ -231,7 +231,5 @@ export function clearShareCache(cloudId: string): void {
}
export function useShareCacheEntry(cloudId: string | null): NoteShareCacheEntry | null {
- return useNoteStore((state) =>
- cloudId ? state.shareByCloudId.get(cloudId) ?? null : null
- );
+ return useNoteStore((state) => (cloudId ? (state.shareByCloudId.get(cloudId) ?? null) : null));
}
diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.ts
index 403780a1b..c388a19c2 100644
--- a/src/stores/settingsStore.ts
+++ b/src/stores/settingsStore.ts
@@ -132,6 +132,10 @@ const BOOLEAN_SETTINGS = new Set([
"dictationAgentDisableThinking",
"noteFormattingDisableThinking",
"chatAgentDisableThinking",
+ "notificationsEnabled",
+ "notifyMeetingDetection",
+ "notifyCalendarReminders",
+ "notifyUpdates",
"gcalPrimaryOnly",
]);
@@ -356,6 +360,10 @@ export interface SettingsState
gcalAccounts: GoogleCalendarAccount[];
gcalConnected: boolean;
gcalEmail: string;
+ notificationsEnabled: boolean;
+ notifyMeetingDetection: boolean;
+ notifyCalendarReminders: boolean;
+ notifyUpdates: boolean;
gcalPrimaryOnly: boolean;
meetingProcessDetection: boolean;
meetingAudioDetection: boolean;
@@ -536,6 +544,10 @@ export interface SettingsState
setFloatingIconAutoHide: (enabled: boolean) => void;
setStartMinimized: (enabled: boolean) => void;
setGcalAccounts: (accounts: GoogleCalendarAccount[]) => void;
+ setNotificationsEnabled: (value: boolean) => void;
+ setNotifyMeetingDetection: (value: boolean) => void;
+ setNotifyCalendarReminders: (value: boolean) => void;
+ setNotifyUpdates: (value: boolean) => void;
setGcalPrimaryOnly: (value: boolean) => void;
setMeetingProcessDetection: (value: boolean) => void;
setMeetingAudioDetection: (value: boolean) => void;
@@ -761,6 +773,10 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
pauseMediaOnDictation: readBoolean("pauseMediaOnDictation", false),
floatingIconAutoHide: readBoolean("floatingIconAutoHide", false),
startMinimized: readBoolean("startMinimized", false),
+ notificationsEnabled: readBoolean("notificationsEnabled", true),
+ notifyMeetingDetection: readBoolean("notifyMeetingDetection", true),
+ notifyCalendarReminders: readBoolean("notifyCalendarReminders", true),
+ notifyUpdates: readBoolean("notifyUpdates", true),
...(() => {
let accounts: GoogleCalendarAccount[] = [];
try {
@@ -1225,6 +1241,10 @@ export const useSettingsStore = create<SettingsState>()((set, get) => ({
gcalEmail: accounts[0]?.email ?? "",
});
},
+ setNotificationsEnabled: createBooleanSetter("notificationsEnabled"),
+ setNotifyMeetingDetection: createBooleanSetter("notifyMeetingDetection"),
+ setNotifyCalendarReminders: createBooleanSetter("notifyCalendarReminders"),
+ setNotifyUpdates: createBooleanSetter("notifyUpdates"),
setGcalPrimaryOnly: (value: boolean) => {
if (isBrowser) localStorage.setItem("gcalPrimaryOnly", String(value));
useSettingsStore.setState({ gcalPrimaryOnly: value });
@@ -1792,6 +1812,22 @@ export async function initializeSettings(): Promise<void> {
);
}
+ try {
+ const currentState = useSettingsStore.getState();
+ await window.electronAPI.syncNotificationPreferences?.({
+ notificationsEnabled: currentState.notificationsEnabled,
+ notifyMeetingDetection: currentState.notifyMeetingDetection,
+ notifyCalendarReminders: currentState.notifyCalendarReminders,
+ notifyUpdates: currentState.notifyUpdates,
+ });
+ } catch (err) {
+ logger.warn(
+ "Failed to sync notification preferences on startup",
+ { error: (err as Error).message },
+ "settings"
+ );
+ }
+
try {
const currentState = useSettingsStore.getState();
await window.electronAPI.gcalSetPrimaryOnly?.(currentState.gcalPrimaryOnly);
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 5d8c10f64..9fc89d78c 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -1698,6 +1698,9 @@ declare global {
meetingDetectionSetPreferences?: (
prefs: Record<string, boolean>
) => Promise<{ success: boolean }>;
+ syncNotificationPreferences?: (
+ prefs: Record<string, boolean>
+ ) => Promise<{ success: boolean }>;
setSpeakerDiarizationEnabled?: (
enabled: boolean
) => Promise<{ success: boolean; error?: string }>;
diff --git a/src/updater.js b/src/updater.js
index 409c9a161..409971fc1 100644
--- a/src/updater.js
+++ b/src/updater.js
@@ -91,7 +91,10 @@ class UpdateManager {
};
}
this.notifyRenderers("update-available", info);
- if (this.windowManager && info && !this._suppressNotification) {
+ const nPrefs = this.windowManager?.notificationPrefs || {};
+ const notifAllowed =
+ nPrefs.notificationsEnabled !== false && nPrefs.notifyUpdates !== false;
+ if (this.windowManager && info && !this._suppressNotification && notifAllowed) {
this.windowManager.showUpdateNotification(info).catch((err) => {
console.error("Failed to show update notification:", err);
});
diff --git a/src/utils/serverUtils.js b/src/utils/serverUtils.js
index d14d4c9f0..57683e6e3 100644
--- a/src/utils/serverUtils.js
+++ b/src/utils/serverUtils.js
@@ -15,7 +15,11 @@ function tryBind(port, host) {
}
async function isPortAvailable(port) {
- return (await tryBind(port, "0.0.0.0")) && (await tryBind(port, "::")) && (await tryBind(port, "127.0.0.1"));
+ return (
+ (await tryBind(port, "0.0.0.0")) &&
+ (await tryBind(port, "::")) &&
+ (await tryBind(port, "127.0.0.1"))
+ );
}
async function findAvailablePort(rangeStart, rangeEnd) {