fix: mic permission check, Fn keycode filter, longer clipboard restore, error icon, TCC hint

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:58:10 +02:00
co-authored by Claude Sonnet 5.5
parent ebc113ee07
commit 56385c7ad8
4 changed files with 22 additions and 3 deletions
+18 -2
View File
@@ -25,10 +25,17 @@ final class AppModel: ObservableObject {
cleaner: PassthroughCleaner(),
inserter: TextInserter(pasteboard: SystemPasteboard(), paster: CGEventPaster())
)
controller.onStateChange = { [weak self] in self?.state = $0 }
controller.onStateChange = { [weak self] in
self?.state = $0
if $0 == .recording { self?.lastError = nil }
}
controller.onError = { [weak self] in self?.lastError = $0 }
hotkey.onEvent = { [weak self] event in
guard let self, self.modelReady else { return }
if event == .pressed, AVCaptureDevice.authorizationStatus(for: .audio) != .authorized {
self.lastError = "Microfoon-toegang ontbreekt"
return
}
Task { await self.controller.handle(event) }
}
Task { await start() }
@@ -46,7 +53,9 @@ final class AppModel: ObservableObject {
var iconName: String {
switch state {
case .idle: return modelReady ? "mic" : "mic.slash"
case .idle:
if lastError != nil { return "exclamationmark.triangle" }
return modelReady ? "mic" : "mic.slash"
case .recording: return "mic.fill"
case .transcribing, .inserting: return "waveform"
}
@@ -75,6 +84,13 @@ final class AppModel: ObservableObject {
_ = AXIsProcessTrustedWithOptions(["AXTrustedCheckOptionPrompt": true] as CFDictionary)
}
retryHotkey()
transcriber.onProgress = { [weak self] fraction in
Task { @MainActor in
self?.modelStatus = fraction < 1
? "Model downloaden… \(Int(fraction * 100))%"
: "Model laden…"
}
}
do {
try await transcriber.load()
modelReady = true