From 161422b66a4bbb4393d5c1366c3f4a812cab1f5f Mon Sep 17 00:00:00 2001 From: so1omon563 <43015107+so1omon563@users.noreply.github.com> Date: Wed, 5 Aug 2026 09:39:41 -0700 Subject: [PATCH] Keep overlay visible while transcribing --- Sources/Fluid/ContentView.swift | 41 +++++++++------------------------ 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift index 353ba102..cde5da7c 100644 --- a/Sources/Fluid/ContentView.swift +++ b/Sources/Fluid/ContentView.swift @@ -2017,15 +2017,6 @@ struct ContentView: View { let activeDictationSlot = self.currentDictationShortcutSlot(for: modeAtStop) let promptOverride = self.promptModeOverrideText let promptTest = DictationPromptTestCoordinator.shared - let shouldUseAIOnStop = activeDictationSlot.map { - DictationAIPostProcessingGate.isConfigured(for: $0, appBundleID: self.recordingAppInfo?.bundleId) - } ?? DictationAIPostProcessingGate.isConfigured(for: .primary, appBundleID: self.recordingAppInfo?.bundleId) - let shouldHideOverlayOnStop = route == .normal && - !wasRewriteMode && - !wasCommandMode && - !promptTest.isActive && - !shouldUseAIOnStop - var didRequestOverlayHideOnStop = false DebugLogger.shared.info( "Routing decision snapshot | activeMode=\(modeAtStop.rawValue) | rewrite=\(wasRewriteMode) | command=\(wasCommandMode) | overlay=\(NotchContentState.shared.mode.rawValue)", source: "ContentView" @@ -2033,22 +2024,14 @@ struct ContentView: View { self.clearActiveRecordingMode() - if shouldHideOverlayOnStop { - didRequestOverlayHideOnStop = true - DebugLogger.shared.debug("Hiding dictation overlay at stop path", source: "ContentView") - self.hideOverlayAsync(reason: "stop_path") - } else { - // Show "Transcribing" state before calling stop() when the overlay needs - // to remain available for prompt, command, rewrite, or AI feedback. - DebugLogger.shared.debug("Showing transcription processing state", source: "ContentView") - self.appBench("processing_ui_request status=Transcribing") - self.menuBarManager.setProcessing(true) - NotchOverlayManager.shared.updateTranscriptionText("Transcribing") - self.appBench("processing_ui_requested status=Transcribing") - - // Give SwiftUI a chance to render the processing state before heavier work. - await Task.yield() - } + DebugLogger.shared.debug("Showing transcription processing state", source: "ContentView") + self.appBench("processing_ui_request status=Transcribing") + self.menuBarManager.setProcessing(true) + NotchOverlayManager.shared.updateTranscriptionText("Transcribing") + self.appBench("processing_ui_requested status=Transcribing") + + // Give SwiftUI a chance to render the processing state before heavier work. + await Task.yield() // Stop the ASR service and wait for transcription to complete // The processing indicator will stay visible during this phase @@ -2073,9 +2056,7 @@ struct ContentView: View { guard transcribedText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false else { DebugLogger.shared.debug("Transcription returned empty text", source: "ContentView") // Finish the same short exit transition even when no text is emitted. - if !didRequestOverlayHideOnStop { - await self.menuBarManager.finishProcessingAndHideOverlay() - } + await self.menuBarManager.finishProcessingAndHideOverlay() return } @@ -2387,7 +2368,7 @@ struct ContentView: View { tracksDictionaryCorrections: true ) didTypeExternally = true - if !shouldShowAIProcessingFailure, !didRequestOverlayHideOnStop { + if !shouldShowAIProcessingFailure { self.hideOverlayAfterOutput() } } @@ -2428,7 +2409,7 @@ struct ContentView: View { ) } - if !didTypeExternally, !shouldShowAIProcessingFailure, !didRequestOverlayHideOnStop { + if !didTypeExternally, !shouldShowAIProcessingFailure { self.hideOverlayAfterOutput() } }