diff --git a/app/lib/features/chat/conversation/chat_composer_bar.dart b/app/lib/features/chat/conversation/chat_composer_bar.dart index f3cb8bda..7e119805 100644 --- a/app/lib/features/chat/conversation/chat_composer_bar.dart +++ b/app/lib/features/chat/conversation/chat_composer_bar.dart @@ -777,26 +777,38 @@ class _ChatComposerBarState extends State { } } - final label = Text(stop ? chatStopLabel : chatSendLabel); + // One icon control, named Send or Stop for assistive technology: a send + // arrow, or a stop square in the error colour while a turn runs. + final label = stop ? chatStopLabel : chatSendLabel; if (cupertino) { - return CupertinoButton( - key: const Key('chat-composer-primary'), - color: stop ? CupertinoColors.systemRed.resolveFrom(context) : null, - onPressed: enabled ? press : null, - child: label, + return Semantics( + button: true, + label: label, + excludeSemantics: true, + child: CupertinoButton.filled( + key: const Key('chat-composer-primary'), + sizeStyle: CupertinoButtonSize.small, + color: stop ? CupertinoColors.systemRed.resolveFrom(context) : null, + onPressed: enabled ? press : null, + child: Icon( + stop ? CupertinoIcons.stop_fill : CupertinoIcons.arrow_up, + size: 18, + ), + ), ); } final scheme = Theme.of(context).colorScheme; - return FilledButton( + return IconButton.filled( key: const Key('chat-composer-primary'), + tooltip: label, style: stop - ? FilledButton.styleFrom( + ? IconButton.styleFrom( backgroundColor: scheme.error, foregroundColor: scheme.onError, ) : null, onPressed: enabled ? press : null, - child: label, + icon: Icon(stop ? Icons.stop : Icons.send), ); } diff --git a/app/lib/features/chat/conversation/chat_thread_view.dart b/app/lib/features/chat/conversation/chat_thread_view.dart index 1465d892..545fcae5 100644 --- a/app/lib/features/chat/conversation/chat_thread_view.dart +++ b/app/lib/features/chat/conversation/chat_thread_view.dart @@ -586,10 +586,6 @@ class _ChatThreadViewState extends State { permissionErrorFor: _controller.permissionErrorFor, formErrorFor: _controller.questionErrorFor, ); - // A pending approval/question means the turn is waiting on the operator, - // not generating, so the transcript indicator and its live region stand - // down; the composer's Stop control still follows `running`. - final awaiting = cards.any(chatCardAwaitingOperator); final allRows = transcriptRows(messages, trailing: cards); // A transcript held from before a socket gap may still say a compaction is // running even when the repair's read is refused. That running state is @@ -804,15 +800,6 @@ class _ChatThreadViewState extends State { notice: notice, onDismiss: _dismiss, ), - if (_controller.running && !awaiting) - Padding( - key: const Key('chat-running'), - padding: const EdgeInsets.all(16), - child: Semantics( - liveRegion: true, - child: const Text('Assistant is responding…'), - ), - ), ], ), if (showJump) diff --git a/app/test/features/chat/conversation/chat_composer_attachment_send_test.dart b/app/test/features/chat/conversation/chat_composer_attachment_send_test.dart index f59b2fc5..956c4654 100644 --- a/app/test/features/chat/conversation/chat_composer_attachment_send_test.dart +++ b/app/test/features/chat/conversation/chat_composer_attachment_send_test.dart @@ -335,7 +335,7 @@ void main() { await tester.tap(find.byKey(const Key('chat-composer-primary'))); await tester.pump(); - FilledButton primary() => tester.widget( + IconButton primary() => tester.widget( find.byKey(const Key('chat-composer-primary')), ); IconButton attach() => tester.widget( diff --git a/app/test/features/chat/conversation/chat_composer_bar_state_test.dart b/app/test/features/chat/conversation/chat_composer_bar_state_test.dart index 336bd90c..541e0619 100644 --- a/app/test/features/chat/conversation/chat_composer_bar_state_test.dart +++ b/app/test/features/chat/conversation/chat_composer_bar_state_test.dart @@ -25,15 +25,15 @@ void main() { composerThread(gateway, newOperationId: nextOperation), ); await tester.pumpAndSettle(); - expect(find.text(chatSendLabel), findsOneWidget); + expect(find.byTooltip(chatSendLabel), findsOneWidget); gateway.emitEvent(chatStepFrame('running')); await tester.pump(); await tester.pump(); - expect(find.text(chatSendLabel), findsNothing); - expect(find.text(chatStopLabel), findsOneWidget); - final button = tester.widget( + expect(find.byTooltip(chatSendLabel), findsNothing); + expect(find.byTooltip(chatStopLabel), findsOneWidget); + final button = tester.widget( find.byKey(const Key('chat-composer-primary')), ); final scheme = Theme.of( diff --git a/app/test/features/chat/conversation/chat_composer_bar_test.dart b/app/test/features/chat/conversation/chat_composer_bar_test.dart index 78eac749..3b0c496a 100644 --- a/app/test/features/chat/conversation/chat_composer_bar_test.dart +++ b/app/test/features/chat/conversation/chat_composer_bar_test.dart @@ -150,7 +150,7 @@ void main() { ); await tester.pumpAndSettle(); - FilledButton primary() => tester.widget( + IconButton primary() => tester.widget( find.byKey(const Key('chat-composer-primary')), ); diff --git a/app/test/features/chat/conversation/chat_permission_card_test.dart b/app/test/features/chat/conversation/chat_permission_card_test.dart index 2fb14d5b..d0ab7dbc 100644 --- a/app/test/features/chat/conversation/chat_permission_card_test.dart +++ b/app/test/features/chat/conversation/chat_permission_card_test.dart @@ -362,8 +362,7 @@ void main() { await tester.pumpAndSettle(); expect(find.text('Approve bash'), findsOneWidget); - expect(find.text('Assistant is responding…'), findsNothing); - expect(find.text('Stop'), findsOneWidget); + expect(find.byTooltip('Stop'), findsOneWidget); gateway.emitRaw({ 'type': 'chat_permission', @@ -371,8 +370,9 @@ void main() { }); await tester.pumpAndSettle(); - expect(find.text('Assistant is responding…'), findsOneWidget); - expect(find.text('Stop'), findsOneWidget); + // No filler line while the turn runs; Stop is the running signal. + expect(find.byKey(const Key('chat-running')), findsNothing); + expect(find.byTooltip('Stop'), findsOneWidget); }); testWidgets('consecutive Material cards stay separate surfaces', ( diff --git a/app/test/features/chat/conversation/chat_thread_view_test.dart b/app/test/features/chat/conversation/chat_thread_view_test.dart index b22d1e80..9f7ce183 100644 --- a/app/test/features/chat/conversation/chat_thread_view_test.dart +++ b/app/test/features/chat/conversation/chat_thread_view_test.dart @@ -422,7 +422,7 @@ void main() { expect(find.text('live code'), findsOneWidget); expect(find.textContaining('### Live answer'), findsNothing); expect(find.textContaining('`live code`'), findsNothing); - expect(find.text('Assistant is responding…'), findsOneWidget); + expect(find.byKey(const Key('chat-running')), findsNothing); }); testWidgets('formatted assistant output fits 320px at 2x in dark Cupertino', (