Thicken the running highlight while the composer has focus

The focus ring outlines the pill in the same colour, hiding the 2 px
highlight; draw it 4 px wide over a focused field.
This commit is contained in:
2026-11-12 14:15:48 +00:00
parent ff39114e4f
commit 677d202ae7
3 changed files with 54 additions and 5 deletions
@@ -4,6 +4,8 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/chat/conversation/chat_command_palette.dart';
import 'package:pipelines_app/features/chat/conversation/chat_composer_bar.dart';
import 'package:pipelines_app/features/chat/conversation/chat_escape_stop.dart';
import 'package:pipelines_app/features/chat/conversation/composer_focus_ring.dart';
import 'package:pipelines_app/features/chat/conversation/composer_running_border.dart';
import 'chat_composer_bar_fixtures.dart';
import 'chat_thread_fixtures.dart';
@@ -60,6 +62,34 @@ void main() {
expect(tester.binding.transientCallbackCount, 0);
});
testWidgets('a focused field draws the highlight thicker than its ring', (
tester,
) async {
_reducedMotion(false);
final gateway = await _pumpThread(tester);
await _startTurn(tester, gateway);
ComposerRunningBorder border() => tester.widget<ComposerRunningBorder>(
find.byType(ComposerRunningBorder),
);
tester
.widgetList<EditableText>(find.byType(EditableText))
.firstWhere((field) => field.focusNode.debugLabel == 'chat-composer')
.focusNode
.requestFocus();
await tester.pump();
await tester.pump();
expect(border().focused, isTrue);
expect(
ComposerRunningBorder.focusedStrokeWidth,
greaterThan(ComposerFocusRing.ringWidth),
);
FocusManager.instance.primaryFocus?.unfocus();
await tester.pump();
await tester.pump();
expect(border().focused, isFalse);
await _endTurn(tester, gateway);
});
testWidgets('reduced motion draws the static border and never ticks', (
tester,
) async {