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
Render longer transcription
grohith32787cd75e05a1e
diff --git a/Fluid.xcodeproj/project.pbxproj b/Fluid.xcodeproj/project.pbxprojindex 45e2a4e2..d066fbf4 100644--- a/Fluid.xcodeproj/project.pbxproj+++ b/Fluid.xcodeproj/project.pbxproj@@ -17,8 +17,8 @@7CDB0A2F2F3C4D5600FB7CAD /* dictation_fixture.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7CDB0A2B2F3C4D5600FB7CAD /* dictation_fixture.wav */; };7CDB0A302F3C4D5600FB7CAD /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CDB0A2C2F3C4D5600FB7CAD /* XCTest.framework */; };7CE006BD2E80EBE600DDCCD6 /* AppUpdater in Frameworks */ = {isa = PBXBuildFile; productRef = 7CE006BC2E80EBE600DDCCD6 /* AppUpdater */; };- 7CF7A1A530AA000100F00001 /* FV_start.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 7CF7A1A730AA000100F00001 /* FV_start.m4a */; };- 7CF7A1A630AA000100F00001 /* FV_start_2.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 7CF7A1A830AA000100F00001 /* FV_start_2.m4a */; };+ 7CF7A1A530AA000100F00001 /* Sources/Fluid/Resources/FV_start.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 7CF7A1A730AA000100F00001 /* Sources/Fluid/Resources/FV_start.m4a */; };+ 7CF7A1A630AA000100F00001 /* Sources/Fluid/Resources/FV_start_2.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 7CF7A1A830AA000100F00001 /* Sources/Fluid/Resources/FV_start_2.m4a */; };/* End PBXBuildFile section *//* Begin PBXContainerItemProxy section */@@ -38,8 +38,8 @@7CDB0A2A2F3C4D5600FB7CAD /* AudioFixtureLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioFixtureLoader.swift; sourceTree = "<group>"; };7CDB0A2B2F3C4D5600FB7CAD /* dictation_fixture.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = dictation_fixture.wav; sourceTree = "<group>"; };7CDB0A2C2F3C4D5600FB7CAD /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };- 7CF7A1A730AA000100F00001 /* FV_start.m4a */ = {isa = PBXFileReference; lastKnownFileType = audio.m4a; path = Sources/Fluid/Resources/FV_start.m4a; sourceTree = "<group>"; };- 7CF7A1A830AA000100F00001 /* FV_start_2.m4a */ = {isa = PBXFileReference; lastKnownFileType = audio.m4a; path = Sources/Fluid/Resources/FV_start_2.m4a; sourceTree = "<group>"; };+ 7CF7A1A730AA000100F00001 /* Sources/Fluid/Resources/FV_start.m4a */ = {isa = PBXFileReference; lastKnownFileType = audio.m4a; path = Sources/Fluid/Resources/FV_start.m4a; sourceTree = "<group>"; };+ 7CF7A1A830AA000100F00001 /* Sources/Fluid/Resources/FV_start_2.m4a */ = {isa = PBXFileReference; lastKnownFileType = audio.m4a; path = Sources/Fluid/Resources/FV_start_2.m4a; sourceTree = "<group>"; };/* End PBXFileReference section *//* Begin PBXFileSystemSynchronizedRootGroup section */@@ -81,6 +81,7 @@7C078D912E3B339200FB7CAC /* Sources/Fluid */,7CDB0A242F3C4D5600FB7CAD /* Tests */,7CDB0A282F3C4D5600FB7CAD /* Frameworks */,+ F744347C2F2ACCBF006BE5F9 /* Recovered References */,);sourceTree = "<group>";};@@ -135,6 +136,15 @@name = Frameworks;sourceTree = "<group>";};+ F744347C2F2ACCBF006BE5F9 /* Recovered References */ = {+ isa = PBXGroup;+ children = (+ 7CF7A1A730AA000100F00001 /* Sources/Fluid/Resources/FV_start.m4a */,+ 7CF7A1A830AA000100F00001 /* Sources/Fluid/Resources/FV_start_2.m4a */,+ );+ name = "Recovered References";+ sourceTree = "<group>";+ };/* End PBXGroup section *//* Begin PBXNativeTarget section */@@ -235,8 +245,8 @@isa = PBXResourcesBuildPhase;buildActionMask = 2147483647;files = (- 7CF7A1A530AA000100F00001 /* FV_start.m4a in Resources */,- 7CF7A1A630AA000100F00001 /* FV_start_2.m4a in Resources */,+ 7CF7A1A530AA000100F00001 /* Sources/Fluid/Resources/FV_start.m4a in Resources */,+ 7CF7A1A630AA000100F00001 /* Sources/Fluid/Resources/FV_start_2.m4a in Resources */,);runOnlyForDeploymentPostprocessing = 0;};@@ -414,7 +424,7 @@CODE_SIGN_STYLE = Automatic;COMBINE_HIDPI_IMAGES = YES;CURRENT_PROJECT_VERSION = 1;- DEVELOPMENT_TEAM = V4J43B279J;+ DEVELOPMENT_TEAM = J67LH9U7BN;ENABLE_APP_SANDBOX = NO;ENABLE_CODE_COVERAGE = NO;ENABLE_FILE_ACCESS_DOWNLOADS_FOLDER = readwrite;@@ -468,7 +478,7 @@CODE_SIGN_STYLE = Automatic;COMBINE_HIDPI_IMAGES = YES;CURRENT_PROJECT_VERSION = 1;- DEVELOPMENT_TEAM = V4J43B279J;+ DEVELOPMENT_TEAM = J67LH9U7BN;ENABLE_APP_SANDBOX = NO;ENABLE_CODE_COVERAGE = NO;ENABLE_FILE_ACCESS_DOWNLOADS_FOLDER = readwrite;@@ -629,8 +639,8 @@isa = XCRemoteSwiftPackageReference;repositoryURL = "https://github.com/ejbills/mediaremote-adapter";requirement = {- kind = branch;branch = master;+ kind = branch;};};7CE006BB2E80EBE600DDCCD6 /* XCRemoteSwiftPackageReference "AppUpdater" */ = {diff --git a/Sources/Fluid/Persistence/SettingsStore.swift b/Sources/Fluid/Persistence/SettingsStore.swiftindex 4460dc83..e4db850a 100644--- a/Sources/Fluid/Persistence/SettingsStore.swift+++ b/Sources/Fluid/Persistence/SettingsStore.swift@@ -98,6 +98,7 @@ final class SettingsStore: ObservableObject {static let overlayPosition = "OverlayPosition"static let overlayBottomOffset = "OverlayBottomOffset"static let overlaySize = "OverlaySize"+ static let transcriptionPreviewCharLimit = "TranscriptionPreviewCharLimit"// Media Playback Controlstatic let pauseMediaDuringTranscription = "PauseMediaDuringTranscription"@@ -679,6 +680,20 @@ final class SettingsStore: ObservableObject {}}+ /// How many recent transcription characters show in overlays (default: 140)+ var transcriptionPreviewCharLimit: Int {+ get {+ let stored = self.defaults.object(forKey: Keys.transcriptionPreviewCharLimit) as? NSNumber+ let value = stored?.intValue ?? 140+ return max(40, min(2000, value))+ }+ set {+ objectWillChange.send()+ let clamped = max(40, min(2000, newValue))+ self.defaults.set(clamped, forKey: Keys.transcriptionPreviewCharLimit)+ }+ }+// MARK: - Preferences Settingsenum AccentColorOption: String, CaseIterable, Identifiable {diff --git a/Sources/Fluid/UI/SettingsView.swift b/Sources/Fluid/UI/SettingsView.swiftindex 698f70f6..1766f484 100644--- a/Sources/Fluid/UI/SettingsView.swift+++ b/Sources/Fluid/UI/SettingsView.swift@@ -854,6 +854,39 @@ struct SettingsView: View {.frame(width: 170, alignment: .trailing)}+ Divider().padding(.vertical, 8)++ HStack {+ VStack(alignment: .leading, spacing: 2) {+ Text("Transcription Preview Length")+ .font(.body)+ Text("How many recent characters appear in the notch/pill preview")+ .font(.subheadline)+ .foregroundStyle(.secondary)+ }++ Spacer()++ HStack(spacing: 6) {+ Slider(+ value: Binding(+ get: { Double(self.settings.transcriptionPreviewCharLimit) },+ set: { self.settings.transcriptionPreviewCharLimit = Int($0.rounded()) }+ ),+ in: 40...2000,+ step: 10+ )+ .frame(width: 110)+ .controlSize(.small)++ Text("\(self.settings.transcriptionPreviewCharLimit) chars")+ .font(.caption.monospaced())+ .foregroundStyle(.secondary)+ .frame(width: 90, alignment: .trailing)+ }+ .frame(width: 200, alignment: .trailing)+ }+// Bottom overlay specific settings (only show when bottom is selected)if self.settings.overlayPosition == .bottom {Divider().padding(.vertical, 4)diff --git a/Sources/Fluid/Views/BottomOverlayView.swift b/Sources/Fluid/Views/BottomOverlayView.swiftindex a7b541d3..3258ace9 100644--- a/Sources/Fluid/Views/BottomOverlayView.swift+++ b/Sources/Fluid/Views/BottomOverlayView.swift@@ -89,6 +89,10 @@ final class BottomOverlayWindowController {NotchContentState.shared.setProcessing(processing)}+ func refreshSizeForContent() {+ self.updateSizeAndPosition()+ }+/// Update window size based on current SwiftUI content and re-positionprivate func updateSizeAndPosition() {guard let window = window, let hostingView = window.contentView as? NSHostingView<BottomOverlayView> else { return }@@ -297,11 +301,16 @@ struct BottomOverlayView: View {return "Default"}- // Show last ~60 characters of transcription on single line- private var transcriptionSuffix: String {- let text = self.contentState.transcriptionText- let maxChars = 60- return text.count > maxChars ? "..." + String(text.suffix(maxChars)) : text+ private var previewMaxHeight: CGFloat {+ self.layout.transFontSize * 4.2+ }++ private var transcriptionVerticalPadding: CGFloat {+ max(4, self.layout.vPadding / 2)+ }++ private var transcriptionPreviewText: String {+ self.contentState.cachedPreviewText}private func handlePromptHover(_ hovering: Bool) {@@ -377,21 +386,45 @@ struct BottomOverlayView: View {var body: some View {VStack(spacing: self.layout.vPadding / 2) {- // Transcription text area (single line)+ // Transcription text area (wrapped)Group {if self.hasTranscription && !self.contentState.isProcessing {- Text(self.transcriptionSuffix)- .font(.system(size: self.layout.transFontSize, weight: .medium))- .foregroundStyle(.white.opacity(0.9))- .lineLimit(1)- .truncationMode(.head)+ let previewText = self.transcriptionPreviewText+ if !previewText.isEmpty {+ ScrollViewReader { proxy in+ ScrollView(.vertical, showsIndicators: false) {+ Text(previewText)+ .font(.system(size: self.layout.transFontSize, weight: .medium))+ .foregroundStyle(.white.opacity(0.9))+ .multilineTextAlignment(.leading)+ .frame(maxWidth: .infinity, alignment: .leading)+ Color.clear.frame(height: 1).id("bottom")+ }+ .frame(maxWidth: self.layout.waveformWidth * 2.2, maxHeight: self.previewMaxHeight)+ .clipped()+ .onAppear {+ DispatchQueue.main.async {+ proxy.scrollTo("bottom", anchor: .bottom)+ }+ }+ .onChange(of: previewText) { _, _ in+ DispatchQueue.main.async {+ proxy.scrollTo("bottom", anchor: .bottom)+ }+ }+ }+ .padding(.vertical, self.transcriptionVerticalPadding)+ }} else if self.contentState.isProcessing {Text(self.processingLabel).font(.system(size: self.layout.transFontSize, weight: .medium)).foregroundStyle(self.modeColor.opacity(0.8))}}- .frame(maxWidth: self.layout.waveformWidth * 2.2, minHeight: self.hasTranscription || self.contentState.isProcessing ? self.layout.transFontSize * 1.5 : 0)+ .frame(+ maxWidth: self.layout.waveformWidth * 2.2,+ minHeight: self.hasTranscription || self.contentState.isProcessing ? self.layout.transFontSize * 1.5 : 0+ )// Dictation prompt selector (only in dictation mode)if self.isDictationMode && !self.contentState.isProcessing {@@ -471,6 +504,12 @@ struct BottomOverlayView: View {}.padding(.horizontal, self.layout.hPadding).padding(.vertical, self.layout.vPadding)+ .onChange(of: self.contentState.cachedPreviewText) { _, _ in+ BottomOverlayWindowController.shared.refreshSizeForContent()+ }+ .onChange(of: self.contentState.isProcessing) { _, _ in+ BottomOverlayWindowController.shared.refreshSizeForContent()+ }.background(ZStack {// Solid pitch black backgrounddiff --git a/Sources/Fluid/Views/NotchContentViews.swift b/Sources/Fluid/Views/NotchContentViews.swiftindex a9747207..b209bced 100644--- a/Sources/Fluid/Views/NotchContentViews.swift+++ b/Sources/Fluid/Views/NotchContentViews.swift@@ -25,9 +25,8 @@ class NotchContentState: ObservableObject {/// Captured at recording start to keep the target stable for the session.@Published var recordingTargetPID: pid_t? = nil- // Cached transcription lines to avoid recomputing on every render- @Published private(set) var cachedLine1: String = ""- @Published private(set) var cachedLine2: String = ""+ // Cached transcription preview text to avoid recomputing on every render+ @Published private(set) var cachedPreviewText: String = ""// MARK: - Expanded Command Output State@@ -60,7 +59,17 @@ class NotchContentState: ObservableObject {// Callback for submitting follow-up commands from the notchvar onSubmitFollowUp: ((String) async -> Void)?- private init() {}+ private var cancellables = Set<AnyCancellable>()+++ private init() {+ NotificationCenter.default.publisher(for: UserDefaults.didChangeNotification)+ .receive(on: DispatchQueue.main)+ .sink { [weak self] _ in+ self?.recomputeTranscriptionLines()+ }+ .store(in: &cancellables)+ }/// Set AI processing statefunc setProcessing(_ processing: Bool) {@@ -79,28 +88,12 @@ class NotchContentState: ObservableObject {let text = self.transcriptionTextguard !text.isEmpty else {- self.cachedLine1 = ""- self.cachedLine2 = ""+ self.cachedPreviewText = ""return}- // Show last ~100 characters- let maxChars = 100- let displayText = text.count > maxChars ? String(text.suffix(maxChars)) : text-- // Split into words- let words = displayText.split(separator: " ").map(String.init)-- if words.count <= 6 {- // Short: only line 2- self.cachedLine1 = ""- self.cachedLine2 = displayText- } else {- // Long: split roughly in half- let midPoint = words.count / 2- self.cachedLine1 = words[..<midPoint].joined(separator: " ")- self.cachedLine2 = words[midPoint...].joined(separator: " ")- }+ let maxChars = SettingsStore.shared.transcriptionPreviewCharLimit+ self.cachedPreviewText = text.count > maxChars ? String(text.suffix(maxChars)) : text}// MARK: - Recording State for Expanded View@@ -281,6 +274,10 @@ struct NotchExpandedView: View {return "Default"}+ private var previewMaxHeight: CGFloat {+ 60+ }+private func handlePromptHover(_ hovering: Bool) {self.promptHoverWorkItem?.cancel()let task = DispatchWorkItem {@@ -416,15 +413,34 @@ struct NotchExpandedView: View {.transition(.opacity)}- // Transcription preview (single line, minimal)+ // Transcription preview (wrapped, fixed width)if self.hasTranscription && !self.contentState.isProcessing {- Text(self.contentState.cachedLine2)- .font(.system(size: 10, weight: .medium))- .foregroundStyle(.white.opacity(0.75))- .lineLimit(1)- .truncationMode(.tail)- .frame(maxWidth: 180)+ let previewText = self.contentState.cachedPreviewText+ if !previewText.isEmpty {+ ScrollViewReader { proxy in+ ScrollView(.vertical, showsIndicators: false) {+ Text(previewText)+ .font(.system(size: 10, weight: .medium))+ .foregroundStyle(.white.opacity(0.75))+ .multilineTextAlignment(.leading)+ .frame(maxWidth: .infinity, alignment: .leading)+ Color.clear.frame(height: 1).id("bottom")+ }+ .frame(maxWidth: 180, maxHeight: self.previewMaxHeight, alignment: .leading)+ .clipped()+ .onAppear {+ DispatchQueue.main.async {+ proxy.scrollTo("bottom", anchor: .bottom)+ }+ }+ .onChange(of: previewText) { _, _ in+ DispatchQueue.main.async {+ proxy.scrollTo("bottom", anchor: .bottom)+ }+ }+ }.transition(.opacity.combined(with: .scale(scale: 0.95)))+ }}}.padding(.horizontal, 8)@@ -634,6 +650,10 @@ struct NotchCommandOutputExpandedView: View {private let commandRed = Color(red: 1.0, green: 0.35, blue: 0.35)+ private var previewMaxHeight: CGFloat {+ 70+ }+// Dynamic height based on content (max half screen)private var dynamicHeight: CGFloat {let baseHeight: CGFloat = 120 // Minimum height@@ -841,23 +861,35 @@ struct NotchCommandOutputExpandedView: View {private var transcriptionPreview: some View {Group {if self.contentState.isRecordingInExpandedMode && !self.contentState.transcriptionText.isEmpty {- VStack(spacing: 2) {- if !self.contentState.cachedLine1.isEmpty {- Text(self.contentState.cachedLine1)- .font(.system(size: 10, weight: .regular))- .foregroundStyle(.white.opacity(0.5))- .lineLimit(1)+ let previewText = self.contentState.cachedPreviewText+ if !previewText.isEmpty {+ ScrollViewReader { proxy in+ ScrollView(.vertical, showsIndicators: false) {+ Text(previewText)+ .font(.system(size: 11, weight: .medium))+ .foregroundStyle(.white.opacity(0.75))+ .multilineTextAlignment(.leading)+ .frame(maxWidth: .infinity, alignment: .leading)+ Color.clear.frame(height: 1).id("bottom")+ }+ .frame(maxWidth: .infinity, maxHeight: self.previewMaxHeight)+ .clipped()+ .onAppear {+ DispatchQueue.main.async {+ proxy.scrollTo("bottom", anchor: .bottom)+ }+ }+ .onChange(of: previewText) { _, _ in+ DispatchQueue.main.async {+ proxy.scrollTo("bottom", anchor: .bottom)+ }+ }}- Text(self.contentState.cachedLine2)- .font(.system(size: 11, weight: .medium))- .foregroundStyle(.white.opacity(0.75))- .lineLimit(1)+ .padding(.horizontal, 12)+ .padding(.vertical, 6)+ .background(self.commandRed.opacity(0.1))+ .transition(.opacity.combined(with: .scale(scale: 0.98)))}- .frame(maxWidth: .infinity)- .padding(.horizontal, 12)- .padding(.vertical, 6)- .background(self.commandRed.opacity(0.1))- .transition(.opacity.combined(with: .scale(scale: 0.98)))}}.animation(.easeInOut(duration: 0.2), value: self.contentState.isRecordingInExpandedMode)