From 8193626076de67c823c6d03a2ab7de5ad587f79c Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sat, 31 Oct 2026 23:40:18 +0000 Subject: [PATCH] Restore activity row touch targets --- .../transcript/chat_turn_activity_view.dart | 51 ++++++++++--------- .../transcript/chat_message_layout_test.dart | 1 + 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/app/lib/features/chat/ui/transcript/chat_turn_activity_view.dart b/app/lib/features/chat/ui/transcript/chat_turn_activity_view.dart index 8e1e65a9..e77bde8a 100644 --- a/app/lib/features/chat/ui/transcript/chat_turn_activity_view.dart +++ b/app/lib/features/chat/ui/transcript/chat_turn_activity_view.dart @@ -149,36 +149,39 @@ class _ChatTurnActivityViewState extends State { : DateTime.now().difference(started); final seconds = duration.inSeconds.clamp(0, 2147483647); final label = '${data.label}${widget.streaming ? ' ${seconds}s' : ''}'; - final content = Row( - children: [ - if (widget.streaming) ...[ - ExcludeSemantics( - child: DefaultTextStyle.merge( - style: TextStyle(color: accent), - child: const ChatResponsePending(), + final content = ConstrainedBox( + constraints: BoxConstraints(minHeight: cupertino ? 28 : 32), + child: Row( + children: [ + if (widget.streaming) ...[ + ExcludeSemantics( + child: DefaultTextStyle.merge( + style: TextStyle(color: accent), + child: const ChatResponsePending(), + ), + ), + const SizedBox(width: 8), + ], + Flexible( + child: Text( + label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle(color: color), ), ), - const SizedBox(width: 8), - ], - Flexible( - child: Text( - label, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle(color: color), + const SizedBox(width: 4), + Icon( + cupertino ? CupertinoIcons.chevron_right : Icons.chevron_right, + color: color, ), - ), - const SizedBox(width: 4), - Icon( - cupertino ? CupertinoIcons.chevron_right : Icons.chevron_right, - color: color, - ), - ], + ], + ), ); final button = cupertino ? CupertinoButton( key: const Key('chat-turn-activity'), - minimumSize: Size.zero, + minimumSize: const Size(0, 44), padding: const EdgeInsets.all(chatAgentContentInset), onPressed: _open, child: content, @@ -186,7 +189,7 @@ class _ChatTurnActivityViewState extends State { : TextButton( key: const Key('chat-turn-activity'), style: TextButton.styleFrom( - minimumSize: Size.zero, + minimumSize: const Size(0, 48), padding: const EdgeInsets.all(chatAgentContentInset), tapTargetSize: MaterialTapTargetSize.shrinkWrap, alignment: AlignmentDirectional.centerStart, diff --git a/app/test/features/chat/ui/transcript/chat_message_layout_test.dart b/app/test/features/chat/ui/transcript/chat_message_layout_test.dart index 6be8b33b..831c9e18 100644 --- a/app/test/features/chat/ui/transcript/chat_message_layout_test.dart +++ b/app/test/features/chat/ui/transcript/chat_message_layout_test.dart @@ -91,6 +91,7 @@ void main() { expect(activityContentRect.top - activityRect.top, closeTo(8, 0.5)); expect(activityRect.right - activityContentRect.right, closeTo(8, 0.5)); expect(activityRect.bottom - activityContentRect.bottom, closeTo(8, 0.5)); + expect(activityRect.height, greaterThanOrEqualTo(cupertino ? 44 : 48)); }); testWidgets('a finished reply copies its answer text ($style)', (