Merge main (Compact) into Notebook; keep Notebook within the per-row rebuild budget

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-04 00:01:40 +00:00
99 changed files with 4390 additions and 463 deletions
@@ -0,0 +1,329 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/core/servers/server_scope.dart';
import 'package:pipelines_app/features/chat/chat_runtime.dart';
import 'package:pipelines_app/features/chat/conversation/chat_thread_view.dart';
import 'package:pipelines_app/features/chat/screen.dart';
import 'package:pipelines_app/features/chat/windows/chat_windows.dart';
import 'package:pipelines_app/features/chat/workspace/chat_pane_focus_flash.dart';
import 'package:pipelines_app/features/chat/workspace/chat_workspace.dart';
import 'package:pipelines_app/features/chat/workspace/chat_workspace_store.dart';
import 'package:pipelines_app/shell/windows/window_host.dart';
import 'package:pipelines_app/shell/windows/window_kind.dart';
import 'package:pipelines_app/shell/windows/window_manager.dart';
import 'package:pipelines_app/shell/windows/window_store.dart';
import 'package:pipelines_app/ui/input/keyboard_owner.dart';
import 'conversation/chat_thread_fixtures.dart';
const _ids = ['a', 'b', 'c', 'd'];
class _Gateway extends FakeChatGateway {
@override
Future<JsonMap> call(String type, [JsonMap fields = const {}]) {
if (type == 'chat_sessions') {
return Future.value({
'chat_sessions': [
for (final id in _ids)
{'id': id, 'title': 'Chat $id', 'directory': '/home/$id'},
],
});
}
if (type == 'chat_shells') return Future.value({'chat_shells': []});
return super.call(type, fields);
}
}
class _Store implements WindowStore {
String? value;
@override
Future<String?> read() async => value;
@override
Future<bool> write(String record) async {
value = record;
return true;
}
}
Finder _thread(String id) => find.byWidgetPredicate(
(widget) => widget is ChatThreadView && widget.sessionId == id,
skipOffstage: false,
);
Finder _input(String id) => find.descendant(
of: find.byKey(ValueKey('chat-composer-$id'), skipOffstage: false),
matching: find.byType(EditableText, skipOffstage: false),
skipOffstage: false,
);
bool _composerFocused(WidgetTester tester, String id) =>
tester.widget<EditableText>(_input(id)).focusNode.hasPrimaryFocus;
ChatWorkspaceController _workspace(WidgetTester tester) => tester
.widget<ChatWorkspace>(find.byType(ChatWorkspace, skipOffstage: false))
.controller;
/// The chats whose focus ring is showing.
List<String> _flashing(WidgetTester tester) => [
for (final id in _ids)
if (find
.descendant(
of: find.ancestor(
of: _thread(id),
matching: find.byType(ChatPaneFocusFlash),
),
matching: find.byKey(const ValueKey('chat-pane-focus-flash')),
)
.evaluate()
.isNotEmpty)
id,
];
/// Saves a horizontal layout of [ids], left to right.
void _saved(List<String> ids) {
final layout = ChatWorkspaceController()..open(ids.first);
for (final id in ids.skip(1)) {
layout.splitActive(id, ChatSplitAxis.horizontal);
}
SharedPreferences.setMockInitialValues({
scopedServerKey(chatWorkspacePreferenceKey, 'server-a'): layout
.snapshot()!
.encode(),
});
}
/// The Chat destination with its floating windows over it, and optionally a
/// terminal that takes typing.
class _App {
final gateway = _Gateway()..history = (_) async => chatPage([]);
late final ChatRuntime runtime;
late final WindowManager manager;
late final ChatWindows windows;
final terminalFocus = FocusNode(debugLabel: 'test terminal');
final terminalTyped = <LogicalKeyboardKey>[];
Future<void> start(
WidgetTester tester, {
Size size = const Size(1800, 1000),
bool terminal = false,
}) async {
tester.view.physicalSize = size;
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
bindServerIdentity(gateway, 'server-a');
runtime = ChatRuntime(gateway: gateway, serverKey: 'server-a');
manager = WindowManager(
kinds: WindowKinds(),
store: _Store(),
server: 'server-a',
);
windows = ChatWindows(
manager: manager,
runtime: runtime,
openInChat: (_) {},
)..start();
await manager.restore();
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: Stack(
fit: StackFit.expand,
children: [
ChatScreen(
gateway: gateway,
persistWorkspace: true,
runtime: runtime,
windows: windows,
),
if (terminal)
Positioned(
left: 0,
top: 0,
width: 10,
height: 10,
child: TypingSurface(
child: Focus(
focusNode: terminalFocus,
onKeyEvent: (node, event) {
if (event is KeyDownEvent) {
terminalTyped.add(event.logicalKey);
}
return KeyEventResult.handled;
},
child: const SizedBox(),
),
),
),
Positioned.fill(child: WindowHost(manager: manager)),
],
),
),
),
);
await tester.pumpAndSettle();
}
Future<void> stop(WidgetTester tester) async {
await tester.pumpWidget(const SizedBox.shrink());
windows.dispose();
runtime.dispose();
manager.dispose();
terminalFocus.dispose();
gateway.close();
}
List<String> get floating => [for (final w in windows.windows) w.contentId];
}
/// Floats [session] from its pane menu.
Future<void> _float(WidgetTester tester, String session) async {
await tester.tap(
find
.descendant(
of: _thread(session),
matching: find.byTooltip('More actions'),
)
.hitTestable(),
);
await tester.pumpAndSettle();
await tester.tap(find.text('Float (Alt+Y)').last);
await tester.pumpAndSettle();
}
/// Alt+] (or Alt+[ with [back]), leaving the focus ring mid-flash.
Future<void> _cycle(WidgetTester tester, {bool back = false}) async {
await tester.sendKeyDownEvent(LogicalKeyboardKey.altLeft);
final physical = back
? PhysicalKeyboardKey.bracketLeft
: PhysicalKeyboardKey.bracketRight;
final logical = back
? LogicalKeyboardKey.bracketLeft
: LogicalKeyboardKey.bracketRight;
await tester.sendKeyDownEvent(logical, physicalKey: physical);
await tester.sendKeyUpEvent(logical, physicalKey: physical);
await tester.sendKeyUpEvent(LogicalKeyboardKey.altLeft);
for (var i = 0; i < 3; i++) {
await tester.pump();
}
}
/// Lets the flash finish.
Future<void> _settle(WidgetTester tester) async {
await tester.pump(chatPaneFlashDuration);
await tester.pumpAndSettle();
}
void main() {
testWidgets('Alt+] and Alt+[ cycle three tiled panes and a floating '
'window, wrapping, each composer focused and its ring flashing', (
tester,
) async {
_saved(['a', 'b', 'c', 'd']);
final app = _App();
await app.start(tester);
await _float(tester, 'd');
final workspace = _workspace(tester);
expect(workspace.panes.map((p) => p.sessionId), ['a', 'b', 'c']);
expect(app.floating, ['d']);
await tester.tapAt(tester.getCenter(_input('a')));
await tester.pumpAndSettle();
expect(_composerFocused(tester, 'a'), isTrue);
// Forward: the tiles left to right, then the window, then around.
for (final id in ['b', 'c', 'd', 'a']) {
await _cycle(tester);
expect(_composerFocused(tester, id), isTrue, reason: id);
expect(_flashing(tester), [id]);
if (id != 'd') expect(workspace.activePane?.sessionId, id);
await _settle(tester);
expect(_flashing(tester), isEmpty);
}
// Back: around to the window, then the tiles right to left.
for (final id in ['d', 'c', 'b', 'a']) {
await _cycle(tester, back: true);
expect(_composerFocused(tester, id), isTrue, reason: id);
expect(_flashing(tester), [id]);
await _settle(tester);
}
// Nothing opened, closed or moved.
expect(workspace.panes.map((p) => p.sessionId), ['a', 'b', 'c']);
expect(app.floating, ['d']);
expect(tester.takeException(), isNull);
await app.stop(tester);
});
testWidgets('two tiled panes and a floating window cycle in the same order', (
tester,
) async {
_saved(['a', 'b', 'c']);
final app = _App();
await app.start(tester);
await _float(tester, 'c');
await tester.tapAt(tester.getCenter(_input('b')));
await tester.pumpAndSettle();
for (final id in ['c', 'a', 'b']) {
await _cycle(tester);
expect(_composerFocused(tester, id), isTrue, reason: id);
await _settle(tester);
}
expect(tester.takeException(), isNull);
await app.stop(tester);
});
testWidgets('with one pane on screen the keys do nothing', (tester) async {
_saved(['a']);
final app = _App();
await app.start(tester);
await tester.tapAt(tester.getCenter(_input('a')));
await tester.pumpAndSettle();
await _cycle(tester);
await _cycle(tester, back: true);
expect(_composerFocused(tester, 'a'), isTrue);
expect(_flashing(tester), isEmpty);
expect(_workspace(tester).paneCount, 1);
expect(tester.takeException(), isNull);
await app.stop(tester);
});
testWidgets('on a phone layout the keys do nothing', (tester) async {
_saved(['a', 'b']);
final app = _App();
await app.start(tester, size: const Size(400, 800));
final workspace = _workspace(tester);
final active = workspace.activePane?.sessionId;
await _cycle(tester);
await _cycle(tester);
expect(workspace.activePane?.sessionId, active);
expect(_flashing(tester), isEmpty);
expect(tester.takeException(), isNull);
await app.stop(tester);
});
testWidgets('a focused terminal keeps Alt+] and Alt+[', (tester) async {
_saved(['a', 'b']);
final app = _App();
await app.start(tester, terminal: true);
final workspace = _workspace(tester);
await tester.tapAt(tester.getCenter(_input('a')));
await tester.pumpAndSettle();
app.terminalFocus.requestFocus();
await tester.pumpAndSettle();
await _cycle(tester);
await _cycle(tester, back: true);
expect(app.terminalTyped, [
LogicalKeyboardKey.altLeft,
LogicalKeyboardKey.bracketRight,
LogicalKeyboardKey.altLeft,
LogicalKeyboardKey.bracketLeft,
]);
expect(app.terminalFocus.hasPrimaryFocus, isTrue);
expect(workspace.activePane?.sessionId, 'a');
expect(_flashing(tester), isEmpty);
expect(tester.takeException(), isNull);
await app.stop(tester);
});
}
@@ -2,21 +2,34 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/chat/conversation/chat_thread_view.dart';
import 'package:pipelines_app/features/chat/speech/speech.dart';
import 'package:pipelines_app/features/chat/ui/speech/chat_speaking_control.dart';
import 'package:pipelines_app/features/chat/ui/transcript/chat_read_aloud_button.dart';
import '../speech/fake_speech_engine.dart';
import 'chat_thread_fixtures.dart';
Widget _thread(FakeChatGateway gateway, String sessionId) => MaterialApp(
Widget _thread(
FakeChatGateway gateway,
String sessionId, {
String title = '',
bool pasteTarget = true,
}) => MaterialApp(
theme: ThemeData(platform: TargetPlatform.android),
home: Scaffold(
body: ChatThreadView(gateway: gateway, sessionId: sessionId, onBack: () {}),
body: ChatThreadView(
gateway: gateway,
sessionId: sessionId,
title: title,
pasteTarget: pasteTarget,
onBack: () {},
),
),
);
Future<(FakeSpeechEngine, SpeechController, FakeChatGateway)> _reading(
WidgetTester tester,
) async {
WidgetTester tester, {
String title = 'Alpha',
}) async {
tester.view.physicalSize = const Size(800, 1600);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
@@ -33,42 +46,78 @@ Future<(FakeSpeechEngine, SpeechController, FakeChatGateway)> _reading(
],
),
]);
await tester.pumpWidget(_thread(gateway, 's1'));
await tester.pumpWidget(_thread(gateway, 's1', title: title));
await tester.pumpAndSettle();
await tester.tap(find.byTooltip(chatReadAloudLabel));
await tester.pump();
engine.onStart!();
await tester.pump();
expect(engine.spoken, ['Hello from the agent.']);
expect(speech.messageId, startsWith(speechScopePrefix('s1')));
expect(speech.reading.value, SpeechReading(scope: 's1', title: title));
return (engine, speech, gateway);
}
void main() {
testWidgets('switching the pane to another chat stops reading', (
testWidgets('switching the pane to another chat keeps reading', (
tester,
) async {
final (engine, speech, gateway) = await _reading(tester);
await tester.pumpWidget(_thread(gateway, 's2'));
await tester.pumpWidget(_thread(gateway, 's2', title: 'Beta'));
await tester.pumpAndSettle();
expect(speech.state, SpeechState.idle);
expect(engine.calls, contains('stop'));
expect(speech.state, SpeechState.speaking);
expect(engine.calls, isNot(contains('stop')));
expect(speechReading.value?.scope, 's1');
// Back in the chat, its reply shows the reading's Pause and Stop again.
await tester.pumpWidget(_thread(gateway, 's1', title: 'Alpha'));
await tester.pumpAndSettle();
expect(find.byTooltip(chatStopReadingLabel), findsOneWidget);
expect(find.byTooltip(chatPauseReadingLabel), findsOneWidget);
});
testWidgets('closing the chat stops reading', (tester) async {
testWidgets('leaving the conversation keeps its reply reading', (
tester,
) async {
final (engine, speech, _) = await _reading(tester);
await tester.pumpWidget(const MaterialApp(home: SizedBox()));
await tester.pumpAndSettle();
expect(speech.state, SpeechState.idle);
expect(engine.calls.last, 'stop');
});
testWidgets('closing a chat leaves another chat reading', (tester) async {
final (engine, speech, _) = await _reading(tester);
await speech.read(speechMessageId('elsewhere', 'b1'), ['Other reply']);
engine.onStart!();
await tester.pumpWidget(const MaterialApp(home: SizedBox()));
await tester.pumpAndSettle();
expect(speech.state, SpeechState.speaking);
expect(speech.messageId, speechMessageId('elsewhere', 'b1'));
expect(engine.calls, isNot(contains('stop')));
});
testWidgets('another chat names the reading and its Stop ends it', (
tester,
) async {
final (engine, speech, gateway) = await _reading(tester);
expect(find.text('Speaking · Alpha'), findsOneWidget);
await tester.pumpWidget(_thread(gateway, 's2', title: 'Beta'));
await tester.pumpAndSettle();
expect(find.text('Speaking · Alpha'), findsOneWidget);
await tester.tap(find.byTooltip(chatSpeakingStopLabel));
await tester.pumpAndSettle();
expect(speech.state, SpeechState.idle);
expect(engine.calls.last, 'stop');
expect(find.byKey(const Key('chat-speaking-control')), findsNothing);
});
testWidgets('the control follows a pause and a rename', (tester) async {
final (_, speech, gateway) = await _reading(tester);
await speech.pause();
await tester.pump();
expect(find.text('Paused · Alpha'), findsOneWidget);
await tester.pumpWidget(_thread(gateway, 's1', title: 'Renamed'));
await tester.pumpAndSettle();
expect(find.text('Paused · Renamed'), findsOneWidget);
});
testWidgets('only the active pane shows the global control', (tester) async {
final (_, _, gateway) = await _reading(tester);
await tester.pumpWidget(_thread(gateway, 's2', pasteTarget: false));
await tester.pumpAndSettle();
expect(find.byKey(const Key('chat-speaking-control')), findsNothing);
});
}
@@ -143,6 +143,29 @@ void main() {
expect(speech.state, SpeechState.idle);
});
testWidgets('reading names the conversation until the reply ends', (
tester,
) async {
reader();
await speech.read(speechMessageId('chat-1', 'm1'), ['Hi'], title: 'One');
expect(
speech.reading.value,
const SpeechReading(scope: 'chat-1', title: 'One'),
);
speech.retitle('chat-2', 'Other');
expect(speech.reading.value?.title, 'One');
speech.retitle('chat-1', 'Renamed');
expect(speech.reading.value?.title, 'Renamed');
// Another reply replaces it; finishing clears it.
await speech.read(speechMessageId('chat-2', 'm1'), ['Yo'], title: 'Two');
expect(speech.reading.value?.scope, 'chat-2');
engine.onStart!();
engine.onCompletion!();
expect(speech.reading.value, isNull);
expect(speech.state, SpeechState.idle);
});
testWidgets('voice and rate are applied and persist across a reload', (
tester,
) async {
@@ -0,0 +1,78 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/chat/data/chat_repository.dart';
import 'package:pipelines_app/features/chat/speech/speech.dart';
import 'package:pipelines_app/features/chat/ui/sessions/chat_sessions_controller.dart';
import '../../speech/fake_speech_engine.dart';
import 'chat_test_harness.dart';
import 'fake_chat_gateway.dart';
JsonMap _row(String id, {bool closed = false}) => {
'id': id,
'title': id,
'directory': '/w',
if (closed) 'closed_at': '2026-12-03T10:00:00Z',
};
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
late FakeChatGateway gateway;
late ChatSessionsController controller;
late SpeechController speech;
setUp(() async {
speech = installFakeSpeech(FakeSpeechEngine());
gateway = FakeChatGateway()
..sessionsReply = {
'chat_sessions': [_row('s1'), _row('s2')],
}
..actionHandler = (_, _) async => const {};
controller = ChatSessionsController(
ChatRepository(gateway),
localStore: MemoryChatSessionLocalStore(),
);
addTearDown(controller.dispose);
await controller.refresh();
await speech.read(speechMessageId('s1', 'r1'), ['Hello.']);
expect(speech.state, SpeechState.speaking);
});
test('closing the reading chat stops it', () async {
await controller.close('s1');
await pumpEventQueue();
expect(speech.state, SpeechState.idle);
});
test('closing another chat keeps reading', () async {
await controller.close('s2');
await pumpEventQueue();
expect(speech.state, SpeechState.speaking);
});
test('a chat closed on another device stops it on the next read', () async {
gateway.sessionsReply = {
'chat_sessions': [_row('s1', closed: true), _row('s2')],
};
await controller.refresh();
await pumpEventQueue();
expect(speech.state, SpeechState.idle);
});
test('a deleted chat stops it; a failed read does not', () async {
gateway.sessionsHandler = () async => throw StateError('offline');
await controller.refresh();
await pumpEventQueue();
expect(speech.state, SpeechState.speaking);
gateway
..sessionsHandler = null
..sessionsReply = {
'chat_sessions': [_row('s2')],
};
await controller.refresh();
await pumpEventQueue();
expect(speech.state, SpeechState.idle);
});
}
@@ -0,0 +1,104 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/chat/speech/speech.dart';
import 'package:pipelines_app/features/chat/ui/sessions/chat_awaiting.dart';
import 'package:pipelines_app/features/chat/ui/sessions/chat_compact_avatar.dart';
import 'package:pipelines_app/features/chat/ui/sessions/session_row_content.dart';
import '../../speech/fake_speech_engine.dart';
const _speaking = Key('chat-row-speaking');
Widget _avatars({bool reduceMotion = false}) => MaterialApp(
home: MediaQuery(
data: MediaQueryData(disableAnimations: reduceMotion),
child: const Scaffold(
body: Column(
children: [
ChatSessionAvatar(
key: Key('one'),
session: {'id': 's1', 'title': 'One'},
running: true,
awaitingOperator: 2,
),
ChatSessionAvatar(
key: Key('two'),
session: {'id': 's2', 'title': 'Two'},
),
ChatCompactAvatar(
key: Key('two-compact'),
sessionId: 's2',
title: 'Two',
color: Colors.blue,
active: false,
visible: false,
running: false,
backgroundTasks: 0,
unread: false,
),
],
),
),
),
);
Finder _badgeOf(String avatar) => find.descendant(
of: find.byKey(Key(avatar)),
matching: find.byKey(_speaking),
);
Future<void> _read(WidgetTester tester, SpeechController speech, String chat) =>
tester.runAsync(() => speech.read(speechMessageId(chat, 'r1'), ['Hi.']));
void main() {
testWidgets('the reading chat wears the speaking badge, and it moves', (
tester,
) async {
final speech = installFakeSpeech(FakeSpeechEngine());
await tester.pumpWidget(_avatars());
expect(find.byKey(_speaking), findsNothing);
await _read(tester, speech, 's1');
await tester.pump();
expect(_badgeOf('one'), findsOneWidget);
expect(_badgeOf('two'), findsNothing);
expect(_badgeOf('two-compact'), findsNothing);
// Speaking outranks the operator wait and the running spinner.
expect(find.byKey(const Key('chat-row-working')), findsNothing);
expect(find.byType(ChatAwaitingBadge), findsNothing);
await _read(tester, speech, 's2');
await tester.pump();
expect(_badgeOf('one'), findsNothing);
expect(_badgeOf('two'), findsOneWidget);
expect(_badgeOf('two-compact'), findsOneWidget);
expect(find.byKey(const Key('chat-speaking-wave')), findsNWidgets(2));
await tester.runAsync(speech.stop);
await tester.pump();
expect(find.byKey(_speaking), findsNothing);
});
testWidgets('a Settings voice sample marks no chat', (tester) async {
final speech = installFakeSpeech(FakeSpeechEngine());
await tester.pumpWidget(_avatars());
await tester.runAsync(speech.sample);
await tester.pump();
expect(speech.state, SpeechState.speaking);
expect(find.byKey(_speaking), findsNothing);
});
testWidgets('reduced motion shows a still speaker', (tester) async {
final speech = installFakeSpeech(FakeSpeechEngine());
await tester.pumpWidget(_avatars(reduceMotion: true));
// The first chat's spinner gives way to the speaking badge.
await _read(tester, speech, 's1');
await tester.pump();
expect(_badgeOf('one'), findsOneWidget);
expect(find.byKey(const Key('chat-speaking-still')), findsOneWidget);
expect(find.byKey(const Key('chat-speaking-wave')), findsNothing);
// Nothing ticks: settling finishes with the badge still shown.
await tester.pumpAndSettle();
expect(_badgeOf('one'), findsOneWidget);
});
}
@@ -168,7 +168,7 @@ void main() {
// Collapsed: the first lines of the output, "+N lines", the duration and
// the status on the right.
expect(find.byKey(const Key('chat-notebook-tool-preview')), findsWidgets);
expect(find.text('+2 lines'), findsOneWidget);
expect(find.text('+4 lines'), findsOneWidget);
expect(find.text('1.2s'), findsNWidgets(2));
expect(find.byKey(const Key('chat-notebook-tool-output')), findsNothing);
expect(find.textContaining('PASS'), findsNothing);
@@ -177,7 +177,7 @@ void main() {
await tester.pump();
expect(find.byKey(const Key('chat-notebook-tool-output')), findsOneWidget);
expect(find.textContaining('PASS'), findsOneWidget);
expect(find.text('+2 lines'), findsNothing);
expect(find.text('+4 lines'), findsNothing);
await tester.tap(find.byKey(const Key('chat-notebook-tool-header')).first);
await tester.pump();
@@ -0,0 +1,122 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/chat/workspace/chat_pane_cycle.dart';
KeyEvent _down(
PhysicalKeyboardKey physical,
LogicalKeyboardKey logical, {
String? character,
}) => KeyDownEvent(
physicalKey: physical,
logicalKey: logical,
character: character,
timeStamp: Duration.zero,
);
final _right = _down(
PhysicalKeyboardKey.bracketRight,
LogicalKeyboardKey.bracketRight,
);
final _left = _down(
PhysicalKeyboardKey.bracketLeft,
LogicalKeyboardKey.bracketLeft,
);
int? _step(
KeyEvent event,
Set<LogicalKeyboardKey> held, [
TargetPlatform platform = TargetPlatform.linux,
]) => chatPaneCycleShortcut(event, _FakeKeyboard(held), platform: platform);
void main() {
test('Alt+] goes forward and Alt+[ back on every platform', () {
for (final platform in TargetPlatform.values) {
expect(_step(_right, {LogicalKeyboardKey.altLeft}, platform), 1);
expect(_step(_left, {LogicalKeyboardKey.altLeft}, platform), -1);
}
});
test('Option+] types a quote on a Mac: it matches by key position', () {
final quote = _down(
PhysicalKeyboardKey.bracketRight,
const LogicalKeyboardKey(0x2018),
character: '‘',
);
expect(_step(quote, {LogicalKeyboardKey.altLeft}, TargetPlatform.macOS), 1);
});
test('Cmd+] and Cmd+[ only on Apple platforms', () {
expect(
_step(_right, {LogicalKeyboardKey.metaLeft}, TargetPlatform.macOS),
1,
);
expect(_step(_left, {LogicalKeyboardKey.metaLeft}, TargetPlatform.iOS), -1);
expect(_step(_right, {LogicalKeyboardKey.metaLeft}), isNull);
expect(
_step(_right, {LogicalKeyboardKey.metaLeft}, TargetPlatform.windows),
isNull,
);
});
test('plain brackets type; Shift, Ctrl, AltGr and key-up do not match', () {
expect(_step(_right, {}), isNull);
for (final extra in [
LogicalKeyboardKey.shiftLeft,
LogicalKeyboardKey.controlLeft,
LogicalKeyboardKey.metaLeft,
LogicalKeyboardKey.altGraph,
]) {
expect(
_step(_right, {LogicalKeyboardKey.altLeft, extra}),
isNull,
reason: '$extra',
);
}
expect(
_step(
const KeyUpEvent(
physicalKey: PhysicalKeyboardKey.bracketRight,
logicalKey: LogicalKeyboardKey.bracketRight,
timeStamp: Duration.zero,
),
{LogicalKeyboardKey.altLeft},
),
isNull,
);
// A key typing "[" elsewhere on the keyboard is not the chord.
expect(
_step(_down(PhysicalKeyboardKey.digit8, LogicalKeyboardKey.bracketLeft), {
LogicalKeyboardKey.altLeft,
}),
isNull,
);
});
test('labels name the chords this platform answers', () {
expect(chatPaneCycleShortcutLabel(TargetPlatform.linux), 'Alt+], Alt+[');
expect(chatPaneCycleShortcutLabel(TargetPlatform.windows), 'Alt+], Alt+[');
expect(
chatPaneCycleShortcutLabel(TargetPlatform.macOS),
'Option+], Option+[, Cmd+], Cmd+[',
);
});
test('targets wrap both ways; one entry or none has no target', () {
const order = ['a', 'b', 'c'];
expect(chatPaneCycleTarget(order, 0, 1), 'b');
expect(chatPaneCycleTarget(order, 2, 1), 'a');
expect(chatPaneCycleTarget(order, 0, -1), 'c');
expect(chatPaneCycleTarget(order, 1, -1), 'a');
expect(chatPaneCycleTarget(order, -1, 1), 'a');
expect(chatPaneCycleTarget(order, -1, -1), 'c');
expect(chatPaneCycleTarget(['a'], 0, 1), isNull);
expect(chatPaneCycleTarget(<String>[], -1, 1), isNull);
});
}
class _FakeKeyboard extends HardwareKeyboard {
_FakeKeyboard(this.pressed);
final Set<LogicalKeyboardKey> pressed;
@override
bool isLogicalKeyPressed(LogicalKeyboardKey key) => pressed.contains(key);
}
@@ -24,8 +24,13 @@ void main() {
});
test('scattered letters in a long note do not match', () {
// `float` occurs only as scattered letters in other entries' notes.
expect(actions('float'), everyElement(contains('floating')));
// `float` occurs as scattered letters in many entries' notes; only the
// entries that say "floating" match.
final found = [
for (final match in filterShortcuts(registry.entries, 'float'))
'${match.entry.action} ${match.entry.caveat ?? ''}',
];
expect(found, everyElement(contains('floating')));
});
test('keys are searchable with or without the plus', () {
@@ -117,4 +117,40 @@ void main() {
await next.restore();
expect(next.design, AppDesign.paper);
});
testWidgets('choosing Compact stores it, densifies the page live, draws '
'a denser swatch and is restored on the next launch', (tester) async {
final store = MemoryAppDesignStore();
final designs = AppDesignController(store: store);
await _pump(tester, designs);
final swatch = tester.widget<DesignSwatchPreview>(
find.descendant(
of: find.byKey(settingsDesignKey(AppDesign.compact)),
matching: find.byType(DesignSwatchPreview),
),
);
expect(swatch.lines, greaterThan(2));
expect(find.text(AppDesign.compact.description), findsOneWidget);
final before = tester.getSize(
find.byKey(settingsDesignKey(AppDesign.paper)),
);
await tester.tap(find.text(AppDesign.compact.label));
await tester.pumpAndSettle();
expect(store.id, 'compact');
expect(designs.design, AppDesign.compact);
final tokens = _tokens(tester);
expect(tokens.density.dense, isTrue);
expect(tokens.transcript, TranscriptStyle.bubbles);
// The rows themselves tighten at once.
final after = tester.getSize(
find.byKey(settingsDesignKey(AppDesign.paper)),
);
expect(after.height, lessThan(before.height));
final next = AppDesignController(store: MemoryAppDesignStore(store.id));
await next.restore();
expect(next.design, AppDesign.compact);
});
}
+8 -1
View File
@@ -257,6 +257,13 @@ void main() {
row['scrollFrameUs'] = watch.elapsedMicroseconds ~/ frames;
rebuilds.uninstall();
row['scrollRebuildsPerFrame'] = rebuilds.count / frames;
// A denser design shows more rows in the same 120px, so it builds
// more per frame for the same per-row cost: the budget is per row
// scrolled past (rows over the transcript's whole extent).
final position = controller.position;
final extent = position.maxScrollExtent + position.viewportDimension;
final rowsScrolled = frames * 120 * _rows.length / extent;
row['scrollRebuildsPerRow'] = rebuilds.count / rowsScrolled;
row['scrollLayersPerFrame'] = _sum(layers) / frames;
row['scrollSaveLayersPerFrame'] =
_sum(layers, (k) => !k.startsWith('clip')) / frames;
@@ -277,7 +284,7 @@ void main() {
// Counts are deterministic: a design may not exceed Default's by more
// than a quarter (its own rows are allowed to differ a little).
for (final key in [
'scrollRebuildsPerFrame',
'scrollRebuildsPerRow',
'scrollLayersPerFrame',
'scrollSaveLayersPerFrame',
'switchFramesPerSwitch',
@@ -265,6 +265,7 @@ void main() {
(AppDesign.standard, false, true),
(AppDesign.terminal, true, false),
(AppDesign.paper, false, false),
(AppDesign.compact, false, true),
]) {
testWidgets('${design.label}: the open row is clearly marked', (
tester,
+199
View File
@@ -0,0 +1,199 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/ui/theme/app_design.dart';
import 'package:pipelines_app/ui/theme/app_design_controller.dart';
import 'package:pipelines_app/ui/theme/app_design_tokens.dart';
import 'package:pipelines_app/ui/theme/app_theme.dart';
ThemeData _theme(AppDesign design, Brightness brightness, {String? font}) =>
brightness == Brightness.dark
? design.dark(fontFamily: font)
: design.light(fontFamily: font);
BorderRadius? _radiusOf(ShapeBorder? shape) =>
(shape as RoundedRectangleBorder?)?.borderRadius as BorderRadius?;
void main() {
const six = BorderRadius.all(Radius.circular(6));
test('Compact is listed with a stable id, a label and one line', () {
expect(AppDesign.fromId('compact'), AppDesign.compact);
expect(AppDesign.compact.label, 'Compact');
expect(AppDesign.compact.description, isNot(contains('\n')));
expect(AppDesign.compact.usesInterfaceFont, isTrue);
expect(AppDesign.compact.swatchLines, greaterThan(2));
for (final design in AppDesign.values) {
if (design != AppDesign.compact) expect(design.swatchLines, 2);
}
});
test('Compact tokens: Default chat and composer, tonal rows, 6px corners, '
'the compact density and tighter paragraphs', () {
for (final brightness in Brightness.values) {
final tokens = _theme(
AppDesign.compact,
brightness,
).extension<AppDesignTokens>()!;
expect(tokens.design, AppDesign.compact);
expect(tokens.radius, 6);
expect(tokens.flat, isFalse);
expect(tokens.frame, isNull);
expect(tokens.transcript, TranscriptStyle.bubbles);
expect(tokens.composer, ComposerStyle.pill);
expect(tokens.selectedRow, SelectedRowStyle.tonal);
expect(tokens.density, DesignDensity.compact);
expect(tokens.density.dense, isTrue);
expect(tokens.density.iconSize, 18);
expect(tokens.density.railLabels, isFalse);
expect(tokens.density.railWidth, lessThan(96));
expect(tokens.reading.family, isNull);
expect(tokens.reading.paragraphGap, lessThan(0.9));
expect(tokens.denseCorners(BorderRadius.circular(12)), six);
}
});
test('the comfortable designs keep the comfortable density', () {
for (final design in [AppDesign.terminal, AppDesign.paper]) {
final tokens = design.light().extension<AppDesignTokens>()!;
expect(tokens.density, DesignDensity.comfortable);
expect(tokens.reading.paragraphGap, 0.9);
final twelve = BorderRadius.circular(12);
expect(tokens.denseCorners(twelve), twelve);
}
expect(AppDesignTokens.standard.density, DesignDensity.comfortable);
// Default still builds its exact themes, with no tokens at all.
expect(AppDesign.standard.light(), appLightTheme());
expect(AppDesign.standard.dark(), appDarkTheme());
});
test('density spacing: unchanged when comfortable, 4px grid when dense', () {
const comfortable = DesignDensity.comfortable;
for (final value in [2.0, 4.0, 6.0, 10.0, 13.0, 16.0, 24.0]) {
expect(comfortable.space(value), value);
expect(comfortable.inset(value), value);
}
expect(comfortable.minTouchRow, 0);
const compact = DesignDensity.compact;
expect(compact.space(16), 8);
expect(compact.space(13), 8);
expect(compact.space(12), 8);
expect(compact.space(8), 4);
expect(compact.space(6), 4);
expect(compact.space(4), 2);
expect(compact.space(24), 16);
expect(compact.inset(16), 12);
expect(compact.inset(12), 8);
for (final value in [8.0, 12.0, 16.0, 24.0, 32.0]) {
expect(compact.space(value) % 4, 0, reason: 'on the 4px grid');
expect(compact.space(value), lessThan(value));
}
});
test('Compact keeps Default colours and packs type, icons and density', () {
for (final brightness in Brightness.values) {
final theme = _theme(AppDesign.compact, brightness, font: 'Inter');
final standard = _theme(AppDesign.standard, brightness, font: 'Inter');
expect(theme.colorScheme, standard.colorScheme);
expect(theme.scaffoldBackgroundColor, standard.scaffoldBackgroundColor);
final text = theme.textTheme;
expect(text.bodyMedium?.fontSize, 13);
expect(text.bodyLarge?.fontSize, 14);
expect(text.labelMedium?.fontSize, 12);
expect(text.labelSmall?.fontSize, 11);
expect(text.titleMedium?.fontSize, 14);
for (final style in [text.bodyMedium, text.titleLarge, text.labelLarge]) {
// The device's interface font still applies.
expect(style?.fontFamily, 'Inter');
expect(style?.fontSize, lessThan(20));
// Line heights on a 2px step.
expect((style!.fontSize! * style.height!) % 2, closeTo(0, 0.01));
}
expect(theme.visualDensity, VisualDensity.compact);
expect(theme.iconTheme.size, 18);
expect(
theme.iconButtonTheme.style?.visualDensity,
VisualDensity.compact,
reason: 'Material 3 icon buttons ignore the theme density otherwise',
);
}
});
test('every floating and framed surface takes the same 6px corners', () {
final theme = AppDesign.compact.light();
expect(_radiusOf(theme.dialogTheme.shape), six);
expect(_radiusOf(theme.popupMenuTheme.shape), six);
expect(_radiusOf(theme.snackBarTheme.shape), six);
expect(_radiusOf(theme.cardTheme.shape), six);
expect(_radiusOf(theme.chipTheme.shape), six);
expect(_radiusOf(theme.floatingActionButtonTheme.shape), six);
expect(_radiusOf(theme.listTileTheme.shape), six);
expect(_radiusOf(theme.navigationRailTheme.indicatorShape), six);
expect(_radiusOf(theme.menuTheme.style?.shape?.resolve(const {})), six);
expect(
_radiusOf(theme.filledButtonTheme.style?.shape?.resolve(const {})),
six,
);
expect(
_radiusOf(theme.iconButtonTheme.style?.shape?.resolve(const {})),
six,
);
expect(
(theme.tooltipTheme.decoration as BoxDecoration?)?.borderRadius,
six,
);
final sheet = _radiusOf(theme.bottomSheetTheme.shape)!;
expect(sheet.topLeft, const Radius.circular(6));
expect(sheet.bottomLeft, Radius.zero);
// A card keeps its outline under the theme's shape (outlined graph
// nodes would otherwise lose it).
final card = theme.cardTheme.shape! as RoundedRectangleBorder;
expect(card.side.color, theme.colorScheme.outlineVariant);
});
test('pointer devices shrink targets; touch devices keep 40px', () {
for (final (platform, pointer) in [
(TargetPlatform.linux, true),
(TargetPlatform.macOS, true),
(TargetPlatform.windows, true),
(TargetPlatform.android, false),
(TargetPlatform.iOS, false),
]) {
debugDefaultTargetPlatformOverride = platform;
// Built afresh: the cached theme is the device's, built once.
final theme = AppDesign.compact.build(Brightness.light);
expect(
theme.materialTapTargetSize,
pointer
? MaterialTapTargetSize.shrinkWrap
: MaterialTapTargetSize.padded,
);
expect(DesignDensity.compact.minTouchRow, pointer ? 0 : 40);
}
debugDefaultTargetPlatformOverride = null;
});
test(
'a switch into or out of Compact snaps; others keep the blend',
() async {
final designs = AppDesignController(store: MemoryAppDesignStore());
expect(AppDesign.compact.dense, isTrue);
for (final design in [
AppDesign.standard,
AppDesign.terminal,
AppDesign.paper,
]) {
expect(design.dense, isFalse);
}
expect(designs.themeAnimationDuration, kThemeAnimationDuration);
await designs.select(AppDesign.terminal);
expect(designs.themeAnimationDuration, kThemeAnimationDuration);
await designs.select(AppDesign.compact);
expect(designs.themeAnimationDuration, Duration.zero);
await designs.select(AppDesign.paper);
expect(designs.themeAnimationDuration, Duration.zero);
await designs.select(AppDesign.standard);
expect(designs.themeAnimationDuration, kThemeAnimationDuration);
},
);
}
@@ -0,0 +1,232 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/chat/ui/transcript/chat_message_bubble.dart';
import 'package:pipelines_app/shell/destination.dart';
import 'package:pipelines_app/shell/navigation_rail.dart';
import 'package:pipelines_app/shell/windows/window_frame.dart';
import 'package:pipelines_app/ui/layout/app_list_avatar.dart';
import 'package:pipelines_app/ui/layout/app_list_row.dart';
import 'package:pipelines_app/ui/theme/app_design.dart';
import 'package:pipelines_app/ui/theme/app_design_tokens.dart';
/// Compact as drawn: thin rows, a narrow icon-only rail, 32px icon buttons
/// (40px targets on touch), tight bubbles, a slim window title bar, and no
/// clipping at a large text scale.
void main() {
tearDown(() => debugDefaultTargetPlatformOverride = null);
Future<void> pump(
WidgetTester tester,
Widget child, {
AppDesign design = AppDesign.compact,
double textScale = 1,
double width = 560,
}) async {
tester.view.physicalSize = Size(width, 900);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
await tester.pumpWidget(
MaterialApp(
// Built afresh, so the platform this test sets is the theme's.
theme: design.build(Brightness.light),
home: MediaQuery(
data: MediaQueryData(
size: Size(width, 900),
textScaler: TextScaler.linear(textScale),
),
child: Scaffold(body: child),
),
),
);
await tester.pumpAndSettle();
}
Widget rows() => ListView(
children: [
AppListRow(
key: const Key('one'),
title: const Text('Release train'),
time: '09:12',
onTap: () {},
),
AppListRow(
key: const Key('two'),
leading: AppListAvatar.initial('Release', color: Colors.teal),
title: const Text('Release notes'),
subtitle: const Text('claude-opus · /workspace/demo'),
time: '10m',
selected: true,
onTap: () {},
),
],
);
testWidgets('pointer: a 36px single-line row and a ~52px two-line row', (
tester,
) async {
debugDefaultTargetPlatformOverride = TargetPlatform.linux;
await pump(tester, rows());
// Each row includes its 1px divider.
expect(tester.getSize(find.byKey(const Key('one'))).height, 37);
final two = tester.getSize(find.byKey(const Key('two'))).height;
expect(two, inInclusiveRange(50, 56));
expect(
tester.getSize(find.byType(AppListAvatar)).height,
DesignDensity.compact.avatarSize,
);
debugDefaultTargetPlatformOverride = null;
});
testWidgets('touch: rows keep a 40px target', (tester) async {
debugDefaultTargetPlatformOverride = TargetPlatform.android;
await pump(tester, rows());
expect(
tester.getSize(find.byKey(const Key('one'))).height,
greaterThanOrEqualTo(41),
);
debugDefaultTargetPlatformOverride = null;
});
testWidgets('Default rows keep their comfortable size', (tester) async {
await pump(tester, rows(), design: AppDesign.standard);
expect(
tester.getSize(find.byKey(const Key('one'))).height,
greaterThan(48),
);
expect(
tester.getSize(find.byType(AppListAvatar)).height,
kAppListAvatarSize,
);
});
testWidgets('rows and bubbles do not clip at 2x text', (tester) async {
debugDefaultTargetPlatformOverride = TargetPlatform.linux;
await pump(
tester,
Column(
children: [
SizedBox(height: 300, child: rows()),
const ChatUserBubble(child: Text('Summarise the release notes.')),
],
),
textScale: 2,
width: 360,
);
expect(tester.takeException(), isNull);
final one = tester.getSize(find.byKey(const Key('one'))).height;
expect(one, greaterThan(37), reason: 'the row grows with its text');
debugDefaultTargetPlatformOverride = null;
});
testWidgets('icon buttons: 32px on a pointer device, 40px target on touch', (
tester,
) async {
Widget button() => IconButton(
key: const Key('b'),
onPressed: () {},
icon: const Icon(Icons.add),
);
debugDefaultTargetPlatformOverride = TargetPlatform.linux;
await pump(tester, Center(child: button()));
expect(tester.getSize(find.byKey(const Key('b'))), const Size(32, 32));
debugDefaultTargetPlatformOverride = TargetPlatform.android;
await pump(tester, Center(child: button()));
expect(tester.getSize(find.byKey(const Key('b'))), const Size(40, 40));
debugDefaultTargetPlatformOverride = null;
});
testWidgets('the rail is narrow and icon-only, each icon with a tooltip', (
tester,
) async {
await pump(
tester,
Row(
children: [
ShellNavigationRail(
selected: AppDestination.runs,
icon: (d) => Icon(destinationDetails(d).icon),
onSelected: (_) {},
),
const Expanded(child: SizedBox()),
],
),
width: 1200,
);
final rail = find.byKey(const ValueKey('shell.navigation-rail.surface'));
expect(tester.getSize(rail).width, DesignDensity.compact.railWidth);
expect(
tester.widget<NavigationRail>(find.byType(NavigationRail)).labelType,
NavigationRailLabelType.none,
);
for (final destination in shellTabDestinations) {
expect(
find.byTooltip(destinationDetails(destination).label),
findsOneWidget,
);
}
expect(find.byTooltip('Settings'), findsOneWidget);
// Settings' indicator matches the tabs' 56x32 rather than the rail.
final indicator = find.descendant(
of: find.byKey(const ValueKey('shell.destination.settings')),
matching: find.byType(Container),
);
expect(tester.getSize(indicator.first), const Size(56, 32));
});
testWidgets('the operator bubble is tight, in the design corners', (
tester,
) async {
await pump(tester, const ChatUserBubble(child: Text('Ship it')));
final material = tester.widget<Material>(
find.descendant(
of: find.byType(ChatUserBubble),
matching: find.byType(Material),
),
);
final shape = material.shape! as RoundedRectangleBorder;
expect(shape.borderRadius, BorderRadius.circular(6));
final padding = tester.widget<Padding>(
find.descendant(
of: find.byType(ChatUserBubble),
matching: find.byType(Padding),
),
);
expect(
padding.padding,
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
);
final gap = chatParagraphGap(tester.element(find.text('Ship it')), 14);
expect(gap, closeTo(14 * 0.6, 0.01));
});
testWidgets('a floating window has a 32px title bar and 6px corners', (
tester,
) async {
late BuildContext context;
await pump(
tester,
Builder(
builder: (c) {
context = c;
return const SizedBox();
},
),
);
expect(windowTitleBarHeight(context), 32);
expect(windowCorners(context), BorderRadius.circular(6));
await pump(
tester,
Builder(
builder: (c) {
context = c;
return const SizedBox();
},
),
design: AppDesign.paper,
);
expect(windowTitleBarHeight(context), 40);
expect(windowCorners(context), BorderRadius.circular(windowCornerRadius));
});
}
+122
View File
@@ -0,0 +1,122 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/chat/domain/chat_transcript.dart';
import 'package:pipelines_app/features/chat/ui/transcript/chat_message_view.dart';
import 'package:pipelines_app/ui/theme/app_design.dart';
final _rows = transcriptRows([
for (var i = 0; i < 6; i++) ...[
{
'id': 'u$i',
'role': 'user',
'parts': [
{'type': 'text', 'text': 'Step $i'},
],
},
{
'id': 'a$i',
'role': 'assistant',
'parts': [
{
'type': 'tool',
'id': 't$i',
'name': 'Bash',
'state': {
'status': 'completed',
'input': {'command': 'go test'},
},
},
{'type': 'text', 'text': 'Fixed `x`.\n\n- one\n\n```go\nreturn 1\n```'},
],
},
],
]);
/// A live design switch to and from Compact animates the theme without an
/// error in any frame. A component theme that set a text-theme style failed
/// to lerp against Default's unset one, and in the browser the broken
/// frames stopped the app drawing.
void main() {
testWidgets('switching to and from Compact lerps every frame cleanly', (
tester,
) async {
debugDefaultTargetPlatformOverride = TargetPlatform.linux;
final design = ValueNotifier(AppDesign.compact);
await tester.pumpWidget(
ValueListenableBuilder<AppDesign>(
valueListenable: design,
builder: (_, d, _) => MaterialApp(
theme: d.dark(),
darkTheme: d.dark(),
home: Scaffold(
floatingActionButton: FloatingActionButton.extended(
onPressed: () {},
icon: const Icon(Icons.add),
label: const Text('New run'),
),
body: Row(
children: [
NavigationRail(
destinations: const [
NavigationRailDestination(
icon: Icon(Icons.add),
label: Text('a'),
),
NavigationRailDestination(
icon: Icon(Icons.add),
label: Text('b'),
),
],
selectedIndex: 0,
),
Expanded(
child: ListView(
children: [
IconButton(onPressed: () {}, icon: const Icon(Icons.add)),
IconButton.filled(
onPressed: () {},
icon: const Icon(Icons.add),
),
Checkbox(value: true, onChanged: (_) {}),
Switch(value: true, onChanged: (_) {}),
const ListTile(title: Text('t'), subtitle: Text('s')),
const TextField(),
Chip(label: const Text('c'), onDeleted: () {}),
SegmentedButton<int>(
segments: const [
ButtonSegment(value: 1, label: Text('one')),
ButtonSegment(value: 2, label: Text('two')),
],
selected: const {1},
),
for (final row in _rows) ChatMessageView(row: row),
],
),
),
],
),
),
),
),
);
await tester.pumpAndSettle();
for (var round = 0; round < 3; round++) {
for (final other in [
AppDesign.standard,
AppDesign.terminal,
AppDesign.paper,
AppDesign.notebook,
AppDesign.compact,
]) {
design.value = other;
for (var f = 0; f < 20; f++) {
await tester.pump(const Duration(milliseconds: 16));
final e = tester.takeException();
if (e != null) fail('to ${other.id} frame $f: $e');
}
}
}
debugDefaultTargetPlatformOverride = null;
});
}