diff --git a/app/notes/chat-seen-only-after-interaction.md b/app/notes/chat-seen-only-after-interaction.md index 1a046f83..2bde5826 100644 --- a/app/notes/chat-seen-only-after-interaction.md +++ b/app/notes/chat-seen-only-after-interaction.md @@ -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 diff --git a/app/test/features/chat/ui/sessions/chat_sessions_live_new_test.dart b/app/test/features/chat/ui/sessions/chat_sessions_live_new_test.dart index 6e0c6e29..a01e4c1d 100644 --- a/app/test/features/chat/ui/sessions/chat_sessions_live_new_test.dart +++ b/app/test/features/chat/ui/sessions/chat_sessions_live_new_test.dart @@ -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();