Retry Fn hotkeys after Accessibility approval#583
Conversation
Greptile SummaryThis PR adds automatic retry of
Confidence Score: 5/5Safe to merge; the retry and fast-path registration logic is well-guarded against double registration and concurrent execution. Both code paths that can trigger registration (the 1-second polling loop and the applicationDidBecomeActive fast path) are protected by eventTap == nil, so re-entrant or overlapping calls are harmless. The cancelAccessibilityRetry call at the top of registerFunctionAwareTranscriptionHotkeys ensures the polling loop is torn down regardless of entry point. No data-race risk exists because all dispatch work is serialised on the main queue. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant App as AppDelegate
participant CHC as ConfigurableHotkeyController
participant OS as macOS AX/CGEvent
App->>CHC: registerDefaultHotkeys(runner)
CHC->>OS: CGEvent.tapCreate
OS-->>CHC: nil (AX not trusted)
CHC->>OS: AXIsProcessTrustedWithOptions (prompt)
CHC->>CHC: scheduleAccessibilityRetry deadline now+120s
loop every 1s while not trusted and before deadline
CHC->>OS: AXIsProcessTrusted
OS-->>CHC: false
CHC->>CHC: reschedule
end
Note over App,OS: User grants Accessibility in System Settings
alt Fast path via app activation
OS->>App: applicationDidBecomeActive
App->>CHC: retryFunctionAwareHotkeysIfTrusted(runner)
CHC->>CHC: cancelAccessibilityRetry
CHC->>OS: CGEvent.tapCreate
OS-->>CHC: tap success
CHC->>CHC: enable tap
else Polling path fires first
CHC->>OS: AXIsProcessTrusted
OS-->>CHC: true
CHC->>OS: CGEvent.tapCreate
OS-->>CHC: tap success
CHC->>App: statusMessage Accessibility permission enabled
end
Reviews (2): Last reviewed commit: "Address accessibility retry review feedb..." | Re-trigger Greptile |
0e9914f to
e189fdd
Compare
Summary
Verification