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.

fix(desktop): put See your phones beside Done, at the left

tonyf48218126772
diff --git a/desktop/lib/widgets/add_phone_dialog.dart b/desktop/lib/widgets/add_phone_dialog.dart
index b10b40ae5..961e61568 100644
--- a/desktop/lib/widgets/add_phone_dialog.dart
+++ b/desktop/lib/widgets/add_phone_dialog.dart
@@ -679,26 +679,29 @@ class _AddPhoneDialogState extends State<AddPhoneDialog> {
},
),
actions: [
- if (ready) ...[
- if (widget.onManageDevices != null)
- // The link sits on the button's line, not at its top.
- SizedBox(
- height: DesktopChrome.controlHeight,
- child: Center(
- child: _InlineLink(
+ if (ready)
+ // One row across the foot: See your phones at its left, Done at
+ // its right. ⚠️ Not two actions: the actions wrap to the right, and
+ // the link, centred in a box of the button's height, took a whole
+ // row of its own — centred over Done.
+ Row(
+ children: [
+ if (widget.onManageDevices != null)
+ _InlineLink(
key: const ValueKey('add-phone-see-phones'),
label: 'See your phones',
onPressed: _seePhones,
),
+ const Spacer(),
+ FilledButton(
+ key: const ValueKey('add-phone-done'),
+ autofocus: true,
+ onPressed: _close,
+ child: const Text('Done'),
),
- ),
- FilledButton(
- key: const ValueKey('add-phone-done'),
- autofocus: true,
- onPressed: _close,
- child: const Text('Done'),
- ),
- ] else if (_signedOut)
+ ],
+ )
+ else if (_signedOut)
TextButton(
key: const ValueKey('add-phone-cancel'),
onPressed: _close,
diff --git a/desktop/test/add_phone_dialog_test.dart b/desktop/test/add_phone_dialog_test.dart
index 80e9a1eb5..1971816f9 100644
--- a/desktop/test/add_phone_dialog_test.dart
+++ b/desktop/test/add_phone_dialog_test.dart
@@ -16,6 +16,8 @@ import 'package:harness/shared/theme/app_theme.dart' as grid;
import 'package:harness/shared/widgets/qr_code_view.dart';
import 'package:harness/state/app_state.dart';
import 'package:harness/widgets/add_phone_dialog.dart';
+import 'package:harness/widgets/desktop_chrome.dart'
+ show DesktopChrome, DesktopDialogSurface;
import 'swarm_interactions_test.dart' show chord;
import 'swarm_screen_test.dart' show mount;
@@ -236,6 +238,18 @@ void main() {
find.byKey(const ValueKey('add-phone-see-phones')),
findsOneWidget,
);
+ // One row across the foot: See your phones at the panel's left edge,
+ // Done at its right, both inside the panel's padding.
+ final panel = tester
+ .getRect(find.byType(DesktopDialogSurface))
+ .deflate(DesktopChrome.panelPadding);
+ final link = tester.getRect(
+ find.byKey(const ValueKey('add-phone-see-phones')),
+ );
+ final done = tester.getRect(find.byKey(const ValueKey('add-phone-done')));
+ expect((link.center.dy - done.center.dy).abs(), lessThan(1));
+ expect(link.left, moreOrLessEquals(panel.left, epsilon: 1));
+ expect(done.right, moreOrLessEquals(panel.right, epsilon: 1));
// Nothing moves once the phone is in: the dialog settles.
await tester.pumpAndSettle();
expect(find.byType(AddPhoneDialog), findsOneWidget);