Matthias Nott
2026-03-24 cb470d33d2665fcc6f8448d2736777656cf0cbe7
lib/screens/navigate_screen.dart
....@@ -192,20 +192,11 @@
192192 void _sendKey(String key) {
193193 _haptic();
194194
195
- // Send via WebSocket - the chat screen's WS is in the provider
196
- // We need to access the WS through the provider system
197
- // For now, send a nav command message
195
+ // Send via MQTT - the chat screen's MQTT service is in the provider
198196 final activeSessionId = ref.read(activeSessionIdProvider);
199197
200
- // Build the navigate command
201
- // This sends a key press to the AIBroker daemon
202
- // which forwards it to the active terminal session
203
- // The WS is managed by ChatScreen, so we'll use a message approach
204
-
205
- // Since we can't directly access the WS from here,
206
- // we send through the provider approach - the message will be picked up
207
- // by the WS service in ChatScreen via a shared notification mechanism.
208
- // For simplicity, we use a global event bus pattern.
198
+ // Send a key press to the AIBroker daemon via the MQTT service.
199
+ // NavigateNotifier bridges the navigate screen to the chat screen's MQTT service.
209200
210201 NavigateNotifier.instance?.sendKey(key, activeSessionId);
211202
....@@ -228,8 +219,8 @@
228219 }
229220 }
230221
231
-/// Global notifier to bridge navigate screen to WebSocket.
232
-/// Set by ChatScreen when WS is initialized.
222
+/// Global notifier to bridge navigate screen to MQTT service.
223
+/// Set by ChatScreen when MQTT is initialized.
233224 class NavigateNotifier {
234225 static NavigateNotifier? instance;
235226