Skip to content

Simplify permission buttons and fix system audio native dialog#490

Merged
gabrielste1n merged 4 commits into
mainfrom
refactor/simplify-permission-buttons
Mar 23, 2026
Merged

Simplify permission buttons and fix system audio native dialog#490
gabrielste1n merged 4 commits into
mainfrom
refactor/simplify-permission-buttons

Conversation

@gabrielste1n

@gabrielste1n gabrielste1n commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Unified permission buttons — Replaced confusing "Test" / "Test and Grant" buttons + gear icons with a single "Grant Access" button per permission card (microphone, accessibility, system audio) in both onboarding and settings
  • Fixed system audio native consent dialog — The "Grant Access" button now triggers the native macOS dialog ("OpenWhispr would like access to record your system audio") instead of sending users to System Settings manually. This works because AudioHardwareCreateProcessTap triggers the TCC prompt when NSAudioCaptureUsageDescription is present in Info.plist — the key was already there, but the IPC handler was short-circuiting before the binary ever ran
  • Improved permission status detection — System audio permission check now consults both getMediaAccessStatus("screen") (for users who granted via old Screen Recording toggle) and the cached audio tap probe result (for users who grant via the new native dialog), since these are separate TCC entries on macOS 14.4+

Backward compatibility

Users who already granted Screen Recording permission through the old flow are unaffected — the handler checks getMediaAccessStatus("screen") first and short-circuits before probing.

Test plan

  • macOS: Click "Grant Access" for system audio — native consent dialog should appear
  • macOS: After granting via native dialog, permission card should turn green
  • macOS: Verify microphone and accessibility "Grant Access" buttons still work
  • macOS: Existing users with Screen Recording already granted should see green card on load
  • Windows/Linux: Only microphone card should appear (accessibility auto-granted, system audio hidden)
  • Onboarding flow: Same behavior as settings page for all permissions
  • All 10 locales: "Grant Access" button text renders correctly

Replace confusing dual-button pattern (Test/Test & Grant + gear icon)
with a single "Grant Access" button that checks permission status,
triggers the OS prompt, and opens System Settings if needed.
Replace NSAudioCaptureUsageDescription (non-standard key) with
NSScreenCaptureUsageDescription so ScreenCaptureKit can display the
native consent dialog.

Change request-system-audio-access IPC handler to probe the audio tap
binary first, which triggers the native ScreenCaptureKit consent prompt
instead of immediately opening System Settings. Falls back to System
Settings if the probe is denied or fails.

Also enhance check-system-audio-access to consult the cached probe
status alongside getMediaAccessStatus("screen"), since macOS 15+
separates system audio from screen recording in TCC.
NSAudioCaptureUsageDescription is the correct Info.plist key for Core
Audio tap permission dialogs — revert the mistaken rename to
NSScreenCaptureUsageDescription.

Increase REQUEST_TIMEOUT_MS from 15s to 60s since the binary probe now
serves as the permission request flow: AudioHardwareCreateProcessTap
triggers the native macOS consent dialog, and the user needs time to
respond.
@gabrielste1n gabrielste1n changed the title Simplify permission buttons to single Grant Access action Simplify permission buttons and fix system audio native dialog Mar 23, 2026
@gabrielste1n
gabrielste1n merged commit 4f3158c into main Mar 23, 2026
6 checks passed
@gabrielste1n
gabrielste1n deleted the refactor/simplify-permission-buttons branch March 23, 2026 20:55
charian47 pushed a commit to charian47/openwhispr that referenced this pull request Apr 25, 2026
…ermission-buttons

Simplify permission buttons and fix system audio native dialog
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