From 032d4cd6c021a5de920466f9432ef3a67c258425 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sun, 8 Nov 2026 01:13:58 +0000 Subject: [PATCH] Restore ordinary root launches with query parameters and verify Back intent --- app/lib/application/pipelines_app.dart | 4 +++- app/notes/persistent-tab-locations.md | 16 +++++++++++++++ .../tab_location_navigation_test.dart | 20 +++++++++++++++++++ .../application/templates_wiring_test.dart | 4 ++++ app/test/shell/split_detail_pages_test.dart | 6 +++--- 5 files changed, 46 insertions(+), 4 deletions(-) diff --git a/app/lib/application/pipelines_app.dart b/app/lib/application/pipelines_app.dart index 8a278a50..56490377 100644 --- a/app/lib/application/pipelines_app.dart +++ b/app/lib/application/pipelines_app.dart @@ -230,7 +230,9 @@ class _PipelinesAppState extends State '', '/', ].contains(WidgetsBinding.instance.platformDispatcher.defaultRouteName); - final restoreTab = !widget.resetRoute && (location == '/' || nativeDefault); + final restoreTab = + !widget.resetRoute && + (Uri.tryParse(location)?.path == '/' || nativeDefault); _tabLocations = TabLocations( widget.tabLocationsStore ?? SharedPreferencesTabLocationsStore(scope: _navigationScope), diff --git a/app/notes/persistent-tab-locations.md b/app/notes/persistent-tab-locations.md index af74b2b9..b8ff46c1 100644 --- a/app/notes/persistent-tab-locations.md +++ b/app/notes/persistent-tab-locations.md @@ -56,3 +56,19 @@ replacement loads it; newer navigation wins afterward. Recreating without a new choice restores the old owner's last accepted chat, not its previous Settings location. Both same-instance fake stores and distinct SharedPreferences store instances sharing one logical key are covered. + +## Manager integration + +Settings category persistence uses the same resolved server scope as tab +locations. Explicit Settings Back returns to the preserved pipeline detail, +while tapping the Pipelines tab retains Settings. Ordinary root launches with +query parameters also restore saved navigation; explicit app paths still win. +The integrated browser flow verified Settings/Tools → Chat → Pipelines → +Settings/Tools, then reopening `/` restored Settings/Tools again. + +Focused integration checks passed 14 cases (`/tmp/memwatch/out.HMixOA`). +An older template workflow assertion was updated to use explicit Back, since +selected-tab taps now preserve location. Two centered-tab assertions failed on +the unchanged previous release too (`/tmp/memwatch/out.m3tMaL`); they now verify +the user-requested left alignment already shipped. No layout code changed for +those assertion corrections. diff --git a/app/test/application/tab_location_navigation_test.dart b/app/test/application/tab_location_navigation_test.dart index 71ce2b33..6da663d8 100644 --- a/app/test/application/tab_location_navigation_test.dart +++ b/app/test/application/tab_location_navigation_test.dart @@ -209,4 +209,24 @@ void main() { ); expect(tester.takeException(), isNull); }); + for (final cupertino in [false, true]) { + testWidgets('ordinary root with query restores its tab ($cupertino)', ( + tester, + ) async { + final store = MemoryTabLocationsStore() + ..value = const TabLocationsSnapshot( + routes: {AppDestination.pipelines: AppRoute.settings}, + ); + final app = await mount( + tester, + route: '/?appearance=cupertino', + cupertino: cupertino, + store: store, + ); + await tester.pumpAndSettle(); + expect(app.provider.value.uri.path, '/settings'); + expect(find.byType(SettingsScreen), findsOneWidget); + expect(tester.takeException(), isNull); + }); + } } diff --git a/app/test/application/templates_wiring_test.dart b/app/test/application/templates_wiring_test.dart index bc5e9b99..8295bffd 100644 --- a/app/test/application/templates_wiring_test.dart +++ b/app/test/application/templates_wiring_test.dart @@ -357,6 +357,10 @@ void main() { await tester.tap(find.byKey(const ValueKey('shell.destination.pipelines'))); await tester.pumpAndSettle(); + expect(provider.value.uri.path, '/settings'); + // A tab retap preserves Settings; explicit Back returns to Pipelines. + await tester.tap(find.byKey(const Key('shell.back'))); + await tester.pumpAndSettle(); expect(provider.value.uri.path, '/pipelines'); expect(find.text('Probe release'), findsOneWidget); // Only the accepted detail's invalidation re-read the list; showing it diff --git a/app/test/shell/split_detail_pages_test.dart b/app/test/shell/split_detail_pages_test.dart index 2f9c2d84..4c75d3e0 100644 --- a/app/test/shell/split_detail_pages_test.dart +++ b/app/test/shell/split_detail_pages_test.dart @@ -16,7 +16,7 @@ import '../features/runs/ui/run_detail_graph_support.dart'; import '../features/runs/ui/run_detail_visit_support.dart'; /// On a wide split window (unfolded foldable, desktop) the real run detail -/// and the stage page it opens keep the shell's tab bar at the bottom right +/// and the stage page it opens keep the shell's tab bar at the bottom left /// and float their own tabs above it with a gap; the stage page opens inside /// the detail pane instead of covering the shell. void main() { @@ -90,7 +90,7 @@ void main() { find.byKey(const ValueKey('list-detail-list')), ); var main = shellPill(tester); - expect(main.center.dx, closeTo(list.center.dx, 0.5)); + expect(main.left, closeTo(list.left + kFloatingBarMargin, 0.5)); expect(main.bottom, closeTo(800 - kFloatingBarMargin, 0.5)); final runTabs = pillOf(tester, find.byKey(const Key('run-detail-tabs'))); @@ -118,7 +118,7 @@ void main() { final back = tester.getRect(find.byKey(const Key('run-visit-back'))); expect(back.left, greaterThanOrEqualTo(body.left)); main = shellPill(tester); - expect(main.center.dx, closeTo(list.center.dx, 0.5)); + expect(main.left, closeTo(list.left + kFloatingBarMargin, 0.5)); final visitTabs = pillOf( tester, find.byKey(const Key('run-visit-tabs')).last,