Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more
fix microphone alert controls
altic-dev5c3dc4b84f4d
diff --git a/Sources/Fluid/Persistence/BackupService.swift b/Sources/Fluid/Persistence/BackupService.swiftindex 4953a598..ff6139e4 100644--- a/Sources/Fluid/Persistence/BackupService.swift+++ b/Sources/Fluid/Persistence/BackupService.swift@@ -81,6 +81,7 @@ struct SettingsBackupPayload: Codable, Equatable {let saveAudioWithTranscriptionHistory: Bool?let audioHistoryBudgetGB: Double?let notifyAIProcessingFailures: Bool?+ let showMicrophoneChangeAlerts: Bool?let weekendsDontBreakStreak: Boollet fillerWords: [String]let removeFillerWordsEnabled: Booldiff --git a/Sources/Fluid/Persistence/SettingsStore.swift b/Sources/Fluid/Persistence/SettingsStore.swiftindex 50b378d4..ceae55ab 100644--- a/Sources/Fluid/Persistence/SettingsStore.swift+++ b/Sources/Fluid/Persistence/SettingsStore.swift@@ -3143,6 +3143,18 @@ final class SettingsStore: ObservableObject {}}+ /// Whether transient microphone selection and availability alerts are shown.+ var showMicrophoneChangeAlerts: Bool {+ get {+ let value = self.defaults.object(forKey: Keys.showMicrophoneChangeAlerts)+ return value as? Bool ?? true+ }+ set {+ objectWillChange.send()+ self.defaults.set(newValue, forKey: Keys.showMicrophoneChangeAlerts)+ }+ }+func makeBackupPayload() -> SettingsBackupPayload {SettingsBackupPayload(selectedProviderID: self.selectedProviderID,@@ -3212,6 +3224,7 @@ final class SettingsStore: ObservableObject {saveAudioWithTranscriptionHistory: self.saveAudioWithTranscriptionHistory,audioHistoryBudgetGB: self.audioHistoryBudgetGB,notifyAIProcessingFailures: self.notifyAIProcessingFailures,+ showMicrophoneChangeAlerts: self.showMicrophoneChangeAlerts,weekendsDontBreakStreak: self.weekendsDontBreakStreak,fillerWords: self.fillerWords,removeFillerWordsEnabled: self.removeFillerWordsEnabled,@@ -3351,6 +3364,9 @@ final class SettingsStore: ObservableObject {if let notifyAIProcessingFailures = payload.notifyAIProcessingFailures {self.notifyAIProcessingFailures = notifyAIProcessingFailures}+ if let showMicrophoneChangeAlerts = payload.showMicrophoneChangeAlerts {+ self.showMicrophoneChangeAlerts = showMicrophoneChangeAlerts+ }self.weekendsDontBreakStreak = payload.weekendsDontBreakStreakself.fillerWords = payload.fillerWordsself.removeFillerWordsEnabled = payload.removeFillerWordsEnabled@@ -5078,6 +5094,7 @@ private extension SettingsStore {static let microphoneSelectionMode = "MicrophoneSelectionMode"// Keep the original persisted key so existing installs migrate in place.static let microphoneSelectionMigrationVersion = "AppOnlyMicrophoneSelectionMigrationVersion"+ static let showMicrophoneChangeAlerts = "ShowMicrophoneChangeAlerts"static let visualizerNoiseThreshold = "VisualizerNoiseThreshold"static let launchAtStartup = "LaunchAtStartup"static let showInDock = "ShowInDock"diff --git a/Sources/Fluid/Services/ASRService.swift b/Sources/Fluid/Services/ASRService.swiftindex 200e5297..5b5c111e 100644--- a/Sources/Fluid/Services/ASRService.swift+++ b/Sources/Fluid/Services/ASRService.swift@@ -1388,11 +1388,6 @@ final class ASRService: ObservableObject {availableInputs: initialInputSnapshot.0,defaultInputUID: initialInputSnapshot.1)- microphonePreferenceCoordinator.scheduleStartupNoticeIfEligible(- microphoneAuthorized: self.micStatus == .authorized,- launchAllowsPresentation: (NSApp.delegate as? AppDelegate)?- .shouldPresentStartupMicrophoneNotice ?? true- )self.registerDefaultDeviceChangeListener()self.registerEngineConfigurationChangeObserver()@@ -1495,11 +1490,6 @@ final class ASRService: ObservableObject {self.micPermissionGranted = grantedself.micStatus = granted ? .authorized : .deniedif granted {- AppServices.shared.microphonePreferenceCoordinator.scheduleStartupNoticeIfEligible(- microphoneAuthorized: true,- launchAllowsPresentation: (NSApp.delegate as? AppDelegate)?- .shouldPresentStartupMicrophoneNotice ?? true- )await self.prewarmConfiguredAudioCaptureIfPossible(reason: "permission_granted")}}diff --git a/Sources/Fluid/UI/SettingsView.swift b/Sources/Fluid/UI/SettingsView.swiftindex fbd91b5d..f4d03b74 100644--- a/Sources/Fluid/UI/SettingsView.swift+++ b/Sources/Fluid/UI/SettingsView.swift@@ -907,16 +907,6 @@ struct SettingsView: View {Divider().opacity(0.2)}- self.optionToggleRow(- title: "Notify AI Enhancement Failures",- description: "Show a macOS notification when AI Enhancement fails and raw transcription is typed.",- isOn: Binding(- get: { SettingsStore.shared.notifyAIProcessingFailures },- set: { SettingsStore.shared.notifyAIProcessingFailures = $0 }- )- )- Divider().opacity(0.2)-self.optionToggleRow(title: "Weekends Don't Break Streak",description: "Skip Saturday and Sunday when calculating usage streaks. Perfect for weekday-only users.",@@ -1078,6 +1068,43 @@ struct SettingsView: View {.padding(16)}+ // Notification Settings Card+ ThemedCard(style: .standard) {+ VStack(alignment: .leading, spacing: 14) {+ Label("Notifications", systemImage: "bell.fill")+ .font(.headline)+ .foregroundStyle(.primary)++ VStack(alignment: .leading, spacing: 12) {+ self.optionToggleRow(+ title: "AI Enhancement Failures",+ description: "Notify when AI Enhancement fails and raw transcription is typed.",+ isOn: Binding(+ get: { SettingsStore.shared.notifyAIProcessingFailures },+ set: { SettingsStore.shared.notifyAIProcessingFailures = $0 }+ )+ )++ Divider().opacity(0.2)++ self.optionToggleRow(+ title: "Microphone Changes",+ description: "Show an alert when FluidVoice changes or loses its microphone.",+ isOn: Binding(+ get: { self.settings.showMicrophoneChangeAlerts },+ set: { enabled in+ self.settings.showMicrophoneChangeAlerts = enabled+ if enabled == false {+ MicrophoneChangeOverlayController.shared.hide()+ }+ }+ )+ )+ }+ }+ .padding(16)+ }+// Audio Devices CardThemedCard(style: .standard) {VStack(alignment: .leading, spacing: 14) {diff --git a/Sources/Fluid/Views/AutomaticDictionaryCorrectionOverlay.swift b/Sources/Fluid/Views/AutomaticDictionaryCorrectionOverlay.swiftindex f1e2ea0b..338ef351 100644--- a/Sources/Fluid/Views/AutomaticDictionaryCorrectionOverlay.swift+++ b/Sources/Fluid/Views/AutomaticDictionaryCorrectionOverlay.swift@@ -251,7 +251,9 @@ final class MicrophoneChangeOverlayController {private init() {}func show(_ notice: MicrophoneChangeNotice) {- guard Bundle.main.bundleIdentifier == "com.FluidApp.app" else { return }+ guard Bundle.main.bundleIdentifier == "com.FluidApp.app",+ SettingsStore.shared.showMicrophoneChangeAlerts+ else { return }self.generation &+= 1let currentGeneration = self.generationself.dismissTask?.cancel()@@ -264,6 +266,9 @@ final class MicrophoneChangeOverlayController {self?.hide()NotificationCenter.default.post(name: .openMicrophoneSettingsRequested, object: nil)},+ onDisable: { [weak self] in+ self?.disableFutureAlerts()+ },onDismiss: { [weak self] in self?.hide() })if let hostingView = self.hostingView {@@ -295,6 +300,11 @@ final class MicrophoneChangeOverlayController {}}+ func disableFutureAlerts() {+ SettingsStore.shared.showMicrophoneChangeAlerts = false+ self.hide()+ }+func hide() {self.generation &+= 1let hideGeneration = self.generation@@ -386,10 +396,12 @@ private struct MicrophoneChangeOverlayView: View {let displayDuration: TimeIntervallet startedAt: Datelet onSettings: () -> Void+ let onDisable: () -> Voidlet onDismiss: () -> Void@Environment(\.accessibilityReduceMotion) private var reduceMotion@State private var isCloseHovered = false+ @State private var isDisableHovered = false@State private var isSettingsHovered = falsevar body: some View {@@ -435,6 +447,11 @@ private struct MicrophoneChangeOverlayView: View {Spacer(minLength: 8)+ Button("Do not show again", action: self.onDisable)+ .buttonStyle(TransientOverlaySettingsButtonStyle(isHovered: self.isDisableHovered))+ .onHover { self.isDisableHovered = $0 }+ .help("Turn off microphone change alerts")+Button("Settings", action: self.onSettings).buttonStyle(TransientOverlaySettingsButtonStyle(isHovered: self.isSettingsHovered)).onHover { self.isSettingsHovered = $0 }@@ -443,7 +460,7 @@ private struct MicrophoneChangeOverlayView: View {}.padding(.horizontal, 14).padding(.vertical, 12)- .frame(width: 460)+ .frame(width: 540).background(TransientOverlayBackground()).overlay(alignment: .bottomLeading) {TransientOverlayCountdownBar(diff --git a/Tests/FluidDictationIntegrationTests/HotkeyShortcutTests.swift b/Tests/FluidDictationIntegrationTests/HotkeyShortcutTests.swiftindex c1976cd4..41758354 100644--- a/Tests/FluidDictationIntegrationTests/HotkeyShortcutTests.swift+++ b/Tests/FluidDictationIntegrationTests/HotkeyShortcutTests.swift@@ -15,6 +15,7 @@ final class HotkeyShortcutTests: XCTestCase {private let microphonePriorityKey = "MicrophonePriority"private let suppressedMicrophoneUIDsKey = "SuppressedMicrophoneUIDs"private let microphoneSelectionMigrationVersionKey = "AppOnlyMicrophoneSelectionMigrationVersion"+ private let showMicrophoneChangeAlertsKey = "ShowMicrophoneChangeAlerts"private let experimentalDirectAudioCaptureEnabledKey = "ExperimentalDirectAudioCaptureEnabled"@MainActor@@ -1142,6 +1143,29 @@ final class HotkeyShortcutTests: XCTestCase {}}+ @MainActor+ func testDisablingMicrophoneChangeAlertsPreservesMicrophonePriority() throws {+ try self.withRestoredDefaults(keys: [+ self.microphonePriorityKey,+ self.showMicrophoneChangeAlertsKey,+ ]) {+ let defaults = UserDefaults.standard+ defaults.removeObject(forKey: self.showMicrophoneChangeAlertsKey)+ let microphone = Self.device(uid: "preferred", name: "Preferred")+ SettingsStore.shared.microphonePriority = [+ .init(uid: microphone.uid, name: microphone.name),+ ]++ XCTAssertTrue(SettingsStore.shared.showMicrophoneChangeAlerts)++ MicrophoneChangeOverlayController.shared.disableFutureAlerts()++ XCTAssertFalse(SettingsStore.shared.showMicrophoneChangeAlerts)+ XCTAssertEqual(SettingsStore.shared.makeBackupPayload().showMicrophoneChangeAlerts, false)+ XCTAssertEqual(SettingsStore.shared.microphonePriority.map(\.uid), [microphone.uid])+ }+ }+@MainActorfunc testFailedPriorityDeviceAdvancesWithoutChangingSavedOrder() throws {try self.withRestoredDefaults(keys: [