Skip to content

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

fix: accessibility permission not detected during onboarding (#394)

Gabriel Stein5b2864441e78
diff --git a/package-lock.json b/package-lock.json
index 31ad9fd1c..0c6ff47f3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "open-whispr",
- "version": "1.6.0",
+ "version": "1.6.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "open-whispr",
- "version": "1.6.0",
+ "version": "1.6.1",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@@ -2486,22 +2486,6 @@
}
}
},
- "node_modules/@neondatabase/auth-ui/node_modules/better-sqlite3": {
- "version": "12.6.2",
- "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.6.2.tgz",
- "integrity": "sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA==",
- "hasInstallScript": true,
- "license": "MIT",
- "optional": true,
- "peer": true,
- "dependencies": {
- "bindings": "^1.5.0",
- "prebuild-install": "^7.1.1"
- },
- "engines": {
- "node": "20.x || 22.x || 23.x || 24.x || 25.x"
- }
- },
"node_modules/@neondatabase/auth-ui/node_modules/lucide-react": {
"version": "0.555.0",
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.555.0.tgz",
@@ -2511,54 +2495,6 @@
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
- "node_modules/@neondatabase/auth-ui/node_modules/pg": {
- "version": "8.20.0",
- "resolved": "https://registry.npmjs.org/pg/-/pg-8.20.0.tgz",
- "integrity": "sha512-ldhMxz2r8fl/6QkXnBD3CR9/xg694oT6DZQ2s6c/RI28OjtSOpxnPrUCGOBJ46RCUxcWdx3p6kw/xnDHjKvaRA==",
- "license": "MIT",
- "optional": true,
- "peer": true,
- "dependencies": {
- "pg-connection-string": "^2.12.0",
- "pg-pool": "^3.13.0",
- "pg-protocol": "^1.13.0",
- "pg-types": "2.2.0",
- "pgpass": "1.0.5"
- },
- "engines": {
- "node": ">= 16.0.0"
- },
- "optionalDependencies": {
- "pg-cloudflare": "^1.3.0"
- },
- "peerDependencies": {
- "pg-native": ">=3.0.1"
- },
- "peerDependenciesMeta": {
- "pg-native": {
- "optional": true
- }
- }
- },
- "node_modules/@neondatabase/auth-ui/node_modules/pg-pool": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.13.0.tgz",
- "integrity": "sha512-gB+R+Xud1gLFuRD/QgOIgGOBE2KCQPaPwkzBBGC9oG69pHTkhQeIuejVIk3/cnDyX39av2AxomQiyPT13WKHQA==",
- "license": "MIT",
- "optional": true,
- "peer": true,
- "peerDependencies": {
- "pg": ">=8.0"
- }
- },
- "node_modules/@neondatabase/auth-ui/node_modules/pg-protocol": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.13.0.tgz",
- "integrity": "sha512-zzdvXfS6v89r6v7OcFCHfHlyG/wvry1ALxZo4LqgUoy7W9xhBDMaqOuMiF3qEV45VqsN6rdlcehHrfDtlCPc8w==",
- "license": "MIT",
- "optional": true,
- "peer": true
- },
"node_modules/@neondatabase/auth-ui/node_modules/zod": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
diff --git a/package.json b/package.json
index 688011661..efb064959 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "open-whispr",
- "version": "1.6.0",
+ "version": "1.6.1",
"description": "A desktop dictation application using whisper.cpp for speech-to-text transcription",
"main": "main.js",
"private": true,
diff --git a/preload.js b/preload.js
index eb9d30a90..9e12ea101 100644
--- a/preload.js
+++ b/preload.js
@@ -168,7 +168,8 @@ contextBridge.exposeInMainWorld("electronAPI", {
createProductionEnvFile: (key) => ipcRenderer.invoke("create-production-env-file", key),
// Clipboard functions
- checkAccessibilityPermission: () => ipcRenderer.invoke("check-accessibility-permission"),
+ checkAccessibilityPermission: (silent) =>
+ ipcRenderer.invoke("check-accessibility-permission", silent),
readClipboard: () => ipcRenderer.invoke("read-clipboard"),
writeClipboard: (text) => ipcRenderer.invoke("write-clipboard", text),
checkPasteTools: () => ipcRenderer.invoke("check-paste-tools"),
@@ -536,8 +537,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
ipcRenderer.send("panel-start-position-changed", position),
// Start minimized
- notifyStartMinimizedChanged: (enabled) =>
- ipcRenderer.send("start-minimized-changed", enabled),
+ notifyStartMinimizedChanged: (enabled) => ipcRenderer.send("start-minimized-changed", enabled),
// Auto-start management
getAutoStartEnabled: () => ipcRenderer.invoke("get-auto-start-enabled"),
diff --git a/src/helpers/clipboard.js b/src/helpers/clipboard.js
index b1848e8af..624a924fa 100644
--- a/src/helpers/clipboard.js
+++ b/src/helpers/clipboard.js
@@ -1460,22 +1460,27 @@ class ClipboardManager {
throw err;
}
- async checkAccessibilityPermissions() {
+ async checkAccessibilityPermissions(silent = false) {
if (process.platform !== "darwin") return true;
- const now = Date.now();
- if (now < this.accessibilityCache.expiresAt && this.accessibilityCache.value !== null) {
- return this.accessibilityCache.value;
+ if (!silent) {
+ const now = Date.now();
+ if (now < this.accessibilityCache.expiresAt && this.accessibilityCache.value !== null) {
+ return this.accessibilityCache.value;
+ }
}
const allowed = systemPreferences.isTrustedAccessibilityClient(false);
- this.accessibilityCache = {
- value: allowed,
- expiresAt: Date.now() + ACCESSIBILITY_CHECK_TTL_MS,
- };
- if (!allowed) {
- this.showAccessibilityDialog("not allowed assistive access");
+ if (!silent) {
+ this.accessibilityCache = {
+ value: allowed,
+ expiresAt: Date.now() + ACCESSIBILITY_CHECK_TTL_MS,
+ };
+
+ if (!allowed) {
+ this.showAccessibilityDialog("not allowed assistive access");
+ }
}
return allowed;
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 60d41b862..0e8100b1a 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -794,8 +794,8 @@ class IPCHandlers {
return result;
});
- ipcMain.handle("check-accessibility-permission", async () => {
- return this.clipboardManager.checkAccessibilityPermissions();
+ ipcMain.handle("check-accessibility-permission", async (_event, silent = false) => {
+ return this.clipboardManager.checkAccessibilityPermissions(silent);
});
ipcMain.handle("read-clipboard", async (event) => {
@@ -2261,10 +2261,12 @@ class IPCHandlers {
};
const setupDictationCallbacks = (streaming, event) => {
- streaming.onPartialTranscript = (text) => event.sender.send("dictation-realtime-partial", text);
+ streaming.onPartialTranscript = (text) =>
+ event.sender.send("dictation-realtime-partial", text);
streaming.onFinalTranscript = (text) => event.sender.send("dictation-realtime-final", text);
streaming.onError = (err) => event.sender.send("dictation-realtime-error", err.message);
- streaming.onSessionEnd = (data) => event.sender.send("dictation-realtime-session-end", data || {});
+ streaming.onSessionEnd = (data) =>
+ event.sender.send("dictation-realtime-session-end", data || {});
};
const connectDictationStreaming = async (event, options) => {
diff --git a/src/hooks/usePermissions.ts b/src/hooks/usePermissions.ts
index 671638060..8c3636de5 100644
--- a/src/hooks/usePermissions.ts
+++ b/src/hooks/usePermissions.ts
@@ -250,13 +250,27 @@ export const usePermissions = (
// localStorage values (e.g. after app update changes the code signature).
useEffect(() => {
if (getPlatform() !== "darwin") return;
- window.electronAPI?.checkAccessibilityPermission?.().then((granted) => {
- if (!granted) {
- setAccessibilityPermissionGranted(false);
- }
+ window.electronAPI?.checkAccessibilityPermission?.(true).then((granted) => {
+ setAccessibilityPermissionGranted(granted);
});
}, [setAccessibilityPermissionGranted]);
+ // Poll for accessibility permission changes on macOS (e.g. user grants in System Settings)
+ useEffect(() => {
+ if (getPlatform() !== "darwin") return;
+ if (accessibilityPermissionGranted) return;
+
+ const interval = setInterval(() => {
+ window.electronAPI?.checkAccessibilityPermission?.(true).then((granted) => {
+ if (granted) {
+ setAccessibilityPermissionGranted(true);
+ }
+ });
+ }, 2000);
+
+ return () => clearInterval(interval);
+ }, [accessibilityPermissionGranted, setAccessibilityPermissionGranted]);
+
const testAccessibilityPermission = useCallback(async () => {
const platform = getPlatform();
diff --git a/src/types/electron.ts b/src/types/electron.ts
index eb0a6888b..c7815b2b3 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -446,7 +446,7 @@ declare global {
}) => Promise<void>;
// Clipboard operations
- checkAccessibilityPermission: () => Promise<boolean>;
+ checkAccessibilityPermission: (silent?: boolean) => Promise<boolean>;
readClipboard: () => Promise<string>;
writeClipboard: (text: string) => Promise<{ success: boolean }>;
checkPasteTools: () => Promise<PasteToolsResult>;
@@ -1101,8 +1101,14 @@ declare global {
onMeetingTranscriptionError?: (callback: (error: string) => void) => () => void;
// Dictation realtime streaming
- dictationRealtimeWarmup?: (options: { model?: string; mode?: "byok" | "openwhispr" }) => Promise<{ success: boolean; error?: string }>;
- dictationRealtimeStart?: (options: { model?: string; mode?: "byok" | "openwhispr" }) => Promise<{ success: boolean; error?: string }>;
+ dictationRealtimeWarmup?: (options: {
+ model?: string;
+ mode?: "byok" | "openwhispr";
+ }) => Promise<{ success: boolean; error?: string }>;
+ dictationRealtimeStart?: (options: {
+ model?: string;
+ mode?: "byok" | "openwhispr";
+ }) => Promise<{ success: boolean; error?: string }>;
dictationRealtimeSend?: (buffer: ArrayBuffer) => void;
dictationRealtimeStop?: () => Promise<{ success: boolean; text: string }>;
onDictationRealtimePartial?: (callback: (text: string) => void) => () => void;