Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
fix(meetings): remove the post-meeting notification (#2192)
Joshua65aa74eed66b
diff --git a/src/components/MeetingRecordingMount.tsx b/src/components/MeetingRecordingMount.tsxindex 077e676ab..e387ad4cf 100644--- a/src/components/MeetingRecordingMount.tsx+++ b/src/components/MeetingRecordingMount.tsx@@ -5,17 +5,10 @@ import {getActiveRecordingSessionId,getMicAnalyser,primeMeetingWorklet,- startRecording,stopRecording,useMeetingRecordingStore,} from "../stores/meetingRecordingStore";-import {- createMeetingAutoEndRestartContext,- requestMeetingRecordingAutoEnd,- runMeetingAutoEndRestart,- type MeetingAutoEndRestartContext,-} from "../helpers/meetingRecordingSession";-import { parseTranscriptSegments } from "../utils/parseTranscriptSegments";+import { requestMeetingRecordingAutoEnd } from "../helpers/meetingRecordingSession";import { serializeTranscriptSegments } from "../utils/transcriptSpeakerState";import logger from "../utils/logger";@@ -47,24 +40,6 @@ export default function MeetingRecordingMount(): null {const micCaptureStatus = useMeetingRecordingStore((s) => s.micCaptureStatus);const wasMicUnavailable = useRef(false);const wasSystemAudioSilent = useRef(false);- const pendingAutoEndRestart = useRef<MeetingAutoEndRestartContext | null>(null);- // The auto-end listeners are registered once, so they cannot close over `t`- // or `toast` directly without pinning the language they mounted with.- const notifyAutoEnded = useRef<() => void>(() => {});- const notifyRestartFailed = useRef<() => void>(() => {});-- useEffect(() => {- notifyAutoEnded.current = () => {- toast({ title: t("notes.meeting.title"), description: t("notes.meeting.autoEnded") });- };- notifyRestartFailed.current = () => {- toast({- title: t("notes.meeting.title"),- description: t("notes.meeting.restartFailed"),- variant: "destructive",- });- };- }, [toast, t]);useEffect(() => {primeMeetingWorklet();@@ -72,47 +47,10 @@ export default function MeetingRecordingMount(): null {useEffect(() => {const unsubscribeStop = window.electronAPI?.onMeetingAutoEndRequested?.((request) => {- const restartContext = createMeetingAutoEndRestartContext(- request.sessionId,- getActiveRecordingSessionId(),- useMeetingRecordingStore.getState()- );- if (!restartContext) return;-requestMeetingRecordingAutoEnd(request,stopRecording,- (sessionId, stopped) => {- // Every path that ends the recording without offering a restart card- // has to say so: the note's own summary offer only reaches a user who- // is looking at that note.- const abandonRestart = () => {- if (pendingAutoEndRestart.current?.sessionId === sessionId) {- pendingAutoEndRestart.current = null;- }- notifyAutoEnded.current();- };-- const completion = window.electronAPI?.meetingAutoEndCompleted;- if (!stopped || !completion) {- abandonRestart();- return;- }-- pendingAutoEndRestart.current = restartContext;- void completion(sessionId)- .then((result) => {- if (!result.success) abandonRestart();- })- .catch((error) => {- abandonRestart();- logger.error(- "Meeting auto-end completion acknowledgment failed",- { error: error instanceof Error ? error.message : String(error), sessionId },- "meeting"- );- });- },+ () => undefined,(error, sessionId) => {logger.error("Meeting auto-end stop failed; recording is still running",@@ -123,48 +61,11 @@ export default function MeetingRecordingMount(): null {);});- const unsubscribeRestart = window.electronAPI?.onMeetingAutoEndRestartRequested?.((request) => {- const context = pendingAutoEndRestart.current;- pendingAutoEndRestart.current = null;-- void runMeetingAutoEndRestart(request, context, {- getActiveSessionId: getActiveRecordingSessionId,- getLatestSegments: () => useMeetingRecordingStore.getState().segments,- getNote: (noteId) => window.electronAPI?.getNote?.(noteId) ?? Promise.resolve(null),- parseSegments: parseTranscriptSegments,- startRecording,- })- .then((outcome) => {- // Main already closed the card and reported success, so an abort the- // user is not told about looks exactly like a restart that worked.- if (outcome.status === "started") return;- logger.error(- "Meeting recording restart aborted",- { reason: outcome.reason, sessionId: request.sessionId },- "meeting"- );- notifyRestartFailed.current();- })- .catch((error) => {- logger.error(- "Meeting recording restart failed",- { error: error instanceof Error ? error.message : String(error) },- "meeting"- );- notifyRestartFailed.current();- });- });-return () => {unsubscribeStop?.();- unsubscribeRestart?.();};}, []);- useEffect(() => {- if (isRecording) pendingAutoEndRestart.current = null;- }, [isRecording]);-// Crash-safety net moved out of the notes view: it must keep running when// the user switches views mid-recording.useEffect(() => {diff --git a/test/components/meetingInterruptionWarning.test.js b/test/components/meetingInterruptionWarning.test.jsindex 4714e3f70..6026bef31 100644--- a/test/components/meetingInterruptionWarning.test.js+++ b/test/components/meetingInterruptionWarning.test.js@@ -15,6 +15,7 @@ async function setup(t) {if (root) await React.act(async () => root.unmount());delete globalThis.__interruptionToasts;delete globalThis.__interruptionDismissals;+ delete globalThis.__autoEndCompletions;});const listeners = {};const noop = () => () => {};@@ -52,6 +53,16 @@ async function setup(t) {if (listeners.resumed === callback) listeners.resumed = null;};},+ onMeetingAutoEndRequested(callback) {+ listeners.autoEnd = callback;+ return () => {+ if (listeners.autoEnd === callback) listeners.autoEnd = null;+ };+ },+ meetingAutoEndCompleted: async (sessionId) => {+ globalThis.__autoEndCompletions.push(sessionId);+ return { success: false, reason: "notification-disabled" };+ },};installBrowserGlobals(t, { window: { electronAPI: api } });installMicCaptureGlobals(t);@@ -78,6 +89,7 @@ async function setup(t) {};globalThis.__interruptionToasts = [];globalThis.__interruptionDismissals = [];+ globalThis.__autoEndCompletions = [];const vite = await createRendererServer(t, {cachePrefix: "pr2040-renderer-warning-review-",mockModules: {@@ -113,9 +125,27 @@ async function setup(t) {);const { default: i18n } = await vite.ssrLoadModule("/i18n.ts");const resume = async () => React.act(async () => listeners.resumed?.());- return { store, render, interrupt, resume, focus, reveal, i18n };+ const autoEnd = async () => {+ const sessionId = store.getActiveRecordingSessionId();+ assert.ok(sessionId);+ await React.act(async () => {+ listeners.autoEnd?.({ sessionId, reason: "mic-released" });+ await new Promise((resolve) => setTimeout(resolve, 0));+ });+ };+ return { store, render, interrupt, resume, autoEnd, focus, reveal, i18n };}+test("an automatic meeting stop does not request or render a post-meeting notification", async (t) => {+ const { store, autoEnd } = await setup(t);++ await autoEnd();++ assert.equal(store.useMeetingRecordingStore.getState().isRecording, false);+ assert.deepEqual(globalThis.__autoEndCompletions, []);+ assert.deepEqual(globalThis.__interruptionToasts, []);+});+test("audio resuming while hidden discards the quiet warning before focus", async (t) => {const { interrupt, resume, focus, reveal } = await setup(t);globalThis.document.visibilityState = "hidden";