From 440995e31ff0e0110da47ff404a14a48b472daa0 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Tue, 10 Nov 2026 17:00:42 +0000 Subject: [PATCH] Keep model and mode text off the action bar pill ends Run 299 removed the model and mode buttons' horizontal padding on desktop so the island's gap sets the spacing, which left their text touching the pill's rounded ends. The island now insets its content by 12 px. --- .../chat/conversation/chat_thread_header.dart | 19 ++++++++++++------- .../conversation/chat_thread_header_test.dart | 15 ++++++++++++++- 2 files changed, 26 insertions(+), 8 deletions(-) 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 -