@@ -4,7 +4,7 @@ import Combine
44@MainActor
55final class NotchViewModel : ObservableObject {
66 enum Tab : String , CaseIterable , Identifiable {
7- case media, shelf, clipboard, snippets, calendar, timer, translate, notes, teleprompter, monitor
7+ case media, shelf, clipboard, snippets, calendar, timer, translate, notes, teleprompter, monitor, weather
88 var id : String { rawValue }
99
1010 var symbol : String {
@@ -19,6 +19,7 @@ final class NotchViewModel: ObservableObject {
1919 case . notes: return " note.text "
2020 case . teleprompter: return " text.line.first.and.arrowtriangle.forward "
2121 case . monitor: return " cpu "
22+ case . weather: return " cloud.sun "
2223 }
2324 }
2425
@@ -34,6 +35,7 @@ final class NotchViewModel: ObservableObject {
3435 case . notes: return localized ( " Notes " )
3536 case . teleprompter: return localized ( " Teleprompter " )
3637 case . monitor: return localized ( " Monitor " )
38+ case . weather: return localized ( " Weather " )
3739 }
3840 }
3941
@@ -46,7 +48,7 @@ final class NotchViewModel: ObservableObject {
4648 /// body has — so growth continues in a second column on the right,
4749 /// which the scratch notes open.
4850 static let leftRail : [ Tab ] = [ . media, . shelf, . clipboard, . snippets, . calendar, . timer, . translate]
49- static let rightRail : [ Tab ] = [ . notes, . teleprompter, . monitor]
51+ static let rightRail : [ Tab ] = [ . notes, . teleprompter, . monitor, . weather ]
5052 }
5153
5254 @Published var isOpen = false {
@@ -96,6 +98,7 @@ final class NotchViewModel: ObservableObject {
9698 let notes : NoteStore
9799 let teleprompter : TeleprompterStore
98100 let monitor : SystemMonitorStore
101+ let weather : WeatherStore
99102
100103 private var cancellables = Set < AnyCancellable > ( )
101104
@@ -111,6 +114,7 @@ final class NotchViewModel: ObservableObject {
111114 self . notes = NoteStore ( )
112115 self . teleprompter = TeleprompterStore ( )
113116 self . monitor = SystemMonitorStore ( )
117+ self . weather = WeatherStore ( )
114118
115119 // The panel header reads through to the stores — counters, the source
116120 // name, the equalizer. Nested ObservableObjects do not propagate on
@@ -137,7 +141,8 @@ final class NotchViewModel: ObservableObject {
137141 clipboard. objectWillChange,
138142 calendar. objectWillChange,
139143 timer. objectWillChange,
140- monitor. objectWillChange
144+ monitor. objectWillChange,
145+ weather. objectWillChange
141146 ] {
142147 child
143148 . sink { [ weak self] _ in
@@ -180,6 +185,7 @@ final class NotchViewModel: ObservableObject {
180185 // never prompts on its own.
181186 calendar. start ( )
182187 monitor. start ( )
188+ weather. start ( )
183189
184190 // Screenshots reach the shelf through here whether they were taken on
185191 // this Mac or on a phone: a copy made on the phone arrives in the same
@@ -203,6 +209,7 @@ final class NotchViewModel: ObservableObject {
203209 clipboard. stop ( )
204210 calendar. stop ( )
205211 monitor. stop ( )
212+ weather. stop ( )
206213 // Whatever was typed makes it to disk even when quitting mid-thought.
207214 notes. flush ( )
208215 teleprompter. flush ( )
0 commit comments