Skip to content

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

fix: suppress meeting detection during hotkey dictation

Gabriel Stein3d55ac17047a
diff --git a/main.js b/main.js
index c6f145bcb..85d41f75c 100644
--- a/main.js
+++ b/main.js
@@ -261,6 +261,7 @@ function initializeCoreManagers() {
windowManager,
databaseManager
);
+ windowManager.meetingDetectionEngine = meetingDetectionEngine;
updateManager = new UpdateManager();
windowsKeyManager = new WindowsKeyManager();
textEditMonitor = new TextEditMonitor();
@@ -495,9 +496,14 @@ async function startApp() {
session.defaultSession.setDisplayMediaRequestHandler(async (_request, callback) => {
try {
const sources = await desktopCapturer.getSources({ types: ["screen"] });
- debugLogger.debug("Display media sources", { count: sources.length, names: sources.map((s) => s.name) });
+ 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");
+ debugLogger.error(
+ "No screen sources available — Screen Recording permission may be denied"
+ );
callback({});
return;
}
@@ -664,8 +670,7 @@ async function startApp() {
}
}, MIN_HOLD_DURATION_MS);
} else {
- windowManager.showDictationPanel();
- windowManager.mainWindow.webContents.send("toggle-dictation");
+ windowManager.sendToggleDictation();
}
} else {
debugLogger?.debug("[Globe] Ignored — mainWindow not live");
@@ -745,8 +750,7 @@ async function startApp() {
}
}, MIN_HOLD_DURATION_MS);
} else {
- windowManager.showDictationPanel();
- windowManager.mainWindow.webContents.send("toggle-dictation");
+ windowManager.sendToggleDictation();
}
});
@@ -820,8 +824,7 @@ async function startApp() {
if (activationMode === "push") {
windowManager.startWindowsPushToTalk();
} else if (activationMode === "tap") {
- windowManager.showDictationPanel();
- windowManager.mainWindow.webContents.send("toggle-dictation");
+ windowManager.sendToggleDictation();
}
});
diff --git a/src/helpers/audioActivityDetector.js b/src/helpers/audioActivityDetector.js
index 9b4c1991c..a69835b28 100644
--- a/src/helpers/audioActivityDetector.js
+++ b/src/helpers/audioActivityDetector.js
@@ -18,6 +18,16 @@ class AudioActivityDetector extends EventEmitter {
this.hasPrompted = false;
this.lastDismissedAt = null;
this._micCheckBinary = null;
+ this._userRecording = false;
+ }
+
+ setUserRecording(active) {
+ this._userRecording = active;
+ if (active) {
+ this.consecutiveChecks = 0;
+ this.audioActiveStart = null;
+ }
+ debugLogger.debug("User recording state changed", { active }, "meeting");
}
start() {
@@ -60,6 +70,7 @@ class AudioActivityDetector extends EventEmitter {
_check() {
if (this.lastDismissedAt && Date.now() - this.lastDismissedAt < COOLDOWN_MS) return;
if (this.hasPrompted) return;
+ if (this._userRecording) return;
const active = this._isMicActive();
debugLogger.debug(
diff --git a/src/helpers/meetingDetectionEngine.js b/src/helpers/meetingDetectionEngine.js
index 828d1c17d..0bbecc83a 100644
--- a/src/helpers/meetingDetectionEngine.js
+++ b/src/helpers/meetingDetectionEngine.js
@@ -191,6 +191,10 @@ class MeetingDetectionEngine {
}
}
+ setUserRecording(active) {
+ this.audioActivityDetector.setUserRecording(active);
+ }
+
setPreferences(prefs) {
debugLogger.info("Updating detection preferences", prefs, "meeting");
Object.assign(this.preferences, prefs);
diff --git a/src/helpers/windowManager.js b/src/helpers/windowManager.js
index 37a92d723..8072ddf24 100644
--- a/src/helpers/windowManager.js
+++ b/src/helpers/windowManager.js
@@ -35,6 +35,7 @@ class WindowManager {
this._floatingIconAutoHide = false;
this._agentAnimationState = null;
this._panelStartPosition = "bottom-right";
+ this._isDictatingToggle = false;
app.on("before-quit", () => {
this.isQuitting = true;
@@ -220,8 +221,7 @@ class WindowManager {
// Capture target app PID before the window might steal focus
if (this.textEditMonitor) this.textEditMonitor.captureTargetPid();
- this.showDictationPanel();
- this.mainWindow.webContents.send("toggle-dictation");
+ this.sendToggleDictation();
};
}
@@ -403,6 +403,18 @@ class WindowManager {
this.winPushState = null;
}
+ sendToggleDictation() {
+ if (this.hotkeyManager.isInListeningMode()) {
+ return;
+ }
+ if (this.mainWindow && !this.mainWindow.isDestroyed()) {
+ this.showDictationPanel();
+ this.mainWindow.webContents.send("toggle-dictation");
+ this._isDictatingToggle = !this._isDictatingToggle;
+ this.meetingDetectionEngine?.setUserRecording(this._isDictatingToggle);
+ }
+ }
+
sendStartDictation() {
if (this.hotkeyManager.isInListeningMode()) {
return;
@@ -410,6 +422,7 @@ class WindowManager {
if (this.mainWindow && !this.mainWindow.isDestroyed()) {
this.showDictationPanel();
this.mainWindow.webContents.send("start-dictation");
+ this.meetingDetectionEngine?.setUserRecording(true);
}
}
@@ -419,6 +432,8 @@ class WindowManager {
}
if (this.mainWindow && !this.mainWindow.isDestroyed()) {
this.mainWindow.webContents.send("stop-dictation");
+ this._isDictatingToggle = false;
+ this.meetingDetectionEngine?.setUserRecording(false);
}
}