Use adaptive popups for chat details
Present chat turn and shell-history detail surfaces through the shared adaptive popup helpers so desktop uses dialogs while phone layouts retain bottom sheets. Update focused tests and document the verified behavior.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'package:pipelines_app/features/changes/widgets/change_style.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
@@ -44,12 +43,10 @@ JsonMap _reply({bool truncated = false}) => {
|
||||
Widget _app(Widget body, bool cupertino, {Size size = const Size(1000, 800)}) {
|
||||
final media = MediaQueryData(size: size);
|
||||
final home = MediaQuery(data: media, child: body);
|
||||
return cupertino
|
||||
? CupertinoApp(home: CupertinoPageScaffold(child: home))
|
||||
: MaterialApp(
|
||||
theme: ThemeData(platform: TargetPlatform.android),
|
||||
home: Scaffold(body: home),
|
||||
);
|
||||
return MaterialApp(
|
||||
theme: ThemeData(platform: TargetPlatform.android),
|
||||
home: Scaffold(body: home),
|
||||
);
|
||||
}
|
||||
|
||||
final _chip = find.byKey(const Key('chat-turn-diff-chip'));
|
||||
@@ -117,6 +114,7 @@ void main() {
|
||||
);
|
||||
await tester.tap(_chip);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(Dialog), findsOneWidget);
|
||||
expect(loads, 1);
|
||||
expect(find.byKey(const Key('chat-turn-diff-list')), findsOneWidget);
|
||||
expect(find.text('lib/a.dart'), findsOneWidget);
|
||||
@@ -162,7 +160,7 @@ void main() {
|
||||
expect(find.textContaining('truncated'), findsWidgets);
|
||||
});
|
||||
|
||||
testWidgets('a narrow window opens the changes full screen ($host)', (
|
||||
testWidgets('a narrow window opens the changes as a bottom sheet ($host)', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(400, 800);
|
||||
@@ -182,7 +180,7 @@ void main() {
|
||||
);
|
||||
await tester.tap(_chip);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Turn changes'), findsOneWidget);
|
||||
expect(find.byType(BottomSheet), findsOneWidget);
|
||||
expect(find.text('lib/a.dart'), findsOneWidget);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user