Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

feat(web): give the app menu rows the desktop menu's icons

Dev jacob28cef2524d66
diff --git a/desktop/lib/shared/theme/app_icons.dart b/desktop/lib/shared/theme/app_icons.dart
index d411a2127..765ed14b4 100644
--- a/desktop/lib/shared/theme/app_icons.dart
+++ b/desktop/lib/shared/theme/app_icons.dart
@@ -156,6 +156,7 @@ abstract final class AppIcons {
static const squarePlus = LucideIcons.squarePlus400;
static const squareTerminal = LucideIcons.squareTerminal400;
static const star = LucideIcons.star400;
+ static const store = LucideIcons.store400;
static const starHalf = LucideIcons.starHalf400;
static const sun = LucideIcons.sun400;
static const terminal = LucideIcons.terminal400;
diff --git a/desktop/lib/web/shell/web_app_menu.dart b/desktop/lib/web/shell/web_app_menu.dart
index 25c2e8f3c..aeb478df0 100644
--- a/desktop/lib/web/shell/web_app_menu.dart
+++ b/desktop/lib/web/shell/web_app_menu.dart
@@ -100,12 +100,18 @@ class WebAppMenuButton extends StatelessWidget {
List<List<WebMenuItem>> groups,
void Function(String?) close,
) {
- Widget row(String id, String label) => paneMenuItem(
+ // Uncoloured on purpose: the row's ink tints it, so it turns with the
+ // label when the row lights up.
+ Widget row(String id, String label, Widget icon) => paneMenuItem(
onTap: () => close(id),
child: PaneMenuRow(
key: ValueKey('web-menu:$id'),
selected: false,
title: label,
+ leading: IconTheme.merge(
+ data: const IconThemeData(size: AppIcons.inlineSize),
+ child: icon,
+ ),
),
);
final rule = Divider(
@@ -117,11 +123,11 @@ class WebAppMenuButton extends StatelessWidget {
);
return [
for (final group in groups) ...[
- for (final item in group) row(item.command, item.label),
+ for (final item in group) row(item.command, item.label, item.icon),
rule,
],
if (app.currentUser?.email case final email?) paneMenuEmpty(email),
- row(_signOut, 'Sign out'),
+ row(_signOut, 'Sign out', const Icon(AppIcons.logOut)),
];
}
}
diff --git a/desktop/lib/web/shell/web_menu_items.dart b/desktop/lib/web/shell/web_menu_items.dart
index 617108de1..afc6ddb25 100644
--- a/desktop/lib/web/shell/web_menu_items.dart
+++ b/desktop/lib/web/shell/web_menu_items.dart
@@ -1,10 +1,21 @@
+import 'package:flutter/widgets.dart';
+
+import '../../shared/theme/app_icons.dart';
+import '../../shared/theme/app_pane_icon.dart';
+
/// Which layouts a menu row belongs to: some rows repeat a control the wide
/// bar already shows, others make no sense on a phone.
enum WebMenuWidth { any, compact, wide }
-/// One entry of the web app menu: a workspace command id and its menu label.
-/// The command itself lives in the workspace's shared command table.
-typedef WebMenuItem = ({String command, String label, WebMenuWidth width});
+/// One entry of the web app menu: a workspace command id, its menu label and
+/// the glyph the desktop menu bar gives the same command. The command itself
+/// lives in the workspace's shared command table.
+typedef WebMenuItem = ({
+ String command,
+ String label,
+ Widget icon,
+ WebMenuWidth width,
+});
/// What the menu offers, in groups a thin rule separates. Only what has no
/// other door in the browser chrome: new work is the `+` beside the tabs
@@ -17,29 +28,70 @@ typedef WebMenuItem = ({String command, String label, WebMenuWidth width});
/// All commands still reaches every one.
const List<List<WebMenuItem>> kWebMenuGroups = [
[
- (command: 'machines.list', label: 'Machines', width: WebMenuWidth.any),
- (command: 'models.list', label: 'Models', width: WebMenuWidth.any),
+ (
+ command: 'machines.list',
+ label: 'Machines',
+ icon: Icon(AppIcons.server),
+ width: WebMenuWidth.any,
+ ),
+ (
+ command: 'models.list',
+ label: 'Models',
+ icon: Icon(AppIcons.cpu),
+ width: WebMenuWidth.any,
+ ),
// The wide bar has its own Store button; the phone bar gives it up.
- (command: 'app.store', label: 'Store', width: WebMenuWidth.compact),
+ (
+ command: 'app.store',
+ label: 'Store',
+ icon: Icon(AppIcons.store),
+ width: WebMenuWidth.compact,
+ ),
],
[
// One split, always to the right: a second "down" row only lengthens the
// menu, and All commands still has Split down.
- (command: 'pane.split_right', label: 'Split pane', width: WebMenuWidth.any),
+ (
+ command: 'pane.split_right',
+ label: 'Split pane',
+ icon: AppPaneIcon(AppPaneSymbol.splitRight, size: AppIcons.inlineSize),
+ width: WebMenuWidth.any,
+ ),
],
[
- (command: 'navigation.history', label: 'History', width: WebMenuWidth.any),
+ (
+ command: 'navigation.history',
+ label: 'History',
+ icon: Icon(AppIcons.history),
+ width: WebMenuWidth.any,
+ ),
(
command: 'navigation.commands',
label: 'All commands',
+ icon: Icon(AppIcons.command),
width: WebMenuWidth.any,
),
],
[
- (command: 'app.settings', label: 'Settings', width: WebMenuWidth.any),
- (command: 'app.customize', label: 'Customize', width: WebMenuWidth.any),
+ (
+ command: 'app.settings',
+ label: 'Settings',
+ icon: Icon(AppIcons.settings),
+ width: WebMenuWidth.any,
+ ),
+ (
+ command: 'app.customize',
+ label: 'Customize',
+ icon: Icon(AppIcons.palette),
+ width: WebMenuWidth.any,
+ ),
// Pairing a phone is for a computer; a phone is already here.
- (command: 'app.add_phone', label: 'Add phone', width: WebMenuWidth.wide),
+ (
+ command: 'app.add_phone',
+ label: 'Add phone',
+ icon: Icon(AppIcons.smartphone),
+ width: WebMenuWidth.wide,
+ ),
],
];