Use proper phone sheets for chat and Files menus
On phones the chat's More menu, chat list rows and Files entries open a Material bottom sheet headed by the chat or file, with full-width icon rows and destructive actions last in the error colour; desktop menus show icons, a minimum width and destructive actions after a divider. The chat menu drops Run command and Open chats, keeps a single terminal entry and lists Close pane last.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user