fix(app): float the chat composer as glass, cap the reading width, tidy chat chrome
This commit is contained in:
@@ -156,7 +156,7 @@ void main() {
|
||||
]);
|
||||
});
|
||||
|
||||
testWidgets('an empty snapshot shows zero tasks and an honest empty modal', (
|
||||
testWidgets('an empty snapshot shows no task control, never "0 tasks"', (
|
||||
tester,
|
||||
) async {
|
||||
final gateway = _TasksGateway();
|
||||
@@ -165,11 +165,10 @@ void main() {
|
||||
await tester.pumpWidget(_host(gateway));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('0 tasks'), findsOneWidget);
|
||||
expect(find.text('Background tasks'), findsNothing);
|
||||
expect(find.text('0 tasks'), findsNothing);
|
||||
expect(find.textContaining('task'), findsNothing);
|
||||
expect(find.byKey(const Key('chat-background-tasks-button')), findsNothing);
|
||||
expect(gateway.fieldsFor('chat_shells'), hasLength(1));
|
||||
await _openTasks(tester);
|
||||
expect(find.text('No background tasks running.'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('pushed shell frames add and remove this session tasks', (
|
||||
@@ -612,7 +611,7 @@ void main() {
|
||||
expect(find.text('go test ./...'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('the task badge sits above Send, outside the transcript', (
|
||||
testWidgets('the task control sits inside the composer pill beside Send', (
|
||||
tester,
|
||||
) async {
|
||||
final gateway = _TasksGateway();
|
||||
@@ -622,19 +621,39 @@ void main() {
|
||||
await tester.pumpWidget(_thread(gateway));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final tasks = tester.getRect(
|
||||
find.byKey(const Key('chat-background-tasks-button')),
|
||||
);
|
||||
final list = tester.getRect(
|
||||
find.byKey(const ValueKey<String>('chat-thread-s')),
|
||||
final button = find.byKey(const Key('chat-background-tasks-button'));
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('chat-composer-pill')),
|
||||
matching: button,
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
final tasks = tester.getRect(button);
|
||||
final send = tester.getRect(find.byKey(const Key('chat-composer-primary')));
|
||||
final composer = tester.getRect(
|
||||
find.byKey(const ValueKey('chat-composer-s')),
|
||||
expect(tasks.right, lessThanOrEqualTo(send.left));
|
||||
expect(tasks.bottom, greaterThan(send.top));
|
||||
expect(tasks.top, lessThan(send.bottom));
|
||||
// Neutral, not the primary tint.
|
||||
final style = tester.widget<TextButton>(button).style!;
|
||||
final theme = Theme.of(tester.element(button));
|
||||
expect(
|
||||
style.foregroundColor!.resolve({}),
|
||||
theme.colorScheme.onSurfaceVariant,
|
||||
);
|
||||
expect(tasks.bottom, lessThanOrEqualTo(send.top));
|
||||
expect(send.center.dx, inInclusiveRange(tasks.left, tasks.right));
|
||||
expect(tasks.top, greaterThanOrEqualTo(composer.top));
|
||||
expect(list.bottom, lessThanOrEqualTo(composer.top));
|
||||
});
|
||||
|
||||
testWidgets('a conversation without tasks shows no task caption', (
|
||||
tester,
|
||||
) async {
|
||||
final gateway = _TasksGateway();
|
||||
addTearDown(gateway.close);
|
||||
|
||||
await tester.pumpWidget(_thread(gateway));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('0 tasks'), findsNothing);
|
||||
expect(find.byKey(const Key('chat-background-tasks-button')), findsNothing);
|
||||
expect(find.byKey(const Key('chat-composer-primary')), findsOneWidget);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user