App: agent notifications on the web (system notification, toast, tab title count)

The app subscribes to the notification stream on every connection and
delivers chat_notify notices: a toast when the page is focused (none if
that chat is in view), a browser notification titled '<chat>: <title>'
plus a '(n)' tab title count when it is not, and on insecure http pages a
toast, the title count and a short chime. Low priority posts only when
hidden. Replays within an hour show once; ids persist in the ledger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 16:02:47 +00:00
parent c8541f29b7
commit 150481b57b
17 changed files with 1197 additions and 23 deletions
+7 -1
View File
@@ -44,6 +44,7 @@ import 'perf/chat_search_fixture.dart';
import 'perf/chat_shown_fixture.dart';
import 'perf/chat_claude_accounts_fixture.dart';
import 'perf/chat_question_fixture.dart';
import 'perf/agent_notice_fixture.dart';
import 'capture/window_probe.dart';
import 'perf/chat_scroll_fixture.dart';
import 'perf/perf_fixture.dart';
@@ -814,7 +815,11 @@ class _FixtureChannel implements WebSocketChannel {
}
});
}
final reply = probeReply(decoded);
final reply =
agentNoticeReply(decoded, (frame) {
if (!_incoming.isClosed) _incoming.add(jsonEncode(frame));
}) ??
probeReply(decoded);
final followUps = perfChatFollowUps(decoded);
final subscribe = decoded['chat_subscribe'];
if (subscribe is Map) {
@@ -927,6 +932,7 @@ Future<void> main() async {
return;
}
configurePerfFixture(params);
configureAgentNoticeFixture(params);
installSpeechFixture(params);
if (params['files'] == '1') {
probeMissingRememberedFolder = params['filesMissing'] == '1';