feat(permissions): add NSAlert-based permission prompts with throttling#80
Merged
missuo merged 6 commits intoApr 13, 2026
Merged
Conversation
- Add SPLocalization utility for runtime language switching via NSUserDefaults (KoeInterfaceLanguage key) - Add en.lproj/Localizable.strings with all user-facing strings - Add zh-Hans.lproj/Localizable.strings with Chinese translations - Update Info.plist to declare CFBundleLocalizations - Support 'Follow System', 'English', and 'Simplified Chinese' modes - KoeLocalizedString() macro for convenient access throughout ObjC code Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
Replace all hardcoded English strings in the status bar menu with KoeLocalizedString() calls. Covers: - Status text (Ready, Listening, Connecting, etc.) - Permission labels and states - Statistics display - Menu actions (Setup Wizard, Quit, etc.) - Microphone submenu items Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
Replace all hardcoded English strings in update alerts with KoeLocalizedString() calls. Covers update available, up-to-date, failed, incompatible, and button labels. Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
Replace hardcoded English strings in notification titles and the Edit menu with KoeLocalizedString() calls. Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
Add Interface Language dropdown in the About pane with options: - Follow System (default for new installs) - English - 简体中文 Language preference is stored in NSUserDefaults and takes effect immediately for KoeLocalizedString() calls. A dialog informs the user that some system UI elements may require an app restart. Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
Add showPermissionAlertForType: to SPPermissionManager with: - Localized title and message for each permission type - 'Open Settings' button that deep-links to the right System Settings pane - 'Don't Remind Again' button backed by NSUserDefaults - Alert throttling: once dismissed with 'Don't Remind Again', the alert won't appear again for that permission type Integrate into SPAppDelegate: - Microphone denied → alert with settings link (blocks startup) - Accessibility missing → alert with settings link - Input Monitoring missing → alert with settings link - Speech Recognition denied (apple-speech provider) → alert Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add user-facing
NSAlertpermission prompts when required macOS permissions are missing, with per-permission "Don't Remind Again" throttling. All alert text uses the localization infrastructure from #79.Motivation
Currently, when critical permissions (Microphone, Accessibility, Input Monitoring) are missing, Koe only logs to the console (
NSLog) and/or plays an error sound. Users have no clear indication of why the app isn't working or how to fix it. This PR adds visible, actionable prompts consistent with the existingshowAlert:pattern used inSPUpdateManager.Changes
SPPermissionManager.h/.mSPPermissionTypeenum:Microphone,Accessibility,InputMonitoring,SpeechRecognitionshowPermissionAlertForType:settingsURL:— shows a localizedNSAlertwith:NSUserDefaultsresetDontRemindForType:for clearing the suppression flagSPAppDelegate.mIntegration at startup after
checkAllPermissionsWithCompletion::NSLog+ error sound, no UIThrottling
KoePermissionDontRemind_<N>key per permission type inNSUserDefaultsresetDontRemindForType:Testing
.mfiles verified for balanced braces/brackets/parens