Skip to content

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(dictation): disable Default when no provider is set

altic-devd0793bffb24f
diff --git a/Sources/Fluid/Persistence/SettingsStore.swift b/Sources/Fluid/Persistence/SettingsStore.swift
index f5fbdb25..01e46fdf 100644
--- a/Sources/Fluid/Persistence/SettingsStore.swift
+++ b/Sources/Fluid/Persistence/SettingsStore.swift
@@ -795,7 +795,9 @@ final class SettingsStore: ObservableObject {
let mode = self.dictationPromptDisplayName(for: slot, appBundleID: appBundleID)
let modelName = PrivateAIModelRegistry.model(id: route.model)?.displayName ?? route.model
let model = modelName.replacingOccurrences(of: "Fluid-1 ", with: "")
- return model.isEmpty ? "\(mode) · Unavailable" : "\(mode) · \(model)"
+ // An unroutable selection runs no cleanup at all, so it reads as Basic rather than
+ // as a long "· Unavailable" line that overflows the pill.
+ return model.isEmpty ? "Basic" : "\(mode) · \(model)"
}
func dictationPromptDisplayName(for slot: DictationShortcutSlot, appBundleID: String?) -> String {
diff --git a/Sources/Fluid/Services/DictationPostProcessingService.swift b/Sources/Fluid/Services/DictationPostProcessingService.swift
index 6afd87aa..2a4dc0de 100644
--- a/Sources/Fluid/Services/DictationPostProcessingService.swift
+++ b/Sources/Fluid/Services/DictationPostProcessingService.swift
@@ -53,6 +53,10 @@ struct DictationProviderRoute: Equatable {
configuredModel = nil
}
+ return self.build(settings: settings, selectedProviderID: selectedProviderID, configuredModel: configuredModel)
+ }
+
+ private static func build(settings: SettingsStore, selectedProviderID: String, configuredModel: String?) -> Self {
let selectedModels = settings.selectedModelByProvider
let providerKeys = settings.providerAPIKeys
@@ -86,6 +90,38 @@ struct DictationProviderRoute: Equatable {
)
}
+ /// Where `.default` would route for dictation, regardless of what is selected now.
+ /// Mirrors the `.default` branch of `resolve` so the picker can drop an option that
+ /// would otherwise render as "Default · Unavailable".
+ static func resolveDictationDefault(settings: SettingsStore, appBundleID: String? = nil) -> Self {
+ let configuration = settings.dictationPromptConfiguration(for: .default)
+ let providerID = configuration.providerID.trimmingCharacters(in: .whitespacesAndNewlines)
+ let model = configuration.modelName.trimmingCharacters(in: .whitespacesAndNewlines)
+ if !providerID.isEmpty, !model.isEmpty {
+ return self.build(settings: settings, selectedProviderID: providerID, configuredModel: model)
+ }
+ let hasAppBinding = settings.appPromptBinding(for: .dictate, appBundleID: appBundleID) != nil
+ if !hasAppBinding, self.shouldUseLegacyPrivateAIRoute(
+ selectedProviderID: settings.selectedProviderID,
+ configuredProviderID: providerID,
+ configuredModel: model
+ ) {
+ return self.privateAIRoute(settings: settings)
+ }
+ return self.build(
+ settings: settings,
+ selectedProviderID: self.externalFallbackProviderID(from: settings.selectedProviderID),
+ configuredModel: nil
+ )
+ }
+
+ /// True when picking "Default" would actually reach a configured, verified provider.
+ static func isDictationDefaultAvailable(settings: SettingsStore, appBundleID: String? = nil) -> Bool {
+ let route = self.resolveDictationDefault(settings: settings, appBundleID: appBundleID)
+ guard !route.providerID.isEmpty, !route.model.isEmpty else { return false }
+ return DictationAIPostProcessingGate.isProviderConfigured(providerID: route.providerID, model: route.model)
+ }
+
static func privateAIRoute(settings: SettingsStore) -> Self {
guard let modelID = PrivateAIProviderPromptFormat.verifiedModelID(settings: settings) else {
return Self(providerID: "", providerKey: "", baseURL: "", model: "", apiKey: "")
diff --git a/Sources/Fluid/Views/BottomOverlayView.swift b/Sources/Fluid/Views/BottomOverlayView.swift
index 267cdb78..35ee70f4 100644
--- a/Sources/Fluid/Views/BottomOverlayView.swift
+++ b/Sources/Fluid/Views/BottomOverlayView.swift
@@ -1775,10 +1775,18 @@ private struct BottomOverlayPromptMenuView: View {
}
}
+ /// Dictation "Default" needs a configured external provider; other prompt modes always allow it.
+ private var isDefaultPromptAvailable: Bool {
+ self.promptMode.normalized != .dictate
+ || DictationProviderRoute.isDictationDefaultAvailable(settings: self.settings, appBundleID: DictationAppSession.shared.appID)
+ }
+
@ViewBuilder
private func offRow() -> some View {
let activeSlot = self.contentState.activeDictationShortcutSlot ?? .primary
- let isSelected = self.settings.resolvedDictationPromptSelection(for: activeSlot, appBundleID: DictationAppSession.shared.appID) == .off
+ let selection = self.settings.resolvedDictationPromptSelection(for: activeSlot, appBundleID: DictationAppSession.shared.appID)
+ // A Default that cannot route runs no cleanup, so Basic is what is really active.
+ let isSelected = selection == .off || (selection == .default && !self.isDefaultPromptAvailable)
Button(action: {
if self.promptMode.normalized == .dictate {
self.contentState.onDictationPromptSelectionRequested?(.off)
@@ -1815,12 +1823,14 @@ private struct BottomOverlayPromptMenuView: View {
@ViewBuilder
private func defaultRow(selectedID: String?) -> some View {
let activeSlot = self.contentState.activeDictationShortcutSlot ?? .primary
- let isSelected = (
+ let isAvailable = self.isDefaultPromptAvailable
+ let isSelected = isAvailable && (
self.promptMode.normalized == .dictate
? (self.settings.resolvedDictationPromptSelection(for: activeSlot, appBundleID: DictationAppSession.shared.appID) == .default)
: (selectedID == nil)
)
Button(action: {
+ guard isAvailable else { return }
if self.promptMode.normalized == .dictate {
self.contentState.onDictationPromptSelectionRequested?(.default)
} else {
@@ -1843,8 +1853,11 @@ private struct BottomOverlayPromptMenuView: View {
.background(self.rowBackground(isSelected: isSelected, rowID: "default"))
}
.buttonStyle(.plain)
+ .disabled(!isAvailable)
+ .opacity(isAvailable ? 1 : 0.45)
+ .help(isAvailable ? "Use your default provider" : "Add an API key to a provider to enable this prompt")
.onHover { hovering in
- self.hoveredRowID = hovering ? "default" : nil
+ self.hoveredRowID = hovering && isAvailable ? "default" : nil
}
}
diff --git a/Sources/Fluid/Views/NotchContentViews.swift b/Sources/Fluid/Views/NotchContentViews.swift
index 0d1ddc3e..1a93e410 100644
--- a/Sources/Fluid/Views/NotchContentViews.swift
+++ b/Sources/Fluid/Views/NotchContentViews.swift
@@ -819,15 +819,20 @@ struct NotchExpandedView: View {
ScrollView(.vertical, showsIndicators: true) {
VStack(alignment: .leading, spacing: 2) {
- let defaultSelected = promptMode.normalized == .dictate
+ let defaultAvailable = promptMode.normalized != .dictate
+ || DictationProviderRoute.isDictationDefaultAvailable(settings: self.settings, appBundleID: self.promptResolutionBundleID)
+ let defaultSelected = defaultAvailable && (promptMode.normalized == .dictate
? (self.settings.resolvedDictationPromptSelection(for: activeDictationSlot, appBundleID: self.promptResolutionBundleID) == .default)
- : (self.settings.selectedPromptID(for: promptMode) == nil)
+ : (self.settings.selectedPromptID(for: promptMode) == nil))
if promptMode.normalized == .dictate {
self.promptMenuRow(
"Basic",
rowID: "off",
- isSelected: self.settings.resolvedDictationPromptSelection(for: activeDictationSlot, appBundleID: self.promptResolutionBundleID) == .off,
+ isSelected: {
+ let selection = self.settings.resolvedDictationPromptSelection(for: activeDictationSlot, appBundleID: self.promptResolutionBundleID)
+ return selection == .off || (selection == .default && !defaultAvailable)
+ }(),
isEnabled: true
) {
self.contentState.onDictationPromptSelectionRequested?(.off)
@@ -836,7 +841,12 @@ struct NotchExpandedView: View {
}
}
- self.promptMenuRow(SettingsStore.DictationModeLabels.externalDefault, rowID: "default", isSelected: defaultSelected) {
+ self.promptMenuRow(
+ SettingsStore.DictationModeLabels.externalDefault,
+ rowID: "default",
+ isSelected: defaultSelected,
+ isEnabled: defaultAvailable
+ ) {
if promptMode.normalized == .dictate {
self.contentState.onDictationPromptSelectionRequested?(.default)
} else {