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

Merge pull request #450 from matthewrball/copy-last-transcript-action

Rohith Gandhi Gef81ab93e11e
diff --cc Sources/Fluid/Views/BottomOverlayView.swift
index a731946c,eee90ac8..47a29e89
--- a/Sources/Fluid/Views/BottomOverlayView.swift
+++ b/Sources/Fluid/Views/BottomOverlayView.swift
@@@ -1617,16 -1533,9 +1617,13 @@@ private struct BottomOverlayActionsMenu
private var canCopyLast: Bool {
guard !self.contentState.isProcessing else { return false }
- guard let latest = self.latestEntry else { return false }
- let processed = latest.processedText.trimmingCharacters(in: .whitespacesAndNewlines)
- let raw = latest.rawText.trimmingCharacters(in: .whitespacesAndNewlines)
- return !(processed.isEmpty && raw.isEmpty)
+ return self.latestEntry?.clipboardText != nil
}
+ private var canPasteLast: Bool {
+ self.canCopyLast
+ }
+
private var canUndoLastAI: Bool {
guard !self.contentState.isProcessing else { return false }
guard let latest = self.latestEntry else { return false }
diff --cc Tests/FluidDictationIntegrationTests/DictationE2ETests.swift
index 390c9b12,41bfd2a5..642718a9
--- a/Tests/FluidDictationIntegrationTests/DictationE2ETests.swift
+++ b/Tests/FluidDictationIntegrationTests/DictationE2ETests.swift
@@@ -35,15 -34,44 +35,51 @@@ final class DictationE2ETests: XCTestCa
PrivateAIProviderFeature.shared.prefixCacheDefaultsKey
}
+ private var privateAIBoostEnabledKey: String {
+ PrivateAIProviderFeature.shared.boostDefaultsKey
+ }
+
+ private let privateAIContextTokenLimitKey = "PrivateAIProviderContextTokenLimit"
+ private let privateAIContextDefaultMigratedTo4KKey = "PrivateAIProviderContextDefaultMigratedTo4K"
+
private let verifiedProviderFingerprintsKey = "VerifiedProviderFingerprints"
+ func testTranscriptionHistoryEntryClipboardTextPrefersProcessedText() {
+ let entry = TranscriptionHistoryEntry(
+ rawText: " raw transcript ",
+ processedText: " processed transcript ",
+ appName: "Notes",
+ windowTitle: "Draft",
+ wasAIProcessed: true
+ )
+
+ XCTAssertEqual(entry.clipboardText, "processed transcript")
+ }
+
+ func testTranscriptionHistoryEntryClipboardTextFallsBackToRawText() {
+ let entry = TranscriptionHistoryEntry(
+ rawText: " raw transcript ",
+ processedText: " ",
+ appName: "Notes",
+ windowTitle: "Draft",
+ wasAIProcessed: false
+ )
+
+ XCTAssertEqual(entry.clipboardText, "raw transcript")
+ }
+
+ func testTranscriptionHistoryEntryClipboardTextSkipsEmptyText() {
+ let entry = TranscriptionHistoryEntry(
+ rawText: " ",
+ processedText: " ",
+ appName: "Notes",
+ windowTitle: "Draft",
+ wasAIProcessed: false
+ )
+
+ XCTAssertNil(entry.clipboardText)
+ }
+
func testTranscriptionStartSound_noneOptionHasNoFile() {
XCTAssertEqual(SettingsStore.TranscriptionStartSound.none.displayName, "None")
XCTAssertNil(SettingsStore.TranscriptionStartSound.none.startSoundFileName)