From 3fa8912a992a027e93ee54f60d064b13d87a5224 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Thu, 30 Apr 2026 16:05:52 -0400 Subject: [PATCH] Revert "fix(mac-perms): fall through to Privacy pane when in-app prompt is a no-op (#1273)" This reverts commit fb3d46710b9ae07b1b60f7d3ae35629460201743. --- src/main/ipc/developer-permissions.ts | 25 +++---------------- .../settings/DeveloperPermissionsPane.tsx | 12 --------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/src/main/ipc/developer-permissions.ts b/src/main/ipc/developer-permissions.ts index 060eb7a38..60b4ea887 100644 --- a/src/main/ipc/developer-permissions.ts +++ b/src/main/ipc/developer-permissions.ts @@ -147,32 +147,13 @@ async function requestPermission( } if (id === 'microphone' || id === 'camera') { - // Why: askForMediaAccess only surfaces the TCC prompt when status is - // 'not-determined'. If the user previously denied (or macOS set the status - // to 'denied'/'restricted'), it resolves false with no prompt — leaving - // the user stuck. Fall through to the Privacy pane so they can toggle it. const granted = await systemPreferences.askForMediaAccess(id) - if (granted) { - return { id, status: 'granted', openedSystemSettings: false } - } - const status = getMediaStatus(id) - if (status === 'denied' || status === 'restricted' || status === 'unknown') { - await openPrivacyPane(id) - return { id, status, openedSystemSettings: true } - } - return { id, status, openedSystemSettings: false } + return { id, status: granted ? 'granted' : getMediaStatus(id), openedSystemSettings: false } } if (id === 'accessibility') { - // Why: isTrustedAccessibilityClient(true) shows the prompt only the first - // time for a given bundle. Once the user has dismissed or denied, calling - // it again is a no-op. Fall through to the Privacy pane when not granted. - const trusted = systemPreferences.isTrustedAccessibilityClient(true) - if (trusted) { - return { id, status: 'granted', openedSystemSettings: false } - } - await openPrivacyPane(id) - return { id, status: getAccessibilityStatus(), openedSystemSettings: true } + systemPreferences.isTrustedAccessibilityClient(true) + return { id, status: getAccessibilityStatus(), openedSystemSettings: false } } if (id === 'automation') { diff --git a/src/renderer/src/components/settings/DeveloperPermissionsPane.tsx b/src/renderer/src/components/settings/DeveloperPermissionsPane.tsx index 1273fda68..eead3e04e 100644 --- a/src/renderer/src/components/settings/DeveloperPermissionsPane.tsx +++ b/src/renderer/src/components/settings/DeveloperPermissionsPane.tsx @@ -179,18 +179,6 @@ export function DeveloperPermissionsPane(): React.JSX.Element { void refresh() }, [refresh]) - // Why: after the user flips a permission in System Settings and switches - // back to Orca, the chip should reflect the new status without a manual - // Refresh click. Tied to window focus rather than a polling interval so - // we don't keep hammering `systemPreferences` while the pane is idle. - useEffect(() => { - const onFocus = (): void => { - void refresh() - } - window.addEventListener('focus', onFocus) - return () => window.removeEventListener('focus', onFocus) - }, [refresh]) - const request = async (id: DeveloperPermissionId): Promise => { setPendingId(id) try {