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

Remove Dashboard playground and its entry points

altic-dev402836b08ea9
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index bdbee396..e518514e 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -1715,12 +1715,8 @@ struct ContentView: View {
WelcomeView(
selectedSidebarItem: self.$selectedSidebarItem,
playgroundUsed: self.$playgroundUsed,
- isTranscriptionFocused: self.$isTranscriptionFocused,
accessibilityEnabled: self.accessibilityEnabled,
- stopAndProcessTranscription: { await self.stopAndProcessTranscription() },
- startRecording: self.startRecording,
openAccessibilitySettings: self.openAccessibilitySettings,
- restartApp: self.restartApp,
openShortcutSettings: { self.openSettings(.dictation) }
)
}
@@ -2578,24 +2574,6 @@ struct ContentView: View {
}
}
- private func isDashboardPracticeTarget(normalDictation: Bool) -> Bool {
- DashboardPracticePolicy.isPractice(
- dashboardVisible: self.selectedSidebarItem == .welcome && !self.settingsNavigation.isPresented && self.settings.onboardingCompleted,
- normalDictation: normalDictation,
- targetPID: NotchContentState.shared.recordingTargetPID,
- appPID: ProcessInfo.processInfo.processIdentifier
- )
- }
-
- private func publishFinalDictationText(_ text: String, dashboardPractice: Bool, lifecycleID: UInt64) {
- self.recordingPrecedingText = ""
- self.asr.finalText = text
- guard dashboardPractice, lifecycleID == self.overlayLifecycleID,
- !text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return }
- self.settings.playgroundUsed = true
- self.playgroundUsed = true
- }
-
private func processStoppedTranscription(route: DictationOutputRoute, pipelineID: String, toggleStopRequestedAt: TimeInterval?) async {
let pipelineStartedAt = ProcessInfo.processInfo.systemUptime
let expectedOverlayLifecycleID = self.overlayLifecycleID
@@ -2614,7 +2592,6 @@ struct ContentView: View {
let activeDictationSlot = self.currentDictationShortcutSlot(for: modeAtStop)
let promptOverride = self.promptModeOverrideText
let promptTest = DictationPromptTestCoordinator.shared
- let isDashboardPractice = self.isDashboardPracticeTarget(normalDictation: route == .normal && !wasRewriteMode && !wasCommandMode && !promptTest.isActive)
let shouldUseAIOnStop = activeDictationSlot.map {
DictationAIPostProcessingGate.isConfigured(for: $0, appBundleID: self.recordingAppInfo?.bundleId)
} ?? DictationAIPostProcessingGate.isConfigured(for: .primary, appBundleID: self.recordingAppInfo?.bundleId)
@@ -2827,7 +2804,8 @@ struct ContentView: View {
bundleID: appInfo.bundleId,
windowTitle: appInfo.windowTitle
)
- self.publishFinalDictationText(finalText, dashboardPractice: isDashboardPractice, lifecycleID: expectedOverlayLifecycleID)
+ self.recordingPrecedingText = ""
+ self.asr.finalText = finalText
if route == .onboardingSandbox,
self.isOnboardingVoicePlaygroundStepActive,
!finalText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
diff --git a/Sources/Fluid/Services/DashboardPracticePolicy.swift b/Sources/Fluid/Services/DashboardPracticePolicy.swift
deleted file mode 100644
index 8a201adb..00000000
--- a/Sources/Fluid/Services/DashboardPracticePolicy.swift
+++ /dev/null
@@ -1,6 +0,0 @@
-/// Capture this at stop; later navigation must not turn unrelated dictation into practice.
-nonisolated enum DashboardPracticePolicy {
- static func isPractice(dashboardVisible: Bool, normalDictation: Bool, targetPID: Int32?, appPID: Int32) -> Bool {
- dashboardVisible && normalDictation && targetPID == appPID
- }
-}
diff --git a/Sources/Fluid/UI/DashboardView.swift b/Sources/Fluid/UI/DashboardView.swift
index 569191c4..f4793a3b 100644
--- a/Sources/Fluid/UI/DashboardView.swift
+++ b/Sources/Fluid/UI/DashboardView.swift
@@ -3,26 +3,21 @@ import AVFoundation
import SwiftUI
/// Home reuses the history and stats snapshots; no polling or duplicate aggregation.
-struct DashboardView<Practice: View>: View {
+struct DashboardView: View {
@ObservedObject var asr: ASRService
@Binding var selectedSidebarItem: SidebarItem?
- let playgroundUsed: Bool
let accessibilityEnabled: Bool
let openAccessibilitySettings: () -> Void
let openShortcutSettings: () -> Void
- let focusPractice: () -> Void
let replayOnboarding: () -> Void
- @ViewBuilder let practice: () -> Practice
@ObservedObject private var history = TranscriptionHistoryStore.shared
@ObservedObject private var stats = StatsSnapshotStore.shared
@ObservedObject private var settings = SettingsStore.shared
@ObservedObject private var contentState = NotchContentState.shared
@Environment(\.theme) private var theme
- @Environment(\.accessibilityReduceMotion) private var reduceMotion
@Environment(\.accessibilityReduceTransparency) private var reduceTransparency
@State private var statsOwner = UUID()
- @State private var showPractice = false
@State private var greeting = "Welcome back."
private var busy: Bool { self.asr.isRunning || self.asr.isStarting || self.contentState.isProcessing }
@@ -30,29 +25,20 @@ struct DashboardView<Practice: View>: View {
var body: some View {
GeometryReader { geometry in
- ScrollViewReader { proxy in
+ Group {
ScrollView {
VStack(alignment: .leading, spacing: 28) {
self.header
if geometry.size.width >= 900 {
HStack(alignment: .top, spacing: 28) {
- self.mainColumn(proxy: proxy)
+ self.mainColumn
.frame(maxWidth: .infinity)
- self.quickActions(proxy: proxy)
+ self.quickActions
.frame(width: min(300, (geometry.size.width - 76) * 0.25))
}
} else {
- self.mainColumn(proxy: proxy)
- self.quickActions(proxy: proxy)
- }
- if self.showPractice {
- self.practice()
- .id("dashboard-practice")
- .task {
- guard NSApp.isActive else { return }
- proxy.scrollTo("dashboard-practice", anchor: .top)
- self.focusPractice()
- }
+ self.mainColumn
+ self.quickActions
}
}
.padding(28)
@@ -69,12 +55,6 @@ struct DashboardView<Practice: View>: View {
let name = NSFullUserName().split(separator: " ").first.map(String.init) ?? ""
self.greeting = name.isEmpty ? "\(salutation)." : "\(salutation), \(name)."
}
- .onChange(of: self.asr.isRunning) { _, running in
- guard running else { return }
- let target = self.contentState.recordingTargetPID
- guard target == ProcessInfo.processInfo.processIdentifier || (target == nil && NSApp.isActive) else { return }
- self.showPractice = true
- }
.onDisappear { self.stats.deactivate(self.statsOwner) }
}
@@ -92,11 +72,11 @@ struct DashboardView<Practice: View>: View {
}
}
- private func mainColumn(proxy: ScrollViewProxy) -> some View {
+ private var mainColumn: some View {
VStack(alignment: .leading, spacing: 28) {
self.statistics
self.recents
- self.learningCenter(proxy: proxy)
+ self.learningCenter
}
}
@@ -159,7 +139,7 @@ struct DashboardView<Practice: View>: View {
}
}
- private func learningCenter(proxy: ScrollViewProxy) -> some View {
+ private var learningCenter: some View {
VStack(alignment: .leading, spacing: 14) {
HStack {
Text("Learning center").font(self.theme.typography.sectionTitle)
@@ -176,7 +156,6 @@ struct DashboardView<Practice: View>: View {
}
self.lesson("Typing access", icon: "keyboard", complete: self.accessibilityEnabled, detail: "Dictate in any app", action: self.openAccessibilitySettings)
self.lesson("AI cleanup", icon: "sparkles", complete: DictationAIPostProcessingGate.isProviderConfigured(), detail: "Optional · polish text") { self.selectedSidebarItem = .aiEnhancements }
- self.lesson("Try dictation", icon: "play", complete: self.playgroundUsed, detail: "Try your setup") { self.openPractice(proxy) }
}
.padding(.vertical, 4)
}
@@ -206,7 +185,7 @@ struct DashboardView<Practice: View>: View {
.accessibilityLabel("\(title), \(complete ? "configured" : detail)")
}
- private func quickActions(proxy: ScrollViewProxy) -> some View {
+ private var quickActions: some View {
VStack(alignment: .leading, spacing: 22) {
Text("Quick actions").font(self.theme.typography.sectionTitle)
if !self.shortcut.isEmpty {
@@ -218,8 +197,6 @@ struct DashboardView<Practice: View>: View {
self.quickAction("Add a word", detail: "Your personal dictionary", icon: "plus") { self.selectedSidebarItem = .customDictionary }
Divider().opacity(0.4)
self.quickAction("Change shortcut", detail: "Make it yours", icon: "keyboard", action: self.openShortcutSettings)
- Divider().opacity(0.4)
- self.quickAction("Try dictation", detail: "Speak a few words", icon: "mic") { self.openPractice(proxy) }
}
HStack(spacing: 12) {
Image(systemName: "note.text")
@@ -272,17 +249,6 @@ struct DashboardView<Practice: View>: View {
}
.buttonStyle(.plain).disabled(self.busy)
}
-
- private func openPractice(_ proxy: ScrollViewProxy) {
- if self.showPractice {
- withAnimation(self.reduceMotion ? nil : .easeOut(duration: 0.2)) {
- proxy.scrollTo("dashboard-practice", anchor: .top)
- }
- self.focusPractice()
- } else {
- self.showPractice = true
- }
- }
}
private struct DashboardRecentRow: View {
diff --git a/Sources/Fluid/UI/WelcomeView.swift b/Sources/Fluid/UI/WelcomeView.swift
index da464fa8..8dec666b 100644
--- a/Sources/Fluid/UI/WelcomeView.swift
+++ b/Sources/Fluid/UI/WelcomeView.swift
@@ -1,222 +1,34 @@
-//
-// WelcomeView.swift
-// fluid
-//
-// Welcome and setup guide view
-//
-
import AppKit
import AVFoundation
import SwiftUI
struct WelcomeView: View {
@EnvironmentObject var appServices: AppServices
- private var asr: ASRService {
- self.appServices.asr
- }
-
@ObservedObject private var settings = SettingsStore.shared
- @ObservedObject private var contentState = NotchContentState.shared
- @State private var isStoppingPractice = false
@Binding var selectedSidebarItem: SidebarItem?
@Binding var playgroundUsed: Bool
- var isTranscriptionFocused: FocusState<Bool>.Binding
- @Environment(\.accessibilityReduceMotion) private var reduceMotion
- @Environment(\.theme) private var theme
-
let accessibilityEnabled: Bool
- let stopAndProcessTranscription: () async -> Void
- let startRecording: () -> Void
let openAccessibilitySettings: () -> Void
- let restartApp: () -> Void
let openShortcutSettings: () -> Void
var body: some View {
DashboardView(
- asr: self.asr,
+ asr: self.appServices.asr,
selectedSidebarItem: self.$selectedSidebarItem,
- playgroundUsed: self.playgroundUsed,
accessibilityEnabled: self.accessibilityEnabled,
openAccessibilitySettings: self.openAccessibilitySettings,
openShortcutSettings: self.openShortcutSettings,
- focusPractice: { self.isTranscriptionFocused.wrappedValue = true },
replayOnboarding: {
self.settings.resetOnboardingProgress()
self.playgroundUsed = false
}
- ) { self.playground }
- .task {
- await AudioStartupGate.shared.scheduleOpenAfterInitialUISettled()
- await AudioStartupGate.shared.waitUntilOpen()
- guard !Task.isCancelled else { return }
- self.asr.micStatus = AVCaptureDevice.authorizationStatus(for: .audio)
- await self.asr.checkIfModelsExistAsync()
- }
- }
-
- private var practiceRecordingDisabled: Bool {
- self.isStoppingPractice || self.asr.isStarting || self.contentState.isProcessing ||
- (self.asr.micStatus == .authorized && !self.asr.isAsrReady && !self.asr.isRunning)
- }
-
- private var practiceRecordingTitle: String {
- if self.isStoppingPractice || self.contentState.isProcessing { return "Processing…" }
- if self.asr.isStarting { return "Starting…" }
- if self.asr.isRunning { return "Stop Recording" }
- switch self.asr.micStatus {
- case .authorized: return "Start Recording"
- case .notDetermined: return "Allow Microphone"
- default: return "Open Microphone Settings"
- }
- }
-
- private func handlePracticeRecording() {
- guard !self.practiceRecordingDisabled else { return }
- if self.asr.isRunning {
- // Latch before creating the task: ASR can remain running during shutdown.
- self.isStoppingPractice = true
- Task { @MainActor in
- defer { self.isStoppingPractice = false }
- await self.stopAndProcessTranscription()
- }
- } else {
- switch self.asr.micStatus {
- case .authorized: self.startRecording()
- case .notDetermined: self.asr.requestMicAccess()
- default: self.asr.openSystemSettingsForMic()
- }
- }
- }
-
- private var playground: some View {
- ThemedCard(hoverEffect: false) {
- VStack(alignment: .leading, spacing: 14) {
- HStack {
- Label {
- VStack(alignment: .leading, spacing: 2) {
- Text("Test Playground")
- .font(self.theme.typography.sectionTitle)
- Text("Click record, speak, and see your transcription")
- .font(self.theme.typography.caption)
- .foregroundStyle(.secondary)
- }
- } icon: {
- Image(systemName: "text.bubble")
- .font(self.theme.typography.titleIcon)
- }
-
- Spacer()
-
- if self.asr.isRunning {
- HStack(spacing: 6) {
- Circle()
- .fill(.red)
- .frame(width: 6, height: 6)
- Text("Recording...")
- .font(self.theme.typography.captionStrong)
- .foregroundStyle(.red)
- }
- } else if !self.asr.finalText.isEmpty {
- Text("\(self.asr.finalText.count) characters")
- .font(self.theme.typography.caption)
- .foregroundStyle(.secondary)
- }
- }
-
- VStack(alignment: .leading, spacing: 14) {
- // Recording Control — centered button
- HStack {
- Spacer()
- Button(action: self.handlePracticeRecording) {
- HStack(spacing: 8) {
- Image(systemName: self.asr.isRunning && !self.isStoppingPractice ? "stop.fill" : "mic.fill")
- Text(self.practiceRecordingTitle)
- }
- .frame(maxWidth: 220)
- }
- .fluidButton(.primary, size: .large, isRecording: self.asr.isRunning)
- .buttonHoverEffect()
- .scaleEffect(!self.reduceMotion && self.asr.isRunning ? 1.02 : 1.0)
- .animation(self.reduceMotion ? nil : .spring(response: 0.3), value: self.asr.isRunning)
- .disabled(self.practiceRecordingDisabled)
- Spacer()
- }
-
- // Text Area
- VStack(alignment: .leading, spacing: 8) {
- TextEditor(text: Binding(
- get: { self.asr.finalText },
- set: { self.asr.finalText = $0 }
- ))
- .font(self.theme.typography.body)
- .focused(self.isTranscriptionFocused)
- .frame(height: 120)
- .padding(10)
- .background(
- RoundedRectangle(cornerRadius: 8, style: .continuous)
- .fill(
- self.asr.isRunning ? self.theme.palette.accent.opacity(0.06) : self.theme.palette.cardBackground
- )
- .overlay(
- RoundedRectangle(cornerRadius: 8, style: .continuous)
- .strokeBorder(
- self.asr.isRunning ? self.theme.palette.accent.opacity(0.4) : self.theme.palette.cardBorder.opacity(0.6),
- lineWidth: self.asr.isRunning ? 2 : 1
- )
- )
- )
- .scrollContentBackground(.hidden)
- .overlay(
- VStack(spacing: 8) {
- if self.asr.isRunning {
- Image(systemName: "waveform")
- .font(self.theme.typography.titleIcon)
- .foregroundStyle(self.theme.palette.accent)
- Text("Listening... Speak now!")
- .font(self.theme.typography.bodySmallStrong)
- .foregroundStyle(self.theme.palette.accent)
- Text("Transcription will appear when you stop recording")
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.accent.opacity(0.7))
- } else if self.asr.finalText.isEmpty {
- Image(systemName: "text.bubble")
- .font(self.theme.typography.titleIcon)
- .foregroundStyle(.secondary.opacity(0.5))
- Text("Press record or your hotkey to begin")
- .font(self.theme.typography.caption)
- .foregroundStyle(.secondary)
- }
- }
- .allowsHitTesting(false)
- )
-
- if !self.asr.finalText.isEmpty {
- HStack(spacing: 8) {
- Button {
- ClipboardAudit.record("ui_copy_begin")
- NSPasteboard.general.clearContents()
- NSPasteboard.general.setString(self.asr.finalText, forType: .string)
- ClipboardAudit.record("ui_copy_end")
- } label: {
- Label("Copy Text", systemImage: "doc.on.doc")
- }
- .buttonStyle(.borderedProminent)
- .tint(self.theme.palette.accent)
- .controlSize(.small)
-
- Button("Clear & Test Again") {
- self.asr.finalText = ""
- }
- .buttonStyle(.bordered)
- .controlSize(.small)
-
- Spacer()
- }
- }
- }
- }
- }
- .padding(16)
+ )
+ .task {
+ await AudioStartupGate.shared.scheduleOpenAfterInitialUISettled()
+ await AudioStartupGate.shared.waitUntilOpen()
+ guard !Task.isCancelled else { return }
+ self.appServices.asr.micStatus = AVCaptureDevice.authorizationStatus(for: .audio)
+ await self.appServices.asr.checkIfModelsExistAsync()
}
}
}
diff --git a/Tests/DashboardPracticePolicyTests.swift b/Tests/DashboardPracticePolicyTests.swift
deleted file mode 100644
index cbba66a5..00000000
--- a/Tests/DashboardPracticePolicyTests.swift
+++ /dev/null
@@ -1,12 +0,0 @@
-@main
-struct DashboardPracticePolicyTests {
- static func main() {
- precondition(DashboardPracticePolicy.isPractice(dashboardVisible: true, normalDictation: true, targetPID: 100, appPID: 100))
- for target: Int32? in [nil, 200] {
- precondition(!DashboardPracticePolicy.isPractice(dashboardVisible: true, normalDictation: true, targetPID: target, appPID: 100))
- }
- precondition(!DashboardPracticePolicy.isPractice(dashboardVisible: false, normalDictation: true, targetPID: 100, appPID: 100))
- precondition(!DashboardPracticePolicy.isPractice(dashboardVisible: true, normalDictation: false, targetPID: 100, appPID: 100))
- print("PASS: Dashboard practice excludes external, missing-target, other-page, and non-dictation sessions")
- }
-}