feat: show tool status notifications in chat during generation

Parse SSE `status` events alongside `chunk` events and display the
status text next to the spinner while the assistant is generating.
Previously the Android app discarded all non-chunk SSE events.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 11:46:42 -04:00
parent 4919f7a185
commit e2a358a158
6 changed files with 180 additions and 24 deletions
+9 -2
View File
@@ -89,6 +89,8 @@ class _ChatScreenState extends ConsumerState<ChatScreen> {
Widget build(BuildContext context) {
final messagesAsync = ref.watch(messagesProvider(widget.conversationId));
final isStreaming = ref.watch(isStreamingProvider(widget.conversationId));
final streamingStatus =
ref.watch(streamingStatusProvider(widget.conversationId));
final voiceState = ref.watch(voiceProvider);
// Scroll when messages change.
@@ -139,8 +141,13 @@ class _ChatScreenState extends ConsumerState<ChatScreen> {
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 12),
itemCount: messages.length,
itemBuilder: (context, i) =>
ChatMessageBubble(message: messages[i]),
itemBuilder: (context, i) => ChatMessageBubble(
message: messages[i],
streamingStatus: (i == messages.length - 1 &&
messages[i].status == 'generating')
? streamingStatus
: '',
),
);
},
),