feat(app): on a phone an open pipeline, run or chat is its own page over the tabs

This commit is contained in:
2026-10-23 22:58:49 +01:00
parent 700ba6f820
commit 7cbfbbbb61
8 changed files with 418 additions and 76 deletions
@@ -243,7 +243,7 @@ void main() {
await tester.pageBack();
await tester.pumpAndSettle();
await tester.tap(find.byTooltip('Back to pipelines'));
await tester.tap(find.byKey(const ValueKey('shell.back')));
await tester.pumpAndSettle();
expect(find.byKey(const Key('pipeline-list')), findsOneWidget);
@@ -282,7 +282,7 @@ void main() {
await tester.pageBack();
await tester.pumpAndSettle();
await tester.tap(find.byTooltip('Back to pipelines'));
await tester.tap(find.byKey(const ValueKey('shell.back')));
await tester.pumpAndSettle();
await tester.tap(find.byKey(const Key('pipeline-row-1')));
await tester.pumpAndSettle();
@@ -33,9 +33,12 @@ void main() {
expect(find.byKey(const Key('pipeline-list')), findsNothing);
expect(find.byKey(const Key('pipeline-detail')), findsOneWidget);
await tester.tap(find.byTooltip('Back to pipelines'));
// The open pipeline is its own page: its bar names it and Back closes it.
expect(find.text('Alpha review'), findsWidgets);
await tester.tap(find.byKey(const ValueKey('shell.back')));
await tester.pumpAndSettle();
expect(find.byKey(const Key('pipeline-list')), findsOneWidget);
expect(find.byKey(const Key('pipeline-detail')), findsNothing);
});
testWidgets(
@@ -298,4 +298,36 @@ void main() {
},
variant: TargetPlatformVariant.only(TargetPlatform.iOS),
);
testWidgets('on a phone an open run is its own page and Back returns', (
tester,
) async {
tester.view.physicalSize = const Size(390, 844);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
int? selected;
var backs = 0;
await tester.pumpWidget(
_materialScreen(
gateway,
onRunSelected: (id) => selected = id,
onBack: (_) => backs++,
),
);
await _mountList(tester, gateway);
await tester.tap(find.text('Beta run'));
await tester.pump();
expect(selected, 2);
gateway.replyDetail(2, 0, {'id': 2, 'title': 'Beta run'});
await tester.pumpAndSettle();
// The run covers the list as a page with its own Back.
expect(find.text('Alpha run'), findsNothing);
expect(find.byKey(const ValueKey('shell.back')), findsOneWidget);
await tester.tap(find.byKey(const ValueKey('shell.back')));
await tester.pumpAndSettle();
expect(backs, 1);
expect(find.text('Alpha run'), findsOneWidget);
});
}