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
Refactor dictation prompt selection and trim ContentView type body
altic-dev9573a6be7bf5
diff --cc Sources/Fluid/Analytics/AnalyticsService.swiftindex 40ea39b2,6ae2242c..6167a799--- a/Sources/Fluid/Analytics/AnalyticsService.swift+++ b/Sources/Fluid/Analytics/AnalyticsService.swift@@@ -80,7 -82,7 +82,7 @@@ final class AnalyticsService"environment": environment,// Low-cardinality settings snapshot-- "ai_processing_enabled": settings.enableAIProcessing,++ "ai_processing_enabled": !settings.isDictationPromptOff,"streaming_preview_enabled": settings.enableStreamingPreview,"press_and_hold_mode": settings.pressAndHoldMode,"copy_to_clipboard_enabled": settings.copyTranscriptionToClipboard,diff --cc Sources/Fluid/ContentView.swiftindex 18e4e638,cad664ba..f0dac998--- a/Sources/Fluid/ContentView.swift+++ b/Sources/Fluid/ContentView.swift@@@ -976,7 -950,7 +984,7 @@@ struct ContentView: ViewaccessibilityEnabled: self.accessibilityEnabled,markAISkipped: {self.settings.onboardingAISkipped = true-- self.menuBarManager.setAIProcessingEnabled(false)++ self.settings.setDictationPromptSelection(.off)},markPlaygroundValidated: {self.settings.onboardingPlaygroundValidated = true@@@ -1700,8 -1668,8 +1708,8 @@@promptTest.lastOutputText = ""promptTest.lastError = ""-- guard DictationAIPostProcessingGate.isConfigured() else {-- promptTest.lastError = "AI post-processing is not configured. Enable AI Enhancement and configure a provider/model (and API key for non-local endpoints)."++ guard DictationAIPostProcessingGate.isProviderConfigured() else {++ promptTest.lastError = "AI post-processing is not configured. Configure a provider/model (and API key for non-local endpoints) to test prompts."self.menuBarManager.setProcessing(false)return}@@@ -1752,8 -1720,9 +1760,11 @@@var finalText: String-- // Check if we should use AI processing- let shouldUseAI = DictationAIPostProcessingGate.isConfigured() || (promptOverride != nil && DictationAIPostProcessingGate.isProviderConfigured())- let shouldUseAI = DictationAIPostProcessingGate.isConfigured()++ // Check if we should use AI processing.++ // Prompt mode can still use AI when a provider is configured even if the global gate is off.++ let shouldUseAI = DictationAIPostProcessingGate.isConfigured() ||++ (promptOverride != nil && DictationAIPostProcessingGate.isProviderConfigured())+ let transcriptionModelInfo = self.currentTranscriptionModelInfo()if shouldUseAI {DebugLogger.shared.debug("Routing transcription through AI post-processing", source: "ContentView")@@@ -1764,7 -1736,19 +1778,19 @@@// Ensure the status label becomes visible immediately.await Task.yield()- finalText = await self.processTextWithAI(transcribedText)+ finalText = await self.processTextWithAI(transcribedText, overrideSystemPrompt: promptOverride)+ let postProcessingLatencyMs = Int((Date().timeIntervalSince(postProcessingStart) * 1000).rounded())+ AnalyticsService.shared.capture(+ .dictationPostProcessingCompleted,+ properties: [+ "latency_ms": postProcessingLatencyMs,+ "input_chars": postProcessingInputChars,+ "post_processing_provider": postProcessingModelInfo.provider ?? "unknown",+ "post_processing_model": postProcessingModelInfo.model ?? "unknown",+ "transcription_provider": transcriptionModelInfo.provider,+ "transcription_model": transcriptionModelInfo.model,+ ]+ )// Clear transient status text before leaving processing state to avoid// a brief non-shimmer "Refining..." preview flash.@@@ -2368,69 -2348,146 +2396,6 @@@self.newModelName = ""}-- // MARK: - OpenAI-compatible call for playground---- private func callOpenAIChat() async {-- guard !self.isCallingAI else { return }-- await MainActor.run { self.isCallingAI = true }-- defer { Task { await MainActor.run { isCallingAI = false } } }---- let result = await processTextWithAI(aiInputText)-- await MainActor.run { self.aiOutputText = result }-- }---- private func getModelStatusText() -> String {-- if self.asr.isLoadingModel {-- return "Loading model into memory... (30-60 sec)"-- } else if self.asr.isDownloadingModel {-- return "Downloading model... Please wait."-- } else if self.asr.isAsrReady {-- return "Model is ready to use!"-- } else if self.asr.modelsExistOnDisk {-- return "Model cached. Will load on first use."-- } else {-- return "Model will download when needed."-- }-- }---- private var onboardingVoiceModelReady: Bool {-- self.asr.isAsrReady || self.asr.modelsExistOnDisk || SettingsStore.shared.selectedSpeechModel.isInstalled-- }---- private var onboardingMicrophoneReady: Bool {-- self.asr.micStatus == .authorized-- }---- private var onboardingAccessibilityReady: Bool {-- self.accessibilityEnabled-- }---- private var onboardingAIReady: Bool {-- self.settings.onboardingAISkipped || DictationAIPostProcessingGate.isConfigured()-- }---- private var onboardingPlaygroundReady: Bool {-- self.settings.onboardingPlaygroundValidated-- }---- private var canCompleteOnboarding: Bool {-- self.onboardingVoiceModelReady &&-- self.onboardingMicrophoneReady &&-- self.onboardingAccessibilityReady &&-- self.onboardingAIReady &&-- self.onboardingPlaygroundReady-- }---- @MainActor- private func completeOnboardingIfPossible() {- guard self.canCompleteOnboarding else { return }-- self.settings.onboardingCompleted = true-- let isOnboarded = self.asr.isAsrReady || self.asr.modelsExistOnDisk- self.selectedSidebarItem = isOnboarded ? .preferences : .welcome- }-- private func labelFor(status: AVAuthorizationStatus) -> String {- switch status {- case .authorized: return "Microphone: Authorized"- case .denied: return "Microphone: Denied"- case .restricted: return "Microphone: Restricted"- case .notDetermined: return "Microphone: Not Determined"- @unknown default: return "Microphone: Unknown"- }- }-- private func checkAccessibilityPermissions() -> Bool {- return AXIsProcessTrusted()- }-- private func openAccessibilitySettings() {- let options = [kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String: true] as CFDictionary- AXIsProcessTrustedWithOptions(options)- self.didOpenAccessibilityPane = true- UserDefaults.standard.set(true, forKey: self.accessibilityRestartFlagKey)- }-- private func restartApp() {- let appPath = Bundle.main.bundlePath- let process = Process()- process.launchPath = "/usr/bin/open"- process.arguments = ["-n", appPath]- // Clear pending flag and hide prompt before restarting- UserDefaults.standard.set(false, forKey: self.accessibilityRestartFlagKey)- self.showRestartPrompt = false- try? process.run()- DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {- NSApp.terminate(nil)- }- }-- private func startAccessibilityPolling() {- // Don't poll if already enabled or if we've already auto-restarted once- guard !self.accessibilityEnabled else { return }- guard !UserDefaults.standard.bool(forKey: self.hasAutoRestartedForAccessibilityKey) else { return }-- // Cancel any existing polling task- self.accessibilityPollingTask?.cancel()-- // Start background polling- self.accessibilityPollingTask = Task {- while !Task.isCancelled {- try? await Task.sleep(nanoseconds: 2_000_000_000) // Poll every 2 seconds-- // Check if permission was granted- let nowTrusted = AXIsProcessTrusted()- if nowTrusted && !self.accessibilityEnabled {- await MainActor.run {- DebugLogger.shared.info("Accessibility permission granted! Auto-restarting app...", source: "ContentView")-- // Mark that we've auto-restarted to prevent loops- UserDefaults.standard.set(true, forKey: self.hasAutoRestartedForAccessibilityKey)-- // Give user brief moment to see any UI feedback- DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {- self.restartApp()- }- }- break // Stop polling after triggering restart- }- }- }- }--- private func revealAppInFinder() {-- let appPath = Bundle.main.bundlePath-- NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: appPath)])-- }---- private func openApplicationsFolder() {-- NSWorkspace.shared.open(URL(fileURLWithPath: "/Applications"))-- }--private func initializeHotkeyManagerIfNeeded() {NotchContentState.shared.onPromptModeSwitchRequested = { mode inself.handleLivePromptModeSwitch(mode)@@@ -2447,9 -2504,9 +2412,6 @@@NotchContentState.shared.onUndoLastAIRequested = {self.undoLastAIProcessingFromHistory()}-- NotchContentState.shared.onToggleAIProcessingRequested = {-- _ = self.menuBarManager.toggleAIProcessingEnabled()-- }NotchContentState.shared.onOpenPreferencesRequested = {self.menuBarManager.openPreferencesFromUI()}@@@ -2732,87 -2741,6 +2694,152 @@@// AudioDevice and AudioHardwareObserver moved to Services/AudioDeviceService.swift++// MARK: - ContentView Playground & Onboarding Helpers++++extension ContentView {++ private func callOpenAIChat() async {++ guard !self.isCallingAI else { return }++ await MainActor.run { self.isCallingAI = true }++ defer { Task { await MainActor.run { isCallingAI = false } } }++++ let result = await processTextWithAI(aiInputText)++ await MainActor.run { self.aiOutputText = result }++ }++++ private func getModelStatusText() -> String {++ if self.asr.isLoadingModel {++ return "Loading model into memory... (30-60 sec)"++ } else if self.asr.isDownloadingModel {++ return "Downloading model... Please wait."++ } else if self.asr.isAsrReady {++ return "Model is ready to use!"++ } else if self.asr.modelsExistOnDisk {++ return "Model cached. Will load on first use."++ } else {++ return "Model will download when needed."++ }++ }++++ private var onboardingVoiceModelReady: Bool {++ self.asr.isAsrReady || self.asr.modelsExistOnDisk || SettingsStore.shared.selectedSpeechModel.isInstalled++ }++++ private var onboardingMicrophoneReady: Bool {++ self.asr.micStatus == .authorized++ }++++ private var onboardingAccessibilityReady: Bool {++ self.accessibilityEnabled++ }++++ private var onboardingAIReady: Bool {++ self.settings.onboardingAISkipped || DictationAIPostProcessingGate.isConfigured()++ }++++ private var onboardingPlaygroundReady: Bool {++ self.settings.onboardingPlaygroundValidated++ }++++ private var canCompleteOnboarding: Bool {++ self.onboardingVoiceModelReady &&++ self.onboardingMicrophoneReady &&++ self.onboardingAccessibilityReady &&++ self.onboardingAIReady &&++ self.onboardingPlaygroundReady++ }++++ @MainActor++ private func revealAppInFinder() {++ let appPath = Bundle.main.bundlePath++ NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: appPath)])++ }++++ private func openApplicationsFolder() {++ NSWorkspace.shared.open(URL(fileURLWithPath: "/Applications"))++ }++}+++// MARK: - ContentView Accessibility & Lifecycle Helpers++extension ContentView {+ func completeOnboardingIfPossible() {+ guard self.canCompleteOnboarding else { return }++ self.settings.onboardingCompleted = true++ let isOnboarded = self.asr.isAsrReady || self.asr.modelsExistOnDisk+ self.selectedSidebarItem = isOnboarded ? .preferences : .welcome+ }++ func labelFor(status: AVAuthorizationStatus) -> String {+ switch status {+ case .authorized: return "Microphone: Authorized"+ case .denied: return "Microphone: Denied"+ case .restricted: return "Microphone: Restricted"+ case .notDetermined: return "Microphone: Not Determined"+ @unknown default: return "Microphone: Unknown"+ }+ }++ func checkAccessibilityPermissions() -> Bool {+ return AXIsProcessTrusted()+ }++ func openAccessibilitySettings() {+ let options = [kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String: true] as CFDictionary+ AXIsProcessTrustedWithOptions(options)+ self.didOpenAccessibilityPane = true+ UserDefaults.standard.set(true, forKey: self.accessibilityRestartFlagKey)+ }++ func restartApp() {+ let appPath = Bundle.main.bundlePath+ let process = Process()+ process.launchPath = "/usr/bin/open"+ process.arguments = ["-n", appPath]+ // Clear pending flag and hide prompt before restarting+ UserDefaults.standard.set(false, forKey: self.accessibilityRestartFlagKey)+ self.showRestartPrompt = false+ try? process.run()+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {+ NSApp.terminate(nil)+ }+ }++ func startAccessibilityPolling() {+ // Don't poll if already enabled or if we've already auto-restarted once+ guard !self.accessibilityEnabled else { return }+ guard !UserDefaults.standard.bool(forKey: self.hasAutoRestartedForAccessibilityKey) else { return }++ // Cancel any existing polling task+ self.accessibilityPollingTask?.cancel()++ // Start background polling+ self.accessibilityPollingTask = Task {+ while !Task.isCancelled {+ try? await Task.sleep(nanoseconds: 2_000_000_000) // Poll every 2 seconds++ // Check if permission was granted+ let nowTrusted = AXIsProcessTrusted()+ if nowTrusted && !self.accessibilityEnabled {+ await MainActor.run {+ DebugLogger.shared.info("Accessibility permission granted! Auto-restarting app...", source: "ContentView")++ // Mark that we've auto-restarted to prevent loops+ UserDefaults.standard.set(true, forKey: self.hasAutoRestartedForAccessibilityKey)++ // Give user brief moment to see any UI feedback+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {+ self.restartApp()+ }+ }+ break // Stop polling after triggering restart+ }+ }+ }+ }+}+// MARK: - Card Animation Modifierstruct CardAppearAnimation: ViewModifier {diff --cc Sources/Fluid/Persistence/SettingsStore.swiftindex dddc4259,cfafda6b..ac301b40--- a/Sources/Fluid/Persistence/SettingsStore.swift+++ b/Sources/Fluid/Persistence/SettingsStore.swift@@@ -23,6 -23,6 +23,7 @@@ final class SettingsStore: ObservableObself.migrateProviderAPIKeysIfNeeded()self.scrubSavedProviderAPIKeys()self.migrateDictationPromptProfilesIfNeeded()++ self.migrateLegacyDictationAIPreferenceIfNeeded()self.normalizePromptSelectionsIfNeeded()self.migrateOverlayBottomOffsetTo50IfNeeded()}@@@ -82,6 -78,6 +83,12 @@@}}++ enum DictationPromptSelection: Equatable {++ case off++ case `default`++ case profile(String)++ }++struct DictationPromptProfile: Codable, Identifiable, Hashable {let id: Stringvar name: String@@@ -266,6 -262,6 +273,38 @@@}}++ var isDictationPromptOff: Bool {++ get { self.defaults.bool(forKey: Keys.dictationPromptOff) }++ set {++ objectWillChange.send()++ self.defaults.set(newValue, forKey: Keys.dictationPromptOff)++ }++ }++++ var dictationPromptSelection: DictationPromptSelection {++ if self.isDictationPromptOff {++ return .off++ }++ if let promptID = self.selectedDictationPromptID {++ return .profile(promptID)++ }++ return .default++ }++++ func setDictationPromptSelection(_ selection: DictationPromptSelection) {++ switch selection {++ case .off:++ self.isDictationPromptOff = true++ self.selectedDictationPromptID = nil++ case .default:++ self.isDictationPromptOff = false++ self.selectedDictationPromptID = nil++ case let .profile(promptID):++ self.isDictationPromptOff = false++ self.selectedDictationPromptID = promptID++ }++ }++/// Convenience: currently selected profile, or nil if Default/invalid selection.var selectedDictationPromptProfile: DictationPromptProfile? {self.selectedPromptProfile(for: .dictate)@@@ -330,7 -326,7 +369,11 @@@func setSelectedPromptID(_ id: String?, for mode: PromptMode) {switch mode.normalized {case .dictate:-- self.selectedDictationPromptID = id++ if let id {++ self.setDictationPromptSelection(.profile(id))++ } else {++ self.setDictationPromptSelection(.default)++ }case .edit:self.selectedEditPromptID = idcase .write, .rewrite:@@@ -1995,6 -1942,6 +2038,25 @@@DebugLogger.shared.info("Migrated legacy custom dictation prompt to a prompt profile", source: "SettingsStore")}++ private func migrateLegacyDictationAIPreferenceIfNeeded() {++ guard self.defaults.object(forKey: Keys.dictationPromptOff) == nil else { return }++++ let hasSelectedCustomDictationPrompt = self.selectedDictationPromptID.flatMap { id in++ self.dictationPromptProfiles.first(where: { $0.id == id && $0.mode == .dictate })++ } != nil++++ let shouldStartOff: Bool++ if hasSelectedCustomDictationPrompt {++ shouldStartOff = false++ } else if self.defaults.object(forKey: Keys.enableAIProcessing) != nil {++ shouldStartOff = !self.defaults.bool(forKey: Keys.enableAIProcessing)++ } else {++ shouldStartOff = false++ }++++ self.defaults.set(shouldStartOff, forKey: Keys.dictationPromptOff)++ }++private func normalizePromptSelectionsIfNeeded() {// One-time migration to unified edit keys.if self.defaults.object(forKey: Keys.selectedEditPromptID) == nil,@@@ -2907,9 -2916,9 +3041,10 @@@// swiftlint:enable type_body_lengthprivate extension SettingsStore {- // Keys+ /// Keysenum Keys {static let enableAIProcessing = "EnableAIProcessing"++ static let dictationPromptOff = "DictationPromptOff"static let enableDebugLogs = "EnableDebugLogs"static let availableAIModels = "AvailableAIModels"static let availableModelsByProvider = "AvailableModelsByProvider"@@@ -2993,8 -2997,10 +3128,10 @@@static let selectedTranscriptionProvider = "SelectedTranscriptionProvider"static let whisperModelSize = "WhisperModelSize"- // Unified Speech Model (replaces above two)+ /// Unified Speech Model (replaces above two)static let selectedSpeechModel = "SelectedSpeechModel"+ static let selectedCohereLanguage = "SelectedCohereLanguage"+ static let externalCoreMLArtifactsDirectories = "ExternalCoreMLArtifactsDirectories"// Overlay Positionstatic let overlayPosition = "OverlayPosition"diff --cc Sources/Fluid/Services/DictationAIPostProcessingGate.swiftindex 15b30e30,70b8302e..21816754--- a/Sources/Fluid/Services/DictationAIPostProcessingGate.swift+++ b/Sources/Fluid/Services/DictationAIPostProcessingGate.swift@@@ -3,32 -3,13 +3,20 @@@ import Foundatio/// Shared gating logic for whether dictation AI post-processing is usable/configured.enum DictationAIPostProcessingGate {/// Returns true if dictation AI post-processing should be allowed, given current settings.-- /// - Requires `SettingsStore.shared.enableAIProcessing == true`++ /// - Requires dictation prompt selection to not be `Off`/// - For Apple Intelligence: requires `AppleIntelligenceService.isAvailable`/// - For other providers: requires a local endpoint OR a non-empty API keystatic func isConfigured() -> Bool {let settings = SettingsStore.shared- let hasCustomPrompt = settings.selectedPromptID(for: .dictate) != nil- guard settings.enableAIProcessing || hasCustomPrompt else { return false }- guard settings.enableAIProcessing else { return false }++ guard !settings.isDictationPromptOff else { return false }- let providerID = settings.selectedProviderID- if providerID == "apple-intelligence" {- return AppleIntelligenceService.isAvailable- }-- let baseURL = self.baseURL(for: providerID, settings: settings)- if self.isLocalEndpoint(baseURL) {- return true- }-- let apiKey = (settings.getAPIKey(for: providerID) ?? "").trimmingCharacters(in: .whitespacesAndNewlines)- return !apiKey.isEmpty++ return self.isProviderConfigured()+ }++ /// Returns true if the selected AI provider is reachable/configured (API key or local endpoint),+ /// regardless of the AI toggle or prompt selection. Used to gate prompt-mode hotkey AI processing.+ static func isProviderConfigured() -> Bool {+ let settings = SettingsStore.sharedlet providerID = settings.selectedProviderIDif providerID == "apple-intelligence" {return AppleIntelligenceService.isAvailablediff --cc Sources/Fluid/Services/MenuBarManager.swiftindex 8c05de55,8c05de55..37dbf7e0--- a/Sources/Fluid/Services/MenuBarManager.swift+++ b/Sources/Fluid/Services/MenuBarManager.swift@@@ -16,7 -16,7 +16,6 @@@ final class MenuBarManager: ObservableO// Cached menu items to avoid rebuilding entire menuprivate var statusMenuItem: NSMenuItem?-- private var aiMenuItem: NSMenuItem?private var rollbackMenuItem: NSMenuItem?// References to app state@@@ -32,7 -32,7 +31,6 @@@private var isProcessingActive: Bool = false@Published var isRecording: Bool = false-- @Published var aiProcessingEnabled: Bool = false/// One-shot navigation requests from the menu bar into the main window UI./// `ContentView` consumes this and clears it.@@@ -50,15 -50,15 +48,6 @@@init() {// Don't setup menu bar immediately - defer until app is ready-- // Initialize from persisted setting-- self.aiProcessingEnabled = SettingsStore.shared.enableAIProcessing-- // Reflect changes to menu when toggled from elsewhere (e.g., General tab)-- self.$aiProcessingEnabled-- .receive(on: DispatchQueue.main)-- .sink { [weak self] _ in-- self?.updateMenu()-- }-- .store(in: &self.cancellables)}func initializeMenuBar() {@@@ -102,9 -102,9 +91,6 @@@}}.store(in: &self.cancellables)---- // Subscribe to AI processing state-- self.aiProcessingEnabled = SettingsStore.shared.enableAIProcessing}private func handleOverlayState(isRunning: Bool, asrService: ASRService) {@@@ -322,15 -322,15 +308,6 @@@menu.addItem(.separator())-- // AI Processing Toggle-- self.aiMenuItem = NSMenuItem(title: "", action: #selector(self.toggleAIProcessing), keyEquivalent: "")-- self.aiMenuItem?.target = self-- if let aiItem = aiMenuItem {-- menu.addItem(aiItem)-- }---- menu.addItem(.separator())--// Open Main Windowlet openItem = NSMenuItem(title: "Open Fluid Voice", action: #selector(openMainWindow), keyEquivalent: "")openItem.target = self@@@ -395,39 -395,39 +372,10 @@@let statusTitle = self.isRecording ? "Recording...\(hotkeyInfo)" : "Ready to Record\(hotkeyInfo)"self.statusMenuItem?.title = statusTitle-- // Update AI toggle text-- let aiTitle = self.aiProcessingEnabled ? "Disable AI Processing" : "Enable AI Processing"-- self.aiMenuItem?.title = aiTitle--// Update rollback availability textself.rollbackMenuItem?.isEnabled = SimpleUpdater.shared.hasRollbackBackup()}-- /// Centralized entry point to update AI post-processing enablement.-- /// Use this instead of writing `aiProcessingEnabled` directly so all state stays in sync.-- func setAIProcessingEnabled(_ enabled: Bool) {-- guard self.aiProcessingEnabled != enabled else {-- // Ensure menu text stays correct even if caller repeats the same value.-- self.updateMenu()-- return-- }-- self.aiProcessingEnabled = enabled-- SettingsStore.shared.enableAIProcessing = enabled-- self.updateMenu()-- }---- /// Toggle AI post-processing and return the new value.-- @discardableResult-- func toggleAIProcessingEnabled() -> Bool {-- let next = !self.aiProcessingEnabled-- self.setAIProcessingEnabled(next)-- return next-- }---- @objc private func toggleAIProcessing() {-- _ = self.toggleAIProcessingEnabled()-- }--@objc private func checkForUpdates(_ sender: Any?) {DebugLogger.shared.info("🔎 Menu action: Check for Updates…", source: "MenuBarManager")diff --cc Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swiftindex 6b84d60e,6b84d60e..44a8d00a--- a/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swift+++ b/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swift@@@ -13,14 -13,14 +13,7 @@@ final class AIEnhancementSettingsViewMo@Published var appear: Bool = false@Published var openAIBaseURL: String-- @Published var enableAIProcessing: Bool {-- didSet {-- guard self.enableAIProcessing != oldValue else { return }-- // Route through MenuBarManager so all UI surfaces (menu, settings, future overlay)-- // share one callable code path.-- self.menuBarManager.setAIProcessingEnabled(self.enableAIProcessing)-- }-- }++ @Published var isDictationPromptOff: Bool = false// Model Management@Published var availableModelsByProvider: [String: [String]] = [:]@@@ -129,7 -129,7 +122,6 @@@self.menuBarManager = menuBarManagerself.promptTest = promptTestself.openAIBaseURL = ModelRepository.shared.defaultBaseURL(for: "openai")-- self.enableAIProcessing = settings.enableAIProcessingself.selectedProviderID = settings.selectedProviderID}@@@ -143,7 -143,7 +135,6 @@@func loadSettings() {self.selectedProviderID = self.settings.selectedProviderID-- self.enableAIProcessing = self.settings.enableAIProcessingself.availableModelsByProvider = self.settings.availableModelsByProviderself.selectedModelByProvider = self.settings.selectedModelByProviderself.appleIntelligenceAvailable = AppleIntelligenceService.isAvailable@@@ -153,6 -153,6 +144,7 @@@self.appPromptBindings = self.settings.appPromptBindingsself.selectedDictationPromptID = self.settings.selectedDictationPromptIDself.selectedEditPromptID = self.settings.selectedEditPromptID++ self.isDictationPromptOff = self.settings.isDictationPromptOff// Normalize provider keysvar normalized: [String: [String]] = [:]@@@ -1276,7 -1276,7 +1268,7 @@@}func isAIPostProcessingConfiguredForDictation() -> Bool {-- DictationAIPostProcessingGate.isConfigured()++ DictationAIPostProcessingGate.isProviderConfigured()}func openDefaultPromptViewer(for mode: SettingsStore.PromptMode) {@@@ -1502,6 -1502,6 +1494,17 @@@return trimmed.isEmpty ? "Untitled Prompt" : trimmed}++ func isPromptSelectionOff(for mode: SettingsStore.PromptMode) -> Bool {++ mode.normalized == .dictate && self.settings.isDictationPromptOff++ }++++ func selectPromptOff(for mode: SettingsStore.PromptMode) {++ guard mode.normalized == .dictate else { return }++ self.settings.setDictationPromptSelection(.off)++ self.selectedDictationPromptID = self.settings.selectedDictationPromptID++ self.isDictationPromptOff = self.settings.isDictationPromptOff++ }++private func resolveBindingTargetApp() -> (name: String, bundleID: String)? {if let pid = NotchContentState.shared.recordingTargetPID,let app = NSRunningApplication(processIdentifier: pid),@@@ -1582,9 -1582,9 +1585,18 @@@}func setSelectedPromptID(_ id: String?, for mode: SettingsStore.PromptMode) {-- self.settings.setSelectedPromptID(id, for: mode.normalized)++ if mode.normalized == .dictate {++ if let id {++ self.settings.setDictationPromptSelection(.profile(id))++ } else {++ self.settings.setDictationPromptSelection(.default)++ }++ } else {++ self.settings.setSelectedPromptID(id, for: mode.normalized)++ }self.selectedDictationPromptID = self.settings.selectedDictationPromptIDself.selectedEditPromptID = self.settings.selectedEditPromptID++ self.isDictationPromptOff = self.settings.isDictationPromptOff}func hasDefaultPromptOverride(for mode: SettingsStore.PromptMode) -> Bool {diff --cc Sources/Fluid/UI/AISettingsView+AIConfiguration.swiftindex 2a262c01,2a262c01..8859d76d--- a/Sources/Fluid/UI/AISettingsView+AIConfiguration.swift+++ b/Sources/Fluid/UI/AISettingsView+AIConfiguration.swift@@@ -67,76 -67,76 +67,68 @@@ extension AIEnhancementSettingsViewImage(systemName: "brain").font(.title3).foregroundStyle(self.theme.palette.accent)-- Text("AI Enhancement")++ Text("AI Setup").font(.title3).fontWeight(.semibold)}Spacer()-- Toggle("", isOn: self.$viewModel.enableAIProcessing)-- .toggleStyle(.switch)-- .labelsHidden()-- .tint(self.theme.palette.accent)}-- if self.viewModel.enableAIProcessing {-- Divider()-- .background(self.theme.palette.separator.opacity(0.5))++ Divider()++ .background(self.theme.palette.separator.opacity(0.5))-- VStack(alignment: .leading, spacing: 8) {-- Text("FluidVoice can clean up or rewrite your transcription using AI.")++ VStack(alignment: .leading, spacing: 8) {++ Text("Choose a provider, model, and dictation prompt. Select `Off` in Dictate prompts for raw transcription.")++ .font(.caption)++ .foregroundStyle(.secondary)++++ self.aiOnboardingInfoRow("Local models run on your Mac. Examples: Ollama and LM Studio.")++ self.aiOnboardingInfoRow("Cloud models use a provider of your choice. Examples: OpenAI, Anthropic, Groq, and OpenRouter.")++ self.aiOnboardingInfoRow("Dictation uses AI when Dictate prompt is `Default` or a custom prompt.")++ }++++ HStack(spacing: 12) {++ VStack(alignment: .leading, spacing: 2) {++ Text("Providers")++ .font(.system(size: 14, weight: .semibold))++ Text("Configure your AI provider").font(.caption).foregroundStyle(.secondary)---- self.aiOnboardingInfoRow("Local models run on your Mac. Examples: Ollama and LM Studio.")-- self.aiOnboardingInfoRow("Cloud models use a provider of your choice. Examples: OpenAI, Anthropic, Groq, and OpenRouter.")-- self.aiOnboardingInfoRow("If you do not want to choose right now, FluidVoice still works without AI.")}-- HStack(spacing: 12) {-- VStack(alignment: .leading, spacing: 2) {-- Text("Providers")-- .font(.system(size: 14, weight: .semibold))-- Text("Configure your AI provider")-- .font(.caption)-- .foregroundStyle(.secondary)-- }---- Spacer()++ Spacer()-- Button(action: { self.viewModel.showHelp.toggle() }) {-- HStack(spacing: 5) {-- Image(systemName: self.viewModel.showHelp ? "questionmark.circle.fill" : "questionmark.circle")-- .font(.system(size: 14))-- Text("Help")-- .font(.caption)-- .fontWeight(.medium)-- }-- .foregroundStyle(self.viewModel.showHelp ? self.theme.palette.accent : .secondary)-- .padding(.horizontal, 10)-- .padding(.vertical, 6)-- .background(-- Capsule()-- .fill(self.viewModel.showHelp ? self.theme.palette.accent.opacity(0.12) : self.theme.palette.cardBackground.opacity(0.8))-- .overlay(-- Capsule()-- .stroke(self.viewModel.showHelp ? self.theme.palette.accent.opacity(0.3) : self.theme.palette.cardBorder.opacity(0.4), lineWidth: 1)-- )-- )++ Button(action: { self.viewModel.showHelp.toggle() }) {++ HStack(spacing: 5) {++ Image(systemName: self.viewModel.showHelp ? "questionmark.circle.fill" : "questionmark.circle")++ .font(.system(size: 14))++ Text("Help")++ .font(.caption)++ .fontWeight(.medium)}-- .buttonStyle(.plain)++ .foregroundStyle(self.viewModel.showHelp ? self.theme.palette.accent : .secondary)++ .padding(.horizontal, 10)++ .padding(.vertical, 6)++ .background(++ Capsule()++ .fill(self.viewModel.showHelp ? self.theme.palette.accent.opacity(0.12) : self.theme.palette.cardBackground.opacity(0.8))++ .overlay(++ Capsule()++ .stroke(self.viewModel.showHelp ? self.theme.palette.accent.opacity(0.3) : self.theme.palette.cardBorder.opacity(0.4), lineWidth: 1)++ )++ )}++ .buttonStyle(.plain)++ }-- if self.viewModel.showHelp { self.helpSectionView }++ if self.viewModel.showHelp { self.helpSectionView }-- self.providerStepContent++ self.providerStepContent-- Divider()-- .background(self.theme.palette.separator.opacity(0.5))++ Divider()++ .background(self.theme.palette.separator.opacity(0.5))-- self.promptsStepContent-- } else {-- self.setupDisabledInfo-- }++ self.promptsStepContent}.padding(16)}@@@ -171,12 -171,12 +163,11 @@@}VStack(alignment: .leading, spacing: 8) {-- self.helpStep("1", "Enable AI enhancement", "power")-- self.helpStep("2", "Choose a provider", "building.2")-- self.helpStep("3", "Add an API key if needed", "key")-- self.helpStep("4", "Pick the model you want", "cpu")-- self.helpStep("5", "Verify the connection", "checkmark.shield")-- self.helpStep("6", "Customize your prompt", "text.bubble")++ self.helpStep("1", "Choose a provider", "building.2")++ self.helpStep("2", "Add an API key if needed", "key")++ self.helpStep("3", "Pick the model you want", "cpu")++ self.helpStep("4", "Verify the connection", "checkmark.shield")++ self.helpStep("5", "Set Dictate to Off, Default, or a custom prompt", "text.bubble")}}.padding(14)@@@ -212,35 -212,35 +203,6 @@@}}-- var setupDisabledInfo: some View {-- HStack(spacing: 12) {-- Image(systemName: "sparkles")-- .font(.system(size: 24))-- .foregroundStyle(self.theme.palette.accent.opacity(0.5))---- VStack(alignment: .leading, spacing: 4) {-- Text("AI Enhancement Disabled")-- .font(.system(size: 13, weight: .medium))-- .foregroundStyle(.secondary)-- Text("Turn this on to enable AI-powered cleanup. We'll guide you through setup in a few short steps.")-- .font(.caption)-- .foregroundStyle(.tertiary)-- .lineLimit(2)-- }-- }-- .padding(14)-- .frame(maxWidth: .infinity, alignment: .leading)-- .background(-- RoundedRectangle(cornerRadius: 12, style: .continuous)-- .fill(self.theme.palette.contentBackground.opacity(0.5))-- .overlay(-- RoundedRectangle(cornerRadius: 12, style: .continuous)-- .stroke(self.theme.palette.cardBorder.opacity(0.25), lineWidth: 1)-- )-- )-- .padding(.top, 4)-- }--var providerStepContent: some View {VStack(alignment: .leading, spacing: 16) {self.verifiedProvidersSectiondiff --cc Sources/Fluid/UI/AISettingsView+AdvancedSettings.swiftindex e6f731fc,e6f731fc..5ccb2350--- a/Sources/Fluid/UI/AISettingsView+AdvancedSettings.swift+++ b/Sources/Fluid/UI/AISettingsView+AdvancedSettings.swift@@@ -65,7 -65,7 +65,7 @@@ extension AIEnhancementSettingsViewmode: SettingsStore.PromptMode,isSelected: Bool,onUse: @escaping () -> Void,-- onManage: @escaping () -> Void,++ onManage: (() -> Void)? = nil,onResetDefault: (() -> Void)? = nil,canResetDefault: Bool = false,onDelete: (() -> Void)? = nil@@@ -116,29 -116,29 +116,33 @@@.foregroundStyle(isSelected ? tone : self.theme.palette.secondaryText.opacity(0.35)).frame(width: 18, height: 18)-- Menu {-- Button("Edit Prompt") { onManage() }-- if mode == .edit {-- Divider()-- Text("Selected text context is added automatically when text is selected.")-- }-- if let onDelete {-- Divider()-- Button(role: .destructive, action: { onDelete() }) {-- Label("Delete Prompt", systemImage: "trash")++ if onManage != nil || onResetDefault != nil || onDelete != nil {++ Menu {++ if let onManage {++ Button("Edit Prompt") { onManage() }}-- } else if let onResetDefault {-- Divider()-- Button("Reset to Built-in Default", role: .destructive) { onResetDefault() }-- .disabled(!canResetDefault)++ if mode == .edit {++ Divider()++ Text("Selected text context is added automatically when text is selected.")++ }++ if let onDelete {++ Divider()++ Button(role: .destructive, action: { onDelete() }) {++ Label("Delete Prompt", systemImage: "trash")++ }++ } else if let onResetDefault {++ Divider()++ Button("Reset to Built-in Default", role: .destructive) { onResetDefault() }++ .disabled(!canResetDefault)++ }++ } label: {++ Image(systemName: "ellipsis.circle")++ .font(.system(size: 14, weight: .semibold))++ .frame(width: AISettingsLayout.controlHeight, height: AISettingsLayout.controlHeight)}-- } label: {-- Image(systemName: "ellipsis.circle")-- .font(.system(size: 14, weight: .semibold))-- .frame(width: AISettingsLayout.controlHeight, height: AISettingsLayout.controlHeight)++ .buttonStyle(.plain)++ .foregroundStyle(self.theme.palette.secondaryText)}-- .buttonStyle(.plain)-- .foregroundStyle(self.theme.palette.secondaryText)}}.padding(12)@@@ -194,12 -194,12 +198,25 @@@self.editModeProviderModelRow}++ if mode.normalized == .dictate {++ self.promptProfileCard(++ cardKey: "\(mode.normalized.rawValue)-off",++ title: "Off",++ subtitle: "Use raw transcription for normal dictation with no AI post-processing.",++ mode: mode,++ isSelected: self.viewModel.isPromptSelectionOff(for: mode),++ onUse: {++ self.viewModel.selectPromptOff(for: mode)++ }++ )++ }++self.promptProfileCard(cardKey: "\(mode.normalized.rawValue)-default",title: "Default \(self.friendlyModeName(mode))",subtitle: self.viewModel.promptPreview(self.viewModel.defaultPromptBodyPreview(for: mode)),mode: mode,-- isSelected: self.viewModel.selectedPromptID(for: mode) == nil,++ isSelected: !self.viewModel.isPromptSelectionOff(for: mode) && self.viewModel.selectedPromptID(for: mode) == nil,onUse: {self.viewModel.setSelectedPromptID(nil, for: mode)},@@@ -901,9 -901,9 +918,6 @@@.onDisappear {self.promptTest.deactivate()}-- .onChange(of: self.viewModel.enableAIProcessing) { _, _ in-- self.autoDisablePromptTestIfNeeded()-- }.onChange(of: self.viewModel.selectedProviderID) { _, _ inself.autoDisablePromptTestIfNeeded()}diff --cc Sources/Fluid/Views/BottomOverlayView.swiftindex 09598d99,89b10b36..7287a378--- a/Sources/Fluid/Views/BottomOverlayView.swift+++ b/Sources/Fluid/Views/BottomOverlayView.swift@@@ -1232,11 -1232,11 +1232,41 @@@ private struct BottomOverlayPromptMenuV)}++ @ViewBuilder++ private func offRow() -> some View {++ let isSelected = self.settings.isDictationPromptOff++ Button(action: {++ self.settings.setDictationPromptSelection(.off)++ self.restoreTypingTargetApp()++ self.onDismissRequested()++ }) {++ HStack {++ Text("Off")++ Spacer()++ if isSelected {++ Image(systemName: "checkmark")++ .font(.system(size: 10, weight: .semibold))++ }++ }++ .padding(.horizontal, 8)++ .padding(.vertical, 6)++ .background(self.rowBackground(isSelected: isSelected, rowID: "off"))++ }++ .buttonStyle(.plain)++ .onHover { hovering in++ self.hoveredRowID = hovering ? "off" : nil++ }++ }++@ViewBuilderprivate func defaultRow(selectedID: String?) -> some View {-- let isSelected = selectedID == nil++ let isSelected = !self.settings.isDictationPromptOff && selectedID == nilButton(action: {-- self.settings.setSelectedPromptID(nil, for: self.promptMode)++ if self.promptMode.normalized == .dictate {++ self.settings.setDictationPromptSelection(.default)++ } else {++ self.settings.setSelectedPromptID(nil, for: self.promptMode)++ }self.restoreTypingTargetApp()self.onDismissRequested()}) {@@@ -1289,6 -1289,6 +1319,13 @@@let profiles = self.settings.promptProfiles(for: self.promptMode)VStack(alignment: .leading, spacing: 0) {++ if self.promptMode.normalized == .dictate {++ self.offRow()++++ Divider()++ .padding(.vertical, 4)++ }++self.defaultRow(selectedID: selectedID)if !profiles.isEmpty {@@@ -1572,7 -1573,7 +1609,6 @@@ struct BottomOverlayView: View@Environment(\.theme) private var theme@State private var isHoveringModeChip = false@State private var isHoveringPromptChip = false-- @State private var isHoveringAIToggleChip = false@State private var isHoveringActionsChip = false@State private var isHoveringSettingsChip = false@State private var modeSelectorFrameInScreen: CGRect = .zero@@@ -1757,6 -1758,6 +1793,12 @@@private var isAppPromptOverrideActive: Bool {guard let activePromptMode else { return false }++ if activePromptMode.normalized == .dictate &&++ self.settings.isDictationPromptOff &&++ !self.contentState.isPromptModeActive++ {++ return false++ }return self.settings.hasAppPromptBinding(for: activePromptMode,appBundleID: self.promptResolutionBundleID@@@ -1764,10 -1765,7 +1806,16 @@@}private var selectedPromptLabel: String {+ if let overrideName = self.contentState.promptModeOverrideProfileName {+ return overrideName+ }guard let activePromptMode else { return "N/A" }++ if activePromptMode.normalized == .dictate &&++ self.settings.isDictationPromptOff &&++ !self.contentState.isPromptModeActive++ {++ return "Off"++ }if let profile = self.settings.resolvedPromptProfile(for: activePromptMode,appBundleID: self.promptResolutionBundleID@@@ -2124,53 -2122,53 +2172,6 @@@)}-- private var aiToggleChip: some View {-- let disabled = self.contentState.isProcessing-- let isEnabled = self.settings.enableAIProcessing-- return HStack(spacing: self.isCompactControls ? 0 : 5) {-- if self.isCompactControls {-- Text(isEnabled ? "AI On" : "AI Off")-- .font(.system(size: self.promptSelectorFontSize, weight: .semibold))-- .foregroundStyle(isEnabled ? .white.opacity(0.82) : .white.opacity(0.7))-- .lineLimit(1)-- } else {-- Text("AI:")-- .font(.system(size: self.promptSelectorFontSize, weight: .medium))-- .foregroundStyle(.white.opacity(0.5))-- .lineLimit(1)-- Text(isEnabled ? "On" : "Off")-- .font(.system(size: self.promptSelectorFontSize, weight: .semibold))-- .foregroundStyle(isEnabled ? .white.opacity(0.82) : .white.opacity(0.7))-- .lineLimit(1)-- Image(systemName: isEnabled ? "brain.fill" : "brain")-- .font(.system(size: max(self.promptSelectorFontSize - 1, 8), weight: .semibold))-- .foregroundStyle(isEnabled ? .white.opacity(0.65) : .white.opacity(0.45))-- }-- }-- .fixedSize(horizontal: true, vertical: false)-- .padding(.horizontal, 8)-- .padding(.vertical, self.promptSelectorVerticalPadding)-- .background(-- self.chipBackground(-- isHovered: self.isHoveringAIToggleChip,-- disabled: disabled-- )-- )-- .contentShape(Rectangle())-- .onHover { hovering in-- self.isHoveringAIToggleChip = hovering && !disabled-- }-- .onTapGesture {-- guard !disabled else { return }-- self.closePromptMenu()-- self.closeModeMenu()-- self.closeActionsMenu()-- self.contentState.onToggleAIProcessingRequested?()-- }-- .help("Toggle AI enhancement for dictation")-- .opacity(disabled ? 0.65 : 1)-- }--private var actionsSelectorView: some View {let actionsDisabled = self.historyStore.entries.isEmpty || self.contentState.isProcessingreturn self.actionsSelectorTrigger@@@ -2239,7 -2237,7 +2240,6 @@@self.modeSelectorViewself.promptSelectorViewSpacer(minLength: 4)-- self.aiToggleChipself.actionsSelectorViewif !self.isCompactControls {self.settingsChip@@@ -2456,7 -2454,7 +2456,6 @@@self.closeActionsMenu()self.isHoveringModeChip = falseself.isHoveringPromptChip = false-- self.isHoveringAIToggleChip = falseself.isHoveringActionsChip = falseself.isHoveringSettingsChip = falseswitch self.contentState.mode {@@@ -2476,7 -2474,7 +2475,6 @@@}self.isHoveringModeChip = falseself.isHoveringPromptChip = false-- self.isHoveringAIToggleChip = falseself.isHoveringActionsChip = falseself.isHoveringSettingsChip = falseif !self.layout.usesFixedCanvas {@@@ -2489,7 -2487,7 +2487,6 @@@self.closeActionsMenu()self.isHoveringModeChip = falseself.isHoveringPromptChip = false-- self.isHoveringAIToggleChip = falseself.isHoveringActionsChip = falseself.isHoveringSettingsChip = false}diff --cc Sources/Fluid/Views/NotchContentViews.swiftindex 1e2feecc,34b04ff2..7538741e--- a/Sources/Fluid/Views/NotchContentViews.swift+++ b/Sources/Fluid/Views/NotchContentViews.swift@@@ -141,8 -135,8 +141,6 @@@ class NotchContentState: ObservableObjevar onCopyLastRequested: (() -> Void)?/// Called when the user requests undoing AI processing for the latest entry.var onUndoLastAIRequested: (() -> Void)?-- /// Called when the user requests toggling dictation AI enhancement.-- var onToggleAIProcessingRequested: (() -> Void)?/// Called when the user requests opening Preferences.var onOpenPreferencesRequested: (() -> Void)?@@@ -352,6 -343,6 +350,12 @@@ struct NotchExpandedView: Viewprivate var isAppPromptOverrideActive: Bool {guard let activePromptMode else { return false }++ if activePromptMode.normalized == .dictate &&++ self.settings.isDictationPromptOff &&++ !self.contentState.isPromptModeActive++ {++ return false++ }return self.settings.hasAppPromptBinding(for: activePromptMode,appBundleID: self.promptResolutionBundleID@@@ -359,10 -350,7 +363,16 @@@}private var selectedPromptLabel: String {+ if let overrideName = self.contentState.promptModeOverrideProfileName {+ return overrideName+ }guard let activePromptMode else { return "N/A" }++ if activePromptMode.normalized == .dictate &&++ self.settings.isDictationPromptOff &&++ !self.contentState.isPromptModeActive++ {++ return "Off"++ }if let profile = self.settings.resolvedPromptProfile(for: activePromptMode,appBundleID: self.promptResolutionBundleID@@@ -509,16 -384,10 +519,46 @@@private func promptMenuContent() -> some View {let promptMode = self.activePromptMode ?? .dictate+ // During prompt mode recording, selections update the live override instead of the global prompt.+ let isInPromptMode = self.contentState.isPromptModeActivereturn VStack(alignment: .leading, spacing: 0) {++ if promptMode.normalized == .dictate && !isInPromptMode {++ Button(action: {++ self.settings.setDictationPromptSelection(.off)++ let pid = NotchContentState.shared.recordingTargetPID++ DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {++ if let pid { _ = TypingService.activateApp(pid: pid) }++ }++ self.showPromptHoverMenu = false++ }) {++ HStack {++ Text("Off")++ Spacer()++ let isSelected = !isInPromptMode && self.settings.isDictationPromptOff++ if isSelected {++ Image(systemName: "checkmark")++ .font(.system(size: 10, weight: .semibold))++ }++ }++ }++ .buttonStyle(.plain)++ .padding(.vertical, 4)++++ Divider()++ .padding(.vertical, 4)++ }++Button(action: {- self.settings.setSelectedPromptID(nil, for: promptMode)+ if isInPromptMode {+ self.contentState.onPromptModeProfileChangeRequested?(nil)+ } else {- self.settings.setSelectedPromptID(nil, for: promptMode)++ if promptMode.normalized == .dictate {++ self.settings.setDictationPromptSelection(.default)++ } else {++ self.settings.setSelectedPromptID(nil, for: promptMode)++ }+ }let pid = NotchContentState.shared.recordingTargetPIDDispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {if let pid { _ = TypingService.activateApp(pid: pid) }@@@ -528,10 -397,7 +568,10 @@@HStack {Text("Default")Spacer()- if self.settings.selectedPromptID(for: promptMode) == nil {+ let isSelected = isInPromptMode+ ? (self.contentState.promptModeOverrideProfileID == nil)- : (self.settings.selectedPromptID(for: promptMode) == nil)++ : (!self.settings.isDictationPromptOff && self.settings.selectedPromptID(for: promptMode) == nil)+ if isSelected {Image(systemName: "checkmark").font(.system(size: 10, weight: .semibold))}@@@ -671,97 -525,6 +711,72 @@@.transition(.opacity)}+ // Mode + AI + Actions chips row+ if !self.contentState.isProcessing {+ HStack(spacing: 6) {+ // Mode chip+ HStack(spacing: 4) {+ Text(self.normalizedMode == .dictation ? "Dictate" : "Edit")+ .font(.system(size: 9, weight: .semibold))+ .foregroundStyle(.white.opacity(0.75))+ Image(systemName: "chevron.up")+ .font(.system(size: 7, weight: .semibold))+ .foregroundStyle(.white.opacity(0.45))+ }+ .padding(.horizontal, 6)+ .padding(.vertical, 3)+ .background(Color.white.opacity(0.07))+ .cornerRadius(5)+ .onTapGesture {+ guard !self.contentState.isProcessing, self.normalizedMode != .command else { return }+ self.showPromptHoverMenu = false+ self.showActionsMenu = false+ self.showModeMenu.toggle()+ }+- // AI toggle chip- let aiEnabled = self.settings.enableAIProcessing- HStack(spacing: 4) {- Text("AI:")- .font(.system(size: 9, weight: .medium))- .foregroundStyle(.white.opacity(0.5))- Text(aiEnabled ? "On" : "Off")- .font(.system(size: 9, weight: .semibold))- .foregroundStyle(aiEnabled ? .white.opacity(0.82) : .white.opacity(0.55))- Image(systemName: aiEnabled ? "brain.fill" : "brain")- .font(.system(size: 8, weight: .semibold))- .foregroundStyle(aiEnabled ? .white.opacity(0.65) : .white.opacity(0.4))- }- .padding(.horizontal, 6)- .padding(.vertical, 3)- .background(Color.white.opacity(0.07))- .cornerRadius(5)- .onTapGesture {- guard !self.contentState.isProcessing else { return }- self.showActionsMenu = false- self.showPromptHoverMenu = false- self.showModeMenu = false- self.contentState.onToggleAIProcessingRequested?()- }-+ // Actions chip+ HStack(spacing: 4) {+ Text("Actions")+ .font(.system(size: 9, weight: .medium))+ .foregroundStyle(.white.opacity(self.hasHistory ? 0.75 : 0.35))+ Image(systemName: "chevron.up")+ .font(.system(size: 7, weight: .semibold))+ .foregroundStyle(.white.opacity(self.hasHistory ? 0.45 : 0.25))+ }+ .padding(.horizontal, 6)+ .padding(.vertical, 3)+ .background(Color.white.opacity(0.07))+ .cornerRadius(5)+ .opacity(self.hasHistory ? 1 : 0.6)+ .onTapGesture {+ guard self.hasHistory, !self.contentState.isProcessing else { return }+ self.showPromptHoverMenu = false+ self.showModeMenu = false+ self.showActionsMenu.toggle()+ }+ }+ // Menus float above as overlays — don't affect VStack height/width so no layout reflow+ .overlay(alignment: .bottomLeading) {+ if self.showModeMenu {+ self.modeModeContent+ .fixedSize()+ .offset(y: -4)+ .transition(.opacity)+ .zIndex(20)+ }+ }+ .overlay(alignment: .bottomTrailing) {+ if self.showActionsMenu {+ self.actionsMenuContent+ .fixedSize()+ .offset(y: -4)+ .transition(.opacity)+ .zIndex(20)+ }+ }+ .transition(.opacity)+ }+// Transcription preview (wrapped, fixed width)if self.hasTranscription && !self.contentState.isProcessing {let previewText = self.contentState.cachedPreviewText