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
Add today stats header card and toolbar pill
altic-dev9906434aa732
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swiftindex 145cded1..d8bd62eb 100644--- a/Sources/Fluid/ContentView.swift+++ b/Sources/Fluid/ContentView.swift@@ -290,6 +290,8 @@ struct ContentView: View {.toolbar {if !self.settings.shouldShowOnboarding {ToolbarItemGroup(placement: .primaryAction) {+ self.todayStatsButton+self.themePreferenceButtonButton(action: self.openIssueReportingPage) {@@ -1064,6 +1066,12 @@ struct ContentView: View {}}+ private var todayStatsButton: some View {+ TodayStatsToolbarButton(typingWPM: self.settings.userTypingWPM) {+ self.selectedSidebarItem = .stats+ }+ }+private var detailView: some View {ZStack {Color(nsColor: .windowBackgroundColor)@@ -3930,6 +3938,36 @@ private extension ContentView {}}+private struct TodayStatsToolbarButton: View {+ @ObservedObject private var historyStore = TranscriptionHistoryStore.shared++ let typingWPM: Int+ let action: () -> Void++ var body: some View {+ let summary = self.historyStore.todaySummary+ let timeSaved = summary.formattedTimeSaved(typingWPM: self.typingWPM)+ let hasActivity = summary.words > 0++ return Button(action: self.action) {+ HStack(spacing: 4) {+ Image(systemName: hasActivity ? "waveform" : "chart.bar.fill")+ if hasActivity {+ Text("\(summary.words) words")+ Text("·")+ .foregroundStyle(.secondary)+ Text(timeSaved)+ } else {+ Text("Today")+ }+ }+ .font(.system(size: 12, weight: .medium))+ }+ .help(hasActivity ? "Today: \(summary.words) words · \(timeSaved) saved - view stats" : "View your stats")+ .accessibilityLabel("Today stats")+ }+}+// MARK: - Card Animation Modifierstruct CardAppearAnimation: ViewModifier {diff --git a/Sources/Fluid/Persistence/SettingsStore.swift b/Sources/Fluid/Persistence/SettingsStore.swiftindex 23de153e..1df28e85 100644--- a/Sources/Fluid/Persistence/SettingsStore.swift+++ b/Sources/Fluid/Persistence/SettingsStore.swift@@ -1384,26 +1384,14 @@ final class SettingsStore: ObservableObject {}}+ /// No-op: never override the user's provider selection on launch.+ ///+ /// The per-prompt shortcut system means the global default provider is no longer the+ /// authoritative routing source — each shortcut can bind to its own provider/model, or be off.+ /// The only time we set a provider is during onboarding (Fluid Intelligence flow); after that+ /// the selection is sticky across restarts and updates. Default is off (empty).func normalizeProviderSelectionForCurrentVerificationState() {- let currentProviderID = self.selectedProviderID- if self.isVerifiedProviderForCurrentConfiguration(currentProviderID) {- self.syncLinkedProviderSelections(to: currentProviderID)- return- }-- let verifiedProviderIDs = self.verifiedProviderIDsForCurrentConfiguration()- guard verifiedProviderIDs.count == 1,- let providerID = verifiedProviderIDs.first- else {- if currentProviderID.isEmpty {- self.selectedProviderID = ""- self.syncLinkedProviderSelections(to: "")- }- return- }-- self.selectedProviderID = providerID- self.syncLinkedProviderSelections(to: providerID)+ // Intentionally empty. Selection is sticky.}var privateAIPrefixKVCacheEnabled: Bool {diff --git a/Sources/Fluid/Persistence/TranscriptionHistoryStore.swift b/Sources/Fluid/Persistence/TranscriptionHistoryStore.swiftindex 21cedb5e..91d89c4a 100644--- a/Sources/Fluid/Persistence/TranscriptionHistoryStore.swift+++ b/Sources/Fluid/Persistence/TranscriptionHistoryStore.swift@@ -369,6 +369,38 @@ final class TranscriptionHistoryStore: ObservableObject {// MARK: - Stats Computation Extensionextension TranscriptionHistoryStore {+ struct TodaySummary {+ let words: Int+ let transcriptions: Int++ func timeSavedMinutes(typingWPM: Int = 40, speakingWPM: Int = 150) -> Double {+ guard typingWPM > 0 && speakingWPM > 0 else { return 0 }++ let words = Double(self.words)+ let typingTime = words / Double(typingWPM)+ let speakingTime = words / Double(speakingWPM)++ return max(0, typingTime - speakingTime)+ }++ func formattedTimeSaved(typingWPM: Int = 40) -> String {+ let minutes = self.timeSavedMinutes(typingWPM: typingWPM)++ if minutes < 1 {+ return "< 1m"+ } else if minutes < 60 {+ return "\(Int(minutes))m"+ } else {+ let hours = Int(minutes) / 60+ let mins = Int(minutes) % 60+ if mins == 0 {+ return "\(hours)h"+ }+ return "\(hours)h \(mins)m"+ }+ }+ }+// MARK: - Word Counting/// Count words in a string (handles multiple spaces, newlines)@@ -386,13 +418,26 @@ extension TranscriptionHistoryStore {self.entries.reduce(0) { $0 + self.wordCount(in: $1.processedText) }}- /// Words transcribed today- var wordsToday: Int {+ /// Summary for today's activity, calculated in one pass.+ var todaySummary: TodaySummary {let calendar = Calendar.currentlet today = calendar.startOfDay(for: Date())- return self.entries- .filter { calendar.isDate($0.timestamp, inSameDayAs: today) }- .reduce(0) { $0 + self.wordCount(in: $1.processedText) }+ let totals = self.entries.reduce(into: (words: 0, transcriptions: 0)) { result, entry in+ guard calendar.isDate(entry.timestamp, inSameDayAs: today) else { return }+ result.words += self.wordCount(in: entry.processedText)+ result.transcriptions += 1+ }+ return TodaySummary(words: totals.words, transcriptions: totals.transcriptions)+ }++ /// Words transcribed today+ var wordsToday: Int {+ self.todaySummary.words+ }++ /// Number of transcriptions recorded today+ var transcriptionsToday: Int {+ self.todaySummary.transcriptions}/// Average words per transcription@@ -435,6 +480,21 @@ extension TranscriptionHistoryStore {}}+ // MARK: - Today Time Saved++ /// Calculate time saved today in minutes+ /// - Parameters:+ /// - typingWPM: User's typing speed (default 40)+ /// - speakingWPM: Average speaking speed (default 150)+ func timeSavedTodayMinutes(typingWPM: Int = 40, speakingWPM: Int = 150) -> Double {+ self.todaySummary.timeSavedMinutes(typingWPM: typingWPM, speakingWPM: speakingWPM)+ }++ /// Formatted time saved today string (e.g., "2h 45m" or "45m")+ func formattedTimeSavedToday(typingWPM: Int = 40) -> String {+ self.todaySummary.formattedTimeSaved(typingWPM: typingWPM)+ }+// MARK: - Streak Calculation/// Get unique days with activity (sorted newest first)diff --git a/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swift b/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swiftindex 86bb1668..7f402991 100644--- a/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swift+++ b/Sources/Fluid/UI/AISettings/AIEnhancementSettingsViewModel.swift@@ -1447,19 +1447,12 @@ final class AIEnhancementSettingsViewModel: ObservableObject {self.connectionStatus = statuses[self.selectedProviderID] ?? .unknown}+ /// No-op: never auto-select a provider. The user's selection is sticky.+ /// The per-prompt shortcut system means each shortcut binds independently, so forcing a+ /// global default provider would silently override a user's deliberate "off" or alternate+ /// choice. Only onboarding sets the initial provider.private func selectSoleVerifiedProviderIfNeeded() {- guard self.connectionStatusByProvider[self.selectedProviderID] != .success else { return }- let currentProviderIDs = ModelRepository.builtInProviderIDs + self.savedProviders.map(\.id)- let verifiedProviderIDs = currentProviderIDs.filter { providerID in- self.connectionStatusByProvider[providerID] == .success- }- guard verifiedProviderIDs.count == 1,- let providerID = verifiedProviderIDs.first- else {- return- }-- self.selectProviderForUse(providerID)+ // Intentionally empty. Selection is sticky.}func openReasoningConfig() {@@ -1971,15 +1964,11 @@ final class AIEnhancementSettingsViewModel: ObservableObject {self.refreshPromptSelectionState()}+ /// No-op: never auto-force the dictation prompt selection. The user's choice is sticky.+ /// Each shortcut binds independently; forcing .privateAI when FI is selected would override+ /// a user's deliberate "off" or "default" choice.private func syncPromptSelectionForSelectedProvider() {- guard self.isPrivateAIPromptAvailable(),- self.settings.dictationPromptSelection(for: .primary) != .privateAI- else {- return- }-- self.settings.setDictationPromptSelection(.privateAI, for: .primary)- self.refreshPromptSelectionState()+ // Intentionally empty. Selection is sticky.}func selectPrimaryDictationPromptOff() {diff --git a/Sources/Fluid/UI/StatsView.swift b/Sources/Fluid/UI/StatsView.swiftindex ac525ed0..3519517a 100644--- a/Sources/Fluid/UI/StatsView.swift+++ b/Sources/Fluid/UI/StatsView.swift@@ -20,6 +20,11 @@ struct StatsView: View {var body: some View {ScrollView(.vertical, showsIndicators: false) {VStack(spacing: 16) {+ self.todayHeaderCard++ Divider()+ .opacity(0.4)+// Header row: Time Saved + Total WordsHStack(spacing: 16) {self.timeSavedCard@@ -51,6 +56,124 @@ struct StatsView: View {}}+ // MARK: - Today Header++ private var todayHeaderCard: some View {+ let summary = self.historyStore.todaySummary+ let wordsToday = summary.words+ let timeSavedToday = summary.formattedTimeSaved(typingWPM: self.settings.userTypingWPM)+ let sessionsToday = summary.transcriptions+ let streak = self.historyStore.currentStreak++ return ThemedCard(style: .prominent, padding: 20, hoverEffect: false) {+ VStack(alignment: .leading, spacing: 14) {+ // Greeting + streak badge+ HStack(alignment: .firstTextBaseline) {+ VStack(alignment: .leading, spacing: 4) {+ Text("Today")+ .font(.system(size: 28, weight: .bold, design: .rounded))+ .foregroundStyle(.primary)++ Text(self.motivationalMessage(+ wordsToday: wordsToday,+ streak: streak+ ))+ .font(.system(size: 13, weight: .medium))+ .foregroundStyle(.secondary)+ .fixedSize(horizontal: false, vertical: true)+ }++ Spacer()++ if streak > 0 {+ HStack(spacing: 4) {+ Image(systemName: "flame.fill")+ .font(.system(size: 11))+ Text("\(streak) day\(streak == 1 ? "" : "s")")+ .font(.system(size: 12, weight: .semibold, design: .rounded))+ }+ .foregroundStyle(self.theme.palette.warning)+ .padding(.horizontal, 10)+ .padding(.vertical, 5)+ .background(+ Capsule()+ .fill(self.theme.palette.warning.opacity(0.15))+ )+ }+ }++ // Today's metrics row+ HStack(spacing: 24) {+ self.todayMetric(+ icon: "text.word.spacing",+ value: self.formatNumber(wordsToday),+ label: "words"+ )++ Divider()+ .frame(height: 32)++ self.todayMetric(+ icon: "clock.fill",+ value: timeSavedToday,+ label: "saved"+ )++ Divider()+ .frame(height: 32)++ self.todayMetric(+ icon: "waveform",+ value: "\(sessionsToday)",+ label: "sessions"+ )+ }+ }+ .frame(maxWidth: .infinity, alignment: .leading)+ }+ }++ private func todayMetric(icon: String, value: String, label: String) -> some View {+ HStack(spacing: 10) {+ Image(systemName: icon)+ .font(.system(size: 14))+ .foregroundStyle(self.theme.palette.accent)+ .frame(width: 22)++ VStack(alignment: .leading, spacing: 1) {+ Text(value)+ .font(.system(size: 20, weight: .bold, design: .rounded))+ .foregroundStyle(.primary)+ .lineLimit(1)++ Text(label)+ .font(.system(size: 10, weight: .medium))+ .foregroundStyle(.secondary)+ }+ }+ }++ /// Motivational message that scales with today's activity level.+ private func motivationalMessage(wordsToday: Int, streak: Int) -> String {+ if wordsToday == 0 {+ return streak > 0 ? "Keep the streak alive — say a few words." : "Ready when you are. Start dictating to save time."+ }++ if wordsToday < 100 {+ return "Warming up. Every word counts."+ }++ if wordsToday < 500 {+ return "Solid pace — you're saving real time today."+ }++ if wordsToday < 1500 {+ return streak > 2 ? "On fire. The streak is paying off." : "Strong day. Your hands thank you."+ }++ return "Outstanding. You've reclaimed serious time today."+ }+// MARK: - Time Saved Cardprivate var timeSavedCard: some View {