Merge branch 'main' into run-sort-sheet-check
This commit is contained in:
@@ -30,6 +30,7 @@ import 'chat_scroll.dart';
|
|||||||
import 'chat_thread_controller.dart';
|
import 'chat_thread_controller.dart';
|
||||||
import '../../../ui/adaptive/floating_bar_layout.dart';
|
import '../../../ui/adaptive/floating_bar_layout.dart';
|
||||||
import '../../../ui/adaptive/segmented_bar_overlay.dart';
|
import '../../../ui/adaptive/segmented_bar_overlay.dart';
|
||||||
|
import '../../../ui/layout/app_sheet_header.dart';
|
||||||
import 'chat_reading_width.dart';
|
import 'chat_reading_width.dart';
|
||||||
import 'chat_thread_header.dart';
|
import 'chat_thread_header.dart';
|
||||||
import 'chat_transcript_cache.dart';
|
import 'chat_transcript_cache.dart';
|
||||||
@@ -1272,39 +1273,15 @@ class _ChatInfoSheet extends StatelessWidget {
|
|||||||
return AnimatedBuilder(
|
return AnimatedBuilder(
|
||||||
animation: controller,
|
animation: controller,
|
||||||
builder: (context, _) {
|
builder: (context, _) {
|
||||||
final titleStyle = cupertino
|
|
||||||
? CupertinoTheme.of(context).textTheme.navTitleTextStyle
|
|
||||||
: Theme.of(context).textTheme.titleLarge;
|
|
||||||
final content = Column(
|
final content = Column(
|
||||||
key: const Key('chat-info-sheet'),
|
key: const Key('chat-info-sheet'),
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
AppSheetHeader(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(24, 8, 16, 4),
|
title: 'Chat information',
|
||||||
child: Row(
|
cupertino: cupertino,
|
||||||
children: [
|
doneKey: const Key('chat-info-close'),
|
||||||
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'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
for (final metric in _chatInfoMetrics(controller.usage))
|
for (final metric in _chatInfoMetrics(controller.usage))
|
||||||
_ChatInfoRow(metric: metric, cupertino: cupertino),
|
_ChatInfoRow(metric: metric, cupertino: cupertino),
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ void main() {
|
|||||||
await _openInfo(tester);
|
await _openInfo(tester);
|
||||||
|
|
||||||
expect(find.text('Chat information'), findsOneWidget);
|
expect(find.text('Chat information'), findsOneWidget);
|
||||||
|
expect(find.text('Done'), findsOneWidget);
|
||||||
expect(find.text('Output rate'), findsOneWidget);
|
expect(find.text('Output rate'), findsOneWidget);
|
||||||
expect(find.text('24.6 tok/s'), findsOneWidget);
|
expect(find.text('24.6 tok/s'), findsOneWidget);
|
||||||
expect(find.text('Total tokens'), findsOneWidget);
|
expect(find.text('Total tokens'), findsOneWidget);
|
||||||
@@ -134,7 +135,7 @@ void main() {
|
|||||||
expect(find.text('\$0.0000'), findsOneWidget);
|
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,
|
tester,
|
||||||
) async {
|
) async {
|
||||||
final gateway = await _thread(tester);
|
final gateway = await _thread(tester);
|
||||||
@@ -168,6 +169,7 @@ void main() {
|
|||||||
|
|
||||||
await _openInfo(tester);
|
await _openInfo(tester);
|
||||||
expect(find.text('Chat information'), findsOneWidget);
|
expect(find.text('Chat information'), findsOneWidget);
|
||||||
|
expect(find.text('Done'), findsOneWidget);
|
||||||
expect(find.text('42'), findsOneWidget);
|
expect(find.text('42'), findsOneWidget);
|
||||||
|
|
||||||
await tester.tap(find.byKey(const Key('chat-info-close')));
|
await tester.tap(find.byKey(const Key('chat-info-close')));
|
||||||
|
|||||||
Reference in New Issue
Block a user