feat(app): move settings to a top-bar gear icon

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-26 03:12:05 +01:00
1 parent 9cd0bacd69
commit 47007aa90b
1 file changed
+17 -7
+17 -7
View File
@@ -13,7 +13,8 @@ import 'quick_switcher.dart';
import 'graph_view.dart'; import 'graph_view.dart';
import 'settings_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 { class Shell extends StatefulWidget {
const Shell({super.key}); const Shell({super.key});
@@ -166,6 +167,14 @@ class _TopBar extends StatelessWidget {
app.canGoForward ? app.forward : null, app.canGoForward ? app.forward : null,
), ),
const Spacer(), const Spacer(),
// 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)), _SearchPill(onTap: () => showQuickSwitcher(context)),
const SizedBox(width: 4), const SizedBox(width: 4),
icon( icon(
@@ -175,6 +184,13 @@ class _TopBar extends StatelessWidget {
'Toggle theme', 'Toggle theme',
() => app.toggleTheme(brightness), () => 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, selected: route is AllPagesRoute,
onTap: () => go(const AllPagesRoute()), onTap: () => go(const AllPagesRoute()),
), ),
_NavItem(
icon: Icons.settings_outlined,
label: 'Settings',
selected: route is SettingsRoute,
onTap: () => go(const SettingsRoute()),
),
const SizedBox(height: 22), const SizedBox(height: 22),
Expanded( Expanded(
child: ListView( child: ListView(