The file /Users/neog/Apps/macOS/NEOGHub/NEOGCommand/App/AppState.swift has been updated. Here's the result of running `cat -n` on a snippet of the edited file: 52→ refreshTask?.cancel() 53→ notificationObservers.forEach { NotificationCenter.default.removeObserver($0) } 54→ } 55→ 56→ // MARK: - Notification Observers 57→ 58→ private func setupNotificationObservers() { 59→ // Navigate to Monitoring 60→ let monitoringObserver = NotificationCenter.default.addObserver( 61→ forName: .navigateToMonitoring, 62→ object: nil, 63→ queue: .main 64→ ) { [weak self] _ in 65→ Task { @MainActor in 66→ self?.selectedCategory = .monitoring 67→ } 68→ } 69→ notificationObservers.append(monitoringObserver) 70→ 71→ // Navigate to Services 72→ let servicesObserver = NotificationCenter.default.addObserver( 73→ forName: .navigateToServices, 74→ object: nil, 75→ queue: .main 76→ ) { [weak self] _ in 77→ Task { @MainActor in 78→ self?.selectedCategory = .services 79→ } 80→ } 81→ notificationObservers.append(servicesObserver) 82→ 83→ // Navigate to specific run 84→ let runObserver = NotificationCenter.default.addObserver( 85→ forName: .navigateToRun, 86→ object: nil, 87→ queue: .main 88→ ) { [weak self] notification in 89→ Task { @MainActor in 90→ if let runId = notification.object as? String { 91→ self?.selectedCategory = .monitoring 92→ self?.selectedRunId = runId 93→ } 94→ } 95→ } 96→ notificationObservers.append(runObserver) 97→ 98→ // Start service from notification 99→ let startServiceObserver = NotificationCenter.default.addObserver( 100→ forName: .startService, 101→ object: nil, 102→ queue: .main 103→ ) { [weak self] notification in 104→ Task { @MainActor in 105→ if let serviceName = notification.object as? String { 106→ await self?.handleStartService(serviceName) 107→ } 108→ } 109→ } 110→ notificationObservers.append(startServiceObserver) 111→ 112→ // Stop service from notification 113→ let stopServiceObserver = NotificationCenter.default.addObserver( 114→ forName: .stopService, 115→ object: nil, 116→ queue: .main 117→ ) { [weak self] notification in 118→ Task { @MainActor in 119→ if let serviceName = notification.object as? String { 120→ await self?.handleStopService(serviceName) 121→ } 122→ } 123→ } 124→ notificationObservers.append(stopServiceObserver) 125→ } 126→ 127→ private func handleStartService(_ serviceName: String) async { 128→ let serviceManager = ServiceManager.shared 129→ if let definition = ServiceManager.serviceDefinitions.first(where: { $0.name == serviceName }) { 130→ _ = await serviceManager.startService(definition) 131→ await refreshServices() 132→ } 133→ } 134→ 135→ private func handleStopService(_ serviceName: String) async { 136→ let serviceManager = ServiceManager.shared 137→ if let definition = ServiceManager.serviceDefinitions.first(where: { $0.name == serviceName }) { 138→ _ = await serviceManager.stopService(definition) 139→ await refreshServices() 140→ } 141→ } 142→ 143→ // MARK: - Realtime Subscriptions 144→ 145→ private func setupRealtimeSubscriptions() { 146→ // Connection state 147→ realtimeService.$connectionState 148→ .receive(on: DispatchQueue.main) 149→ .sink { [weak self] state in 150→ guard let self = self else { return } 151→ let newIsConnected = (state == .connected) 152→ 153→ // Send notification on connection change 154→ if newIsConnected != self.previousConnectionState { 155→ Task { 156→ await self.notificationService.sendConnectionStatusNotification(isConnected: newIsConnected) 157→ } 158→ self.previousConnectionState = newIsConnected 159→ } 160→ 161→ self.connectionState = state 162→ self.isConnected = newIsConnected 163→ } 164→ .store(in: &cancellables) 165→ 166→ // Last update time 167→ realtimeService.$lastUpdate 168→ .receive(on: DispatchQueue.main)