From 138027a8ef4dedb8fd989a8f25b55e5c608bd7e9 Mon Sep 17 00:00:00 2001 From: vjrj Date: Fri, 10 Jul 2026 16:24:54 +0200 Subject: [PATCH] =?UTF-8?q?fix(nav):=20inventory=20is=20a=20spoke=20off=20?= =?UTF-8?q?the=20home=20hub=20=E2=80=94=20back=20arrow,=20no=20duplicate?= =?UTF-8?q?=20drawer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inventory screen carried its own const AppDrawer() (no marketEnabled), so opening the menu from inventory greyed out market/chat/profile — the recurring 'phase 1' look. It was also reached via go() (route replace), which is why it showed a hamburger instead of a back arrow like the market. Make it coherent with the market: reach inventory via push() (from the home card and the drawer), and drop its drawer so the AppBar shows a back arrow returning to the home hub. The drawer now lives only on the home screen, which always passes marketEnabled — the wrong-drawer bug class is gone. Update the home_screen test to assert the spoke has a back arrow and no hamburger. --- apps/app_seeds/lib/ui/app_drawer.dart | 2 +- apps/app_seeds/lib/ui/home_screen.dart | 2 +- apps/app_seeds/lib/ui/inventory_list_screen.dart | 2 -- apps/app_seeds/test/ui/home_screen_test.dart | 12 ++++++------ 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/app_seeds/lib/ui/app_drawer.dart b/apps/app_seeds/lib/ui/app_drawer.dart index 1b25003..6031ecb 100644 --- a/apps/app_seeds/lib/ui/app_drawer.dart +++ b/apps/app_seeds/lib/ui/app_drawer.dart @@ -31,7 +31,7 @@ class AppDrawer extends StatelessWidget { label: t.menu.inventory, onTap: () { Navigator.of(context).pop(); - context.go('/inventory'); + context.push('/inventory'); }, ), _DrawerItem( diff --git a/apps/app_seeds/lib/ui/home_screen.dart b/apps/app_seeds/lib/ui/home_screen.dart index 656406f..47d9a1f 100644 --- a/apps/app_seeds/lib/ui/home_screen.dart +++ b/apps/app_seeds/lib/ui/home_screen.dart @@ -77,7 +77,7 @@ class HomeScreen extends StatelessWidget { icon: Icons.inventory_2_outlined, label: t.home.yourInventory, subtitle: t.home.yourInventorySubtitle, - onTap: () => context.go('/inventory'), + onTap: () => context.push('/inventory'), ), const SizedBox(height: 16), _OutlinedMenuCard( diff --git a/apps/app_seeds/lib/ui/inventory_list_screen.dart b/apps/app_seeds/lib/ui/inventory_list_screen.dart index ac8282e..7733dfd 100644 --- a/apps/app_seeds/lib/ui/inventory_list_screen.dart +++ b/apps/app_seeds/lib/ui/inventory_list_screen.dart @@ -9,7 +9,6 @@ import '../domain/seed_viability.dart'; import '../i18n/strings.g.dart'; import '../services/share_catalog_service.dart'; import '../state/inventory_cubit.dart'; -import 'app_drawer.dart'; import 'draft_triage.dart'; import 'quantity_kind_l10n.dart'; import 'quantity_picker.dart'; @@ -50,7 +49,6 @@ class InventoryListScreen extends StatelessWidget { ), ], ), - drawer: const AppDrawer(), floatingActionButton: FloatingActionButton( key: const Key('inventory.addFab'), tooltip: t.quickAdd.title, diff --git a/apps/app_seeds/test/ui/home_screen_test.dart b/apps/app_seeds/test/ui/home_screen_test.dart index 9e386e2..d302eda 100644 --- a/apps/app_seeds/test/ui/home_screen_test.dart +++ b/apps/app_seeds/test/ui/home_screen_test.dart @@ -59,7 +59,8 @@ void main() { await disposeTree(tester); }); - testWidgets('drawer header returns to home', (tester) async { + testWidgets('inventory is a spoke: back arrow, no drawer, returns to home', + (tester) async { LocaleSettings.setLocaleSync(AppLocale.en); final db = newTestDatabase(); addTearDown(db.close); @@ -67,15 +68,14 @@ void main() { await tester.pumpWidget(app(db)); await tester.pumpAndSettle(); - // Navigate away from home first. + // Push into inventory off the home hub. await tester.tap(find.byKey(const Key('home.inventory'))); await tester.pumpAndSettle(); expect(find.text('No seeds yet. Tap + to add your first.'), findsOneWidget); - // Open the drawer and tap the Tanemaki brand header. - await tester.tap(find.byIcon(Icons.menu)); - await tester.pumpAndSettle(); - await tester.tap(find.text('Tanemaki')); + // The spoke shows a back arrow, not a hamburger — coherent with the market. + expect(find.byIcon(Icons.menu), findsNothing); + await tester.tap(find.byType(BackButton)); await tester.pumpAndSettle(); // Back on the home menu.