diff --git a/app/lib/features/chat/conversation/chat_thread_view.dart b/app/lib/features/chat/conversation/chat_thread_view.dart index e5deb8ad..d98a4c18 100644 --- a/app/lib/features/chat/conversation/chat_thread_view.dart +++ b/app/lib/features/chat/conversation/chat_thread_view.dart @@ -30,6 +30,7 @@ import 'chat_scroll.dart'; import 'chat_thread_controller.dart'; import '../../../ui/adaptive/floating_bar_layout.dart'; import '../../../ui/adaptive/segmented_bar_overlay.dart'; +import '../../../ui/layout/app_sheet_header.dart'; import 'chat_reading_width.dart'; import 'chat_thread_header.dart'; import 'chat_transcript_cache.dart'; @@ -1272,39 +1273,15 @@ class _ChatInfoSheet extends StatelessWidget { return AnimatedBuilder( animation: controller, builder: (context, _) { - final titleStyle = cupertino - ? CupertinoTheme.of(context).textTheme.navTitleTextStyle - : Theme.of(context).textTheme.titleLarge; final content = Column( key: const Key('chat-info-sheet'), mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24, 8, 16, 4), - child: Row( - children: [ - Expanded( - child: Semantics( - header: true, - child: Text('Chat information', style: titleStyle), - ), - ), - if (cupertino) - CupertinoButton( - key: const Key('chat-info-close'), - padding: EdgeInsets.zero, - onPressed: () => Navigator.of(context).pop(), - child: const Text('Close'), - ) - else - TextButton( - key: const Key('chat-info-close'), - onPressed: () => Navigator.of(context).pop(), - child: const Text('Close'), - ), - ], - ), + AppSheetHeader( + title: 'Chat information', + cupertino: cupertino, + doneKey: const Key('chat-info-close'), ), for (final metric in _chatInfoMetrics(controller.usage)) _ChatInfoRow(metric: metric, cupertino: cupertino), diff --git a/app/test/features/chat/conversation/chat_info_sheet_test.dart b/app/test/features/chat/conversation/chat_info_sheet_test.dart index 9c0b137b..ceb96e10 100644 --- a/app/test/features/chat/conversation/chat_info_sheet_test.dart +++ b/app/test/features/chat/conversation/chat_info_sheet_test.dart @@ -63,6 +63,7 @@ void main() { await _openInfo(tester); expect(find.text('Chat information'), findsOneWidget); + expect(find.text('Done'), findsOneWidget); expect(find.text('Output rate'), findsOneWidget); expect(find.text('24.6 tok/s'), findsOneWidget); expect(find.text('Total tokens'), findsOneWidget); @@ -134,7 +135,7 @@ void main() { expect(find.text('\$0.0000'), findsOneWidget); }); - testWidgets('the native sheet dismisses from Close and the barrier', ( + testWidgets('the native sheet dismisses from Done and the barrier', ( tester, ) async { final gateway = await _thread(tester); @@ -168,6 +169,7 @@ void main() { await _openInfo(tester); expect(find.text('Chat information'), findsOneWidget); + expect(find.text('Done'), findsOneWidget); expect(find.text('42'), findsOneWidget); await tester.tap(find.byKey(const Key('chat-info-close')));