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
Merge remote-tracking branch 'origin/main' into B/model-storage-unification
altic-dev8b6c4aa9001f
diff --cc Fluid.xcodeproj/project.pbxprojindex fb27d4de,cdd8e7a2..3814f5be--- a/Fluid.xcodeproj/project.pbxproj+++ b/Fluid.xcodeproj/project.pbxproj@@@ -533,7 -548,7 +552,8 @@@"@executable_path/../Frameworks",);MACOSX_DEPLOYMENT_TARGET = 15.0;+ MARKETING_VERSION = "1.6.10-beta.4";+ MARKETING_VERSION = "1.6.10-beta.2";PRODUCT_BUNDLE_IDENTIFIER = com.FluidApp.app.debug;PRODUCT_NAME = "FluidVoice Debug";PROVISIONING_PROFILE_SPECIFIER = "";@@@ -588,7 -603,7 +608,8 @@@"@executable_path/../Frameworks",);MACOSX_DEPLOYMENT_TARGET = 15.0;+ MARKETING_VERSION = "1.6.10-beta.4";+ MARKETING_VERSION = "1.6.10-beta.2";PRODUCT_BUNDLE_IDENTIFIER = com.FluidApp.app;PRODUCT_NAME = FluidVoice;PROVISIONING_PROFILE_SPECIFIER = "";diff --cc Sources/Fluid/AppDelegate.swiftindex de09c481,2219052c..f869252d--- a/Sources/Fluid/AppDelegate.swift+++ b/Sources/Fluid/AppDelegate.swift@@@ -107,21 -83,10 +108,22 @@@ class AppDelegate: NSObject, NSApplicat}func applicationWillTerminate(_ notification: Notification) {+ if Self.restartPrepared {+ // Launch only after this process exits: never overlap two app instances.+ let helper = Process()+ helper.executableURL = URL(fileURLWithPath: "/bin/sh")+ let waitForExit = "i=0; while kill -0 \"$1\" 2>/dev/null; do i=$((i+1)); [ \"$i\" -lt 120 ] || exit 1; sleep 1; done; exec /usr/bin/open \"$2\""+ helper.arguments = ["-c", waitForExit, "fluidvoice-restart", String(ProcessInfo.processInfo.processIdentifier), Bundle.main.bundlePath]+ do { try helper.run() } catch {+ DebugLogger.shared.error("Could not schedule relaunch: \(error)", source: "AppDelegate")+ }+ }DebugLogger.shared.info("Application will terminate", source: "AppDelegate")- self.shutdownPrivateAIRuntimeForTermination()- self.shutdownASRRuntimeForTermination()- self.closeZeppelinForTermination()+ if !Self.restartPrepared {+ self.shutdownPrivateAIRuntimeForTermination()+ self.shutdownASRRuntimeForTermination()+ }++ self.closeZeppelinForTermination();LocalAPIServer.shared.stop()// Clean up the update check timerself.updateCheckTimer?.invalidate()diff --cc Sources/Fluid/ContentView.swiftindex df979ac9,e84e10cc..6920052c--- a/Sources/Fluid/ContentView.swift+++ b/Sources/Fluid/ContentView.swift@@@ -1296,15 -1314,47 +1306,55 @@@ struct ContentView: View}private var appSidebarView: some View {+ VStack(spacing: 0) {+ SidebarSearchField(+ text: self.$appSearch.query,+ placeholder: "Search",+ isActive: !self.settingsNavigation.isPresented,+ onCommand: self.handleAppSearchCommand+ )+ .frame(height: 24)+ .padding(.horizontal, self.theme.metrics.spacing.md)+ .padding(.top, self.theme.metrics.spacing.sm)+ .padding(.bottom, self.theme.metrics.spacing.sm)++ if self.isAppSearchActive {+ AppSearchResultsView(+ service: self.appSearch,+ cursor: self.$appSearchCursor,+ expanded: self.$appSearchExpanded,+ open: self.open(searchHit:)+ )+ } else {+ self.appSidebarSections+ }+ }+ .safeAreaInset(edge: .bottom, spacing: 0) {+ VStack(spacing: 0) {+ self.helpEntryButton+ self.settingsEntryButton+ }+ }+ .onChange(of: self.appSearch.groups) {+ self.appSearchCursor = nil+ self.appSearchExpanded = []+ }+ }++ private var isAppSearchActive: Bool {+ !self.appSearch.query.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty+ }++ private var appSidebarSections: some View {List(selection: self.$selectedSidebarItem) {+ Section {+ self.sidebarNavigationLink(.welcome, title: "Dashboard", systemImage: "house.fill")+ self.sidebarNavigationLink(.history, title: "History", systemImage: "clock.arrow.circlepath")+ self.sidebarNavigationLink(.stats, title: "Stats", systemImage: "chart.bar.fill")+ } header: {+ self.sidebarSectionHeader("Activity")+ }+Section {self.sidebarNavigationLink(.voiceEngine, title: "Voice Engine", systemImage: "waveform")self.sidebarNavigationLink(.aiEnhancements, title: "AI Providers", systemImage: "cpu")@@@ -2954,23 -2960,43 +3044,36 @@@)}// When FluidVoice itself is frontmost, the bound editor already receives `finalText`.- // Avoid re-inserting or overwriting the clipboard in that self-target case.let shouldCopyToClipboard = shouldPersistOutputs &&!sendsExistingDraft &&- SettingsStore.shared.copyTranscriptionToClipboard &&- !isFluidFrontmost-- if shouldCopyToClipboard {- ClipboardService.copyToClipboard(finalText)- }+ SettingsStore.shared.copyTranscriptionToClipboard+ let shouldTypeExternally = shouldPersistOutputs && !isFluidFrontmostvar didTypeExternally = false- var didScheduleOverlayHideAfterDelivery = false- let shouldTypeExternally = shouldPersistOutputs && !isFluidFrontmost+ var didFailTextDelivery = false- DebugLogger.shared.debug(- "Typing decision → frontmost: \(frontmostName), fluidFrontmost: \(isFluidFrontmost), editorFocused: \(self.isTranscriptionFocused), willTypeExternally: \(shouldTypeExternally)",- source: "ContentView"- )+ self.appBench("typing_decision frozenTarget=\(stopSnapshot != nil) external=\(shouldTypeExternally)")+ // A sidebar search field that was already focused when recording began gets+ // the text through its field editor, which also fires change notifications.+ if isFluidFrontmost, shouldPersistOutputs, !sendsExistingDraft,+ let focusTarget = self.recordingFocusTarget,+ focusTarget.pid == ProcessInfo.processInfo.processIdentifier,+ TypingService.isExactFocusTargetActive(focusTarget),+ let window = NSApp.keyWindow,+ let editor = window.firstResponder as? NSTextView,+ SidebarSearchField.owns(editor, in: window)+ {+ editor.insertText(finalText, replacementRange: editor.selectedRange())+ }+if shouldTypeExternally {- let typingTarget = self.resolveTypingTargetPID()+ let typingTarget = stopSnapshot.map { (pid: $0.target?.pid, shouldRestoreOriginalFocus: true) }+ ?? self.resolveTypingTargetPID(returnToStartingField: self.settings.returnDictationToStartingField)let spokenSendRequested = spokenSendParse.shouldSend+ let sendFocus = stopSnapshot == nil ? self.recordingFocusTarget : stopSnapshot?.focusTargetlet targetMatchesRecordingFocus = typingTarget.pid != nil- && typingTarget.pid == self.recordingFocusTarget?.pid+ && typingTarget.pid == sendFocus?.pidlet spokenSendAllowed = spokenSendRequested&& aiFallbackReason == nil&& (sendsExistingDraft || !finalText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)diff --cc Sources/Fluid/Services/ASRService.swiftindex 17d7ed68,6d90b906..489a9d44--- a/Sources/Fluid/Services/ASRService.swift+++ b/Sources/Fluid/Services/ASRService.swift@@@ -1388,12 -1502,11 +1505,13 @@@ final class ASRService: ObservableObjec) async {switch self.activeAudioCaptureBackend {case .directCoreAudio:+ let captureAwaitStartedAt = ProcessInfo.processInfo.systemUptimelet report = await self.directAudioLifecycleController.stop(retainPrepared: retainDirectPreparedCapture,- reason: reason+ reason: reason,+ recoveringRoute: self.isRecoveringAudioRoute)+ DebugLogger.shared.info("CLOSE_DETAIL audioCallerResumed uptime=\(ProcessInfo.processInfo.systemUptime) awaitMs=\((ProcessInfo.processInfo.systemUptime - captureAwaitStartedAt) * 1000)", source: "StopTiming")if report.status != noErr {DebugLogger.shared.warning("Direct Core Audio stop returned OSStatus \(report.status)",diff --cc Sources/Fluid/Services/DirectCoreAudioInput.swiftindex 62c713e4,afecc745..fdf53949--- a/Sources/Fluid/Services/DirectCoreAudioInput.swift+++ b/Sources/Fluid/Services/DirectCoreAudioInput.swift@@@ -920,22 -1107,15 +1113,19 @@@ final nonisolated class DirectCoreAudio}}- func stop(retainPrepared: Bool, reason: String) async -> StopReport {+ func stop(retainPrepared: Bool, reason: String, recoveringRoute: Bool = false) async -> StopReport {+ let requestedAt = ProcessInfo.processInfo.systemUptime- return await withCheckedContinuation { continuation in- self.lifecycleQueue.async {+ do {+ return try await self.performHardwareOperation(cancellable: false, timeout: recoveringRoute ? self.recoveryTimeout : nil) {+ var trace = OverlayCloseTrace("audio.lifecycleQueue")+ trace.mark("queueWait", since: requestedAt)+ defer { trace.finish() }guard let input = self.input else {- continuation.resume(- returning: StopReport(- status: noErr,- droppedPackets: 0,- retainedPreparedCapture: false- )+ return StopReport(+ status: noErr,+ droppedPackets: 0,+ retainedPreparedCapture: false)- return}let startedAt = ProcessInfo.processInfo.systemUptime@@@ -976,16 -1155,15 +1166,17 @@@"retained=\(retainPrepared && self.input != nil)",level: .info)+ trace.mark("postStopState")+ DebugLogger.shared.info("CLOSE_DETAIL audioContinuationResume uptime=\(ProcessInfo.processInfo.systemUptime)", source: "StopTiming")- continuation.resume(- returning: StopReport(- status: status,- droppedPackets: droppedPackets,- retainedPreparedCapture: retainPrepared && self.input != nil- )+ return StopReport(+ status: status,+ droppedPackets: droppedPackets,+ retainedPreparedCapture: retainPrepared && self.input != nil)}+ } catch {+ Self.log("Direct capture stop interrupted reason=\(reason): \(error.localizedDescription)", level: .warning)+ return StopReport(status: kAudioHardwareUnspecifiedError, droppedPackets: 0, retainedPreparedCapture: false)}}diff --cc Sources/Fluid/UI/MeetingTranscriptionView.swiftindex fdc3cdd6,d559c553..2174e0e9--- a/Sources/Fluid/UI/MeetingTranscriptionView.swift+++ b/Sources/Fluid/UI/MeetingTranscriptionView.swift@@@ -41,24 -50,27 +50,27 @@@ struct MeetingTranscriptionView: Viewvar body: some View {VStack(spacing: 0) {- // Header- VStack(spacing: 8) {+ HStack(spacing: 12) {Image(systemName: "waveform.circle.fill")- .font(.fluidSystem(size: 48))- .font(.system(size: 32))++ .font(.fluidSystem(size: 32)).foregroundStyle(Color.fluidGreen.gradient)- Text("Meeting Transcription")- .font(.fluidSystem(.title2))- .fontWeight(.semibold)-- Text("Choose an audio or video file to transcribe")- .font(.fluidSystem(.subheadline))- .foregroundColor(.secondary)+ VStack(alignment: .leading, spacing: 4) {+ Text("File Transcription")- .font(.title2)++ .font(.fluidSystem(.title2))+ .fontWeight(.semibold)+ Text("Choose an audio or video file to transcribe")- .font(.subheadline)++ .font(.fluidSystem(.subheadline))+ .foregroundColor(.secondary)+ }+ Spacer()}- .padding(.top, 40)- .padding(.bottom, 30)+ .padding(.horizontal, 24)+ .padding(.top, 24)+ .padding(.bottom, 8)// Main Content Area+ ScrollViewReader { proxy inScrollView {VStack(spacing: 24) {// File Selection Card@@@ -134,31 -156,78 +156,79 @@@private var fileSelectionCard: some View {VStack(spacing: 16) {if let fileURL = selectedFileURL {- // Show selected file- HStack {- Image(systemName: "doc.fill")- .font(.fluidSystem(.title2))- .foregroundColor(Color.fluidGreen)+ VStack(alignment: .leading, spacing: 16) {+ HStack {+ Image(systemName: "doc.fill")- .font(.title2)++ .font(.fluidSystem(.title2))+ .foregroundColor(Color.fluidGreen)++ VStack(alignment: .leading, spacing: 4) {+ Text(fileURL.lastPathComponent)- .font(.headline)++ .font(.fluidSystem(.headline))+ .lineLimit(1)+ .truncationMode(.middle)+ .help(fileURL.lastPathComponent)++ Text(self.formatFileSize(fileURL: fileURL))- .font(.caption)++ .font(.fluidSystem(.caption))+ .foregroundColor(.secondary)+ }- VStack(alignment: .leading, spacing: 4) {- Text(fileURL.lastPathComponent)- .font(.fluidSystem(.headline))+ Spacer()- Text(self.formatFileSize(fileURL: fileURL))- .font(.fluidSystem(.caption))- .foregroundColor(.secondary)+ Button("Change file…") {+ self.showingFilePicker = true+ }+ .disabled(self.transcriptionService.isTranscribing)}- Spacer()-- Button(action: {- self.selectedFileURL = nil- self.transcriptionService.reset()- }) {- Image(systemName: "xmark.circle.fill")- .foregroundColor(.secondary)+ // Speaker labeling options (unavailable on Intel Macs)+ if SpeakerDiarizationService.isSupported {+ Divider()+ VStack(spacing: 12) {+ Toggle(isOn: self.$settings.fileTranscriptionSpeakerLabelsEnabled) {+ VStack(alignment: .leading, spacing: 2) {+ Text("Label speakers")- .font(.subheadline)++ .font(.fluidSystem(.subheadline))++ Text(self.selectedFileIsVideo+ ? "Available for audio files only"+ : "Identify who said what")- .font(.caption)++ .font(.fluidSystem(.caption))+ .foregroundColor(.secondary)+ }+ .frame(maxWidth: .infinity, alignment: .leading)+ }+ .help("Speaker models download automatically on first use.")+ .toggleStyle(.switch)+ .disabled(self.selectedFileIsVideo)++ if self.settings.fileTranscriptionSpeakerLabelsEnabled, !self.selectedFileIsVideo {+ HStack {+ Text("Number of speakers")- .font(.subheadline)++ .font(.fluidSystem(.subheadline))++ Spacer()++ Picker("Number of speakers", selection: self.$settings.fileTranscriptionExpectedSpeakerCount) {+ Text("Auto").tag(0)+ ForEach(2...8, id: \.self) { count in+ Text("\(count)").tag(count)+ }+ }+ .pickerStyle(.menu)++ .fluidDropdownStyle()+ .labelsHidden()+ .frame(width: 90)+ }+ .transition(.opacity)+ }+ }+ .animation(+ self.reduceMotion ? nil : .spring(response: 0.3, dampingFraction: 1),+ value: self.settings.fileTranscriptionSpeakerLabelsEnabled+ )}- .buttonStyle(.plain)}.padding().background(@@@ -481,22 -526,18 +527,18 @@@Spacer()- if isSelected {- Image(systemName: "chevron.right.circle.fill")- .foregroundColor(Color.fluidGreen)- }+ Image(systemName: "chevron.right")- .font(.caption.weight(.semibold))++ .font(.fluidSystem(.caption).weight(.semibold))+ .foregroundColor(.secondary)+ .rotationEffect(.degrees(isSelected ? 90 : 0))+ .accessibilityHidden(true)}.padding(12)- .background(- RoundedRectangle(cornerRadius: 8, style: .continuous)- .fill(self.theme.palette.cardBackground)- .overlay(- RoundedRectangle(cornerRadius: 8, style: .continuous)- .stroke(isSelected ? Color.fluidGreen.opacity(0.5) : self.theme.palette.cardBorder.opacity(0.3), lineWidth: isSelected ? 2 : 1)- )- )+ .contentShape(Rectangle())}.buttonStyle(.plain)+ .accessibilityValue(isSelected ? "Expanded" : "Collapsed")+ .accessibilityHint(isSelected ? "Collapse transcription" : "Expand transcription")}private func historyDetailCard(entry: FileTranscriptionEntry) -> some View {@@@ -504,8 -545,8 +546,8 @@@return VStack(alignment: .leading, spacing: 16) {HStack {VStack(alignment: .leading, spacing: 4) {- Text("From history")+ Text("Transcript")- .font(.headline)+ .font(.fluidSystem(.headline))HStack(spacing: 16) {Label("\(String(format: "%.1f", entry.duration))s", systemImage: "clock")Label("\(String(format: "%.0f%%", entry.confidence * 100))", systemImage: "checkmark.circle")