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.

Mobile web: the top bar's icons line up evenly and are the same size (Huy) (#2556)

0xken153efb77676f6f
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index cb5ec7e5b..9f62cd1c6 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -3419,20 +3419,23 @@ class _SwarmScreenState extends State<SwarmScreen> {
else
KeyedSubtree(
key: _accountButtonKey,
- child: fingerTarget(
- enabled: compact,
- WorkspaceAvatarButton(
- key: const ValueKey('swarm-account-button'),
- initial: _accountInitial,
- tooltip: _accountTooltip,
- onPressed: _shortcutsEnabled
- ? () => unawaited(_showAccountMenu())
- : null,
- ),
- ),
+ child: compact
+ ? phoneBarCell(_avatarButton(size: kPhoneBarIcon))
+ : _avatarButton(),
),
];
+ Widget _avatarButton({double size = WorkspaceAvatarButton.diameter}) =>
+ WorkspaceAvatarButton(
+ key: const ValueKey('swarm-account-button'),
+ initial: _accountInitial,
+ tooltip: _accountTooltip,
+ size: size,
+ onPressed: _shortcutsEnabled
+ ? () => unawaited(_showAccountMenu())
+ : null,
+ );
+
double _accountControlWidth(BuildContext context) => !_accountControlShown
? 0
: DesktopChrome.controlGap +
@@ -9334,8 +9337,9 @@ class _SwarmScreenState extends State<SwarmScreen> {
},
);
- Widget _daemonTabButton() => DaemonSlotButton(
+ Widget _daemonTabButton({bool phoneBar = false}) => DaemonSlotButton(
face: _face,
+ phoneBar: phoneBar,
enabled: _shortcutsEnabled,
selected: _daemonOverlay != null,
onPressed: _activateDaemon,
@@ -9359,15 +9363,17 @@ class _SwarmScreenState extends State<SwarmScreen> {
builder: (context, emphasized) => SizedBox(
width: workspaceBarCellSizeOf(context).width * 4,
height: workspaceBarControlHeight(context),
- child: Icon(
- AppIcons.search,
- size: 16,
- color: theme.foreground.withValues(
- alpha: !_shortcutsEnabled
- ? .28
- : emphasized
- ? 1
- : .75,
+ child: Center(
+ child: Icon(
+ AppIcons.search,
+ size: workspaceIsCompact(context) ? kPhoneBarIcon : 16,
+ color: theme.foreground.withValues(
+ alpha: !_shortcutsEnabled
+ ? .28
+ : emphasized
+ ? 1
+ : .75,
+ ),
),
),
),
@@ -9429,38 +9435,44 @@ class _SwarmScreenState extends State<SwarmScreen> {
);
/// A compact host uses a tab switcher instead of the tab list.
- Widget _compactTabStrip(WorkspaceChrome chrome, TerminalTheme theme) =>
- Builder(
- builder: (context) {
- final cell = workspaceBarCellSizeOf(context);
- return Material(
- key: const ValueKey('workspace-tab-bar'),
- color: grid.AppPalette.swarmTabBar,
- // A phone's bar: every control a finger's size, its icon as it
- // was, so the bar is at least that tall too.
- child: SizedBox(
- height: math.max(
- kFingerTarget,
- math.max(_tabBarHeight, cell.height * 2),
- ),
- child: Row(
- children: [
- SizedBox(width: cell.width),
- Expanded(
- child: chrome.compactTabs!(context, _workspaceCommands),
- ),
- fingerTarget(enabled: true, _searchButton(theme)),
- fingerTarget(enabled: true, _notificationsButton(theme)),
- if (kIsWeb && _slotShown)
- fingerTarget(enabled: true, _daemonTabButton()),
- ..._accountControl(compact: true),
- SizedBox(width: cell.width),
- ],
+ Widget _compactTabStrip(
+ WorkspaceChrome chrome,
+ TerminalTheme theme,
+ ) => Builder(
+ builder: (context) {
+ final cell = workspaceBarCellSizeOf(context);
+ return Material(
+ key: const ValueKey('workspace-tab-bar'),
+ color: grid.AppPalette.swarmTabBar,
+ // A phone's bar: every control a finger's size, its icon as it
+ // was, so the bar is at least that tall too.
+ child: SizedBox(
+ height: math.max(
+ kFingerTarget,
+ math.max(_tabBarHeight, cell.height * 2),
+ ),
+ // What is drawn starts and ends [kPhoneBarGutter] from the screen's
+ // edges: the switcher pads its text by a cell, an icon's square
+ // pads its icon by the rest of the finger's width.
+ child: Row(
+ children: [
+ SizedBox(width: math.max(0, kPhoneBarGutter - cell.width)),
+ Expanded(child: chrome.compactTabs!(context, _workspaceCommands)),
+ phoneBarCell(_searchButton(theme)),
+ phoneBarCell(_notificationsButton(theme)),
+ if (kIsWeb && _slotShown) _daemonTabButton(phoneBar: true),
+ ..._accountControl(compact: true),
+ SizedBox(
+ width: _accountControlShown && app.isGuest
+ ? cell.width
+ : kPhoneBarGutter - (kFingerTarget - kPhoneBarIcon) / 2,
),
- ),
- );
- },
+ ],
+ ),
+ ),
);
+ },
+ );
Widget _statusToolIcon(
String id,
diff --git a/desktop/lib/super_tabs/machines.dart b/desktop/lib/super_tabs/machines.dart
index 4612c3179..cbe360cf6 100644
--- a/desktop/lib/super_tabs/machines.dart
+++ b/desktop/lib/super_tabs/machines.dart
@@ -19,6 +19,7 @@ import '../terminal/terminal_theme.dart';
import '../terminal/terminal_theme_store.dart';
import '../usage/models_menu_controller.dart';
import '../widgets/browser_menu_guard.dart';
+import '../widgets/finger_target.dart';
import '../widgets/desktop_chrome.dart';
import '../widgets/engine_identity.dart';
import '../widgets/harness_activity_mark.dart';
@@ -2665,28 +2666,38 @@ class _MachineMoreState extends State<_MachineMore> {
@override
Widget build(BuildContext context) {
- final shown = _focused || _open || _RowHover.of(context);
+ // A touch screen has nothing to hover (Huy, 2026-11-02): the ⋯ stays, a finger's size.
+ final touch = BrowserMenuGuard.onTouchScreen;
+ final shown = touch || _focused || _open || _RowHover.of(context);
+ final extent = touch ? kFingerTarget : _MachineMore.width;
+ final button = AppIconButton(
+ icon: AppIcons.ellipsis,
+ tooltip: 'More',
+ size: 16,
+ onPressed: () => unawaited(_press()),
+ );
return Focus(
canRequestFocus: false,
skipTraversal: true,
onFocusChange: (focused) => setState(() => _focused = focused),
child: SizedBox(
- width: shown ? _MachineMore.width : 0,
- height: _MachineMore.width,
+ width: shown ? extent : 0,
+ height: extent,
child: OverflowBox(
alignment: Alignment.centerRight,
- minWidth: _MachineMore.width,
- maxWidth: _MachineMore.width,
+ minWidth: extent,
+ maxWidth: extent,
child: Opacity(
opacity: shown ? 1 : 0,
child: IgnorePointer(
ignoring: !shown,
- child: AppIconButton(
- icon: AppIcons.ellipsis,
- tooltip: 'More',
- size: 16,
- onPressed: () => unawaited(_press()),
- ),
+ child: touch
+ ? GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () => unawaited(_press()),
+ child: Center(child: button),
+ )
+ : button,
),
),
),
diff --git a/desktop/lib/web/shell/web_new_menu.dart b/desktop/lib/web/shell/web_new_menu.dart
index 7ac8d6060..d6c125c2b 100644
--- a/desktop/lib/web/shell/web_new_menu.dart
+++ b/desktop/lib/web/shell/web_new_menu.dart
@@ -8,8 +8,8 @@ import '../../state/workspace_chrome.dart';
import '../../terminal/terminal_theme.dart';
import '../../terminal/terminal_theme_store.dart';
import '../../theme/app_theme.dart' show AppColors;
-import '../../widgets/finger_target.dart';
import '../../widgets/pane_menu.dart';
+import '../../widgets/finger_target.dart';
import '../../widgets/workspace_bar_control.dart';
import 'web_dropdown_control.dart';
import 'web_layout.dart';
@@ -66,7 +66,9 @@ class _WebNewMenuButtonState extends State<WebNewMenuButton> {
child: Center(
child: Icon(
AppIcons.plus,
- size: AppIcons.inlineSize,
+ size: workspaceIsCompact(context)
+ ? kPhoneBarIcon
+ : AppIcons.inlineSize,
color: theme.foreground.withValues(
alpha: !enabled
? .28
diff --git a/desktop/lib/web/tabs/web_tab_switcher.dart b/desktop/lib/web/tabs/web_tab_switcher.dart
index 883f0dba7..e43f4563f 100644
--- a/desktop/lib/web/tabs/web_tab_switcher.dart
+++ b/desktop/lib/web/tabs/web_tab_switcher.dart
@@ -51,16 +51,18 @@ class WebTabSwitcher extends StatelessWidget {
].join(' ');
return Row(
children: [
- Flexible(
- child: fingerTarget(
- enabled: true,
- _switcher(context, label, enabled, theme),
+ // All the room the name leaves: + stays beside the other icons, however
+ // short the name is.
+ Expanded(
+ child: Align(
+ alignment: Alignment.centerLeft,
+ child: fingerTarget(
+ enabled: true,
+ _switcher(context, label, enabled, theme),
+ ),
),
),
- fingerTarget(
- enabled: true,
- WebNewMenuButton(app: app, commands: commands),
- ),
+ phoneBarCell(WebNewMenuButton(app: app, commands: commands)),
],
);
}
diff --git a/desktop/lib/widgets/browser_menu_guard.dart b/desktop/lib/widgets/browser_menu_guard.dart
index da97e83b5..7d2d53d57 100644
--- a/desktop/lib/widgets/browser_menu_guard.dart
+++ b/desktop/lib/widgets/browser_menu_guard.dart
@@ -35,6 +35,12 @@ class BrowserMenuGuard {
/// Whether this runs in a browser, where a right-click is not sure to reach the app.
static bool get inBrowser => _web;
+ /// Whether this runs in a phone's or tablet's browser, where nothing can hover.
+ static bool get onTouchScreen =>
+ _web &&
+ (defaultTargetPlatform == TargetPlatform.android ||
+ defaultTargetPlatform == TargetPlatform.iOS);
+
/// Whether the browser's menu is off now.
static bool get isOff => _off;
diff --git a/desktop/lib/widgets/daemon_slot.dart b/desktop/lib/widgets/daemon_slot.dart
index d1bffbcff..c243504c4 100644
--- a/desktop/lib/widgets/daemon_slot.dart
+++ b/desktop/lib/widgets/daemon_slot.dart
@@ -7,6 +7,7 @@ import '../daemons/daemon_brain.dart';
import '../daemons/daemon_face.dart';
import '../daemons/illustrated_art.dart';
import 'daemon_illustration.dart';
+import 'finger_target.dart';
import '../daemons/individuals.dart';
import '../daemons/plates.dart';
import '../daemons/render.dart' show cardWidth;
@@ -287,8 +288,12 @@ class DaemonSlotButton extends StatefulWidget {
this.tooltip,
this.onHover,
this.enabled = true,
+ this.phoneBar = false,
});
final bool enabled;
+
+ /// On the phone's top bar: one of its even squares, drawn at its one icon size.
+ final bool phoneBar;
final DaemonFace face;
final VoidCallback onPressed;
final bool selected;
@@ -327,7 +332,7 @@ class _DaemonSlotButtonState extends State<DaemonSlotButton> {
if (!face.visible) return const SizedBox.shrink();
final theme = currentTerminalTheme();
final art = IllustratedArt.forFace(face);
- return MouseRegion(
+ final control = MouseRegion(
onEnter: (_) {
if (!widget.enabled ||
face.revealing ||
@@ -368,18 +373,22 @@ class _DaemonSlotButtonState extends State<DaemonSlotButton> {
key: const ValueKey('daemon-slot-art'),
art: art,
frame: IllustratedArt.frameForFace(face),
- size: 32,
+ size: widget.phoneBar ? kPhoneBarIcon : 32,
)
- : FittedBox(
- fit: BoxFit.scaleDown,
- child: Text(
- face.cell,
- key: const ValueKey('daemon-slot-glyph'),
- maxLines: 1,
- style: workspaceBarTextStyle(
- color: daemonSlotInk(face, theme),
- emphasized: emphasized,
- ).copyWith(fontFeatures: daemonTextFeatures),
+ : SizedBox(
+ width: widget.phoneBar ? kPhoneBarIcon : null,
+ height: widget.phoneBar ? kPhoneBarIcon : null,
+ child: FittedBox(
+ fit: BoxFit.scaleDown,
+ child: Text(
+ face.cell,
+ key: const ValueKey('daemon-slot-glyph'),
+ maxLines: 1,
+ style: workspaceBarTextStyle(
+ color: daemonSlotInk(face, theme),
+ emphasized: emphasized,
+ ).copyWith(fontFeatures: daemonTextFeatures),
+ ),
),
),
),
@@ -387,6 +396,9 @@ class _DaemonSlotButtonState extends State<DaemonSlotButton> {
),
),
);
+ // Here, not around the button: with no face shown there is no square,
+ // and the icons either side stay evenly spaced.
+ return widget.phoneBar ? phoneBarCell(control) : control;
},
);
}
@@ -553,7 +565,11 @@ class DaemonKeys extends StatelessWidget {
key: ValueKey('$idPrefix-$key'),
label: action.label,
tooltip: chord
- ? '${action.label} ${linuxKeyLabels ? 'Alt+Super+' : windowsKeyLabels ? 'Alt+Win+' : '⌘⌥'}${key.toUpperCase()}'
+ ? '${action.label} ${linuxKeyLabels
+ ? 'Alt+Super+'
+ : windowsKeyLabels
+ ? 'Alt+Win+'
+ : '⌘⌥'}${key.toUpperCase()}'
: action.label,
onPressed: () => onAnswer!(key),
builder: (context, emphasized) => SizedBox(
diff --git a/desktop/lib/widgets/finger_target.dart b/desktop/lib/widgets/finger_target.dart
index 2877d45f6..557d4756d 100644
--- a/desktop/lib/widgets/finger_target.dart
+++ b/desktop/lib/widgets/finger_target.dart
@@ -7,6 +7,18 @@ import '../state/workspace_chrome.dart';
/// The smallest target a finger can hit, both ways (audit finding S1).
const double kFingerTarget = 44;
+/// What the phone's top bar draws in each of its icon squares: one size, the
+/// avatar's circle too (Huy, 2026-11-02).
+const double kPhoneBarIcon = 20;
+
+/// How far the phone's top bar keeps what it draws from the screen's edges.
+const double kPhoneBarGutter = 16;
+
+/// One icon of the phone's top bar: exactly a finger's square, whatever the
+/// terminal font's cell, so the icons sit side by side at an even spacing.
+Widget phoneBarCell(Widget child) =>
+ SizedBox.square(dimension: kFingerTarget, child: child);
+
/// [child] grown to at least [kFingerTarget] each way when [enabled] (a
/// phone), its content centered; otherwise [child] as it is.
Widget fingerTarget(Widget child, {required bool enabled}) => enabled
diff --git a/desktop/lib/widgets/workspace_account_button.dart b/desktop/lib/widgets/workspace_account_button.dart
index 04ac496dd..f3e274d78 100644
--- a/desktop/lib/widgets/workspace_account_button.dart
+++ b/desktop/lib/widgets/workspace_account_button.dart
@@ -86,6 +86,7 @@ class WorkspaceAvatarButton extends StatelessWidget {
required this.initial,
required this.tooltip,
this.onPressed,
+ this.size = diameter,
});
/// One letter, or empty while the profile has not been read: a person mark.
@@ -93,6 +94,9 @@ class WorkspaceAvatarButton extends StatelessWidget {
final String tooltip;
final VoidCallback? onPressed;
+ /// The circle as this row draws it ([diameter], unless the row says).
+ final double size;
+
/// The circle. Its slot in the row is [widthOf].
static const diameter = 24.0;
@@ -113,7 +117,7 @@ class WorkspaceAvatarButton extends StatelessWidget {
child: Center(
child: AccountAvatar(
initial: initial,
- diameter: diameter,
+ diameter: size,
emphasized: emphasized,
enabled: enabled,
accent: accent,
diff --git a/desktop/lib/widgets/workspace_notifications_button.dart b/desktop/lib/widgets/workspace_notifications_button.dart
index 7efa55800..9818bcf17 100644
--- a/desktop/lib/widgets/workspace_notifications_button.dart
+++ b/desktop/lib/widgets/workspace_notifications_button.dart
@@ -2,6 +2,7 @@ import 'package:harness/shared/theme/app_icons.dart';
import 'package:flutter/material.dart';
import '../shared/theme/workspace_bar_style.dart';
+import 'finger_target.dart';
import 'workspace_bar_control.dart';
/// A fixed-width bell; changes to its count never move the neighboring ribbon.
@@ -42,7 +43,7 @@ class WorkspaceNotificationsButton extends StatelessWidget {
),
child: Icon(
AppIcons.bell,
- size: 16,
+ size: workspaceIsCompact(context) ? kPhoneBarIcon : 16,
color: foreground.withValues(
alpha: onPressed == null
? .28
diff --git a/desktop/test/daemon_review_render_test.dart b/desktop/test/daemon_review_render_test.dart
index b8c2851a7..17782ee4f 100644
--- a/desktop/test/daemon_review_render_test.dart
+++ b/desktop/test/daemon_review_render_test.dart
@@ -326,6 +326,67 @@ Widget _bar(
void main() {
setUpAll(_fonts);
+ // Huy, 2026-11-02: the phone bar's icons are one size, in even squares.
+ group('the slot on the phone bar', () {
+ final cell = find.byKey(const ValueKey('daemon-slot'));
+ final art = find.byKey(const ValueKey('daemon-slot-art'));
+ final glyph = find.byKey(const ValueKey('daemon-slot-glyph'));
+
+ Future<void> slot(WidgetTester tester, DaemonFace face, bool phone) async {
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Center(
+ child: DaemonSlotButton(
+ face: face,
+ onPressed: () {},
+ phoneBar: phone,
+ ),
+ ),
+ ),
+ );
+ await tester.pump();
+ }
+
+ testWidgets('draws its art at the bar\'s icon size in a finger\'s square', (
+ tester,
+ ) async {
+ final face = await _face(tester, _paired('tim', version: '0.1'));
+ await slot(tester, face, true);
+ expect(tester.getSize(cell), const Size(44, 44));
+ expect(tester.getSize(art), const Size(20, 20));
+ // Anywhere else, as it was.
+ await slot(tester, face, false);
+ expect(tester.getSize(art).width, 32);
+ });
+
+ testWidgets('draws its glyph no bigger than the bar\'s icon size', (
+ tester,
+ ) async {
+ // A daemon with no illustration draws its text cell.
+ final face = await _face(tester, _paired('vim', version: '0.1'));
+ await slot(tester, face, true);
+ expect(art, findsNothing);
+ expect(tester.getSize(cell), const Size(44, 44));
+ final drawn = tester.getRect(glyph);
+ final box = find.ancestor(of: glyph, matching: find.byType(FittedBox));
+ expect(tester.getSize(box.first).width, lessThanOrEqualTo(20));
+ expect(tester.getSize(box.first).height, lessThanOrEqualTo(20));
+ expect(drawn.center, tester.getCenter(cell));
+ });
+
+ testWidgets('takes no room at all while the face is not shown', (
+ tester,
+ ) async {
+ final face = await _face(tester, const Zoo());
+ face.zoo.bind(null);
+ await tester.pump();
+ expect(face.visible, isFalse);
+ await slot(tester, face, true);
+ expect(cell, findsNothing);
+ expect(tester.getSize(find.byType(DaemonSlotButton)), Size.zero);
+ });
+ });
+
for (final brightness in [Brightness.dark, Brightness.light]) {
for (final species in IllustratedArt.species) {
testWidgets('artwork gallery: $species ${brightness.name}', (
diff --git a/desktop/test/super_tab_machines_test.dart b/desktop/test/super_tab_machines_test.dart
index 8c95455f3..472ef727a 100644
--- a/desktop/test/super_tab_machines_test.dart
+++ b/desktop/test/super_tab_machines_test.dart
@@ -1,6 +1,8 @@
import 'dart:io';
import 'dart:ui' show PointerDeviceKind;
+import 'package:flutter/foundation.dart'
+ show debugDefaultTargetPlatformOverride;
import 'package:flutter/gestures.dart' show kSecondaryMouseButton;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
@@ -1665,7 +1667,11 @@ void main() {
Future<dynamic> browser(
WidgetTester tester, {
String owner = 'owner',
+ // A test runs as Android unless it says: these are a mouse's browser.
+ TargetPlatform platform = TargetPlatform.macOS,
}) async {
+ debugDefaultTargetPlatformOverride = platform;
+ addTearDown(() => debugDefaultTargetPlatformOverride = null);
BrowserMenuGuard.debugWeb = true;
BrowserMenuGuard.debugSink = (_) async {};
addTearDown(BrowserMenuGuard.debugReset);
@@ -1689,8 +1695,42 @@ void main() {
await tester.pumpWidget(const SizedBox());
await c.flush();
c.dispose();
+ debugDefaultTargetPlatformOverride = null;
}
+ // Huy, 2026-11-02: a touch screen has nothing to hover, so the ⋯ stays.
+ for (final platform in [TargetPlatform.iOS, TargetPlatform.android]) {
+ testWidgets(
+ 'on a ${platform.name} browser it is always there, a finger wide, and a tap opens the menu',
+ (tester) async {
+ final c = await browser(tester, platform: platform);
+ final size = tester.getSize(more);
+ expect(size.width, greaterThanOrEqualTo(44));
+ expect(size.height, greaterThanOrEqualTo(44));
+ // Its corner too: the whole finger's target opens it.
+ await tester.tapAt(tester.getTopLeft(more) + const Offset(2, 2));
+ await tester.pumpAndSettle();
+ expect(find.text('Details'), findsOneWidget);
+ expect(c.isMachineExpanded('studio'), isFalse);
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pumpAndSettle();
+ expect(tester.getSize(more).width, greaterThanOrEqualTo(44));
+ await done(tester, c);
+ },
+ );
+ }
+
+ testWidgets(
+ 'a browser with a mouse keeps it for hover, focus or an open menu',
+ (tester) async {
+ final c = await browser(tester);
+ expect(width(tester), 0);
+ await hover(tester);
+ expect(width(tester), 32);
+ await done(tester, c);
+ },
+ );
+
testWidgets('shows on pointing and opens the same menu on a left click', (
tester,
) async {
diff --git a/desktop/test/web_chrome_menus_test.dart b/desktop/test/web_chrome_menus_test.dart
index 76fed264a..1b0d5aa63 100644
--- a/desktop/test/web_chrome_menus_test.dart
+++ b/desktop/test/web_chrome_menus_test.dart
@@ -11,6 +11,7 @@ import 'package:harness/state/terminal_pane.dart';
import 'package:harness/web/shell/web_chrome.dart';
import 'package:harness/widgets/account_menu.dart';
import 'package:harness/widgets/swarm_switcher.dart';
+import 'package:harness/widgets/workspace_account_button.dart';
import 'support/capture.dart';
import 'support/real_fonts.dart';
@@ -303,6 +304,60 @@ void main() {
});
}
+ // Huy, 2026-11-02: the phone bar's icons line up evenly and are one size.
+ for (final width in [360.0, 390.0]) {
+ for (final name in ['a', 'A tab with a very long name that cannot fit']) {
+ testWidgets(
+ 'its icons line up evenly and match at $width, tab "$name"',
+ (tester) async {
+ final app = _app();
+ app.renameSwarm(app.activeSwarmId, name);
+ await _mount(tester, Size(width, 740), app: app);
+ Finder icon(String key, Type type) => find.descendant(
+ of: find.byKey(ValueKey(key)),
+ matching: find.byType(type),
+ );
+ final cells = [
+ for (final key in [
+ 'web-new-menu-button',
+ 'swarm-search-button',
+ 'workspace-notifications-button',
+ 'swarm-account-button',
+ ])
+ tester.getRect(find.byKey(ValueKey(key))),
+ ];
+ // Every icon has the same square, side by side, so the spacing is even.
+ for (final cell in cells) {
+ expect(cell.size, const Size(44, 44));
+ }
+ for (var i = 1; i < cells.length; i++) {
+ expect(cells[i].left, cells[i - 1].right);
+ }
+ // And what is drawn in it is one size, the avatar's circle too.
+ final drawn = [
+ tester.getRect(icon('web-new-menu-button', Icon).first),
+ tester.getRect(icon('swarm-search-button', Icon).first),
+ tester.getRect(
+ icon('workspace-notifications-button', Icon).first,
+ ),
+ tester.getRect(icon('swarm-account-button', AccountAvatar).first),
+ ];
+ for (final rect in drawn) {
+ expect(rect.size, const Size(20, 20));
+ }
+ for (var i = 0; i < drawn.length; i++) {
+ expect(drawn[i].center, cells[i].center);
+ }
+ // The row starts and ends the same distance from the screen's edges.
+ final label = tester.getRect(icon('web-tab-switcher', Text).first);
+ expect(label.left, 16);
+ expect(drawn.last.right, width - 16);
+ await _done(tester, app);
+ },
+ );
+ }
+ }
+
testWidgets('Machines and Models stay in the phone footer\'s menu', (
tester,
) async {
diff --git a/desktop/test/web_tab_switcher_test.dart b/desktop/test/web_tab_switcher_test.dart
index ec0f81f67..f93c3a621 100644
--- a/desktop/test/web_tab_switcher_test.dart
+++ b/desktop/test/web_tab_switcher_test.dart
@@ -269,7 +269,8 @@ void main() {
matching: find.byType(Icon),
),
);
- expect(icon.size, 16, reason: key);
+ // The phone bar's one icon size (Huy, 2026-11-02), still well under the target.
+ expect(icon.size, 20, reason: key);
}
expect(tester.takeException(), isNull);
await tester.pumpWidget(const SizedBox.shrink());
@@ -282,6 +283,13 @@ void main() {
final app = await mount(tester, const Size(1280, 800));
for (final key in ['swarm-search-button']) {
expect(tester.getSize(find.byKey(ValueKey(key))).height, 28);
+ final icon = tester.widget<Icon>(
+ find.descendant(
+ of: find.byKey(ValueKey(key)),
+ matching: find.byType(Icon),
+ ),
+ );
+ expect(icon.size, 16, reason: key);
}
await tester.pumpWidget(const SizedBox.shrink());
app.dispose();