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
measure accurate dau
grohith327889a83f605ac
diff --git a/Sources/Fluid/Analytics/AnalyticsDatabase.swift b/Sources/Fluid/Analytics/AnalyticsDatabase.swiftindex e9ba54a8..cb69c634 100644--- a/Sources/Fluid/Analytics/AnalyticsDatabase.swift+++ b/Sources/Fluid/Analytics/AnalyticsDatabase.swift@@ -371,6 +371,25 @@ final class AnalyticsDatabase {try self.purgeDeletedPages()}+ /// Removes detailed analytics while preserving the daily active-user signal and its dedupe key.+ func purgeDetailedAnalytics() throws {+ try self.transaction {+ try self.run(+ "DELETE FROM outbox WHERE event_name != ?",+ bindings: [.text(AnalyticsEvent.activeUser.rawValue)]+ )+ try self.execute("DELETE FROM daily_usage")+ try self.execute("DELETE FROM daily_model_usage")+ try self.run(+ "DELETE FROM event_dedupe WHERE dedupe_key NOT LIKE ?",+ bindings: [.text("activity:%")]+ )+ try self.execute("DELETE FROM onboarding_flows")+ try self.execute("DELETE FROM model_download_attempts")+ }+ try self.purgeDeletedPages()+ }+private func createSchema() throws {try self.execute("""CREATE TABLE IF NOT EXISTS outbox (diff --git a/Sources/Fluid/Analytics/AnalyticsService.swift b/Sources/Fluid/Analytics/AnalyticsService.swiftindex a4282af7..df063f77 100644--- a/Sources/Fluid/Analytics/AnalyticsService.swift+++ b/Sources/Fluid/Analytics/AnalyticsService.swift@@ -4,13 +4,13 @@ import Foundationfinal class AnalyticsService {static let shared = AnalyticsService()- private let consentGate: AnalyticsConsentGate+ private let detailedConsentGate: DetailedAnalyticsConsentGateprivate let core: AnalyticsCoreprivate init() {- let consentGate = AnalyticsConsentGate()- self.consentGate = consentGate- self.core = AnalyticsCore(consentGate: consentGate)+ let detailedConsentGate = DetailedAnalyticsConsentGate()+ self.detailedConsentGate = detailedConsentGate+ self.core = AnalyticsCore(detailedConsentGate: detailedConsentGate)}func bootstrap() {@@ -19,11 +19,14 @@ final class AnalyticsService {}}- func setEnabled(_ enabled: Bool) {- let consentGeneration = self.consentGate.advance()- let context = Self.context(enabled: enabled, consentGeneration: consentGeneration)+ func setDetailedAnalyticsEnabled(_ enabled: Bool) {+ let consentGeneration = self.detailedConsentGate.advance()+ let context = Self.context(+ detailedAnalyticsEnabled: enabled,+ detailedConsentGeneration: consentGeneration+ )Task.detached(priority: .background) { [core] in- await core.setEnabled(context: context)+ await core.setDetailedAnalyticsEnabled(context: context)}}@@ -127,19 +130,22 @@ final class AnalyticsService {_ operation: @escaping @Sendable (AnalyticsCore, AnalyticsContext) async -> Void) {let context = Self.context(- enabled: SettingsStore.shared.shareAnonymousAnalytics,- consentGeneration: self.consentGate.currentGeneration+ detailedAnalyticsEnabled: SettingsStore.shared.shareDetailedAnalytics,+ detailedConsentGeneration: self.detailedConsentGate.currentGeneration)Task.detached(priority: .background) { [core] inawait operation(core, context)}}- private static func context(enabled: Bool, consentGeneration: UInt64) -> AnalyticsContext {+ private static func context(+ detailedAnalyticsEnabled: Bool,+ detailedConsentGeneration: UInt64+ ) -> AnalyticsContext {let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "unknown"return AnalyticsContext(- enabled: enabled,- consentGeneration: consentGeneration,+ detailedAnalyticsEnabled: detailedAnalyticsEnabled,+ detailedConsentGeneration: detailedConsentGeneration,config: AnalyticsConfig.fromBundle(),distinctID: AnalyticsIdentityStore.shared.anonymousInstallID,appVersion: version@@ -148,14 +154,14 @@ final class AnalyticsService {}private struct AnalyticsContext {- let enabled: Bool- let consentGeneration: UInt64+ let detailedAnalyticsEnabled: Bool+ let detailedConsentGeneration: UInt64let config: AnalyticsConfiglet distinctID: Stringlet appVersion: String}-final nonisolated class AnalyticsConsentGate: @unchecked Sendable {+final nonisolated class DetailedAnalyticsConsentGate: @unchecked Sendable {private let lock = NSLock()private var generation: UInt64 = 0@@ -177,7 +183,7 @@ final nonisolated class AnalyticsConsentGate: @unchecked Sendable {private actor AnalyticsCore {private var context: AnalyticsContext?- private let consentGate: AnalyticsConsentGate+ private let detailedConsentGate: DetailedAnalyticsConsentGateprivate var database: AnalyticsDatabase?private var flushTask: Task<Void, Never>?private var activeUploadTask: Task<Int, Error>?@@ -185,21 +191,22 @@ private actor AnalyticsCore {private let batchSize = 50- init(consentGate: AnalyticsConsentGate) {- self.consentGate = consentGate+ init(detailedConsentGate: DetailedAnalyticsConsentGate) {+ self.detailedConsentGate = detailedConsentGate}func bootstrap(context: AnalyticsContext) async {guard self.apply(context) else { return }- guard context.enabled else {- try? self.purgeStoredAnalyticsIfPresent(context: context)- return- }- guard context.config.isConfigured else { return }do {+ if !context.detailedAnalyticsEnabled {+ try self.purgeStoredDetailedAnalyticsIfPresent(context: context)+ }+ guard context.config.isConfigured else { return }let database = try self.database(for: context)- try database.finalizeDays(before: Date())- try database.recoverInterruptedModelDownloads(at: Date())+ if context.detailedAnalyticsEnabled {+ try database.finalizeDays(before: Date())+ try database.recoverInterruptedModelDownloads(at: Date())+ }self.startFlushLoopIfNeeded()await self.flushIfNeeded()} catch {@@ -207,19 +214,15 @@ private actor AnalyticsCore {}}- func setEnabled(context: AnalyticsContext) async {+ func setDetailedAnalyticsEnabled(context: AnalyticsContext) async {guard self.apply(context) else { return }- if !context.enabled {- self.activeUploadTask?.cancel()- self.stopFlushLoop()- try? self.purgeStoredAnalyticsIfPresent(context: context)- return- }+ self.activeUploadTask?.cancel()+ self.stopFlushLoop()await self.bootstrap(context: context)}func recordActivity(_ kind: AnalyticsActivityKind, context: AnalyticsContext) async {- await self.write(context: context) { database, date in+ await self.writeActivity(context: context) { database, date intry database.recordActivity(kind, at: date)}}@@ -230,7 +233,7 @@ private actor AnalyticsCore {aiModel: AnalyticsModelDescriptor?,context: AnalyticsContext) async {- await self.write(context: context) { database, date in+ await self.writeDetailed(context: context, fallbackActivity: .coreAction) { database, date intry database.recordUsage(mode: mode,transcriptionModel: transcriptionModel,@@ -246,13 +249,13 @@ private actor AnalyticsCore {descriptor: AnalyticsModelDescriptor,context: AnalyticsContext) async {- await self.write(context: context) { database, date in+ await self.writeDetailed(context: context, fallbackActivity: .coreAction) { database, date intry database.recordModelUsage(role: role, mode: mode, descriptor: descriptor, at: date)}}func recordOnboardingStarted(origin: AnalyticsOnboardingOrigin, context: AnalyticsContext) async {- await self.write(context: context) { database, date in+ await self.writeDetailed(context: context, fallbackActivity: .app) { database, date intry database.recordOnboardingStarted(origin: origin, at: date)}}@@ -262,7 +265,7 @@ private actor AnalyticsCore {origin: AnalyticsOnboardingOrigin,context: AnalyticsContext) async {- await self.write(context: context) { database, date in+ await self.writeDetailed(context: context) { database, date intry database.recordOnboardingStepViewed(step, origin: origin, at: date)}}@@ -274,7 +277,7 @@ private actor AnalyticsCore {completesFlow: Bool,context: AnalyticsContext) async {- await self.write(context: context) { database, date in+ await self.writeDetailed(context: context) { database, date intry database.recordOnboardingStepCompleted(step,outcome: outcome,@@ -291,7 +294,7 @@ private actor AnalyticsCore {source: AnalyticsModelDownloadSource,context: AnalyticsContext) async {- await self.write(context: context) { database, date in+ await self.writeDetailed(context: context, fallbackActivity: .coreAction) { database, date intry database.recordModelDownloadStarted(id: id, descriptor: descriptor, source: source, at: date)}}@@ -304,7 +307,7 @@ private actor AnalyticsCore {duration: TimeInterval?,context: AnalyticsContext) async {- await self.write(context: context) { database, date in+ await self.writeDetailed(context: context) { database, date intry database.recordModelDownloadFinished(id: id,descriptor: descriptor,@@ -316,12 +319,11 @@ private actor AnalyticsCore {}}- private func write(+ private func writeActivity(context: AnalyticsContext,operation: (AnalyticsDatabase, Date) throws -> Void) async {- guard self.apply(context) else { return }- guard context.enabled, context.config.isConfigured else { return }+ guard context.config.isConfigured else { return }do {let database = try self.database(for: context)try operation(database, Date())@@ -331,8 +333,30 @@ private actor AnalyticsCore {}}+ private func writeDetailed(+ context: AnalyticsContext,+ fallbackActivity: AnalyticsActivityKind? = nil,+ operation: (AnalyticsDatabase, Date) throws -> Void+ ) async {+ let mayRecordDetails = self.apply(context) && context.detailedAnalyticsEnabled+ guard context.config.isConfigured else { return }+ guard mayRecordDetails || fallbackActivity != nil else { return }+ do {+ let database = try self.database(for: context)+ let date = Date()+ if mayRecordDetails {+ try operation(database, date)+ } else if let fallbackActivity {+ try database.recordActivity(fallbackActivity, at: date)+ }+ self.startFlushLoopIfNeeded()+ } catch {+ return+ }+ }+private func apply(_ context: AnalyticsContext) -> Bool {- guard self.consentGate.accepts(context.consentGeneration) else { return false }+ guard self.detailedConsentGate.accepts(context.detailedConsentGeneration) else { return false }self.context = contextreturn true}@@ -363,9 +387,9 @@ private actor AnalyticsCore {.appendingPathComponent("analytics-v2.sqlite3")}- private func purgeStoredAnalyticsIfPresent(context: AnalyticsContext) throws {+ private func purgeStoredDetailedAnalyticsIfPresent(context: AnalyticsContext) throws {if let database {- try database.purgeAll()+ try database.purgeDetailedAnalytics()return}let url = try self.databaseURL()@@ -375,14 +399,13 @@ private actor AnalyticsCore {distinctID: context.distinctID,appVersion: context.appVersion)- try existingDatabase.purgeAll()+ try existingDatabase.purgeDetailedAnalytics()}private func startFlushLoopIfNeeded() {guard self.flushTask == nil,let context,- self.consentGate.accepts(context.consentGeneration),- context.enabled,+ self.detailedConsentGate.accepts(context.detailedConsentGeneration),context.config.isConfiguredelse { return }self.flushTask = Task { [weak self] in@@ -402,8 +425,7 @@ private actor AnalyticsCore {private func flushIfNeeded() async {guard !self.isFlushing,let context,- self.consentGate.accepts(context.consentGeneration),- context.enabled,+ self.detailedConsentGate.accepts(context.detailedConsentGeneration),context.config.isConfigured,let databaseelse { return }@@ -416,17 +438,19 @@ private actor AnalyticsCore {let items: [AnalyticsOutboxItem]do {- try database.finalizeDays(before: Date())+ if context.detailedAnalyticsEnabled {+ try database.finalizeDays(before: Date())+ }items = try database.readyOutbox(limit: self.batchSize, at: Date())} catch {return}guard !items.isEmpty else { return }- guard self.consentGate.accepts(context.consentGeneration) else { return }+ guard self.detailedConsentGate.accepts(context.detailedConsentGeneration) else { return }let ids = items.map(\.id)let uploadTask = Task {- guard self.consentGate.accepts(context.consentGeneration) else {+ guard self.detailedConsentGate.accepts(context.detailedConsentGeneration) else {throw CancellationError()}return try await self.send(items: items, config: context.config)@@ -437,11 +461,11 @@ private actor AnalyticsCore {do {status = try await uploadTask.value} catch {- guard self.consentGate.accepts(context.consentGeneration) else { return }+ guard self.detailedConsentGate.accepts(context.detailedConsentGeneration) else { return }try? database.retry(ids: ids, at: Date())return}- guard self.consentGate.accepts(context.consentGeneration) else { return }+ guard self.detailedConsentGate.accepts(context.detailedConsentGeneration) else { return }switch status {case 200..<300:diff --git a/Sources/Fluid/Persistence/SettingsStore.swift b/Sources/Fluid/Persistence/SettingsStore.swiftindex 91bff4e5..d97159b2 100644--- a/Sources/Fluid/Persistence/SettingsStore.swift+++ b/Sources/Fluid/Persistence/SettingsStore.swift@@ -1401,9 +1401,9 @@ final class SettingsStore: ObservableObject {}}- /// Anonymous analytics toggle (default: ON). Uses default-true semantics so existing installs- /// upgrading to a version that includes analytics do not silently default to OFF.- var shareAnonymousAnalytics: Bool {+ /// Detailed anonymous analytics toggle (default: ON). The daily activity signal is always enabled.+ /// Uses default-true semantics so existing installs upgrading to analytics do not default to OFF.+ var shareDetailedAnalytics: Bool {get {let value = self.defaults.object(forKey: Keys.shareAnonymousAnalytics)if value == nil { return true }@@ -3203,7 +3203,7 @@ final class SettingsStore: ObservableObject {autoUpdateCheckEnabled: self.autoUpdateCheckEnabled,betaReleasesEnabled: self.betaReleasesEnabled,enableDebugLogs: self.enableDebugLogs,- shareAnonymousAnalytics: self.shareAnonymousAnalytics,+ shareAnonymousAnalytics: self.shareDetailedAnalytics,pressAndHoldMode: self.pressAndHoldMode,hotkeyMode: self.hotkeyMode,enableStreamingPreview: self.enableStreamingPreview,@@ -3327,7 +3327,7 @@ final class SettingsStore: ObservableObject {self.autoUpdateCheckEnabled = payload.autoUpdateCheckEnabledself.betaReleasesEnabled = payload.betaReleasesEnabledself.enableDebugLogs = payload.enableDebugLogs- self.shareAnonymousAnalytics = payload.shareAnonymousAnalytics+ self.shareDetailedAnalytics = payload.shareAnonymousAnalyticsself.hotkeyMode = payload.hotkeyMode ?? (payload.pressAndHoldMode ? .hold : .toggle)self.enableStreamingPreview = payload.enableStreamingPreviewif let skipSilentRecordingsEnabled = payload.skipSilentRecordingsEnabled {diff --git a/Sources/Fluid/UI/AnalyticsPrivacyView.swift b/Sources/Fluid/UI/AnalyticsPrivacyView.swiftindex 08dad9dc..8a99f893 100644--- a/Sources/Fluid/UI/AnalyticsPrivacyView.swift+++ b/Sources/Fluid/UI/AnalyticsPrivacyView.swift@@ -10,7 +10,7 @@ struct AnalyticsPrivacyView: View {VStack(alignment: .leading, spacing: 2) {Text("Anonymous Analytics").font(.system(size: 18, weight: .semibold))- Text("What FluidVoice collects when analytics is enabled")+ Text("Daily activity and optional detailed analytics").font(.system(size: 12)).foregroundStyle(.secondary)}@@ -29,9 +29,11 @@ struct AnalyticsPrivacyView: View {ScrollView {VStack(alignment: .leading, spacing: 14) {- self.sectionTitle("We collect")+ self.sectionTitle("Always collected")self.bullet("A random installation ID, app version, and the operating-system label macOS.")self.bullet("One daily active-use signal after you interact with the app.")++ self.sectionTitle("When detailed analytics is enabled")self.bullet("Daily totals for Dictation, Command Mode, Edit Mode, and meeting transcription.")self.bullet("Onboarding steps viewed and completed, including skips.")self.bullet("Transcription and AI provider/model identifiers, counted as daily totals.")@@ -45,11 +47,12 @@ struct AnalyticsPrivacyView: View {self.bullet("Hardware identifiers, CPU/chip details, performance timings, or individual transcription events.")self.sectionTitle("How it’s used")- self.bullet("To understand feature adoption, onboarding completion, model usage, active installations, and retention without requiring accounts.")+ self.bullet("Daily activity measures active installations and retention without requiring accounts.")+ self.bullet("Optional detailed analytics helps us understand feature adoption, onboarding completion, and model usage.")self.sectionTitle("Control")- self.bullet("You can disable analytics anytime in Settings → Share Anonymous Analytics.")- self.bullet("Disabling analytics securely removes all queued and aggregated analytics stored on this Mac.")+ self.bullet("You can disable detailed analytics anytime in Settings → Share Detailed Anonymous Analytics.")+ self.bullet("Disabling detailed analytics securely removes its queued and aggregated data from this Mac. The daily activity signal remains enabled.")}.padding(.vertical, 6)}diff --git a/Sources/Fluid/UI/SettingsView.swift b/Sources/Fluid/UI/SettingsView.swiftindex f5d9380d..c332b7e1 100644--- a/Sources/Fluid/UI/SettingsView.swift+++ b/Sources/Fluid/UI/SettingsView.swift@@ -57,11 +57,11 @@ struct SettingsView: View {@State private var cachedDefaultInputUID: String = ""@State private var cachedDefaultOutputName: String = ""- // Analytics consent UI state (default ON; user can opt-out)- @State private var shareAnonymousAnalytics: Bool = SettingsStore.shared.shareAnonymousAnalytics+ // Detailed analytics consent UI state (default ON; daily activity remains enabled)+ @State private var shareDetailedAnalytics: Bool = SettingsStore.shared.shareDetailedAnalytics@State private var showAnalyticsPrivacy: Bool = false- @State private var pendingAnalyticsValue: Bool? = nil- @State private var showAreYouSureToStopAnalytics: Bool = false+ @State private var pendingDetailedAnalyticsValue: Bool? = nil+ @State private var showDetailedAnalyticsConfirmation: Bool = false@State private var rollbackVersion: String = ""@State private var isRollingBack: Bool = false@State private var audioHistoryBudgetText: String = Self.audioBudgetText(for: SettingsStore.shared.audioHistoryBudgetGB)@@ -99,40 +99,40 @@ struct SettingsView: View {self.activeShortcutRecordingTarget == target}- private var analyticsToggleBinding: Binding<Bool> {+ private var detailedAnalyticsToggleBinding: Binding<Bool> {Binding(get: {- self.pendingAnalyticsValue ?? self.shareAnonymousAnalytics+ self.pendingDetailedAnalyticsValue ?? self.shareDetailedAnalytics},set: { newValue in// User is trying to turn OFF → ask first- if self.shareAnonymousAnalytics == true, newValue == false {- self.pendingAnalyticsValue = false- self.showAreYouSureToStopAnalytics = true+ if self.shareDetailedAnalytics, !newValue {+ self.pendingDetailedAnalyticsValue = false+ self.showDetailedAnalyticsConfirmation = truereturn}// Normal ON path- self.shareAnonymousAnalytics = newValue+ self.shareDetailedAnalytics = newValueself.applyAnalyticsConsentChange(newValue)})}- private var analyticsConfirmationBinding: Binding<Bool> {+ private var detailedAnalyticsConfirmationBinding: Binding<Bool> {Binding(- get: { self.showAreYouSureToStopAnalytics },+ get: { self.showDetailedAnalyticsConfirmation },set: { newValue in// Only open modal if we have a pending valueif newValue {- if self.pendingAnalyticsValue != nil {- self.showAreYouSureToStopAnalytics = true+ if self.pendingDetailedAnalyticsValue != nil {+ self.showDetailedAnalyticsConfirmation = true}} else {// Closing the modal: reset pending state- self.showAreYouSureToStopAnalytics = false- self.pendingAnalyticsValue = nil+ self.showDetailedAnalyticsConfirmation = false+ self.pendingDetailedAnalyticsValue = nil}})@@ -939,9 +939,11 @@ struct SettingsView: View {Divider().opacity(0.2)self.optionToggleRow(- title: "Share Anonymous Analytics",- description: "Send lean, anonymous daily usage, onboarding, retention, and model metrics. Never includes transcription text or prompts.",- isOn: self.analyticsToggleBinding+ title: "Share Detailed Anonymous Analytics",+ description: "Share anonymous daily feature, onboarding, and model metrics. " ++ "When off, FluidVoice still sends one anonymous daily activity signal to measure active use. " ++ "Never includes transcription text or prompts.",+ isOn: self.detailedAnalyticsToggleBinding)HStack {@@ -1488,19 +1490,19 @@ struct SettingsView: View {.frame(minWidth: 520, minHeight: 520).appTheme(self.theme)}- .sheet(isPresented: self.analyticsConfirmationBinding) {+ .sheet(isPresented: self.detailedAnalyticsConfirmationBinding) {AnalyticsConfirmationView(onConfirm: {- if let pending = pendingAnalyticsValue {- self.shareAnonymousAnalytics = pending+ if let pending = pendingDetailedAnalyticsValue {+ self.shareDetailedAnalytics = pendingself.applyAnalyticsConsentChange(pending)}- self.pendingAnalyticsValue = nil- self.showAreYouSureToStopAnalytics = false+ self.pendingDetailedAnalyticsValue = nil+ self.showDetailedAnalyticsConfirmation = false},onCancel: {- self.pendingAnalyticsValue = nil- self.showAreYouSureToStopAnalytics = false+ self.pendingDetailedAnalyticsValue = nil+ self.showDetailedAnalyticsConfirmation = false})}@@ -1648,9 +1650,9 @@ struct SettingsView: View {}private func syncLocalSettingsAfterBackupRestore() {- self.shareAnonymousAnalytics = SettingsStore.shared.shareAnonymousAnalytics- self.pendingAnalyticsValue = nil- self.showAreYouSureToStopAnalytics = false+ self.shareDetailedAnalytics = SettingsStore.shared.shareDetailedAnalytics+ self.pendingDetailedAnalyticsValue = nil+ self.showDetailedAnalyticsConfirmation = falseself.refreshAudioHistoryUsage()}@@ -1802,8 +1804,8 @@ struct SettingsView: View {}private func applyAnalyticsConsentChange(_ enabled: Bool) {- SettingsStore.shared.shareAnonymousAnalytics = enabled- AnalyticsService.shared.setEnabled(enabled)+ SettingsStore.shared.shareDetailedAnalytics = enabled+ AnalyticsService.shared.setDetailedAnalyticsEnabled(enabled)}// MARK: - Helper Views@@ -2873,21 +2875,25 @@ struct AnalyticsConfirmationView: View {var body: some View {VStack(alignment: .leading, spacing: 16) {- Text("Are you sure you want to stop sharing anonymous analytics?")+ Text("Stop sharing detailed anonymous analytics?").font(.headline)- Text("By sharing anonymous usage data, you help us build the features you care about most. We never collect personal information (Audio, Transcription text etc), ever. Your support simply helps us make FluidVoice better for you.")- .font(self.theme.typography.bodySmall)- .foregroundStyle(.secondary)- .padding(12)- .background(- RoundedRectangle(cornerRadius: 8)- .fill(self.theme.palette.cardBackground)- )- .overlay(- RoundedRectangle(cornerRadius: 8)- .stroke(self.theme.palette.cardBorder.opacity(0.6), lineWidth: 1)- )+ Text(+ "FluidVoice will stop sharing feature, onboarding, and model metrics. " ++ "One anonymous daily activity signal will continue so we can measure active use. " ++ "We never collect audio, transcription text, prompts, or other personal information."+ )+ .font(self.theme.typography.bodySmall)+ .foregroundStyle(.secondary)+ .padding(12)+ .background(+ RoundedRectangle(cornerRadius: 8)+ .fill(self.theme.palette.cardBackground)+ )+ .overlay(+ RoundedRectangle(cornerRadius: 8)+ .stroke(self.theme.palette.cardBorder.opacity(0.6), lineWidth: 1)+ )Text(self.contactInfoText).font(self.theme.typography.bodySmall)@@ -2903,7 +2909,7 @@ struct AnalyticsConfirmationView: View {self.onCancel()}- Button("Yes") {+ Button("Stop Detailed Analytics") {self.onConfirm()}.buttonStyle(.borderedProminent)diff --git a/Tests/FluidDictationIntegrationTests/AnalyticsDatabaseTests.swift b/Tests/FluidDictationIntegrationTests/AnalyticsDatabaseTests.swiftindex 2ad73ef3..74375f50 100644--- a/Tests/FluidDictationIntegrationTests/AnalyticsDatabaseTests.swift+++ b/Tests/FluidDictationIntegrationTests/AnalyticsDatabaseTests.swift@@ -109,8 +109,8 @@ final class AnalyticsDatabaseTests: XCTestCase {XCTAssertEqual(finish.properties["duration_seconds"] as? Double, 25)}- func testConsentGateRejectsWorkQueuedBeforeOptOut() {- let gate = AnalyticsConsentGate()+ func testDetailedConsentGateRejectsWorkQueuedBeforeOptOut() {+ let gate = DetailedAnalyticsConsentGate()let queuedGeneration = gate.currentGenerationlet currentGeneration = gate.advance()@@ -118,6 +118,37 @@ final class AnalyticsDatabaseTests: XCTestCase {XCTAssertTrue(gate.accepts(currentGeneration))}+ func testPurgingDetailedAnalyticsPreservesOnlyDailyActivity() throws {+ let database = try self.makeDatabase()+ let firstDay = Date(timeIntervalSince1970: 1_735_689_600) // 2025-01-01 UTC+ let secondDay = firstDay.addingTimeInterval(24 * 60 * 60)+ let descriptor = AnalyticsModelDescriptor(provider: "Fluid Audio", model: "Parakeet TDT")+ let downloadID = UUID().uuidString.lowercased()++ try database.recordActivity(.app, at: firstDay)+ try database.recordUsage(mode: .dictation, transcriptionModel: descriptor, aiModel: nil, at: firstDay)+ try database.recordOnboardingStarted(origin: .firstRun, at: firstDay)+ try database.recordOnboardingStepViewed(.welcome, origin: .firstRun, at: firstDay)+ try database.recordModelDownloadStarted(+ id: downloadID,+ descriptor: descriptor,+ source: .onboarding,+ at: firstDay+ )+ try database.finalizeDays(before: secondDay)++ try database.purgeDetailedAnalytics()++ var events = try self.events(in: database)+ XCTAssertEqual(events.map(\.name), [AnalyticsEvent.activeUser.rawValue])++ try database.recordActivity(.coreAction, at: firstDay.addingTimeInterval(60))+ try database.finalizeDays(before: secondDay.addingTimeInterval(24 * 60 * 60))++ events = try self.events(in: database)+ XCTAssertEqual(events.map(\.name), [AnalyticsEvent.activeUser.rawValue])+ }+private func makeDatabase(url: URL? = nil) throws -> AnalyticsDatabase {var calendar = Calendar(identifier: .gregorian)calendar.timeZone = try XCTUnwrap(TimeZone(secondsFromGMT: 0))