Restore activity row touch targets

This commit is contained in:
2026-10-31 23:40:18 +00:00
parent 49afcba2d3
commit 8193626076
2 changed files with 28 additions and 24 deletions
@@ -149,36 +149,39 @@ class _ChatTurnActivityViewState extends State<ChatTurnActivityView> {
: 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<ChatTurnActivityView> {
: 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,
@@ -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)', (