From 36bc36cd9daef829acc0193d46e50d1559eff2b2 Mon Sep 17 00:00:00 2001 From: bvandeusen Date: Mon, 6 Apr 2026 07:14:38 -0400 Subject: [PATCH] feat: replace Projects tab with More bottom sheet (news/calendar stubs) --- lib/app.dart | 93 +++++++++++++++++++++++++++++++++++------ lib/core/constants.dart | 2 + 2 files changed, 82 insertions(+), 13 deletions(-) diff --git a/lib/app.dart b/lib/app.dart index 8c7f297..0e69b17 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -154,12 +154,26 @@ final routerProvider = Provider((ref) { path: Routes.conversations, builder: (_, _) => const ConversationsTabScreen(), ), - GoRoute( - path: Routes.projects, - builder: (_, _) => const ProjectsScreen(), - ), ], ), + GoRoute( + path: Routes.projects, + builder: (_, _) => const ProjectsScreen(), + ), + GoRoute( + path: Routes.news, + builder: (_, _) => Scaffold( + appBar: AppBar(title: const Text('News')), + body: const Center(child: Text('News — coming soon')), + ), + ), + GoRoute( + path: Routes.calendar, + builder: (_, _) => Scaffold( + appBar: AppBar(title: const Text('Calendar')), + body: const Center(child: Text('Calendar — coming soon')), + ), + ), ], ); }); @@ -177,7 +191,6 @@ class _ShellState extends ConsumerState<_Shell> { Routes.briefing, Routes.knowledge, Routes.conversations, - Routes.projects, ]; @override @@ -210,9 +223,51 @@ class _ShellState extends ConsumerState<_Shell> { for (var i = 0; i < _tabs.length; i++) { if (location.startsWith(_tabs[i])) return i; } + if (location.startsWith(Routes.projects) || + location.startsWith(Routes.news) || + location.startsWith(Routes.calendar)) { + return 3; + } return 0; } + void _showMoreSheet(BuildContext context) { + showModalBottomSheet( + context: context, + builder: (_) => SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + leading: const Icon(Icons.folder_outlined), + title: const Text('Projects'), + onTap: () { + Navigator.pop(context); + context.push(Routes.projects); + }, + ), + ListTile( + leading: const Icon(Icons.newspaper_outlined), + title: const Text('News'), + onTap: () { + Navigator.pop(context); + context.push(Routes.news); + }, + ), + ListTile( + leading: const Icon(Icons.calendar_month_outlined), + title: const Text('Calendar'), + onTap: () { + Navigator.pop(context); + context.push(Routes.calendar); + }, + ), + ], + ), + ), + ); + } + void _showUpdateDialog(UpdateState update) { showDialog( context: context, @@ -303,7 +358,13 @@ class _ShellState extends ConsumerState<_Shell> { children: [ NavigationRail( selectedIndex: index, - onDestinationSelected: (i) => context.go(_tabs[i]), + onDestinationSelected: (i) { + if (i == 3) { + _showMoreSheet(context); + } else { + context.go(_tabs[i]); + } + }, labelType: NavigationRailLabelType.all, destinations: const [ NavigationRailDestination( @@ -322,9 +383,9 @@ class _ShellState extends ConsumerState<_Shell> { label: Text('Chat'), ), NavigationRailDestination( - icon: Icon(Icons.folder_outlined), - selectedIcon: Icon(Icons.folder), - label: Text('Projects'), + icon: Icon(Icons.more_horiz_outlined), + selectedIcon: Icon(Icons.more_horiz), + label: Text('More'), ), ], ), @@ -354,7 +415,13 @@ class _ShellState extends ConsumerState<_Shell> { ), bottomNavigationBar: NavigationBar( selectedIndex: index, - onDestinationSelected: (i) => context.go(_tabs[i]), + onDestinationSelected: (i) { + if (i == 3) { + _showMoreSheet(context); + } else { + context.go(_tabs[i]); + } + }, destinations: const [ NavigationDestination( icon: Icon(Icons.wb_sunny_outlined), @@ -372,9 +439,9 @@ class _ShellState extends ConsumerState<_Shell> { label: 'Chat', ), NavigationDestination( - icon: Icon(Icons.folder_outlined), - selectedIcon: Icon(Icons.folder), - label: 'Projects', + icon: Icon(Icons.more_horiz_outlined), + selectedIcon: Icon(Icons.more_horiz), + label: 'More', ), ], ), diff --git a/lib/core/constants.dart b/lib/core/constants.dart index bf4b3d1..2de5da1 100644 --- a/lib/core/constants.dart +++ b/lib/core/constants.dart @@ -17,5 +17,7 @@ abstract class Routes { static const quickCapture = '/quick-capture'; static const settings = '/settings'; static const briefing = '/briefing'; + static const news = '/news'; + static const calendar = '/calendar'; static const projectTasks = '/projects/:id/tasks'; }