Merge branch 'main' into pipelines/run-20261112-2323-read-chat-replies-aloud-with-word-highli-e079
This commit is contained in:
@@ -11,7 +11,6 @@ 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_float_store.dart';
|
||||
import 'package:pipelines_app/features/chat/workspace/chat_workspace.dart';
|
||||
import 'package:pipelines_app/features/chat/shell/chat_shell_command.dart';
|
||||
import 'package:pipelines_app/features/chat/workspace/chat_workspace_store.dart';
|
||||
import 'package:pipelines_app/features/terminal/terminal_scope.dart';
|
||||
import 'package:pipelines_app/shell/windows/window_frame.dart';
|
||||
@@ -236,12 +235,16 @@ Future<List<String>> _listMenu(WidgetTester tester, String id) async {
|
||||
// Windows sit over the list, so the list's menu is reached with them hidden.
|
||||
await tester.tap(find.byTooltip('Chat actions for Chat $id').first);
|
||||
await tester.pumpAndSettle();
|
||||
// A wide app shows an anchored menu; a phone shows a bottom sheet of rows.
|
||||
final rows = find.byType(PopupMenuItem<Object>).evaluate().isNotEmpty
|
||||
? find.byType(PopupMenuItem<Object>)
|
||||
: find.descendant(
|
||||
of: find.byType(BottomSheet),
|
||||
matching: find.byType(ListTile),
|
||||
);
|
||||
return [
|
||||
for (final text in tester.widgetList<Text>(
|
||||
find.descendant(
|
||||
of: find.byType(PopupMenuItem<Object>),
|
||||
matching: find.byType(Text),
|
||||
),
|
||||
find.descendant(of: rows, matching: find.byType(Text)),
|
||||
))
|
||||
text.data!,
|
||||
];
|
||||
@@ -788,7 +791,9 @@ void main() {
|
||||
await tester.tap(finder.first);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.textContaining('Float'), findsNothing);
|
||||
expect(find.text('Open chats (2)'), findsOneWidget);
|
||||
// A phone's menu is a bottom sheet.
|
||||
expect(find.byType(BottomSheet), findsOneWidget);
|
||||
expect(find.text('Open chats (2)'), findsNothing);
|
||||
await app.stop(tester);
|
||||
});
|
||||
|
||||
@@ -808,13 +813,15 @@ void main() {
|
||||
'Open below',
|
||||
'Float (Alt+Y)',
|
||||
'Add chat pane',
|
||||
'Open chats (2)',
|
||||
'Close pane',
|
||||
'Files',
|
||||
'Run command…',
|
||||
'Star',
|
||||
// Closing comes last.
|
||||
'Close pane',
|
||||
]),
|
||||
);
|
||||
expect(labels, isNot(contains('Open chats (2)')));
|
||||
expect(labels, isNot(contains('Run command…')));
|
||||
expect(labels.last, 'Close chat…');
|
||||
expect(labels.any((label) => label.startsWith('Center stage')), isTrue);
|
||||
// Only a window's own pane offers Chat details, and no terminal is wired.
|
||||
expect(labels, isNot(contains('Chat details')));
|
||||
@@ -900,24 +907,6 @@ void main() {
|
||||
await app.stop(tester);
|
||||
});
|
||||
|
||||
testWidgets('a list choice runs the command dialog for its chat', (
|
||||
tester,
|
||||
) async {
|
||||
await _saved('a', 'b');
|
||||
final app = _App(_Store());
|
||||
await app.start(tester);
|
||||
app.manager.setGroupShown(chatWindowKind, false);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await _listChoice(tester, 'b', 'Run command…');
|
||||
expect(find.text(chatShellRunDialogTitle), findsOneWidget);
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
|
||||
await tester.pumpAndSettle();
|
||||
expect(_workspace(tester).panes.map((p) => p.sessionId), ['a', 'b']);
|
||||
expect(tester.takeException(), isNull);
|
||||
await app.stop(tester);
|
||||
});
|
||||
|
||||
testWidgets('narrow layouts offer the list the panes it can reach', (
|
||||
tester,
|
||||
) async {
|
||||
@@ -929,7 +918,7 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
final labels = await _listMenu(tester, 'b');
|
||||
expect(labels, contains('Add chat pane'));
|
||||
expect(labels, contains('Open chats (2)'));
|
||||
expect(labels, isNot(contains('Open chats (2)')));
|
||||
expect(labels.any((label) => label.startsWith('Center stage')), isFalse);
|
||||
expect(labels, isNot(contains('Float (Alt+Y)')));
|
||||
expect(labels, isNot(contains('Open to the right')));
|
||||
|
||||
@@ -106,7 +106,11 @@ void main() {
|
||||
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.keyA);
|
||||
await tester.pump();
|
||||
expect(count, 0, reason: 'a key with no focus in the pane is not its input');
|
||||
expect(
|
||||
count,
|
||||
0,
|
||||
reason: 'a key with no focus in the pane is not its input',
|
||||
);
|
||||
|
||||
focus.requestFocus();
|
||||
await tester.pump();
|
||||
@@ -116,7 +120,9 @@ void main() {
|
||||
expect(count, 1);
|
||||
});
|
||||
|
||||
testWidgets('code-driven focus into the pane reports nothing', (tester) async {
|
||||
testWidgets('code-driven focus into the pane reports nothing', (
|
||||
tester,
|
||||
) async {
|
||||
var count = 0;
|
||||
final focus = FocusNode();
|
||||
addTearDown(focus.dispose);
|
||||
@@ -127,7 +133,11 @@ void main() {
|
||||
await tester.pump(const Duration(seconds: 1));
|
||||
|
||||
expect(focus.hasFocus, isTrue);
|
||||
expect(count, 0, reason: 'focus moved in code, with no key press, is passive');
|
||||
expect(
|
||||
count,
|
||||
0,
|
||||
reason: 'focus moved in code, with no key press, is passive',
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('Tab from outside the pane into it reports once', (tester) async {
|
||||
|
||||
@@ -38,8 +38,12 @@ void main() {
|
||||
tester,
|
||||
) async {
|
||||
final gateway = await pumpThread(tester);
|
||||
await tester.tap(find.byTooltip('More actions').hitTestable().first);
|
||||
await tester.pumpAndSettle();
|
||||
// With nothing else to offer, the bar shows no More menu at all.
|
||||
final more = find.byTooltip('More actions').hitTestable();
|
||||
if (more.evaluate().isNotEmpty) {
|
||||
await tester.tap(more.first);
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
expect(find.text('Stop'), findsNothing);
|
||||
expect(gateway.interruptBodies, isEmpty);
|
||||
});
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar_overflow.dart';
|
||||
|
||||
import 'chat_shell_fixtures.dart';
|
||||
|
||||
@@ -66,25 +65,4 @@ void main() {
|
||||
expect(find.text('Type a command after !.'), findsOneWidget);
|
||||
expect(gateway.bodies('chat_shell_run'), isEmpty);
|
||||
});
|
||||
|
||||
testWidgets('Run command… in the actions menu runs the typed command', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(shellThread(gateway));
|
||||
await tester.pump();
|
||||
await tester.tap(find.byKey(segmentedMoreKey).hitTestable().first);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Run command…'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.enterText(
|
||||
find.byKey(const Key('chat-shell-run-field')),
|
||||
' ls -la ',
|
||||
);
|
||||
await tester.tap(find.byKey(const Key('chat-shell-run-confirm')));
|
||||
// The running card's indicator never settles; let the dialog close.
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(seconds: 1));
|
||||
expect(gateway.bodies('chat_shell_run').single['command'], 'ls -la');
|
||||
expect(find.text('\$ ls -la'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,9 +71,12 @@ void main() {
|
||||
gateway.runs = [shellRecord('run_live')];
|
||||
await tester.pumpWidget(shellThread(gateway));
|
||||
await tester.pump();
|
||||
await tester.tap(find.byKey(segmentedMoreKey).hitTestable().first);
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
expect(find.text('Run command…'), findsOneWidget);
|
||||
// With nothing else to offer, the bar shows no More menu at all.
|
||||
final more = find.byKey(segmentedMoreKey).hitTestable();
|
||||
if (more.evaluate().isNotEmpty) {
|
||||
await tester.tap(more.first);
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
}
|
||||
expect(find.text('Dismiss all finished commands'), findsNothing);
|
||||
});
|
||||
|
||||
|
||||
@@ -174,9 +174,6 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final scrim = find.byKey(const ValueKey('chat-pane-dim-scrim')).first;
|
||||
expect(
|
||||
tester.widget<AnimatedContainer>(scrim).duration,
|
||||
Motion.standard,
|
||||
);
|
||||
expect(tester.widget<AnimatedContainer>(scrim).duration, Motion.standard);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user