- watchOS: add WatchSessionManager (WCSession bridge), WatchNotificationHandler (snooze/dismiss actions), recommendations() for AppIntentTimelineProvider - watchOS: WatchTimerStore tick loop with cascade haptics, App Group sync - macOS: CreateTimerSheet (countdown/alarm/pomodoro), launch-at-login toggle - macOS: MenuBarState showCreateSheet, MacSettingsView data tab - Xcode project updated with new file references
31 lines
830 B
Swift
31 lines
830 B
Swift
// ── Menu Bar State ────────────────────────────────────────────
|
|
// Observable state for the macOS menu bar popover
|
|
|
|
import SwiftUI
|
|
import Combine
|
|
|
|
@MainActor
|
|
final class MenuBarState: ObservableObject {
|
|
static let shared = MenuBarState()
|
|
|
|
@Published var isExpanded = false
|
|
@Published var showQuickTimer = false
|
|
@Published var showCreateSheet = false
|
|
@Published var quickTimerLabel = ""
|
|
@Published var quickTimerMinutes: Double = 25
|
|
|
|
private init() {}
|
|
|
|
func toggleExpanded() {
|
|
withAnimation(.easeInOut(duration: 0.2)) {
|
|
isExpanded.toggle()
|
|
}
|
|
}
|
|
|
|
func resetQuickTimer() {
|
|
quickTimerLabel = ""
|
|
quickTimerMinutes = 25
|
|
showQuickTimer = false
|
|
}
|
|
}
|