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.

Local model manager dialog: say which machine will run the model

Tim72b7d40ec192
diff --git a/desktop/lib/widgets/run_local_model_dialog.dart b/desktop/lib/widgets/run_local_model_dialog.dart
index a602000d3..253db4f96 100644
--- a/desktop/lib/widgets/run_local_model_dialog.dart
+++ b/desktop/lib/widgets/run_local_model_dialog.dart
@@ -152,37 +152,28 @@ class _RunLocalModelDialogState extends State<_RunLocalModelDialog> {
/// lines, the name above, what it is below ("This machine", or online /
/// offline for another). The row is the select's own trigger when there is
/// more than one machine — same row, plus a chevron — and plain otherwise.
+ /// The machine, as one line under its label: "This machine (name)" or the
+ /// name — which one the person is sitting at is the fact a hostname alone
+ /// does not carry. The row is the select's own
+ /// trigger when there is more than one machine (plus a chevron), and plain
+ /// otherwise.
Widget _machineRow(MachineState m, {required bool opens}) => Row(
mainAxisSize: MainAxisSize.min,
children: [
- _machineMark(m, size: 22),
- const SizedBox(width: 10),
+ _machineMark(m, size: 16),
+ const SizedBox(width: 8),
Flexible(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- m.machine.displayName,
- key: const Key('run-local-model-machine'),
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontFamily: grid.AppFont.sans,
- fontSize: 12.5,
- height: 1.2,
- color: grid.AppPalette.textPrimary,
- ),
- ),
- Text(
- _kind(m),
- style: TextStyle(
- fontFamily: grid.AppFont.sans,
- fontSize: 11.5,
- height: 1.2,
- color: grid.AppPalette.textSecondary,
- ),
- ),
- ],
+ child: Text(
+ m.isLocalMachine
+ ? 'This machine (${m.machine.displayName})'
+ : m.machine.displayName,
+ key: const Key('run-local-model-machine'),
+ overflow: TextOverflow.ellipsis,
+ style: TextStyle(
+ fontFamily: grid.AppFont.sans,
+ fontSize: 12.5,
+ color: grid.AppPalette.textPrimary,
+ ),
),
),
if (opens) ...[
@@ -196,26 +187,20 @@ class _RunLocalModelDialogState extends State<_RunLocalModelDialog> {
],
);
- /// What a machine is, in two words, beside its name.
- String _kind(MachineState m) => m.isLocalMachine
- ? 'This machine'
- : _online(m)
- ? 'Online'
- : 'Offline';
-
- /// One machine: the slim row, nothing to choose. More: a row of small chips
- /// — up to three, this computer first, the chosen one filled — and a "…"
- /// that opens the pane menu (the same menu the pane's model picker draws,
- /// the current row filled rather than ticked) with every machine. One row
- /// whatever the count; the chosen machine always among the visible chips.
Widget _machineLine(List<MachineState> machines) {
final current = widget.notifier.stateOf(_machineId) ?? machines.firstOrNull;
if (current == null) return const SizedBox.shrink();
if (!widget.chooseMachine || machines.length < 2) {
+ // The same shape as the chooser below — a label, then the machine — so
+ // the two doors read as one dialog; only the verb differs, because here
+ // nothing is chosen.
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
- children: [_machineRow(current, opens: false), _where(current)],
+ children: [
+ _label('The model will run on'),
+ _machineRow(current, opens: false),
+ ],
);
}
final visible = machines.take(3).toList();
@@ -226,40 +211,26 @@ class _RunLocalModelDialogState extends State<_RunLocalModelDialog> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
- Padding(
- padding: const EdgeInsets.only(bottom: 8),
- child: Text(
- 'Which computer should it look after?',
- style: TextStyle(
- fontFamily: grid.AppFont.sans,
- fontSize: 12.5,
- color: grid.AppPalette.textSecondary,
- ),
- ),
- ),
+ _label('Select the machine to run the model'),
_chips(visible, machines),
- _where(current),
],
);
}
- /// One sentence under the machine, saying what the choice means in plain
- /// words: where the model will live, and that the picker everywhere sees it.
- /// "This computer" is said outright, because a hostname alone does not tell
- /// a person which of their machines they are sitting at.
- Widget _where(MachineState m) => Padding(
- padding: const EdgeInsets.only(top: 8),
+ /// What a machine is, in two words, beside its name.
+ String _kind(MachineState m) => m.isLocalMachine
+ ? 'This machine'
+ : _online(m)
+ ? 'Online'
+ : 'Offline';
+
+ Widget _label(String text) => Padding(
+ padding: const EdgeInsets.only(bottom: 8),
child: Text(
- m.isLocalMachine
- ? 'The model will run on this computer (${m.machine.displayName}). '
- 'Agents on any machine can use it.'
- : 'The model will run on ${m.machine.displayName}, not on this '
- 'computer. Agents on any machine can use it.',
- key: const Key('run-local-model-where'),
+ text,
style: TextStyle(
fontFamily: grid.AppFont.sans,
- fontSize: 12,
- height: 1.4,
+ fontSize: 12.5,
color: grid.AppPalette.textSecondary,
),
),
diff --git a/desktop/test/run_local_model_dialog_test.dart b/desktop/test/run_local_model_dialog_test.dart
index 06555c982..8ec05abf6 100644
--- a/desktop/test/run_local_model_dialog_test.dart
+++ b/desktop/test/run_local_model_dialog_test.dart
@@ -180,17 +180,9 @@ void main() {
expect(status, findsNothing);
// One slim row, not a control: with one machine there is nothing to choose.
expect(find.byKey(const Key('run-local-model-machine')), findsOneWidget);
- expect(find.text('studio-7'), findsOneWidget);
- expect(find.text('This machine'), findsOneWidget);
- // And one plain sentence saying what that means.
- expect(
- find.text(
- 'The model will run on this computer (studio-7). Agents on any machine can use it.',
- ),
- findsOneWidget,
- );
+ expect(find.text('This machine (studio-7)'), findsOneWidget);
// No chips, no "…", no prompt to pick: one machine is a statement, not a choice.
- expect(find.text('Which computer should it look after?'), findsNothing);
+ expect(find.text('Select the machine to run the model'), findsNothing);
expect(
find.byKey(const ValueKey('run-local-model-machine-local')),
findsNothing,
@@ -209,7 +201,7 @@ void main() {
expect(statusText(tester), 'Needs opencode on this machine first.');
// The machine is still named: the sentence is about it.
- expect(find.text('studio-7'), findsOneWidget);
+ expect(find.text('This machine (studio-7)'), findsOneWidget);
expect(startEnabled(tester), isFalse);
await tester.tap(start, warnIfMissed: false);
await tester.pumpAndSettle();
@@ -517,14 +509,10 @@ void main() {
await tester.tap(find.byKey(const Key('door')));
await tester.pumpAndSettle();
+ // Named plainly, under the same label the chooser wears, and NOT called this machine.
+ expect(find.text('The model will run on'), findsOneWidget);
expect(find.text('studio-7'), findsOneWidget);
- // Said plainly that this is NOT the computer the person is sitting at.
- expect(
- find.text(
- 'The model will run on studio-7, not on this computer. Agents on any machine can use it.',
- ),
- findsOneWidget,
- );
+ expect(find.textContaining('This machine'), findsNothing);
expect(
find.byKey(const ValueKey('run-local-model-machine-local')),
findsNothing,
@@ -533,7 +521,7 @@ void main() {
find.byKey(const ValueKey('run-local-model-machine-studio')),
findsNothing,
);
- expect(find.text('Which computer should it look after?'), findsNothing);
+ expect(find.text('Select the machine to run the model'), findsNothing);
await tester.tap(start);
await tester.pumpAndSettle();
@@ -596,7 +584,7 @@ void main() {
await tester.pumpAndSettle();
// Both machines as chips on one row, this computer first, the door's machine chosen — and
// one sentence saying what the chips are for.
- expect(find.text('Which computer should it look after?'), findsOneWidget);
+ expect(find.text('Select the machine to run the model'), findsOneWidget);
final localChip = find.byKey(
const ValueKey('run-local-model-machine-local'),
);