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

Replace Getting Started with a personalized Dashboard

altic-dev140caae716d5
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index 5254350a..bdbee396 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -1329,7 +1329,7 @@ struct ContentView: View {
}
Section {
- self.sidebarNavigationLink(.welcome, title: "Getting Started", systemImage: "house.fill")
+ self.sidebarNavigationLink(.welcome, title: "Dashboard", systemImage: "house.fill")
self.sidebarNavigationLink(.changelog, title: "Change logs", systemImage: "doc.text.magnifyingglass")
self.sidebarNavigationLink(.feedback, title: "Feedback", systemImage: "envelope.fill")
} header: {
@@ -1720,7 +1720,8 @@ struct ContentView: View {
stopAndProcessTranscription: { await self.stopAndProcessTranscription() },
startRecording: self.startRecording,
openAccessibilitySettings: self.openAccessibilitySettings,
- restartApp: self.restartApp
+ restartApp: self.restartApp,
+ openShortcutSettings: { self.openSettings(.dictation) }
)
}
@@ -2577,6 +2578,24 @@ 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
@@ -2595,6 +2614,7 @@ 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)
@@ -2807,8 +2827,7 @@ struct ContentView: View {
bundleID: appInfo.bundleId,
windowTitle: appInfo.windowTitle
)
- self.recordingPrecedingText = ""
- self.asr.finalText = finalText
+ self.publishFinalDictationText(finalText, dashboardPractice: isDashboardPractice, lifecycleID: expectedOverlayLifecycleID)
if route == .onboardingSandbox,
self.isOnboardingVoicePlaygroundStepActive,
!finalText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
diff --git a/Sources/Fluid/Services/DashboardPracticePolicy.swift b/Sources/Fluid/Services/DashboardPracticePolicy.swift
new file mode 100644
index 00000000..8a201adb
--- /dev/null
+++ b/Sources/Fluid/Services/DashboardPracticePolicy.swift
@@ -0,0 +1,6 @@
+/// 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
new file mode 100644
index 00000000..569191c4
--- /dev/null
+++ b/Sources/Fluid/UI/DashboardView.swift
@@ -0,0 +1,323 @@
+import AppKit
+import AVFoundation
+import SwiftUI
+
+/// Home reuses the history and stats snapshots; no polling or duplicate aggregation.
+struct DashboardView<Practice: View>: 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 }
+ private var shortcut: String { self.settings.primaryDictationShortcutDisplayString }
+
+ var body: some View {
+ GeometryReader { geometry in
+ ScrollViewReader { proxy in
+ ScrollView {
+ VStack(alignment: .leading, spacing: 28) {
+ self.header
+ if geometry.size.width >= 900 {
+ HStack(alignment: .top, spacing: 28) {
+ self.mainColumn(proxy: proxy)
+ .frame(maxWidth: .infinity)
+ self.quickActions(proxy: proxy)
+ .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()
+ }
+ }
+ }
+ .padding(28)
+ .frame(maxWidth: 1440, alignment: .leading)
+ .frame(maxWidth: .infinity)
+ }
+ }
+ }
+ .background(self.theme.palette.contentBackground)
+ .onAppear {
+ self.stats.activate(self.statsOwner)
+ let hour = Calendar.current.component(.hour, from: Date())
+ let salutation = hour < 12 ? "Good morning" : (hour < 18 ? "Good afternoon" : "Good evening")
+ 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) }
+ }
+
+ private var header: some View {
+ VStack(alignment: .leading, spacing: 10) {
+ Text(self.greeting)
+ .font(.fluidSystem(size: 34, weight: .regular, design: .serif))
+ .foregroundStyle(.primary)
+ .fixedSize(horizontal: false, vertical: true)
+ if !self.shortcut.isEmpty {
+ Text("\(self.settings.pressAndHoldMode ? "Hold" : "Press") \(self.shortcut) to dictate")
+ .font(self.theme.typography.body)
+ .foregroundStyle(.secondary)
+ }
+ }
+ }
+
+ private func mainColumn(proxy: ScrollViewProxy) -> some View {
+ VStack(alignment: .leading, spacing: 28) {
+ self.statistics
+ self.recents
+ self.learningCenter(proxy: proxy)
+ }
+ }
+
+ private var statistics: some View {
+ let today = self.history.todaySummary
+ let streak = self.stats.snapshot?.usingWeekdays(self.settings.weekendsDontBreakStreak).currentStreak
+ return HStack(alignment: .top, spacing: 20) {
+ self.stat("Today", value: today.words.formatted(), detail: "words dictated")
+ Divider()
+ self.stat("Time saved", value: today.words == 0 ? "0m" : today.formattedTimeSaved(typingWPM: self.settings.userTypingWPM), detail: "estimated today")
+ Divider()
+ self.stat("Streak", value: streak.map { "\($0) \($0 == 1 ? "day" : "days")" } ?? "—", detail: "keep it going")
+ }
+ .fixedSize(horizontal: false, vertical: true)
+ .padding(.vertical, 16)
+ }
+
+ private func stat(_ title: String, value: String, detail: String) -> some View {
+ VStack(alignment: .leading, spacing: 7) {
+ Text(title).font(self.theme.typography.caption).foregroundStyle(.secondary)
+ Text(value).font(.fluidSystem(size: 27, weight: .semibold)).monospacedDigit()
+ .lineLimit(1).minimumScaleFactor(0.7)
+ Text(detail).font(self.theme.typography.caption).foregroundStyle(.secondary)
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .accessibilityElement(children: .combine)
+ }
+
+ private var recents: some View {
+ VStack(alignment: .leading, spacing: 14) {
+ HStack {
+ Text("Recent dictations").font(self.theme.typography.sectionTitle)
+ Spacer()
+ Button("View all") { self.selectedSidebarItem = .history }
+ .buttonStyle(.plain).foregroundStyle(self.theme.palette.accent)
+ .disabled(self.busy)
+ }
+ ThemedCard(style: .subtle, padding: 0) {
+ if self.history.isLoading && self.history.entries.isEmpty {
+ ProgressView("Loading history…").frame(maxWidth: .infinity).padding(32)
+ } else if self.history.entries.isEmpty {
+ VStack(alignment: .leading, spacing: 8) {
+ Image(systemName: "text.bubble").font(.fluidSystem(size: 24)).foregroundStyle(self.theme.palette.accent)
+ Text("Your words start here").font(self.theme.typography.bodyStrong)
+ Text("Your recent dictations will appear here after you speak.")
+ .font(self.theme.typography.bodySmall).foregroundStyle(.secondary)
+ }
+ .frame(maxWidth: .infinity, alignment: .leading).padding(24)
+ } else {
+ VStack(spacing: 0) {
+ ForEach(Array(self.history.entries.prefix(4))) { entry in
+ DashboardRecentRow(entry: entry)
+ if entry.id != self.history.entries.prefix(4).last?.id {
+ Divider().opacity(0.4).padding(.horizontal, 18)
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private func learningCenter(proxy: ScrollViewProxy) -> some View {
+ VStack(alignment: .leading, spacing: 14) {
+ HStack {
+ Text("Learning center").font(self.theme.typography.sectionTitle)
+ Spacer()
+ Button("Replay onboarding", systemImage: "arrow.counterclockwise", action: self.replayOnboarding)
+ .buttonStyle(.plain).font(self.theme.typography.caption)
+ .foregroundStyle(.secondary).disabled(self.busy)
+ }
+ ScrollView(.horizontal) {
+ HStack(spacing: 12) {
+ self.lesson("Voice model", icon: "waveform", complete: self.asr.modelsExistOnDisk || self.asr.isAsrReady, detail: "Choose your engine") { self.selectedSidebarItem = .voiceEngine }
+ self.lesson("Microphone", icon: "mic", complete: self.asr.micStatus == .authorized, detail: "Set up voice input") {
+ if self.asr.micStatus == .notDetermined { self.asr.requestMicAccess() } else { self.asr.openSystemSettingsForMic() }
+ }
+ 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)
+ }
+ .scrollIndicators(.visible)
+ }
+ }
+
+ private func lesson(_ title: String, icon: String, complete: Bool, detail: String, action: @escaping () -> Void) -> some View {
+ Button(action: action) {
+ VStack(alignment: .leading, spacing: 14) {
+ HStack {
+ Image(systemName: icon).font(.fluidSystem(size: 22, weight: .medium)).foregroundStyle(self.theme.palette.accent)
+ Spacer()
+ if complete {
+ Image(systemName: "checkmark.circle.fill").font(.fluidSystem(size: 12)).foregroundStyle(.secondary)
+ }
+ }
+ VStack(alignment: .leading, spacing: 5) {
+ Text(title).font(self.theme.typography.bodySmallStrong)
+ Text(detail).font(self.theme.typography.caption).foregroundStyle(.secondary)
+ }
+ }
+ .padding(16).frame(width: 154, alignment: .leading)
+ .background(self.theme.palette.cardBackground, in: RoundedRectangle(cornerRadius: 16))
+ }
+ .buttonStyle(.plain).disabled(self.busy)
+ .accessibilityLabel("\(title), \(complete ? "configured" : detail)")
+ }
+
+ private func quickActions(proxy: ScrollViewProxy) -> some View {
+ VStack(alignment: .leading, spacing: 22) {
+ Text("Quick actions").font(self.theme.typography.sectionTitle)
+ if !self.shortcut.isEmpty {
+ self.shortcutKey
+ .disabled(self.busy)
+ .help("Change your dictation shortcut")
+ }
+ VStack(spacing: 0) {
+ 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")
+ Text("Notepad")
+ Spacer(minLength: 2)
+ Text("Coming soon").font(.fluidSystem(size: 10))
+ }
+ .foregroundStyle(.tertiary).padding(.top, 4)
+ .accessibilityElement(children: .combine)
+ }
+ .padding(22)
+ .background(self.reduceTransparency ? self.theme.palette.cardBackground : self.theme.palette.accent.opacity(0.035), in: RoundedRectangle(cornerRadius: 22))
+ .background {
+ if !self.reduceTransparency {
+ RoundedRectangle(cornerRadius: 22).fill(.ultraThinMaterial)
+ }
+ }
+ }
+
+ @ViewBuilder
+ private var shortcutKey: some View {
+ let button = Button(action: self.openShortcutSettings) {
+ Text(self.shortcut)
+ .font(.fluidSystem(size: 23, weight: .medium))
+ .lineLimit(1).minimumScaleFactor(0.6)
+ .frame(maxWidth: .infinity).padding(.vertical, 24)
+ .contentShape(RoundedRectangle(cornerRadius: 16))
+ }
+ .buttonStyle(.plain)
+ if #available(macOS 26, *), !self.reduceTransparency {
+ button.glassEffect(.regular.interactive(), in: RoundedRectangle(cornerRadius: 16))
+ } else {
+ button.background(self.theme.palette.cardBackground, in: RoundedRectangle(cornerRadius: 16))
+ .overlay(RoundedRectangle(cornerRadius: 16).strokeBorder(self.theme.palette.cardBorder, lineWidth: 1))
+ }
+ }
+
+ private func quickAction(_ title: String, detail: String, icon: String, action: @escaping () -> Void) -> some View {
+ Button(action: action) {
+ HStack(spacing: 12) {
+ Image(systemName: icon).font(.fluidSystem(size: 17)).frame(width: 20).foregroundStyle(self.theme.palette.accent)
+ VStack(alignment: .leading, spacing: 4) {
+ Text(title).font(self.theme.typography.bodySmallStrong)
+ Text(detail).font(self.theme.typography.caption).foregroundStyle(.secondary)
+ }
+ Spacer(minLength: 0)
+ Image(systemName: "chevron.right").font(.fluidSystem(size: 10)).foregroundStyle(.tertiary)
+ }
+ .padding(.vertical, 16).contentShape(Rectangle())
+ }
+ .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 {
+ let entry: TranscriptionHistoryEntry
+ @Environment(\.theme) private var theme
+ @State private var copied = false
+
+ var body: some View {
+ HStack(spacing: 12) {
+ HistoryAppIcon(appName: self.entry.appName)
+ VStack(alignment: .leading, spacing: 5) {
+ Text(self.entry.previewText).font(self.theme.typography.bodySmall).lineLimit(2)
+ HStack(spacing: 6) {
+ Text(self.entry.appName.isEmpty ? "Unknown app" : self.entry.appName)
+ Text("·")
+ Text(self.entry.timestamp, style: .date)
+ }
+ .font(self.theme.typography.caption).foregroundStyle(.secondary)
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ Button {
+ guard let text = self.entry.clipboardText else { return }
+ ClipboardAudit.record("ui_copy_begin")
+ NSPasteboard.general.clearContents()
+ NSPasteboard.general.setString(text, forType: .string)
+ ClipboardAudit.record("ui_copy_end")
+ self.copied = true
+ } label: {
+ Image(systemName: self.copied ? "checkmark" : "doc.on.doc")
+ }
+ .buttonStyle(.plain).foregroundStyle(.secondary)
+ .disabled(self.entry.clipboardText == nil)
+ .help(self.copied ? "Copied" : "Copy dictation")
+ .accessibilityLabel(self.copied ? "Copied dictation" : "Copy dictation")
+ }
+ .padding(18)
+ }
+}
diff --git a/Sources/Fluid/UI/WelcomeView.swift b/Sources/Fluid/UI/WelcomeView.swift
index b2cf8a36..da464fa8 100644
--- a/Sources/Fluid/UI/WelcomeView.swift
+++ b/Sources/Fluid/UI/WelcomeView.swift
@@ -16,6 +16,8 @@ struct WelcomeView: View {
}
@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
@@ -27,294 +29,194 @@ struct WelcomeView: View {
let startRecording: () -> Void
let openAccessibilitySettings: () -> Void
let restartApp: () -> Void
+ let openShortcutSettings: () -> Void
- private let playgroundSectionID = "welcome-playground-section"
+ var body: some View {
+ DashboardView(
+ asr: self.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 isAIEnhancementReady: Bool {
- DictationAIPostProcessingGate.isProviderConfigured()
+ private var practiceRecordingDisabled: Bool {
+ self.isStoppingPractice || self.asr.isStarting || self.contentState.isProcessing ||
+ (self.asr.micStatus == .authorized && !self.asr.isAsrReady && !self.asr.isRunning)
}
- private var appDisplayName: String {
- Bundle.main.fluidAppDisplayName
+ 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"
+ }
}
- var body: some View {
- ScrollViewReader { proxy in
- ScrollView {
- VStack(alignment: .leading, spacing: 16) {
- HStack(spacing: 10) {
- Image(systemName: "book.fill")
- .font(self.theme.typography.titleIcon)
- .foregroundStyle(self.theme.palette.accent)
+ 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((self.asr.isAsrReady || self.asr.modelsExistOnDisk) ? "Getting Started" : "Welcome to FluidVoice")
- .font(self.theme.typography.title)
- Text("Talk anywhere. FluidVoice types for you.")
- .font(self.theme.typography.bodySmall)
+ 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)
}
- .padding(.bottom, 4)
-
- // Quick Setup Checklist
- ThemedCard(style: .prominent) {
- VStack(alignment: .leading, spacing: 12) {
- HStack(spacing: 10) {
- Label("Quick Setup", systemImage: "checkmark.circle.fill")
- .font(self.theme.typography.sectionTitle)
- .foregroundStyle(self.theme.palette.accent)
- Spacer()
-
- Button {
- self.settings.resetOnboardingProgress()
- self.playgroundUsed = false
- } label: {
- Label("Run Onboarding Again", systemImage: "arrow.counterclockwise")
- }
- .buttonStyle(.bordered)
- .controlSize(.small)
- }
-
- VStack(alignment: .leading, spacing: 8) {
- SetupStepView(
- step: 1,
- // Consider model step complete if ready OR downloaded (even if not loaded)
- title: (self.asr.isAsrReady || self.asr.modelsExistOnDisk) ? "Voice Model Ready" : "Download Voice Model",
- description: self.asr.isAsrReady
- ? "Speech recognition model is loaded and ready"
- : (
- self.asr.modelsExistOnDisk
- ? "Model downloaded, will load when needed"
- : "Download the AI model for offline voice transcription (~500MB)"
- ),
- status: (self.asr.isAsrReady || self.asr.modelsExistOnDisk) ? .completed : .pending,
- action: {
- self.selectedSidebarItem = .voiceEngine
- },
- actionButtonTitle: "Go to Voice Engine",
- showActionButton: !(self.asr.isAsrReady || self.asr.modelsExistOnDisk)
- )
-
- SetupStepView(
- step: 2,
- title: self.asr.micStatus == .authorized ? "Microphone Permission Granted" : "Grant Microphone Permission",
- description: self.asr.micStatus == .authorized
- ? "FluidVoice has access to your microphone"
- : "Allow FluidVoice to access your microphone for voice input",
- status: self.asr.micStatus == .authorized ? .completed : .pending,
- action: {
- if self.asr.micStatus == .notDetermined {
- self.asr.requestMicAccess()
- } else if self.asr.micStatus == .denied {
- self.asr.openSystemSettingsForMic()
- }
- },
- actionButtonTitle: self.asr.micStatus == .notDetermined ? "Grant Access" : "Open Settings",
- showActionButton: self.asr.micStatus != .authorized
- )
-
- SetupStepView(
- step: 3,
- title: self.accessibilityEnabled ? "Accessibility Access Enabled" : "Enable Accessibility Access",
- description: self.accessibilityEnabled
- ? "Accessibility permission granted for typing into apps"
- : "Drag \(self.appDisplayName) into the Accessibility apps list as shown",
- status: self.accessibilityEnabled ? .completed : .pending,
- action: {
- self.openAccessibilitySettings()
- },
- actionButtonTitle: "Open Settings",
- showActionButton: !self.accessibilityEnabled
- )
+ Spacer()
- SetupStepView(
- step: 4,
- title: self.isAIEnhancementReady ? "AI Enhancement Configured" : "Set Up AI Enhancement (Optional)",
- description: self.isAIEnhancementReady
- ? "AI-powered text enhancement is ready to use"
- : "Configure API keys for AI-powered text enhancement",
- status: self.isAIEnhancementReady ? .completed : .pending,
- action: {
- self.selectedSidebarItem = .aiEnhancements
- },
- actionButtonTitle: "AI Providers"
- )
+ 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)
+ }
+ }
- SetupStepView(
- step: 5,
- title: self.playgroundUsed ? "Setup Tested Successfully" : "Test Your Setup",
- description: self.playgroundUsed
- ? "You've successfully tested voice transcription"
- : "Try the playground below to test your complete setup",
- status: self.playgroundUsed ? .completed : .pending,
- action: {
- withAnimation(.easeInOut(duration: 0.25)) {
- proxy.scrollTo(self.playgroundSectionID, anchor: .top)
- }
- self.isTranscriptionFocused.wrappedValue = true
- },
- actionButtonTitle: "Go to Playground",
- showActionButton: !self.playgroundUsed
- )
- .id("playground-step-\(self.playgroundUsed)")
+ 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)
}
- .padding(14)
+ .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()
}
- // Test Playground
- 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: {
+ // 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)
- }
-
- 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")
+ .foregroundStyle(.secondary.opacity(0.5))
+ Text("Press record or your hotkey to begin")
.font(self.theme.typography.caption)
.foregroundStyle(.secondary)
}
}
+ .allowsHitTesting(false)
+ )
- VStack(alignment: .leading, spacing: 14) {
- // Recording Control — centered button
- HStack {
- Spacer()
- Button {
- if self.asr.isRunning {
- Task {
- await self.stopAndProcessTranscription()
- }
- } else {
- self.startRecording()
- self.playgroundUsed = true
- SettingsStore.shared.playgroundUsed = true
- }
- } label: {
- HStack(spacing: 8) {
- Image(systemName: self.asr.isRunning ? "stop.fill" : "mic.fill")
- Text(self.asr.isRunning ? "Stop Recording" : "Start Recording")
- }
- .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.asr.isAsrReady && !self.asr.isRunning)
- Spacer()
+ 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)
- // 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()
- }
- }
+ Button("Clear & Test Again") {
+ self.asr.finalText = ""
}
+ .buttonStyle(.bordered)
+ .controlSize(.small)
+
+ Spacer()
}
}
- .padding(16)
}
- .id(self.playgroundSectionID)
}
- .padding(16)
- }
- }
- .onAppear {
- Task { @MainActor in
- await AudioStartupGate.shared.scheduleOpenAfterInitialUISettled()
- await AudioStartupGate.shared.waitUntilOpen()
- self.asr.micStatus = AVCaptureDevice.authorizationStatus(for: .audio)
- await self.asr.checkIfModelsExistAsync()
}
+ .padding(16)
}
}
}
diff --git a/Tests/DashboardPracticePolicyTests.swift b/Tests/DashboardPracticePolicyTests.swift
new file mode 100644
index 00000000..cbba66a5
--- /dev/null
+++ b/Tests/DashboardPracticePolicyTests.swift
@@ -0,0 +1,12 @@
+@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")
+ }
+}