Skip to content

feat: gate Record on mic & speech permissions with onboarding - #25

Merged
pranc1ngpegasus merged 3 commits into
mainfrom
feat/permission-onboarding
May 28, 2026
Merged

feat: gate Record on mic & speech permissions with onboarding#25
pranc1ngpegasus merged 3 commits into
mainfrom
feat/permission-onboarding

Conversation

@pranc1ngpegasus

Copy link
Copy Markdown
Member

Summary

  • Add a startup onboarding screen that gates the Record UI until the
    Microphone and Speech Recognition permissions are both Granted. Per-row
    Allow buttons fire the OS prompt directly; if a permission is already
    Denied the button switches to Open Settings and deep-links to the
    right Privacy & Security pane.
  • Expose a small permission FFI in WispAudioKit (wisp_permission_status
    / wisp_permission_request, mic via AVCaptureDevice and speech via
    SFSpeechRecognizer) with a safe Rust wrapper in wisp-audiokit.
  • Ship a wisp-desktop.entitlements file declaring
    com.apple.security.device.audio-input, cs.allow-jit, and an
    explicit app-sandbox = false. This is required because the release
    workflow signs with --options runtime (hardened runtime); without
    the audio-input entitlement AVCaptureDevice.requestAccess(for: .audio)
    silently returns false and no TCC entry is created. Wire the same
    file into the release codesign step.

Why

Before this change, the only signal that the user was missing a permission
was the small Failed: WispAudioKit session start failed: Permission denied: Microphone line in the status bar after pressing Record, and on
released builds the OS prompt never appeared in the first place — so even
clicking around in System Settings couldn't recover the user, because no
TCC entry for the app ever got created. Onboarding plus the missing
entitlement together produce the expected "Allow" → OS prompt → Granted
flow on a fresh install of the distributed .dmg.

Test plan

  • cargo build -p wisp-desktop --release clean
  • cargo test -p wisp-desktop -p wisp-audiokit (14 passed)
  • cargo clippy -p wisp-desktop -p wisp-audiokit -p wisp-audiokit-sys clean
  • Local repro: bundle into ~/Applications/Wisp-test.app, sign with
    --entitlements apps/wisp-desktop/wisp-desktop.entitlements,
    tccutil reset Microphone dev.mokmok.wisp + same for
    SpeechRecognition, launch. Both Allow buttons fire the OS prompt
    and after Granted the UI transitions to the Record screen.
  • Confirm the release workflow on tag push produces a .dmg whose
    embedded app has the entitlements set (verifiable via
    codesign --display --entitlements - Wisp.app).

🤖 Generated with Claude Code

pranc1ngpegasus and others added 3 commits May 29, 2026 00:21
Previously the only way to discover missing TCC permissions was to press
Record and read the failure in the status bar — and on hardened-runtime
builds the OS prompt never appeared at all because the ad-hoc signature
lacked com.apple.security.device.audio-input, so even granting after the
fact required digging through System Settings.

Add a permission-aware onboarding screen that shows up whenever
Microphone or Speech Recognition is not yet Granted, with Allow / Open
Settings buttons that branch on the underlying TCC state. Wire the
entitlement through both the local repro path (the new
wisp-desktop.entitlements file) and the release codesign step so the
distributed .dmg behaves the same way.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pranc1ngpegasus
pranc1ngpegasus merged commit 75bca63 into main May 28, 2026
3 checks passed
@pranc1ngpegasus
pranc1ngpegasus deleted the feat/permission-onboarding branch May 28, 2026 15:31
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