diff --git a/app/lib/features/chat/conversation/chat_thread_header.dart b/app/lib/features/chat/conversation/chat_thread_header.dart index 709c9396..68f2aadf 100644 --- a/app/lib/features/chat/conversation/chat_thread_header.dart +++ b/app/lib/features/chat/conversation/chat_thread_header.dart @@ -155,14 +155,19 @@ class _ControlIsland extends StatelessWidget { final List children; final double gap; + // With a gap (desktop) the buttons carry no horizontal padding of their + // own, so the island keeps the text off its pill's rounded ends. @override - Widget build(BuildContext context) => Row( - mainAxisSize: MainAxisSize.min, - children: [ - for (final (index, child) in children.indexed) ...[ - if (index > 0) SizedBox(width: gap), - Flexible(child: child), + Widget build(BuildContext context) => Padding( + padding: EdgeInsets.symmetric(horizontal: gap * 1.5), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + for (final (index, child) in children.indexed) ...[ + if (index > 0) SizedBox(width: gap), + Flexible(child: child), + ], ], - ], + ), ); } diff --git a/app/test/features/chat/conversation/chat_thread_header_test.dart b/app/test/features/chat/conversation/chat_thread_header_test.dart index 24381ac2..a6526100 100644 --- a/app/test/features/chat/conversation/chat_thread_header_test.dart +++ b/app/test/features/chat/conversation/chat_thread_header_test.dart @@ -80,7 +80,20 @@ void main() { tester.getTopRight(find.byKey(Key(left))).dx; expect(gap('header-control-1', 'header-control-2'), 8); - expect(gap('header-control-2', 'header-action-1'), 8); + // The model/mode island keeps its text 12 px off its pill's ends. + final island = tester.getRect( + find.byKey(const Key('chat-model-permission-island')), + ); + expect( + tester.getTopLeft(find.byKey(const Key('header-control-1'))).dx - + island.left, + 12, + ); + expect( + island.right - + tester.getTopRight(find.byKey(const Key('header-control-2'))).dx, + 12, + ); expect(gap('header-action-1', 'header-action-2'), 8); expect( tester.getTopLeft(find.byKey(segmentedMoreKey).first).dx -