feat(app): chat composer sends with an icon; no filler running line

This commit is contained in:
2026-10-23 15:39:32 +01:00
parent 7e93348b25
commit ef078db80b
7 changed files with 32 additions and 33 deletions
@@ -777,26 +777,38 @@ class _ChatComposerBarState extends State<ChatComposerBar> {
}
}
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),
);
}
@@ -586,10 +586,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
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<ChatThreadView> {
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)
@@ -335,7 +335,7 @@ void main() {
await tester.tap(find.byKey(const Key('chat-composer-primary')));
await tester.pump();
FilledButton primary() => tester.widget<FilledButton>(
IconButton primary() => tester.widget<IconButton>(
find.byKey(const Key('chat-composer-primary')),
);
IconButton attach() => tester.widget<IconButton>(
@@ -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<FilledButton>(
expect(find.byTooltip(chatSendLabel), findsNothing);
expect(find.byTooltip(chatStopLabel), findsOneWidget);
final button = tester.widget<IconButton>(
find.byKey(const Key('chat-composer-primary')),
);
final scheme = Theme.of(
@@ -150,7 +150,7 @@ void main() {
);
await tester.pumpAndSettle();
FilledButton primary() => tester.widget<FilledButton>(
IconButton primary() => tester.widget<IconButton>(
find.byKey(const Key('chat-composer-primary')),
);
@@ -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', (
@@ -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', (