Keep unengaged open chats unread

Update the live-chat regression and note to reflect that replies received while a chat is merely open are not acknowledged as seen. This preserves phone notifications until the user actually interacts with the chat.
This commit is contained in:
2026-11-12 03:21:38 +00:00
parent 6ccced012e
commit ae5e00326c
2 changed files with 38 additions and 23 deletions
+13 -1
View File
@@ -83,7 +83,19 @@ notifications on the watermark.
`chat_color_test`, `chat_star_optimistic_test`, `chat_state_legibility_test`,
`chat_visibility_marker_test`, `chat_add_pane_picker_test`,
`chat_session_local_state_test`, `server_connections_recovery_test`) pass
unchanged. No expectation was edited.
unchanged, except one expectation (below).
- Land-gate fix: `test/features/chat/ui/sessions/chat_sessions_live_new_test.dart`
"a tool call and reply in the open chat stay read on leaving" failed in the
full `test/features test/shell test/ui test/core` run. The chat was open with
no user interaction, so under the new rule the reply is not seen. The test
was renamed to "...stay New on leaving without interaction" and now expects
the `chat-row-unread` dot and `isUnseen('s1')` after the chat is left. Its
open-chat assertion (no dot while open) is unchanged. This is the one
behaviour change the task asked for; no other expectation changed.
- Focused rerun after that fix: `chat_sessions_live_new_test.dart`,
`conversation/chat_seen_interaction_test.dart`,
`ui/sessions/chat_seen_interaction_test.dart`: 34 passed, 0 failed (memwatch
PASS, peak 1182 MB, names only those three paths). `tool/analyze.sh`: clean.
## Limitations
@@ -229,29 +229,32 @@ void main() {
expect(find.byKey(const Key('chat-row-unread')), findsOneWidget);
});
testWidgets('a tool call and reply in the open chat stay read on leaving', (
tester,
) async {
final fake = gateway();
await _pump(tester, fake, active: 's1');
fake.pushed.add(_tool('s1', 'running'));
fake.pushed.add(_tool('s1', 'completed'));
fake.pushed.add(_event('s1', delta: 'Here is the answer.'));
fake.pushed.add({
'type': 'chat_event',
'chat_event': {
'session_id': 's1',
'kind': 'step',
'step': {'status': 'ended'},
},
});
await tester.pumpAndSettle();
expect(find.byKey(const Key('chat-row-unread')), findsNothing);
testWidgets(
'a tool call and reply in the open chat stay New on leaving without interaction',
(tester) async {
final fake = gateway();
await _pump(tester, fake, active: 's1');
fake.pushed.add(_tool('s1', 'running'));
fake.pushed.add(_tool('s1', 'completed'));
fake.pushed.add(_event('s1', delta: 'Here is the answer.'));
fake.pushed.add({
'type': 'chat_event',
'chat_event': {
'session_id': 's1',
'kind': 'step',
'step': {'status': 'ended'},
},
});
await tester.pumpAndSettle();
expect(find.byKey(const Key('chat-row-unread')), findsNothing);
await _pump(tester, fake);
expect(find.byKey(const Key('chat-row-unread')), findsNothing);
expect(_store.state?.isUnseen('s1') ?? false, isFalse);
});
// The chat was open but the user never interacted with it, so the
// reply is not seen: it stays New after the chat is left.
await _pump(tester, fake);
expect(find.byKey(const Key('chat-row-unread')), findsOneWidget);
expect(_store.state?.isUnseen('s1') ?? false, isTrue);
},
);
testWidgets('only unresolved permission requests mark New', (tester) async {
final fake = gateway();