Skip to content

fix(mac-perms): fall through to Privacy pane when in-app prompt is a no-op - #1273

Merged
nwparker merged 2 commits into
mainfrom
nwparker/perms-2
Apr 30, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/perms-2

Conversation

@nwparker

@nwparker nwparker commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

After #1233 shipped the Settings → Permissions pane, clicking Request on Microphone (or Camera) while macOS had the permission set to Denied did nothing visible except show a toast that read "Permission request sent". No TCC dialog appeared, and the user had no way to actually toggle the permission on from Orca.

Root cause: systemPreferences.askForMediaAccess(type) only surfaces the macOS prompt when the current status is 'not-determined'. If the user has already denied (or the status is otherwise non-pending), the API resolves false with no side effect. The IPC handler was returning openedSystemSettings: false in that case, which hit the generic fallback toast in the renderer.

systemPreferences.isTrustedAccessibilityClient(true) has the same one-shot behavior for Accessibility.

Fix

When the in-app prompt API cannot grant access, open the matching Privacy & Security deep-link pane so the user can flip the permission themselves:

  • Microphone / Camera: if askForMediaAccess resolves false and the status is denied, restricted, or unknown, open the Privacy → Microphone (or Camera) pane and report openedSystemSettings: true — the renderer then shows the correct "Opened macOS Privacy & Security" toast.
  • Accessibility: if isTrustedAccessibilityClient(true) returns false, open Privacy → Accessibility the same way.

No behavioral change when the in-app prompt can actually grant access: askForMediaAccess on a 'not-determined' status still shows the native TCC dialog as before.

Testing

  • pnpm exec oxlint src/main/ipc/developer-permissions.ts
  • pnpm run typecheck:node
  • Manual end-to-end via Electron CDP: launched Orca dev, opened Settings → Permissions, confirmed the Microphone row showed Denied, clicked Request. Observed: macOS Privacy → Microphone pane opened, and the in-app toast correctly read "Opened macOS Privacy & Security" (previously it showed the misleading "Permission request sent").

Made with Orca 🐋

nwparker and others added 2 commits April 29, 2026 23:27
…no-op

askForMediaAccess only surfaces the TCC dialog when the current status is
'not-determined'. If the user has previously denied mic/camera access,
clicking Request in Settings → Permissions resolved silently: the renderer
showed a "Permission request sent" toast while nothing actually happened.

isTrustedAccessibilityClient(true) has the same one-shot behavior.

When the in-app API cannot grant access, open the matching Privacy &
Security pane so the user can toggle the permission themselves.

Co-authored-by: Orca <help@stably.ai>
After clicking Request, the user flips a toggle in macOS System Settings
and returns to Orca. Without this, the chip stays stale until they hit
Refresh manually — a silent UX trap that makes the fix look broken.

Refresh on window focus rather than on a polling interval so the pane
doesn't keep calling into `systemPreferences` while it sits idle.

Co-authored-by: Orca <help@stably.ai>
@nwparker
nwparker merged commit fb3d467 into main Apr 30, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/perms-2 branch April 30, 2026 06:51
mralexsaavedra pushed a commit to mralexsaavedra/orca that referenced this pull request May 2, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant