feat: redesign Dynamic Island with phase-driven UI and animations
This commit is contained in:
@@ -2,12 +2,13 @@ import Foundation
|
||||
import Observation
|
||||
|
||||
/// Global app bootstrap state — initialises all services once at launch.
|
||||
@MainActor
|
||||
@Observable
|
||||
final class AppState {
|
||||
|
||||
var isBootstrapped = false
|
||||
static let shared = AppState()
|
||||
|
||||
@MainActor
|
||||
var isBootstrapped = false
|
||||
func bootstrap() async {
|
||||
guard !isBootstrapped else { return }
|
||||
guard !AppEnvironment.isPreview else { isBootstrapped = true; return }
|
||||
@@ -15,4 +16,6 @@ final class AppState {
|
||||
AnalyticsService.shared.initialize()
|
||||
isBootstrapped = true
|
||||
}
|
||||
|
||||
private init() {}
|
||||
}
|
||||
|
||||
@@ -3,20 +3,19 @@ import SwiftData
|
||||
|
||||
extension Notification.Name {
|
||||
static let skipTrackFromActivity = Notification.Name("skipTrackFromActivity")
|
||||
// togglePauseFromActivity is declared in WorkoutActivityAttributes.swift (shared with widget)
|
||||
}
|
||||
|
||||
@main
|
||||
struct TabataGoApp: App {
|
||||
|
||||
@State private var appState = AppState()
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
RootView()
|
||||
.environment(appState)
|
||||
.environment(AppState.shared)
|
||||
.modelContainer(TabataGoSchema.container)
|
||||
.task {
|
||||
await appState.bootstrap()
|
||||
await AppState.shared.bootstrap()
|
||||
}
|
||||
.onOpenURL { url in
|
||||
if url.scheme == "tabatago", url.host == "skipTrack" {
|
||||
|
||||
Reference in New Issue
Block a user