Skip to content

[fix] onboarding: live-refresh permission status on focus - #36

Merged
YJack0000 merged 1 commit into
mainfrom
fix/onboarding-perm-refresh
Jun 22, 2026
Merged

[fix] onboarding: live-refresh permission status on focus#36
YJack0000 merged 1 commit into
mainfrom
fix/onboarding-perm-refresh

Conversation

@YJack0000

Copy link
Copy Markdown
Contributor

Problem

On the onboarding Permissions step, granting microphone (or screen-recording) access in the system prompt / System Settings didn't update the row — it stayed showing "not authorized" until you manually hit Re-check.

Cause

The step only re-checked permissions on entry (useEffect keyed on step === 4). When you switch to System Settings, grant, and come back, nothing triggers a re-check.

Fix

Re-check on window focus + visibilitychange, plus a 2 s fallback poll while on the step (webview focus events aren't fully reliable across the app-switch). The Rust microphone_status() reads the live AVCaptureDevice authorization status, so the re-check reflects the grant immediately and the row flips to ✓ on its own. The poll is torn down when leaving the step.

Testing

bunx tsc --noEmit clean · bun run build succeeds.

The permissions step only re-checked on entry, so after granting mic (or screen)
access in the system prompt / System Settings, the row stayed stale until a
manual re-check. Now it re-checks on window focus + visibilitychange, with a 2 s
fallback poll while on the step (webview focus events aren't reliable across the
app-switch to System Settings). microphone_status() reads the live AVCaptureDevice
status, so the recheck reflects the grant immediately and the row flips to ✓.
@YJack0000
YJack0000 merged commit a6148e0 into main Jun 22, 2026
@YJack0000
YJack0000 deleted the fix/onboarding-perm-refresh branch June 22, 2026 16:14
@sonarqubecloud

Copy link
Copy Markdown

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