Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

fix: harden 1.6.10 review edge cases

altic-dev4310f1434190
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index f46d9e5f..2c232842 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -2380,7 +2380,7 @@ struct ContentView: View {
let shouldShowAIProcessingFailure = shouldPersistOutputs && aiFallbackReason != nil
if shouldShowAIProcessingFailure {
- self.pendingAIReprocessText = transcribedText
+ self.pendingAIReprocessText = spokenSendParse.shouldSend ? normalizedTranscribedText : transcribedText
NotchContentState.shared.showAIProcessingFailure()
self.menuBarManager.finishProcessingKeepingOverlayVisible()
} else {
@@ -2517,6 +2517,7 @@ struct ContentView: View {
}
private func handleSpokenSendPartialTranscription(_ text: String) {
+ guard self.settings.spokenSendEnabled else { return }
self.spokenSendPartialRevision &+= 1
let isDictationMode = self.activeRecordingMode == .dictate || self.activeRecordingMode == .promptMode
let shouldStop = isDictationMode &&
diff --git a/Sources/Fluid/Services/RewriteModeService.swift b/Sources/Fluid/Services/RewriteModeService.swift
index ccfff452..07474ff3 100644
--- a/Sources/Fluid/Services/RewriteModeService.swift
+++ b/Sources/Fluid/Services/RewriteModeService.swift
@@ -261,6 +261,16 @@ final class RewriteModeService: ObservableObject {
userInfo: [NSLocalizedDescriptionKey: "No AI model selected"]
)
}
+ if usesPrivateAIProvider {
+ let verifiedModelID = PrivateAIProviderPromptFormat.verifiedModelID(settings: settings)
+ guard verifiedModelID == model else {
+ throw NSError(
+ domain: "RewriteMode",
+ code: -5,
+ userInfo: [NSLocalizedDescriptionKey: "Selected Fluid-1 model is not installed and verified"]
+ )
+ }
+ }
self.appendDiagnosticLog(
"LLM config | writeMode=\(isWriteMode) | linkedToGlobal=\(settings.rewriteModeLinkedToGlobal) | " +
"provider=\(providerID) | model=\(model) | profile=\(selectedPromptName) | " +
diff --git a/Sources/Fluid/Services/TypingService.swift b/Sources/Fluid/Services/TypingService.swift
index fba14be8..4ee2ac38 100644
--- a/Sources/Fluid/Services/TypingService.swift
+++ b/Sources/Fluid/Services/TypingService.swift
@@ -59,6 +59,20 @@ final class TypingService {
return !isSecureTextField && modifiersReleased && exactFocusIsActive
}
+ nonisolated static func canInsertBeforePostInsertionAction(
+ preferredTargetPID: pid_t?,
+ requiredTargetPID: pid_t?,
+ isSecureTextField: Bool,
+ exactFocusIsActive: Bool
+ ) -> Bool {
+ guard let preferredTargetPID, preferredTargetPID > 0,
+ requiredTargetPID == preferredTargetPID
+ else {
+ return false
+ }
+ return !isSecureTextField && exactFocusIsActive
+ }
+
// Logging toggle (off by default). Enable by setting env FLUID_TYPING_LOGS=1
// or UserDefaults bool for key "enableTypingLogs".
private static var isLoggingEnabled: Bool {
@@ -480,11 +494,13 @@ final class TypingService {
outcome = .actionSuppressed
return
}
- guard Self.canDispatchPostInsertionAction(
+ // A held dictation modifier must suppress only the key action,
+ // not the dictated text. The longer check below waits for
+ // modifiers after insertion before deciding whether to send.
+ guard Self.canInsertBeforePostInsertionAction(
preferredTargetPID: preferredTargetPID,
requiredTargetPID: requiredFocusTarget.pid,
isSecureTextField: requiredFocusTarget.isSecureTextField,
- modifiersReleased: self.waitForPhysicalModifiersToRelease(timeout: 0.2),
exactFocusIsActive: Self.isExactFocusTargetActive(requiredFocusTarget)
) else {
outcome = .actionSuppressed
diff --git a/Tests/FluidDictationIntegrationTests/SpokenSendTests.swift b/Tests/FluidDictationIntegrationTests/SpokenSendTests.swift
index 658c2690..cadda369 100644
--- a/Tests/FluidDictationIntegrationTests/SpokenSendTests.swift
+++ b/Tests/FluidDictationIntegrationTests/SpokenSendTests.swift
@@ -345,6 +345,41 @@ final class SpokenSendTests: XCTestCase {
XCTAssertFalse(TypingService.DeliveryOutcome.insertedActionSuppressed.didDispatchAction)
}
+ func testHeldModifierDoesNotBlockSafeTextInsertionBeforeSendDecision() {
+ XCTAssertTrue(
+ TypingService.canInsertBeforePostInsertionAction(
+ preferredTargetPID: 42,
+ requiredTargetPID: 42,
+ isSecureTextField: false,
+ exactFocusIsActive: true
+ )
+ )
+ XCTAssertFalse(
+ TypingService.canInsertBeforePostInsertionAction(
+ preferredTargetPID: 42,
+ requiredTargetPID: 41,
+ isSecureTextField: false,
+ exactFocusIsActive: true
+ )
+ )
+ XCTAssertFalse(
+ TypingService.canInsertBeforePostInsertionAction(
+ preferredTargetPID: 42,
+ requiredTargetPID: 42,
+ isSecureTextField: true,
+ exactFocusIsActive: true
+ )
+ )
+ XCTAssertFalse(
+ TypingService.canInsertBeforePostInsertionAction(
+ preferredTargetPID: 42,
+ requiredTargetPID: 42,
+ isSecureTextField: false,
+ exactFocusIsActive: false
+ )
+ )
+ }
+
func testOverlayIndicatorVisibilityCoversEveryActiveState() {
XCTAssertFalse(SpokenSendIndicatorState.hidden.isVisible)
XCTAssertTrue(SpokenSendIndicatorState.detected.isVisible)