diff --git a/app/lib/features/runs/ui/run_detail_view.dart b/app/lib/features/runs/ui/run_detail_view.dart index 555dc8ec..7bb0fa11 100644 --- a/app/lib/features/runs/ui/run_detail_view.dart +++ b/app/lib/features/runs/ui/run_detail_view.dart @@ -125,6 +125,7 @@ class _RunDetailViewState extends State { titleSemanticLabel: 'Run title $title', onBack: widget.onBack, actions: [more], + hideNavigation: true, child: detail, ); } @@ -168,6 +169,7 @@ class _RunDetailViewState extends State { return ShellBar( title: 'Run', onBack: widget.onBack, + hideNavigation: true, child: _placeholderBody(loading, message), ); } diff --git a/app/notes/phone-navigation-bar.md b/app/notes/phone-navigation-bar.md index bfbc0ca3..1685f80a 100644 --- a/app/notes/phone-navigation-bar.md +++ b/app/notes/phone-navigation-bar.md @@ -62,3 +62,33 @@ perf bench). The verdict line named only those paths. - Settings-as-destination on the phone bar is new behaviour; the Pipelines gear is still present. - Medium widths (600 px to the rail threshold) keep the floating pill, by design. + +## Land-gate fix (visit 2) +- Failure: `test/ui/adaptive/floating_tab_motion_test.dart` ("switching the shell + tabs never replays the main bar's entrance") ran the shell at 560 px, which is a + phone now and shows the `NavigationBar`, so no `GlassPill` existed (`StateError: + No element`). +- Fix (test only): that one test now sets a 640 px window, above the 600 px split + and below the rail threshold, so it still exercises the floating bar it covers. + No expectation changed; the other six tests in the file are untouched. +- Focused result: `tool/memwatch/full.sh 'test/ui/adaptive/floating_tab_motion_test.dart'` + → PASS 7 passed, 0 failed (verdict named only that path). +- `tool/analyze.sh`: clean. +- The full gate suite was not re-run here (the land stage runs it). + +## Review fix (implement visit 3): run detail hides the phone bar +- Failure: on a phone, a run detail (loaded, and the loading/failed placeholder) + still showed the `NavigationBar`, because both `ShellBar`s in + `lib/features/runs/ui/run_detail_view.dart` lacked `hideNavigation`. +- Fix: `hideNavigation: true` on the detail `ShellBar` and on the placeholder + `ShellBar`. Nothing else changed. +- Regression test: new `test/features/runs/ui/run_detail_phone_navigation_test.dart` + mounts `RunDetailView` in `AdaptiveShell` at 390×844. It asserts no + `NavigationBar` for the loaded detail and for the placeholder, and keeps a + control that the runs list still shows the bar. +- Negative check: with the two `hideNavigation` lines removed, the two detail + tests fail and the control passes; the fix was then restored. +- Focused result: `tool/memwatch/full.sh 'test/features/runs/ui/run_detail_phone_navigation_test.dart test/features/runs/ui/run_detail_widget_test.dart'` + → PASS 5 passed, 0 failed (verdict named only those two paths). +- `tool/analyze.sh`: clean. +- Not captured here (ui-review owns captures). diff --git a/app/test/features/runs/ui/run_detail_phone_navigation_test.dart b/app/test/features/runs/ui/run_detail_phone_navigation_test.dart new file mode 100644 index 00000000..fe8e4d56 --- /dev/null +++ b/app/test/features/runs/ui/run_detail_phone_navigation_test.dart @@ -0,0 +1,79 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:pipelines_app/features/runs/data/runs_repository.dart'; +import 'package:pipelines_app/features/runs/ui/run_detail_view.dart'; +import 'package:pipelines_app/features/runs/ui/runs_controller.dart'; +import 'package:pipelines_app/shell/adaptive_shell.dart'; +import 'package:pipelines_app/shell/destination.dart'; + +import 'run_detail_graph_support.dart'; + +/// A pushed run detail covers the phone's bottom navigation bar, both once the +/// run has loaded and while its placeholder (loading or failed) shows. +void main() { + Future pumpPhoneRunDetail( + WidgetTester tester, { + required bool loaded, + }) async { + tester.view.physicalSize = const Size(390, 844); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + final gateway = RunDetailFakeGateway(graphRunFixture()); + final controller = RunsController(RunsRepository(gateway)); + addTearDown(controller.dispose); + if (loaded) await controller.select(51); + await tester.pumpWidget( + MaterialApp( + home: AdaptiveShell( + destination: AppDestination.runs, + destinationBodies: { + AppDestination.runs: (_) => RunDetailView( + controller: controller, + gateway: gateway, + onBack: () {}, + ), + }, + ), + ), + ); + await tester.pumpAndSettle(); + } + + testWidgets('a loaded run detail hides the phone navigation bar', ( + tester, + ) async { + await pumpPhoneRunDetail(tester, loaded: true); + + expect(find.byType(RunDetailView), findsOneWidget); + expect(find.byType(NavigationBar), findsNothing); + }); + + testWidgets('the run detail placeholder hides the phone navigation bar', ( + tester, + ) async { + await pumpPhoneRunDetail(tester, loaded: false); + + expect(find.byType(RunDetailView), findsOneWidget); + expect(find.text('Run details unavailable.'), findsOneWidget); + expect(find.byType(NavigationBar), findsNothing); + }); + + testWidgets('the runs list keeps the phone navigation bar', (tester) async { + tester.view.physicalSize = const Size(390, 844); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + await tester.pumpWidget( + MaterialApp( + home: AdaptiveShell( + destination: AppDestination.runs, + destinationBodies: { + AppDestination.runs: (_) => const Text('runs list'), + }, + ), + ), + ); + await tester.pumpAndSettle(); + + expect(find.byType(NavigationBar), findsOneWidget); + }); +} diff --git a/app/test/ui/adaptive/floating_tab_motion_test.dart b/app/test/ui/adaptive/floating_tab_motion_test.dart index 8c09bd66..509e188d 100644 --- a/app/test/ui/adaptive/floating_tab_motion_test.dart +++ b/app/test/ui/adaptive/floating_tab_motion_test.dart @@ -284,6 +284,9 @@ void main() { "bar's entrance", (tester) async { final size = FloatingDestinationBar.buttonSize(); animate(tester, on: true); + // A window above the list-detail split but below the rail keeps the + // floating bar; a phone (under 600 px) shows the Material NavigationBar. + tester.view.physicalSize = const Size(640, 900); var destination = AppDestination.runs; final shell = StatefulBuilder( builder: (context, setState) => AdaptiveShell(