Live Activities, nudging, unit tests

This commit is contained in:
2026-04-20 11:11:24 +02:00
parent 3858500a45
commit 7e25a4f978
15 changed files with 348 additions and 20 deletions
@@ -10,10 +10,12 @@ import UIKit
struct RootView: View {
@Environment(MAService.self) private var service
@Environment(MAStoreManager.self) private var storeManager
@State private var isInitializing = true
@State private var loadingProgress: Double = 0.0
@State private var loadingPhase: String = "Starting…"
@State private var showNudge = false
var body: some View {
Group {
@@ -32,9 +34,26 @@ struct RootView: View {
.animation(.easeInOut(duration: 0.4), value: service.isConnected)
.applyTheme()
.applyLocale()
.sheet(isPresented: $showNudge, onDismiss: {
storeManager.recordNudgeShown()
}) {
SupportNudgeView(isPresented: $showNudge)
}
.task {
await initializeConnection()
}
.onChange(of: isInitializing) { _, initializing in
if !initializing { checkNudge() }
}
}
private func checkNudge() {
guard storeManager.shouldShowNudge else { return }
// Small delay so the main UI settles before the sheet appears
Task {
try? await Task.sleep(for: .seconds(1))
showNudge = true
}
}
// MARK: - Initialization