diff --git a/app/lib/features/chat/conversation/chat_background_tasks.dart b/app/lib/features/chat/conversation/chat_background_tasks.dart index 8bc8f18f..8097d308 100644 --- a/app/lib/features/chat/conversation/chat_background_tasks.dart +++ b/app/lib/features/chat/conversation/chat_background_tasks.dart @@ -202,7 +202,7 @@ class _ChatBackgroundTasksState extends State { // Level with the field's single line, beside Send. padding: const EdgeInsetsDirectional.only(end: 4, bottom: 4), child: Semantics( - identifier: 'chat-background-tasks-button', + identifier: 'chat-background-tasks-button', button: true, excludeSemantics: true, onTap: _open, diff --git a/app/lib/features/chat/workspace/chat_workspace_geometry.dart b/app/lib/features/chat/workspace/chat_workspace_geometry.dart index 0724cad8..3900ff44 100644 --- a/app/lib/features/chat/workspace/chat_workspace_geometry.dart +++ b/app/lib/features/chat/workspace/chat_workspace_geometry.dart @@ -142,10 +142,8 @@ class ChatWorkspaceGeometry { }; if (gap < -slack || gap > chatPaneDividerExtent + slack) continue; final overlap = horizontal - ? math.min(origin.bottom, rect.bottom) - - math.max(origin.top, rect.top) - : math.min(origin.right, rect.right) - - math.max(origin.left, rect.left); + ? math.min(origin.bottom, rect.bottom) - math.max(origin.top, rect.top) + : math.min(origin.right, rect.right) - math.max(origin.left, rect.left); if (overlap <= slack) continue; final centred = horizontal ? rect.top <= centre && centre < rect.bottom diff --git a/app/test/features/chat/chat_pane_move_test.dart b/app/test/features/chat/chat_pane_move_test.dart index 10a0fcee..c5ae8e8a 100644 --- a/app/test/features/chat/chat_pane_move_test.dart +++ b/app/test/features/chat/chat_pane_move_test.dart @@ -82,10 +82,7 @@ Future _openMenu(WidgetTester tester, String session) async { MenuItemButton _item(WidgetTester tester, String label) => tester.widget( - find.ancestor( - of: find.text(label), - matching: find.byType(MenuItemButton), - ), + find.ancestor(of: find.text(label), matching: find.byType(MenuItemButton)), ); ChatWorkspaceController _controller(WidgetTester tester) => @@ -208,9 +205,7 @@ void main() { final gateway = _Gateway()..history = (_) async => chatPage([]); addTearDown(gateway.close); await tester.pumpWidget( - MaterialApp( - home: Scaffold(body: ChatScreen(gateway: gateway)), - ), + MaterialApp(home: Scaffold(body: ChatScreen(gateway: gateway))), ); await tester.pumpAndSettle(); await tester.tap(find.text('Chat a').first); diff --git a/app/test/features/chat/conversation/chat_bar_tint_test.dart b/app/test/features/chat/conversation/chat_bar_tint_test.dart index d2c8a974..8ac9ca46 100644 --- a/app/test/features/chat/conversation/chat_bar_tint_test.dart +++ b/app/test/features/chat/conversation/chat_bar_tint_test.dart @@ -244,6 +244,9 @@ void main() { isSameColorAs(tint.foreground), ); // Outside the bar the theme's tint is untouched. - expect(CupertinoTheme.of(context).primaryColor, isNot(tint.foreground)); + expect( + CupertinoTheme.of(context).primaryColor, + isNot(tint.foreground), + ); }); } diff --git a/app/test/features/chat/files/files_panel_mutations_test.dart b/app/test/features/chat/files/files_panel_mutations_test.dart index 4cc53905..df1bbe9a 100644 --- a/app/test/features/chat/files/files_panel_mutations_test.dart +++ b/app/test/features/chat/files/files_panel_mutations_test.dart @@ -271,20 +271,19 @@ void main() { expect(mounted.gateway.listings, 2); }); - testWidgets( - 'A refused move is shown in the server\'s words until dismissed', - (tester) async { - final mounted = await pump(tester); - const refusal = '$shown/docs/notes.txt already exists'; - mounted.gateway.refusals['move_path'] = refusal; - await dragOnto(tester, 'notes.txt', 'docs'); - expect(find.text(refusal), findsOneWidget); - expect(mounted.gateway.listings, 2, reason: 'reloaded all the same'); - await tester.tap(find.text('Dismiss')); - await tester.pumpAndSettle(); - expect(find.text(refusal), findsNothing); - }, - ); + testWidgets('A refused move is shown in the server\'s words until dismissed', ( + tester, + ) async { + final mounted = await pump(tester); + const refusal = '$shown/docs/notes.txt already exists'; + mounted.gateway.refusals['move_path'] = refusal; + await dragOnto(tester, 'notes.txt', 'docs'); + expect(find.text(refusal), findsOneWidget); + expect(mounted.gateway.listings, 2, reason: 'reloaded all the same'); + await tester.tap(find.text('Dismiss')); + await tester.pumpAndSettle(); + expect(find.text(refusal), findsNothing); + }); test('canDropEntryOn refuses files, itself and its own subtree', () { const docs = DirectoryEntry( diff --git a/app/test/features/chat/ui/sessions/session_attention_test.dart b/app/test/features/chat/ui/sessions/session_attention_test.dart index bedc1e14..ce79e2fb 100644 --- a/app/test/features/chat/ui/sessions/session_attention_test.dart +++ b/app/test/features/chat/ui/sessions/session_attention_test.dart @@ -39,10 +39,11 @@ void main() { }); test('only visible assistant reply text is unread', () { - bool attention(Map event) => chatSessionFrameEffect({ - 'type': 'chat_event', - 'chat_event': {'session_id': 's', ...event}, - })!.attention; + bool attention(Map event) => + chatSessionFrameEffect({ + 'type': 'chat_event', + 'chat_event': {'session_id': 's', ...event}, + })!.attention; for (final status in ['running', 'completed', 'error']) { expect( attention({ @@ -66,7 +67,11 @@ void main() { expect(attention({'kind': 'text', 'delta': ' \n'}), isFalse); for (final messageKind in ['notice', 'agent_report']) { expect( - attention({'kind': 'text', 'delta': 'x', 'message_kind': messageKind}), + attention({ + 'kind': 'text', + 'delta': 'x', + 'message_kind': messageKind, + }), isFalse, ); } diff --git a/app/test/features/chat/ui/transcript/chat_copy_gutter_test.dart b/app/test/features/chat/ui/transcript/chat_copy_gutter_test.dart index ab429dc4..c66a4070 100644 --- a/app/test/features/chat/ui/transcript/chat_copy_gutter_test.dart +++ b/app/test/features/chat/ui/transcript/chat_copy_gutter_test.dart @@ -76,36 +76,34 @@ void main() { expect(_opacity(tester), 1); }); - testWidgets( - 'desktop shows it on hover and focus, and keeps semantics', - (tester) async { - final semantics = tester.ensureSemantics(); - await tester.pumpWidget(_host(48)); - expect(_opacity(tester), 0); - // Hidden, it is still reachable by a screen reader. - expect( - tester.getSemantics(_copy), - isSemantics(tooltip: 'Copy', isButton: true, isFocusable: true), - ); + testWidgets('desktop shows it on hover and focus, and keeps semantics', ( + tester, + ) async { + final semantics = tester.ensureSemantics(); + await tester.pumpWidget(_host(48)); + expect(_opacity(tester), 0); + // Hidden, it is still reachable by a screen reader. + expect( + tester.getSemantics(_copy), + isSemantics(tooltip: 'Copy', isButton: true, isFocusable: true), + ); - final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); - addTearDown(mouse.removePointer); - await mouse.addPointer(location: Offset.zero); - await mouse.moveTo(tester.getCenter(find.text('The answer text'))); - await tester.pumpAndSettle(); - expect(_opacity(tester), 1); - await mouse.moveTo(const Offset(5, 590)); - await tester.pumpAndSettle(); - expect(_opacity(tester), 0); + final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse); + addTearDown(mouse.removePointer); + await mouse.addPointer(location: Offset.zero); + await mouse.moveTo(tester.getCenter(find.text('The answer text'))); + await tester.pumpAndSettle(); + expect(_opacity(tester), 1); + await mouse.moveTo(const Offset(5, 590)); + await tester.pumpAndSettle(); + expect(_opacity(tester), 0); - // Keyboard focus reveals it too. - await tester.sendKeyEvent(LogicalKeyboardKey.tab); - await tester.pumpAndSettle(); - expect(_opacity(tester), 1); - semantics.dispose(); - }, - variant: TargetPlatformVariant.only(TargetPlatform.macOS), - ); + // Keyboard focus reveals it too. + await tester.sendKeyEvent(LogicalKeyboardKey.tab); + await tester.pumpAndSettle(); + expect(_opacity(tester), 1); + semantics.dispose(); + }, variant: TargetPlatformVariant.only(TargetPlatform.macOS)); for (final (width, inGutter) in [(1400.0, true), (560.0, false)]) { testWidgets('a ${width.toInt()} px conversation puts Copy ' diff --git a/app/test/features/chat/workspace/chat_pane_move_test.dart b/app/test/features/chat/workspace/chat_pane_move_test.dart index 4fdfdd8f..4c727b48 100644 --- a/app/test/features/chat/workspace/chat_pane_move_test.dart +++ b/app/test/features/chat/workspace/chat_pane_move_test.dart @@ -125,9 +125,7 @@ void main() { addTearDown(controller.dispose); final outer = controller.root as ChatWorkspaceSplit; controller.resize(outer.id, .3); - final ids = { - for (final s in ['a', 'b', 'c', 'd']) s: _id(controller, s), - }; + final ids = {for (final s in ['a', 'b', 'c', 'd']) s: _id(controller, s)}; final serial = controller.moveSerial; controller.swap(ids['a']!, ids['c']!); expect(controller.panes.map((p) => p.sessionId), ['c', 'b', 'a', 'd']);