Refresh permission warnings after returning to Speaky - #6
Open
amrshawqy wants to merge 2 commits into
Open
Conversation
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
Refresh Speaky's permission-dependent state when the app becomes active so the main-window warning clears automatically after a user grants access in System Settings.
This keeps permission handling responsive without adding another timer or polling loop.
Problem
The Settings screen already rechecks macOS permissions, but the main warning banner is backed by
AppState.permissionWarning, which was only refreshed at launch. As a result:With the global Escape work in #5, a second piece of state also needs refreshing: if the active Escape event tap could not be created before Accessibility was granted, Speaky should retry it after the user returns.
Changes
AppStatemethod.Scope
The production change is limited to three existing files:
AppState.swiftHotkeyManager.swiftSpeakyApp.swiftOne focused test file covers the warning policy. This PR does not reset TCC, alter permission prompts, add background polling, or change signing/build identity.
Validation
arm64andx86_64./Applications/Speaky.appexecutable matched the verified Release product byte-for-byte and launched successfully.Review / merge order
This PR is intentionally stacked on #5 because it refreshes the Escape event-tap state introduced there.
Please merge #5 first. Until then, GitHub will show the #5 commit in this PR as well; after #5 is merged, this PR should reduce to the single permission-refresh commit.
Manual verification