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

Added mail based feedback button ; updated LICENSE

altic-dev37fb783aa9ce
diff --git a/LICENSE b/LICENSE
index f1de7a32..d6456956 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,20 +1,202 @@
-CC BY 4.0 License
-This work is licensed under the Creative Commons Attribution 4.0 International License.
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
-To view a copy of this license, visit:
-https://creativecommons.org/licenses/by/4.0/
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-Or send a letter to:
-Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
+ 1. Definitions.
-You are free to:
-- Share — copy and redistribute the material in any medium or format
-- Adapt — remix, transform, and build upon the material for any purpose, even commercially
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
-Under the following terms:
-- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
-No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
-Full license text: https://creativecommons.org/licenses/by/4.0/legalcode.en
\ No newline at end of file
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index f7b7d4d9..892f4301 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -143,6 +143,10 @@ struct ContentView: View {
@State private var showAPIKeyEditor: Bool = false
@State private var newProviderBaseURL: String = ""
@State private var keyJustSaved: Bool = false
+
+ // Feedback State
+ @State private var feedbackText: String = ""
+ @State private var includeDebugLogs: Bool = false
var body: some View {
NavigationSplitView {
@@ -213,7 +217,7 @@ struct ContentView: View {
let eventModifiers = event.modifierFlags.intersection([.command, .option, .control, .shift])
let shortcutModifiers = hotkeyShortcut.modifierFlags.intersection([.command, .option, .control, .shift])
- DebugLogger.shared.debug("NSEvent monitor - type: \(event.type), keyCode: \(event.keyCode), eventModifiers: \(eventModifiers), hotkeyShortcut: \(hotkeyShortcut.displayString), isRecordingShortcut: \(isRecordingShortcut)", source: "ContentView")
+ DebugLogger.shared.debug("NSEvent \(event.type) keyCode=\(event.keyCode) recordingShortcut=\(isRecordingShortcut)", source: "ContentView")
if event.type == .keyDown {
if event.keyCode == hotkeyShortcut.keyCode && eventModifiers == shortcutModifiers {
@@ -227,7 +231,6 @@ struct ContentView: View {
asr.stopWithoutTranscription()
return nil
}
- DebugLogger.shared.debug("NSEvent monitor: Not recording shortcut, forwarding event", source: "ContentView")
resetPendingShortcutState()
return event
}
@@ -260,7 +263,6 @@ struct ContentView: View {
}
guard isRecordingShortcut else {
- DebugLogger.shared.debug("NSEvent monitor: Not recording shortcut (modifier), forwarding event", source: "ContentView")
resetPendingShortcutState()
return event
}
@@ -434,6 +436,12 @@ struct ContentView: View {
.font(.system(size: 15, weight: .medium))
}
.listRowBackground(sidebarRowBackground)
+
+ NavigationLink(value: SidebarItem.feedback) {
+ Label("Feedback", systemImage: "envelope.fill")
+ .font(.system(size: 15, weight: .medium))
+ }
+ .listRowBackground(sidebarRowBackground)
}
.listStyle(.sidebar)
.navigationTitle("Fluid")
@@ -523,6 +531,8 @@ struct ContentView: View {
settingsView
case .meetingTools:
meetingToolsView
+ case .feedback:
+ feedbackView
}
}
}
@@ -2579,6 +2589,160 @@ struct ContentView: View {
.padding(20)
}
+ // MARK: - Feedback View
+ private var feedbackView: some View {
+ ScrollView {
+ VStack(alignment: .leading, spacing: 20) {
+ // Header
+ VStack(alignment: .leading, spacing: 8) {
+ HStack {
+ Image(systemName: "envelope.fill")
+ .font(.system(size: 32))
+ .foregroundStyle(.blue)
+ VStack(alignment: .leading) {
+ Text("Send Feedback")
+ .font(.system(size: 28, weight: .bold))
+ Text("Help us improve Fluid with your feedback")
+ .font(.system(size: 16))
+ .foregroundStyle(.secondary)
+ }
+ }
+ Text("Share your thoughts, report bugs, or suggest new features.")
+ .font(.system(size: 14))
+ .foregroundStyle(.secondary)
+ .padding(.top, 4)
+ }
+ .padding(.bottom, 8)
+
+ // Feedback Form
+ HoverableGlossyCard {
+ VStack(alignment: .leading, spacing: 16) {
+ HStack {
+ Image(systemName: "text.bubble.fill")
+ .font(.title2)
+ .foregroundStyle(.white)
+ Text("Your Feedback")
+ .font(.title3)
+ .fontWeight(.semibold)
+ }
+
+ VStack(alignment: .leading, spacing: 12) {
+ Text("Message")
+ .font(.headline)
+ .fontWeight(.semibold)
+
+ TextEditor(text: $feedbackText)
+ .font(.system(size: 14))
+ .frame(height: 120)
+ .padding(12)
+ .background(
+ RoundedRectangle(cornerRadius: 8)
+ .fill(Color.gray.opacity(0.1))
+ .overlay(
+ RoundedRectangle(cornerRadius: 8)
+ .stroke(Color.gray.opacity(0.3), lineWidth: 1)
+ )
+ )
+ .overlay(
+ VStack {
+ if feedbackText.isEmpty {
+ VStack(spacing: 4) {
+ Text("Share your thoughts...")
+ .font(.subheadline)
+ .foregroundStyle(.secondary)
+ Text("• Report bugs or issues")
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ Text("• Suggest new features")
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ Text("• General feedback")
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ }
+ }
+ }
+ .allowsHitTesting(false)
+ )
+
+ // Attachment Options
+ VStack(alignment: .leading, spacing: 8) {
+ Toggle("Include debug logs", isOn: $includeDebugLogs)
+ .toggleStyle(GlassToggleStyle())
+
+ if includeDebugLogs {
+ Text("Debug logs will help us diagnose issues faster. No personal data is included.")
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ .padding(.leading, 4)
+ }
+ }
+
+ // Send Button
+ HStack {
+ Spacer()
+
+ Button(action: {
+ sendFeedback()
+ }) {
+ HStack(spacing: 8) {
+ Image(systemName: "paperplane.fill")
+ Text("Send Feedback")
+ .fontWeight(.semibold)
+ }
+ .padding(.horizontal, 20)
+ .padding(.vertical, 10)
+ }
+ .buttonStyle(GlassButtonStyle())
+ .disabled(feedbackText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
+ .buttonHoverEffect()
+ }
+ }
+ }
+ .padding(20)
+ }
+ .modifier(CardAppearAnimation(delay: 0.1, appear: $appear))
+
+ // Contact Info
+ HoverableGlossyCard {
+ VStack(alignment: .leading, spacing: 12) {
+ HStack {
+ Image(systemName: "info.circle.fill")
+ .font(.title3)
+ .foregroundStyle(.blue)
+ Text("Contact Information")
+ .font(.headline)
+ .fontWeight(.semibold)
+ }
+
+ VStack(alignment: .leading, spacing: 8) {
+ HStack {
+ Image(systemName: "envelope")
+ .foregroundStyle(.secondary)
+ .font(.subheadline)
+ Spacer()
+ Button("Copy") {
+ NSPasteboard.general.clearContents()
+ NSPasteboard.general.setString("[email protected]", forType: .string)
+ }
+ .buttonStyle(InlineButtonStyle())
+ .buttonHoverEffect()
+ }
+
+ Text("We typically respond within 24-48 hours.")
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ }
+ }
+ .padding(16)
+ }
+ .modifier(CardAppearAnimation(delay: 0.2, appear: $appear))
+ }
+ .padding(24)
+ }
+ }
+
// MARK: - Audio Tab
private var audioView: some View
{
@@ -2942,63 +3106,39 @@ struct ContentView: View {
// MARK: - Stop and Process Transcription
private func stopAndProcessTranscription() async {
DebugLogger.shared.debug("stopAndProcessTranscription called", source: "ContentView")
-
+
// Stop the ASR service and wait for transcription to complete
let transcribedText = await asr.stop()
-
- DebugLogger.shared.debug("Transcribed text: \"\(transcribedText)\"", source: "ContentView")
-
- guard !transcribedText.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).isEmpty else {
- DebugLogger.shared.debug("No transcribed text to process", source: "ContentView")
- return // No text to process
+
+ guard transcribedText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false else {
+ DebugLogger.shared.debug("Transcription returned empty text", source: "ContentView")
+ return
}
-
+
let finalText: String
-
- if enableAIProcessing && !(providerAPIKeys[currentProvider] ?? "").trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).isEmpty {
- DebugLogger.shared.debug("Processing text through AI...", source: "ContentView")
- // Process through AI
+
+ if enableAIProcessing && !(providerAPIKeys[currentProvider] ?? "").trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
+ DebugLogger.shared.debug("Routing transcription through AI post-processing", source: "ContentView")
finalText = await processTextWithAI(transcribedText)
} else {
- DebugLogger.shared.debug("Using original transcribed text (no AI processing)", source: "ContentView")
- // Use original transcribed text
finalText = transcribedText
}
-
- DebugLogger.shared.debug("Final text: \"\(finalText)\"", source: "ContentView")
- DebugLogger.shared.debug("isTranscriptionFocused: \(isTranscriptionFocused)", source: "ContentView")
-
- // Do not update asr.finalText directly to avoid instant double-insert in playground
-
- // Only type to external field if TextEditor is not focused
- // When TextEditor is focused, the binding will handle the text update
+
+ DebugLogger.shared.info("Transcription finalized (chars: \(finalText.count))", source: "ContentView")
+
await MainActor.run {
- DebugLogger.shared.debug("About to check if should type to external field", source: "ContentView")
-
- // Check if we're actually in the fluid app or external app
let frontmostApp = NSWorkspace.shared.frontmostApplication
+ let frontmostName = frontmostApp?.localizedName ?? "Unknown"
let isFluidFrontmost = frontmostApp?.bundleIdentifier?.contains("fluid") == true
-
- DebugLogger.shared.debug("Frontmost app: \(frontmostApp?.localizedName ?? "Unknown")", source: "ContentView")
- DebugLogger.shared.debug("Is fluid frontmost: \(isFluidFrontmost)", source: "ContentView")
- DebugLogger.shared.debug("isTranscriptionFocused: \(isTranscriptionFocused)", source: "ContentView")
+ let shouldTypeExternally = !isFluidFrontmost || isTranscriptionFocused == false
- // If we're in an external app, force external typing regardless of focus state
- if !isFluidFrontmost {
- DebugLogger.shared.debug("External app is frontmost, forcing external text injection", source: "ContentView")
+ DebugLogger.shared.debug(
+ "Typing decision → frontmost: \(frontmostName), fluidFrontmost: \(isFluidFrontmost), editorFocused: \(isTranscriptionFocused), willTypeExternally: \(shouldTypeExternally)",
+ source: "ContentView"
+ )
+
+ if shouldTypeExternally {
asr.typeTextToActiveField(finalText)
- DebugLogger.shared.debug("External typeTextToActiveField call completed", source: "ContentView")
- } else {
- // We're in the Fluid app - only type externally if TextEditor is NOT focused
- if !isTranscriptionFocused {
- DebugLogger.shared.debug("TextEditor not focused, calling typeTextToActiveField with text: \"\(finalText.prefix(50))\(finalText.count > 50 ? "..." : "")\"", source: "ContentView")
- asr.typeTextToActiveField(finalText)
- DebugLogger.shared.debug("typeTextToActiveField call completed", source: "ContentView")
- } else {
- DebugLogger.shared.debug("TextEditor is focused - typing via simulation only", source: "ContentView")
- asr.typeTextToActiveField(finalText)
- DebugLogger.shared.debug("typeTextToActiveField call completed", source: "ContentView")
- }
}
}
}
@@ -3039,17 +3179,8 @@ struct ContentView: View {
let baseURL = openAIBaseURL.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
// Debug logging
- DebugLogger.shared.info("=== API CONNECTION TEST STARTED ===", source: "ContentView")
- DebugLogger.shared.debug("Provider: \(currentProvider)", source: "ContentView")
- DebugLogger.shared.debug("Base URL: \(baseURL)", source: "ContentView")
- DebugLogger.shared.debug("API Key present: \(apiKey.isEmpty ? "NO" : "YES (length: \(apiKey.count))")", source: "ContentView")
- DebugLogger.shared.debug("Current provider key: '\(providerAPIKeys[currentProvider] ?? "NOT_FOUND")'", source: "ContentView")
- DebugLogger.shared.debug("API Key value (first 10 chars): \(apiKey.prefix(10))...", source: "ContentView")
-
- DebugLogger.shared.debug("API Key format check:", source: "ContentView")
- DebugLogger.shared.debug(" Starts with 'sk-': \(apiKey.hasPrefix("sk-") ? "YES" : "NO - OpenAI keys must start with 'sk-'")", source: "ContentView")
- DebugLogger.shared.debug(" Contains only valid characters: \(apiKey.rangeOfCharacter(from: CharacterSet.alphanumerics.union(CharacterSet(charactersIn: "-_"))) == nil ? "YES" : "NO")", source: "ContentView")
- DebugLogger.shared.debug(" Length is reasonable: \(apiKey.count >= 20 && apiKey.count <= 200 ? "YES" : "NO - Should be 20-200 chars")", source: "ContentView")
+ DebugLogger.shared.info("API connection test started (provider: \(currentProvider), baseURL: \(baseURL))", source: "ContentView")
+ DebugLogger.shared.debug("API key supplied: \(!apiKey.isEmpty), length: \(apiKey.count)", source: "ContentView")
if !apiKey.hasPrefix("sk-") {
DebugLogger.shared.warning("PROBLEM: API key doesn't start with 'sk-' - this is likely the cause of the 401 error!", source: "ContentView")
@@ -3057,7 +3188,6 @@ struct ContentView: View {
if apiKey.count < 20 || apiKey.count > 200 {
DebugLogger.shared.warning("PROBLEM: API key length is unusual - should be 20-200 characters!", source: "ContentView")
}
- DebugLogger.shared.info("=== END API ANALYSIS ===", source: "ContentView")
guard !apiKey.isEmpty && !baseURL.isEmpty else {
DebugLogger.shared.error("Missing required fields - API key or base URL is empty", source: "ContentView")
@@ -3269,6 +3399,64 @@ struct ContentView: View {
NSWorkspace.shared.open(URL(fileURLWithPath: "/Applications"))
}
+ // MARK: - Feedback Functions
+ private func sendFeedback() {
+ let subject = "Fluid App Feedback"
+ let body = createFeedbackEmailBody()
+
+ // Create mailto URL
+ var components = URLComponents()
+ components.scheme = "mailto"
+ components.path = "[email protected]"
+ components.queryItems = [
+ URLQueryItem(name: "subject", value: subject),
+ URLQueryItem(name: "body", value: body)
+ ]
+
+ if let mailtoURL = components.url {
+ NSWorkspace.shared.open(mailtoURL)
+
+ // Clear the feedback form after sending
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
+ feedbackText = ""
+ includeDebugLogs = false
+ }
+ }
+ }
+
+ private func createFeedbackEmailBody() -> String {
+ var body = "Hi Fluid Team,\n\n"
+ body += feedbackText
+ body += "\n\n"
+
+ if includeDebugLogs {
+ body += "--- Debug Information ---\n"
+ body += "App Version: \(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown")\n"
+ body += "Build: \(Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown")\n"
+ body += "macOS Version: \(ProcessInfo.processInfo.operatingSystemVersionString)\n"
+ body += "Date: \(Date().formatted())\n\n"
+
+ // Add recent log entries
+ let logFileURL = FileLogger.shared.currentLogFileURL()
+ if FileManager.default.fileExists(atPath: logFileURL.path) {
+ do {
+ let logContent = try String(contentsOf: logFileURL)
+ let lines = logContent.components(separatedBy: .newlines)
+ let recentLines = Array(lines.suffix(50)) // Last 50 lines
+ body += "Recent Log Entries:\n"
+ body += recentLines.joined(separator: "\n")
+ } catch {
+ body += "Could not read log file: \(error.localizedDescription)\n"
+ }
+ } else {
+ body += "No log file found.\n"
+ }
+ }
+
+ body += "\n\nBest regards,\nFluid User"
+ return body
+ }
+
// MARK: - Hotkey Manager Initialization Helpers
private func initializeHotkeyManagerIfNeeded() {
guard hotkeyManager == nil else { return }
@@ -3344,6 +3532,7 @@ private enum SidebarItem: Hashable {
case audio
case settings
case meetingTools
+ case feedback
}
// MARK: - Embedded CoreAudio Device Manager
diff --git a/Sources/Fluid/Services/ASRService.swift b/Sources/Fluid/Services/ASRService.swift
index e02fa3e0..72eff665 100644
--- a/Sources/Fluid/Services/ASRService.swift
+++ b/Sources/Fluid/Services/ASRService.swift
@@ -464,6 +464,12 @@ final class ASRService: ObservableObject
/// Manual calls are typically not needed unless you want to preload models.
func ensureAsrReady() async throws
{
+ // Check if we're already ready and models are loaded - avoid unnecessary flicker
+ if isAsrReady && asrManager != nil {
+ DebugLogger.shared.debug("ASR already ready with loaded models, skipping initialization", source: "ASRService")
+ return
+ }
+
// Force reinitialization for v3 models by resetting state
isAsrReady = false
asrManager = nil
@@ -616,9 +622,6 @@ final class ASRService: ObservableObject
func typeTextToActiveField(_ text: String)
{
- DebugLogger.shared.debug("typeTextToActiveField called with: \"\(text.prefix(50))\(text.count > 50 ? "..." : "")\"", source: "ASRService")
- DebugLogger.shared.debug("About to call typingService.typeTextInstantly", source: "ASRService")
typingService.typeTextInstantly(text)
- DebugLogger.shared.debug("typingService.typeTextInstantly call completed", source: "ASRService")
}
}
diff --git a/Sources/Fluid/Services/FileLogger.swift b/Sources/Fluid/Services/FileLogger.swift
index 8a63177d..c52f58f2 100644
--- a/Sources/Fluid/Services/FileLogger.swift
+++ b/Sources/Fluid/Services/FileLogger.swift
@@ -11,6 +11,7 @@ final class FileLogger
private let logFileURL: URL
private let backupLogURL: URL
private let maxLogFileSize: UInt64 = 1 * 1024 * 1024 // 1 MB limit per log file
+ private let maxLogFileAge: TimeInterval = 72 * 60 * 60 // Rotate every 72 hours
private init()
{
@@ -84,7 +85,9 @@ final class FileLogger
{
let attributes = try? fileManager.attributesOfItem(atPath: logFileURL.path)
let size = attributes?[.size] as? UInt64 ?? 0
- shouldRotate = size >= maxLogFileSize
+ let modifiedDate = attributes?[.modificationDate] as? Date ?? Date()
+ let ageExceedsLimit = Date().timeIntervalSince(modifiedDate) >= maxLogFileAge
+ shouldRotate = size >= maxLogFileSize || ageExceedsLimit
}
guard shouldRotate else { return }