Skip to content

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

feat: meeting mode back button, window restore, and upcoming meetings

Gabriel Stein01e747b71c3e
diff --git a/main.js b/main.js
index 923cd4d28..583304831 100644
--- a/main.js
+++ b/main.js
@@ -493,12 +493,19 @@ async function startApp() {
// screen source with loopback audio so no system picker dialog is shown.
const { desktopCapturer } = require("electron");
session.defaultSession.setDisplayMediaRequestHandler(async (_request, callback) => {
- const sources = await desktopCapturer.getSources({ types: ["screen"] });
- if (!sources.length) {
+ try {
+ const sources = await desktopCapturer.getSources({ types: ["screen"] });
+ debugLogger.debug("Display media sources", { count: sources.length, names: sources.map((s) => s.name) });
+ if (!sources.length) {
+ debugLogger.error("No screen sources available — Screen Recording permission may be denied");
+ callback({});
+ return;
+ }
+ callback({ video: sources[0], audio: "loopback" });
+ } catch (err) {
+ debugLogger.error("Display media handler error", { error: err.message });
callback({});
- return;
}
- callback({ video: sources[0], audio: "loopback" });
});
windowManager.setActivationModeCache(environmentManager.getActivationMode());
diff --git a/preload.js b/preload.js
index 45e1a5120..a872e1b8e 100644
--- a/preload.js
+++ b/preload.js
@@ -208,6 +208,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
windowMaximize: () => ipcRenderer.invoke("window-maximize"),
windowClose: () => ipcRenderer.invoke("window-close"),
windowIsMaximized: () => ipcRenderer.invoke("window-is-maximized"),
+ restoreFromMeetingMode: () => ipcRenderer.invoke("restore-from-meeting-mode"),
getPlatform: () => process.platform,
appQuit: () => ipcRenderer.invoke("app-quit"),
diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsx
index a6ad9407b..02567023a 100644
--- a/src/components/ControlPanel.tsx
+++ b/src/components/ControlPanel.tsx
@@ -1,7 +1,7 @@
import React, { Suspense, useState, useEffect, useRef, useCallback } from "react";
import { useTranslation } from "react-i18next";
import { Button } from "./ui/button";
-import { Download, RefreshCw, Loader2, AlertTriangle, Zap, ArrowLeft } from "lucide-react";
+import { Download, RefreshCw, Loader2, AlertTriangle, Zap, ChevronLeft } from "lucide-react";
import UpgradePrompt from "./UpgradePrompt";
import { ConfirmDialog, AlertDialog } from "./ui/dialog";
import { useDialogs } from "../hooks/useDialogs";
@@ -18,7 +18,7 @@ import {
} from "../stores/transcriptionStore";
import ControlPanelSidebar, { type ControlPanelView } from "./ControlPanelSidebar";
import WindowControls from "./WindowControls";
-import { cn } from "./lib/utils";
+
import { getCachedPlatform } from "../utils/platform";
import { setActiveNoteId, setActiveFolderId } from "../stores/noteStore";
import HistoryView from "./HistoryView";
@@ -203,6 +203,11 @@ export default function ControlPanel() {
[]
);
+ const handleExitMeetingMode = useCallback(() => {
+ setIsMeetingMode(false);
+ window.electronAPI?.restoreFromMeetingMode?.();
+ }, []);
+
const loadTranscriptions = async () => {
try {
setIsLoading(true);
@@ -425,25 +430,26 @@ export default function ControlPanel() {
</div>
<main className="flex-1 flex flex-col overflow-hidden">
<div
- className={cn(
- "flex items-center w-full h-10 shrink-0",
- isMeetingMode ? "justify-between" : "justify-end"
- )}
+ className="flex items-center justify-between w-full h-10 shrink-0"
style={{ WebkitAppRegion: "drag" } as React.CSSProperties}
>
{isMeetingMode && (
- <button
- onClick={() => setIsMeetingMode(false)}
- className={cn(
- "flex items-center gap-1 text-xs font-medium text-muted-foreground/70 hover:text-foreground transition-colors",
- platform === "darwin" ? "ml-19" : "ml-3"
- )}
+ <div
+ className={platform === "darwin" ? "ml-[84px] mt-[12px]" : "ml-2"}
style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}
>
- <ArrowLeft size={13} strokeWidth={2} />
- {t("notes.meeting.back")}
- </button>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={handleExitMeetingMode}
+ className="h-7 px-2 gap-1"
+ >
+ <ChevronLeft size={14} strokeWidth={2} />
+ <span className="text-xs">Back to notes</span>
+ </Button>
+ </div>
)}
+ <div className="flex-1" />
{platform !== "darwin" && (
<div className="pr-1" style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}>
<WindowControls />
diff --git a/src/components/HistoryView.tsx b/src/components/HistoryView.tsx
index 504c8e240..cafc3296a 100644
--- a/src/components/HistoryView.tsx
+++ b/src/components/HistoryView.tsx
@@ -1,11 +1,14 @@
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { Button } from "./ui/button";
-import { Loader2, Sparkles, Cloud, X } from "lucide-react";
+import { Loader2, Sparkles, Cloud, X, Mic } from "lucide-react";
import TranscriptionItem from "./ui/TranscriptionItem";
import type { TranscriptionItem as TranscriptionItemType } from "../types/electron";
import { formatHotkeyLabel } from "../utils/hotkeys";
import { formatDateGroup } from "../utils/dateFormatting";
+import { cn } from "./lib/utils";
+import { useUpcomingEvents } from "../hooks/useUpcomingEvents";
+import UpcomingMeetings from "./UpcomingMeetings";
interface HistoryViewProps {
history: TranscriptionItemType[];
@@ -35,6 +38,7 @@ export default function HistoryView({
onOpenSettings,
}: HistoryViewProps) {
const { t } = useTranslation();
+ const { events, isLoading: eventsLoading, isConnected } = useUpcomingEvents();
const groupedHistory = useMemo(() => {
if (history.length === 0) return [];
@@ -58,7 +62,7 @@ export default function HistoryView({
return (
<div className="px-4 pt-4 pb-6">
- <div className="max-w-3xl mx-auto">
+ <div className={cn("mx-auto", isConnected ? "max-w-5xl" : "max-w-3xl")}>
{showCloudMigrationBanner && (
<div className="mb-3 relative rounded-lg border border-primary/20 bg-primary/5 dark:bg-primary/10 p-3">
<button
@@ -135,135 +139,155 @@ export default function HistoryView({
</div>
)}
- {isLoading ? (
- <div className="rounded-lg border border-border bg-card/50 dark:bg-card/60 backdrop-blur-sm">
- <div className="flex items-center justify-center gap-2 py-8">
- <Loader2 size={14} className="animate-spin text-primary" />
- <span className="text-sm text-muted-foreground">{t("controlPanel.loading")}</span>
- </div>
- </div>
- ) : history.length === 0 ? (
- <div className="rounded-lg border border-border bg-card/50 dark:bg-card/60 backdrop-blur-sm">
- <div className="flex flex-col items-center justify-center py-16 px-4">
- <svg
- className="text-foreground dark:text-white mb-5"
- width="64"
- height="64"
- viewBox="0 0 64 64"
- fill="none"
- >
- <rect
- x="24"
- y="6"
- width="16"
- height="28"
- rx="8"
- fill="currentColor"
- fillOpacity={0.04}
- stroke="currentColor"
- strokeOpacity={0.1}
- />
- <rect
- x="28"
- y="12"
- width="8"
- height="3"
- rx="1.5"
- fill="currentColor"
- fillOpacity={0.06}
- />
- <path
- d="M18 28c0 7.7 6.3 14 14 14s14-6.3 14-14"
- fill="none"
- stroke="currentColor"
- strokeOpacity={0.07}
- strokeWidth={1.5}
- strokeLinecap="round"
- />
- <line
- x1="32"
- y1="42"
- x2="32"
- y2="50"
- stroke="currentColor"
- strokeOpacity={0.07}
- strokeWidth={1.5}
- strokeLinecap="round"
- />
- <line
- x1="26"
- y1="50"
- x2="38"
- y2="50"
- stroke="currentColor"
- strokeOpacity={0.07}
- strokeWidth={1.5}
- strokeLinecap="round"
- />
- <path
- d="M12 20a2 2 0 0 1 0 8"
- stroke="currentColor"
- strokeOpacity={0.04}
- strokeWidth={1.5}
- strokeLinecap="round"
- />
- <path
- d="M8 18a2 2 0 0 1 0 12"
- stroke="currentColor"
- strokeOpacity={0.03}
- strokeWidth={1.5}
- strokeLinecap="round"
- />
- <path
- d="M52 20a2 2 0 0 0 0 8"
- stroke="currentColor"
- strokeOpacity={0.04}
- strokeWidth={1.5}
- strokeLinecap="round"
- />
- <path
- d="M56 18a2 2 0 0 0 0 12"
- stroke="currentColor"
- strokeOpacity={0.03}
- strokeWidth={1.5}
- strokeLinecap="round"
- />
- </svg>
- <h3 className="text-xs font-semibold text-foreground/70 dark:text-foreground/60 mb-2">
- {t("controlPanel.history.empty")}
- </h3>
- <div className="flex items-center gap-2 text-xs text-foreground/50 dark:text-foreground/25">
- <span>{t("controlPanel.history.press")}</span>
- <kbd className="inline-flex items-center h-5 px-1.5 rounded-sm bg-surface-1 dark:bg-white/6 border border-border/50 text-xs font-mono font-medium text-foreground/60 dark:text-foreground/40">
- {formatHotkeyLabel(hotkey)}
- </kbd>
- <span>{t("controlPanel.history.toStart")}</span>
+ <div className={cn(isConnected ? "flex gap-6" : "")}>
+ <div className={cn("min-w-0", isConnected ? "flex-1" : "w-full")}>
+ {isConnected && (
+ <div className="flex items-center gap-1.5 pb-2.5">
+ <Mic size={12} className="text-muted-foreground" />
+ <span className="text-[11px] font-semibold text-muted-foreground uppercase tracking-wide">
+ {t("upcoming.transcriptions")}
+ </span>
</div>
- </div>
- </div>
- ) : (
- <div>
- {groupedHistory.map((group, index) => (
- <div key={group.label} className={index > 0 ? "mt-4" : ""}>
- <div className="sticky -top-1 z-10 -mx-4 px-5 pt-2 pb-2 bg-background">
- <span className="text-[11px] font-semibold text-muted-foreground dark:text-muted-foreground uppercase tracking-wide">
- {group.label}
- </span>
+ )}
+ {isLoading ? (
+ <div className="rounded-lg border border-border bg-card/50 dark:bg-card/60 backdrop-blur-sm">
+ <div className="flex items-center justify-center gap-2 py-8">
+ <Loader2 size={14} className="animate-spin text-primary" />
+ <span className="text-sm text-muted-foreground">{t("controlPanel.loading")}</span>
</div>
- <div className="space-y-1.5 relative z-0">
- {group.items.map((item) => (
- <TranscriptionItem
- key={item.id}
- item={item}
- onCopy={copyToClipboard}
- onDelete={deleteTranscription}
+ </div>
+ ) : history.length === 0 ? (
+ <div className="rounded-lg border border-border bg-card/50 dark:bg-card/60 backdrop-blur-sm">
+ <div className="flex flex-col items-center justify-center py-16 px-4">
+ <svg
+ className="text-foreground dark:text-white mb-5"
+ width="64"
+ height="64"
+ viewBox="0 0 64 64"
+ fill="none"
+ >
+ <rect
+ x="24"
+ y="6"
+ width="16"
+ height="28"
+ rx="8"
+ fill="currentColor"
+ fillOpacity={0.04}
+ stroke="currentColor"
+ strokeOpacity={0.1}
+ />
+ <rect
+ x="28"
+ y="12"
+ width="8"
+ height="3"
+ rx="1.5"
+ fill="currentColor"
+ fillOpacity={0.06}
+ />
+ <path
+ d="M18 28c0 7.7 6.3 14 14 14s14-6.3 14-14"
+ fill="none"
+ stroke="currentColor"
+ strokeOpacity={0.07}
+ strokeWidth={1.5}
+ strokeLinecap="round"
+ />
+ <line
+ x1="32"
+ y1="42"
+ x2="32"
+ y2="50"
+ stroke="currentColor"
+ strokeOpacity={0.07}
+ strokeWidth={1.5}
+ strokeLinecap="round"
+ />
+ <line
+ x1="26"
+ y1="50"
+ x2="38"
+ y2="50"
+ stroke="currentColor"
+ strokeOpacity={0.07}
+ strokeWidth={1.5}
+ strokeLinecap="round"
/>
- ))}
+ <path
+ d="M12 20a2 2 0 0 1 0 8"
+ stroke="currentColor"
+ strokeOpacity={0.04}
+ strokeWidth={1.5}
+ strokeLinecap="round"
+ />
+ <path
+ d="M8 18a2 2 0 0 1 0 12"
+ stroke="currentColor"
+ strokeOpacity={0.03}
+ strokeWidth={1.5}
+ strokeLinecap="round"
+ />
+ <path
+ d="M52 20a2 2 0 0 0 0 8"
+ stroke="currentColor"
+ strokeOpacity={0.04}
+ strokeWidth={1.5}
+ strokeLinecap="round"
+ />
+ <path
+ d="M56 18a2 2 0 0 0 0 12"
+ stroke="currentColor"
+ strokeOpacity={0.03}
+ strokeWidth={1.5}
+ strokeLinecap="round"
+ />
+ </svg>
+ <h3 className="text-xs font-semibold text-foreground/70 dark:text-foreground/60 mb-2">
+ {t("controlPanel.history.empty")}
+ </h3>
+ <div className="flex items-center gap-2 text-xs text-foreground/50 dark:text-foreground/25">
+ <span>{t("controlPanel.history.press")}</span>
+ <kbd className="inline-flex items-center h-5 px-1.5 rounded-sm bg-surface-1 dark:bg-white/6 border border-border/50 text-xs font-mono font-medium text-foreground/60 dark:text-foreground/40">
+ {formatHotkeyLabel(hotkey)}
+ </kbd>
+ <span>{t("controlPanel.history.toStart")}</span>
+ </div>
</div>
</div>
- ))}
+ ) : (
+ <div>
+ {groupedHistory.map((group, index) => (
+ <div key={group.label} className={index > 0 ? "mt-4" : ""}>
+ <div className="sticky -top-1 z-10 -mx-4 px-5 pt-2 pb-2 bg-background">
+ <span className="text-[11px] font-semibold text-muted-foreground dark:text-muted-foreground uppercase tracking-wide">
+ {group.label}
+ </span>
+ </div>
+ <div className="space-y-1.5 relative z-0">
+ {group.items.map((item) => (
+ <TranscriptionItem
+ key={item.id}
+ item={item}
+ onCopy={copyToClipboard}
+ onDelete={deleteTranscription}
+ />
+ ))}
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
</div>
- )}
+
+ {isConnected && (
+ <div className="w-64 shrink-0 hidden sm:block">
+ <div className="sticky top-4">
+ <UpcomingMeetings events={events} isLoading={eventsLoading} />
+ </div>
+ </div>
+ )}
+ </div>
</div>
</div>
);
diff --git a/src/components/UpcomingMeetings.tsx b/src/components/UpcomingMeetings.tsx
new file mode 100644
index 000000000..cf8d85e0c
--- /dev/null
+++ b/src/components/UpcomingMeetings.tsx
@@ -0,0 +1,198 @@
+import { useState, useMemo } from "react";
+import { useTranslation } from "react-i18next";
+import { Calendar, Loader2, Video } from "lucide-react";
+import { Button } from "./ui/button";
+import { cn } from "./lib/utils";
+import type { CalendarEvent } from "../types/calendar";
+import { formatUpcomingDateGroup } from "../utils/dateFormatting";
+
+interface UpcomingMeetingsProps {
+ events: CalendarEvent[];
+ isLoading: boolean;
+}
+
+const getJoinUrl = (event: CalendarEvent): string | null => {
+ if (event.hangout_link) return event.hangout_link;
+ if (!event.conference_data) return null;
+ try {
+ const data = JSON.parse(event.conference_data);
+ return (
+ data?.entryPoints?.find(
+ (ep: { entryPointType: string; uri?: string }) => ep.entryPointType === "video"
+ )?.uri || null
+ );
+ } catch {
+ return null;
+ }
+};
+
+const openJoinUrl = (url: string) => {
+ if (window.electronAPI?.openExternal) {
+ window.electronAPI.openExternal(url);
+ } else {
+ window.open(url, "_blank");
+ }
+};
+
+export default function UpcomingMeetings({ events, isLoading }: UpcomingMeetingsProps) {
+ const { t, i18n } = useTranslation();
+ const [hoveredEventId, setHoveredEventId] = useState<string | null>(null);
+
+ const now = useMemo(() => new Date(), []);
+
+ const groupedEvents = useMemo(() => {
+ if (events.length === 0) return [];
+ const groups: { label: string; items: CalendarEvent[] }[] = [];
+ let currentLabel: string | null = null;
+
+ for (const event of events) {
+ const label = formatUpcomingDateGroup(event.start_time, t);
+ if (label !== currentLabel) {
+ groups.push({ label, items: [event] });
+ currentLabel = label;
+ } else {
+ groups[groups.length - 1].items.push(event);
+ }
+ }
+ return groups;
+ }, [events, t]);
+
+ const formatTimeRange = (startTime: string, endTime: string): string => {
+ const start = new Date(startTime);
+ const end = new Date(endTime);
+ const locale = i18n.language;
+
+ const startStr = start.toLocaleTimeString(locale, {
+ hour: "numeric",
+ minute: "2-digit",
+ });
+ const endStr = end.toLocaleTimeString(locale, {
+ hour: "numeric",
+ minute: "2-digit",
+ });
+
+ return `${startStr} \u2013 ${endStr}`;
+ };
+
+ const isHappeningNow = (event: CalendarEvent): boolean => {
+ const start = new Date(event.start_time);
+ const end = new Date(event.end_time);
+ return start <= now && now <= end;
+ };
+
+ return (
+ <div className="w-64 sticky top-0 self-start max-h-screen overflow-y-auto">
+ {/* Header */}
+ <div className="flex items-center gap-1.5 pb-2.5">
+ <Calendar size={12} className="text-muted-foreground" />
+ <span className="text-[11px] font-semibold text-muted-foreground uppercase tracking-wide">
+ {t("upcoming.title")}
+ </span>
+ </div>
+
+ {/* Loading state */}
+ {isLoading && (
+ <div className="flex items-center justify-center gap-2 py-6">
+ <Loader2 size={14} className="animate-spin text-primary" />
+ </div>
+ )}
+
+ {/* Empty state */}
+ {!isLoading && events.length === 0 && (
+ <div className="flex flex-col items-center justify-center py-8 px-3">
+ <Calendar size={24} className="text-muted-foreground/30 mb-2.5" />
+ <p className="text-xs text-muted-foreground/60 text-center">
+ {t("upcoming.noMoreMeetings")}
+ </p>
+ </div>
+ )}
+
+ {/* Grouped event list */}
+ {!isLoading && groupedEvents.length > 0 && (
+ <div>
+ {groupedEvents.map((group, groupIndex) => (
+ <div key={group.label} className={groupIndex > 0 ? "mt-4" : ""}>
+ <div className="pt-2 pb-2">
+ <span className="text-[11px] font-semibold text-muted-foreground uppercase tracking-wide">
+ {group.label}
+ </span>
+ </div>
+ <div className="space-y-1.5">
+ {group.items.map((event) => {
+ const joinUrl = getJoinUrl(event);
+ const isNow = isHappeningNow(event);
+ const isHovered = hoveredEventId === event.id;
+
+ return (
+ <div
+ key={event.id}
+ className="group rounded-md border border-border/40 dark:border-border-subtle/60 bg-card/50 dark:bg-surface-2/60 px-3 py-2.5 transition-colors duration-150 hover:bg-muted/30 dark:hover:bg-surface-2/80"
+ onMouseEnter={() => setHoveredEventId(event.id)}
+ onMouseLeave={() => setHoveredEventId(null)}
+ >
+ <div className="flex items-start gap-2.5">
+ {/* Time / Now indicator */}
+ <div className="shrink-0 pt-0.5">
+ {isNow ? (
+ <div className="flex items-center gap-1.5">
+ <span className="relative flex h-1.5 w-1.5">
+ <span className="absolute inline-flex h-full w-full animate-pulse rounded-full bg-green-500 opacity-75" />
+ <span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-green-500" />
+ </span>
+ <span className="text-[11px] font-medium text-green-600 dark:text-green-400 tabular-nums">
+ {t("upcoming.now")}
+ </span>
+ </div>
+ ) : (
+ <span className="text-[11px] text-muted-foreground tabular-nums">
+ {formatTimeRange(event.start_time, event.end_time)}
+ </span>
+ )}
+ </div>
+
+ {/* Spacer to push join button right */}
+ <div className="flex-1" />
+
+ {/* Join button (on hover) */}
+ {joinUrl && (
+ <div
+ className={cn(
+ "shrink-0 transition-opacity duration-150",
+ isHovered ? "opacity-100" : "opacity-0"
+ )}
+ >
+ <Button
+ size="icon"
+ variant="ghost"
+ onClick={() => openJoinUrl(joinUrl)}
+ title={t("upcoming.join")}
+ className="h-6 w-6 rounded-sm text-muted-foreground hover:text-foreground hover:bg-foreground/10"
+ >
+ <Video size={12} />
+ </Button>
+ </div>
+ )}
+ </div>
+
+ {/* Title + attendees */}
+ <div className="mt-1 flex items-baseline gap-1.5">
+ <p className="flex-1 min-w-0 text-foreground text-sm leading-snug line-clamp-2">
+ {event.summary || t("upcoming.untitledEvent")}
+ </p>
+ {event.attendees_count > 1 && (
+ <span className="shrink-0 text-[11px] text-muted-foreground/70 tabular-nums">
+ +{event.attendees_count - 1}
+ </span>
+ )}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index edc769cd9..bfe1fa885 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -270,6 +270,10 @@ class IPCHandlers {
return false;
});
+ ipcMain.handle("restore-from-meeting-mode", () => {
+ this.windowManager.restoreControlPanelFromMeetingMode();
+ });
+
ipcMain.handle("app-quit", () => {
app.quit();
});
diff --git a/src/helpers/meetingDetectionEngine.js b/src/helpers/meetingDetectionEngine.js
index 57a075bf0..828d1c17d 100644
--- a/src/helpers/meetingDetectionEngine.js
+++ b/src/helpers/meetingDetectionEngine.js
@@ -105,7 +105,7 @@ class MeetingDetectionEngine {
event = {
id: `detected-${Date.now()}`,
calendar_id: "__detected__",
- summary: data.appName ? `${data.appName} Meeting` : "Detected Meeting",
+ summary: data.appName ? `${data.appName} Meeting` : "New note",
start_time: new Date().toISOString(),
end_time: new Date(Date.now() + 3600000).toISOString(),
is_all_day: 0,
@@ -156,7 +156,7 @@ class MeetingDetectionEngine {
const detection = this.activeDetections.get(detectionId);
if (action === "start" && detection) {
- const eventSummary = detection.event?.summary || "Meeting";
+ const eventSummary = detection.event?.summary || "New note";
const noteResult = this.databaseManager.saveNote(eventSummary, "", "meeting");
const meetingsFolder = this.databaseManager.getMeetingsFolder();
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index 5bf5a5087..99b144523 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -923,6 +923,7 @@ class WindowManager {
snapControlPanelToMeetingMode() {
const win = this.controlPanelWindow;
if (!win || win.isDestroyed()) return;
+ this._preMeetingBounds = win.getBounds();
const display = screen.getPrimaryDisplay();
const workArea = display.workArea;
const width = Math.round(workArea.width / 3);
@@ -935,6 +936,19 @@ class WindowManager {
win.focus();
}
+ restoreControlPanelFromMeetingMode() {
+ const win = this.controlPanelWindow;
+ if (!win || win.isDestroyed()) return;
+ if (this._preMeetingBounds) {
+ win.setBounds(this._preMeetingBounds);
+ this._preMeetingBounds = null;
+ } else {
+ const { width, height } = CONTROL_PANEL_CONFIG;
+ win.setSize(width, height);
+ win.center();
+ }
+ }
+
refreshLocalizedUi() {
MenuManager.setupMainMenu();
diff --git a/src/hooks/useMeetingTranscription.ts b/src/hooks/useMeetingTranscription.ts
index 12373b494..6c18a5f2c 100644
--- a/src/hooks/useMeetingTranscription.ts
+++ b/src/hooks/useMeetingTranscription.ts
@@ -21,6 +21,15 @@ const getSystemAudioStream = async (): Promise<MediaStream | null> => {
const audioTracks = stream.getAudioTracks();
const videoTracks = stream.getVideoTracks();
+ logger.debug(
+ "Display media stream obtained",
+ {
+ audioTracks: audioTracks.length,
+ videoTracks: videoTracks.length,
+ audioSettings: audioTracks[0]?.getSettings(),
+ },
+ "meeting"
+ );
if (!audioTracks.length) {
logger.error("No audio track in display media stream", {}, "meeting");
@@ -178,14 +187,26 @@ export function useMeetingTranscription(): UseMeetingTranscriptionReturn {
});
if (errorCleanup) ipcCleanupsRef.current.push(errorCleanup);
+ let audioCheckCount = 0;
scriptNode.onaudioprocess = (event) => {
if (!isRecordingRef.current) return;
const input = event.inputBuffer.getChannelData(0);
const pcm = new Int16Array(input.length);
+ let maxAmplitude = 0;
for (let i = 0; i < input.length; i++) {
const s = Math.max(-1, Math.min(1, input[i]));
pcm[i] = s < 0 ? s * 0x8000 : s * 0x7fff;
+ const abs = Math.abs(input[i]);
+ if (abs > maxAmplitude) maxAmplitude = abs;
}
+ if (audioCheckCount < 10 || audioCheckCount % 50 === 0) {
+ logger.debug(
+ "Meeting audio chunk",
+ { maxAmplitude: maxAmplitude.toFixed(6), samples: input.length },
+ "meeting"
+ );
+ }
+ audioCheckCount++;
window.electronAPI?.meetingTranscriptionSend?.(pcm.buffer);
};
diff --git a/src/hooks/useUpcomingEvents.ts b/src/hooks/useUpcomingEvents.ts
new file mode 100644
index 000000000..a6c9af84a
--- /dev/null
+++ b/src/hooks/useUpcomingEvents.ts
@@ -0,0 +1,64 @@
+import { useState, useEffect, useCallback } from "react";
+import { useSettingsStore } from "../stores/settingsStore";
+import type { CalendarEvent } from "../types/calendar";
+
+export interface UseUpcomingEventsReturn {
+ events: CalendarEvent[];
+ isLoading: boolean;
+ isConnected: boolean;
+}
+
+const LOOKAHEAD_DAYS = 7;
+
+function getLookaheadMinutes(): number {
+ const now = new Date();
+ const end = new Date(now);
+ end.setDate(end.getDate() + LOOKAHEAD_DAYS);
+ end.setHours(0, 0, 0, 0);
+ return Math.max(1, Math.ceil((end.getTime() - now.getTime()) / 60000));
+}
+
+export function useUpcomingEvents(): UseUpcomingEventsReturn {
+ const gcalAccounts = useSettingsStore((s) => s.gcalAccounts);
+ const isConnected = gcalAccounts.length > 0;
+
+ const [events, setEvents] = useState<CalendarEvent[]>([]);
+ const [isLoading, setIsLoading] = useState(false);
+
+ const fetchEvents = useCallback(async () => {
+ if (!isConnected) {
+ setEvents([]);
+ return;
+ }
+ setIsLoading(true);
+ try {
+ const windowMinutes = getLookaheadMinutes();
+ const result = await window.electronAPI?.gcalGetUpcomingEvents?.(windowMinutes);
+ if (result?.success && Array.isArray(result.events)) {
+ setEvents(result.events);
+ } else {
+ setEvents([]);
+ }
+ } catch {
+ setEvents([]);
+ } finally {
+ setIsLoading(false);
+ }
+ }, [isConnected]);
+
+ // Fetch on mount and when connection status changes
+ useEffect(() => {
+ fetchEvents();
+ }, [fetchEvents]);
+
+ // Re-fetch when events are synced from Google Calendar
+ useEffect(() => {
+ if (!isConnected) return;
+ const unsub = window.electronAPI?.onGcalEventsSynced?.(() => {
+ fetchEvents();
+ });
+ return () => unsub?.();
+ }, [isConnected, fetchEvents]);
+
+ return { events, isLoading, isConnected };
+}
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index efc638fb5..9262b6a2e 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1669,5 +1669,14 @@
"proLimit": "Unbegrenzt",
"upgrade": "Upgrade"
}
+ },
+ "upcoming": {
+ "title": "Anstehende Meetings",
+ "transcriptions": "Transkriptionen",
+ "tomorrow": "Morgen",
+ "noMoreMeetings": "Keine weiteren Meetings heute",
+ "now": "Jetzt",
+ "join": "Beitreten",
+ "untitledEvent": "Unbenanntes Ereignis"
}
}
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 86da14f7f..283c348bc 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -525,6 +525,15 @@
"audioDescription": "Prompt when sustained conversation is detected"
}
},
+ "upcoming": {
+ "title": "Upcoming Meetings",
+ "transcriptions": "Transcriptions",
+ "tomorrow": "Tomorrow",
+ "noMoreMeetings": "No more meetings today",
+ "now": "Now",
+ "join": "Join",
+ "untitledEvent": "Untitled event"
+ },
"cleanupPrompt": "Cleanup",
"developerSection": {
"currentLogFile": "Current log file",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index c0032f239..d758494f1 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -1673,5 +1673,14 @@
"proLimit": "Ilimitado",
"upgrade": "Mejorar"
}
+ },
+ "upcoming": {
+ "title": "Próximas reuniones",
+ "transcriptions": "Transcripciones",
+ "tomorrow": "Mañana",
+ "noMoreMeetings": "No hay más reuniones hoy",
+ "now": "Ahora",
+ "join": "Unirse",
+ "untitledEvent": "Evento sin título"
}
}
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 06ab2c457..b634230e5 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1673,5 +1673,14 @@
"proLimit": "Illimité",
"upgrade": "Passer au supérieur"
}
+ },
+ "upcoming": {
+ "title": "Réunions à venir",
+ "transcriptions": "Transcriptions",
+ "tomorrow": "Demain",
+ "noMoreMeetings": "Plus de réunions aujourd'hui",
+ "now": "En cours",
+ "join": "Rejoindre",
+ "untitledEvent": "Événement sans titre"
}
}
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index ccc4a131f..e53cdb267 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1673,5 +1673,14 @@
"proLimit": "Illimitato",
"upgrade": "Aggiorna"
}
+ },
+ "upcoming": {
+ "title": "Riunioni in programma",
+ "transcriptions": "Trascrizioni",
+ "tomorrow": "Domani",
+ "noMoreMeetings": "Nessun'altra riunione oggi",
+ "now": "In corso",
+ "join": "Partecipa",
+ "untitledEvent": "Evento senza titolo"
}
}
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index 3d62e5ce5..e86e8d054 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1669,5 +1669,14 @@
"proLimit": "無制限",
"upgrade": "アップグレード"
}
+ },
+ "upcoming": {
+ "title": "今後の会議",
+ "transcriptions": "文字起こし",
+ "tomorrow": "明日",
+ "noMoreMeetings": "今日の予定はありません",
+ "now": "進行中",
+ "join": "参加",
+ "untitledEvent": "無題のイベント"
}
}
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index 7a7e9ed21..84c0a7d64 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1673,5 +1673,14 @@
"proLimit": "Ilimitado",
"upgrade": "Atualizar"
}
+ },
+ "upcoming": {
+ "title": "Próximas reuniões",
+ "transcriptions": "Transcrições",
+ "tomorrow": "Amanhã",
+ "noMoreMeetings": "Sem mais reuniões hoje",
+ "now": "Agora",
+ "join": "Entrar",
+ "untitledEvent": "Evento sem título"
}
}
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index e167dafca..ef0a8e6d2 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1673,5 +1673,14 @@
"proLimit": "Безлимитно",
"upgrade": "Улучшить"
}
+ },
+ "upcoming": {
+ "title": "Предстоящие встречи",
+ "transcriptions": "Транскрипции",
+ "tomorrow": "Завтра",
+ "noMoreMeetings": "Больше встреч сегодня нет",
+ "now": "Сейчас",
+ "join": "Присоединиться",
+ "untitledEvent": "Без названия"
}
}
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index b01fb6f3b..a034e8c30 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1669,5 +1669,14 @@
"proLimit": "无限",
"upgrade": "升级"
}
+ },
+ "upcoming": {
+ "title": "即将开始的会议",
+ "transcriptions": "转录",
+ "tomorrow": "明天",
+ "noMoreMeetings": "今天没有更多会议了",
+ "now": "进行中",
+ "join": "加入",
+ "untitledEvent": "无标题事件"
}
}
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index e14fdd15d..e5bba5bd0 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1669,5 +1669,14 @@
"proLimit": "無限",
"upgrade": "升級"
}
+ },
+ "upcoming": {
+ "title": "即將開始的會議",
+ "transcriptions": "轉錄",
+ "tomorrow": "明天",
+ "noMoreMeetings": "今天沒有更多會議了",
+ "now": "進行中",
+ "join": "加入",
+ "untitledEvent": "無標題事件"
}
}
diff --git a/src/types/electron.ts b/src/types/electron.ts
index b6f5de109..bf8b2c300 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -562,6 +562,7 @@ declare global {
windowMaximize: () => Promise<void>;
windowClose: () => Promise<void>;
windowIsMaximized: () => Promise<boolean>;
+ restoreFromMeetingMode: () => Promise<void>;
getPlatform: () => string;
startWindowDrag: () => Promise<void>;
stopWindowDrag: () => Promise<void>;
diff --git a/src/utils/dateFormatting.ts b/src/utils/dateFormatting.ts
index a5e8c99fe..1764877e1 100644
--- a/src/utils/dateFormatting.ts
+++ b/src/utils/dateFormatting.ts
@@ -3,6 +3,19 @@ export function normalizeDbDate(dateStr: string): Date {
return new Date(source);
}
+export function formatUpcomingDateGroup(date: Date | string, t: (key: string) => string): string {
+ const d = typeof date === "string" ? new Date(date) : date;
+ const now = new Date();
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
+ const tomorrow = new Date(today);
+ tomorrow.setDate(tomorrow.getDate() + 1);
+ const target = new Date(d.getFullYear(), d.getMonth(), d.getDate());
+
+ if (target.getTime() === today.getTime()) return t("controlPanel.history.dateGroups.today");
+ if (target.getTime() === tomorrow.getTime()) return t("upcoming.tomorrow");
+ return d.toLocaleDateString(undefined, { weekday: "long", month: "short", day: "numeric" });
+}
+
export function formatDateGroup(date: Date | string, t: (key: string) => string): string {
const d = typeof date === "string" ? new Date(date) : date;
const now = new Date();