Keep dropped-out signals as MISSING rows; clear the nav bar in the mark sheet
A signal absent from the latest state now stays listed (from the last envelope seen on this gateway) and renders as missing, distinct from null and stale as BOUNDARY.md requires; rows no longer jump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
This commit is contained in:
@@ -39,6 +39,10 @@ class Boundary extends ChangeNotifier {
|
||||
String detail = 'not started';
|
||||
Map<String, dynamic>? hello;
|
||||
Map<String, dynamic> signals = {};
|
||||
|
||||
/// Last envelope of every signal this gateway has sent. A name here but not in
|
||||
/// [signals] is missing right now — distinct from null and stale.
|
||||
final Map<String, Map<String, dynamic>> seen = {};
|
||||
DateTime? lastState;
|
||||
DateTime? lastMessage;
|
||||
|
||||
@@ -75,6 +79,7 @@ class Boundary extends ChangeNotifier {
|
||||
/// Change the target; the current connection is dropped and the loop reconnects.
|
||||
void retarget(String newUrl) {
|
||||
url = newUrl;
|
||||
seen.clear();
|
||||
_ws?.close();
|
||||
}
|
||||
|
||||
@@ -144,6 +149,9 @@ class Boundary extends ChangeNotifier {
|
||||
}
|
||||
case 'state':
|
||||
signals = Map<String, dynamic>.from(m['signals'] as Map);
|
||||
signals.forEach((k, v) {
|
||||
if (v is Map) seen[k] = Map<String, dynamic>.from(v);
|
||||
});
|
||||
lastState = DateTime.now();
|
||||
case 'ack':
|
||||
final id = m['id'] as String?;
|
||||
|
||||
Reference in New Issue
Block a user