From 47007aa90b607488233c3c32665eb338a6db0ee4 Mon Sep 17 00:00:00 2001 From: Dasemu Date: Mon, 26 Oct 2026 03:12:05 +0100 Subject: [PATCH] feat(app): move settings to a top-bar gear icon Co-Authored-By: Claude Opus 5.5 --- app/lib/src/views/shell.dart | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/app/lib/src/views/shell.dart b/app/lib/src/views/shell.dart index 4507c9e..c39cf9c 100644 --- a/app/lib/src/views/shell.dart +++ b/app/lib/src/views/shell.dart @@ -13,7 +13,8 @@ import 'quick_switcher.dart'; import 'graph_view.dart'; import 'settings_view.dart'; -/// App frame: sidebar (navigation, recents, theme), top bar and the current view. +/// App frame: sidebar (navigation, hubs, recents), top bar (history, search, theme, +/// settings) and the current view. class Shell extends StatefulWidget { const Shell({super.key}); @@ -166,7 +167,15 @@ class _TopBar extends StatelessWidget { app.canGoForward ? app.forward : null, ), const Spacer(), - _SearchPill(onTap: () => showQuickSwitcher(context)), + // Phones: an icon instead of the pill keeps the bar from overflowing. + if (MediaQuery.sizeOf(context).width < 480) + icon( + Icons.search_rounded, + 'Search (${app.keymap.of(AppAction.quickSwitcher).label})', + () => showQuickSwitcher(context), + ) + else + _SearchPill(onTap: () => showQuickSwitcher(context)), const SizedBox(width: 4), icon( brightness == Brightness.dark @@ -175,6 +184,13 @@ class _TopBar extends StatelessWidget { 'Toggle theme', () => app.toggleTheme(brightness), ), + icon( + app.route is SettingsRoute + ? Icons.settings_rounded + : Icons.settings_outlined, + 'Settings (${app.keymap.of(AppAction.settings).label})', + () => app.go(const SettingsRoute()), + ), ], ), ); @@ -274,12 +290,6 @@ class _Sidebar extends StatelessWidget { selected: route is AllPagesRoute, onTap: () => go(const AllPagesRoute()), ), - _NavItem( - icon: Icons.settings_outlined, - label: 'Settings', - selected: route is SettingsRoute, - onTap: () => go(const SettingsRoute()), - ), const SizedBox(height: 22), Expanded( child: ListView(