Skip to content

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

fix(meetings): release detections the onboarding gate suppresses (#2900)

Henry Su369be9b0a185
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index 98cea1b30..a6a1ab4da 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -2307,7 +2307,16 @@ class WindowManager {
}
async showMeetingNotification(promptData, { autoDismiss = true } = {}) {
- if (this._onboardingActive) return false;
+ if (this._onboardingActive) {
+ // No card will settle this detection, and while it stays active the
+ // engine skips every repeat of it.
+ if (promptData?.detectionId) {
+ this.meetingDetectionEngine?.handleDetectionNotificationClosed?.(promptData.detectionId, {
+ flushQueued: false,
+ });
+ }
+ return false;
+ }
this._cancelMeetingNavigation("STALE_NOTIFICATION");
const previousOwner = this._meetingNotificationOwner;
if (
@@ -2446,7 +2455,8 @@ class WindowManager {
}
if (this.notificationWindow !== win) return false;
if (this._onboardingActive) {
- this.dismissMeetingNotification();
+ // Queued prompts would only reach the same closed gate.
+ this.dismissMeetingNotification({ flushQueued: false });
return false;
}
@@ -2470,7 +2480,7 @@ class WindowManager {
// "ready" must not clear the fallback that would force-show its replacement.
showNotificationWindow(ownerWebContents) {
if (this._onboardingActive) {
- this.dismissMeetingNotification();
+ this.dismissMeetingNotification({ flushQueued: false });
return;
}
const win = this.notificationWindow;
diff --git a/test/helpers/windowManagerMeetingNotification.test.js b/test/helpers/windowManagerMeetingNotification.test.js
index f7941e645..52575df87 100644
--- a/test/helpers/windowManagerMeetingNotification.test.js
+++ b/test/helpers/windowManagerMeetingNotification.test.js
@@ -416,6 +416,43 @@ test("window manager starts fail-closed and suppresses normal-app popup surfaces
assert.deepEqual(createdWindows, []);
});
+test("a detection suppressed while onboarding is active is released", async () => {
+ const manager = new WindowManager();
+ const closedDetections = [];
+ manager.meetingDetectionEngine = {
+ handleDetectionNotificationClosed: (detectionId, options) =>
+ closedDetections.push([detectionId, options]),
+ };
+
+ // The gate is also closed at startup and while the control panel reloads;
+ // a detection held active then would block every later prompt for it.
+ assert.equal(
+ await manager.showMeetingNotification({ detectionId: "audio:sustained-audio" }),
+ false
+ );
+ assert.deepEqual(closedDetections, [["audio:sustained-audio", { flushQueued: false }]]);
+});
+
+test("a card the onboarding gate hides mid-load does not replay the queue into the gate", async () => {
+ const manager = createNormalWindowManager();
+ const closedDetections = [];
+ manager.meetingDetectionEngine = {
+ handleDetectionNotificationClosed: (detectionId, options) =>
+ closedDetections.push([detectionId, options]),
+ };
+
+ const showPromise = manager.showMeetingNotification({
+ detectionId: "audio:sustained-audio",
+ source: "audio",
+ });
+ // An onboarding demo closes the gate without hiding the card that is loading.
+ assert.equal(manager.beginOnboardingDemo("dictation"), true);
+ createdWindows[0].loadDeferred.resolve();
+
+ assert.equal(await showPromise, false);
+ assert.deepEqual(closedDetections, [["audio:sustained-audio", { flushQueued: false }]]);
+});
+
test("window creation uses the notification dimensions and position", async () => {
const manager = createNormalWindowManager();
const notification = { detectionId: "calendar:next", source: "calendar" };