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): → goes to the choices, and a machine that is down says so

0xken15bc66784bd1a4
diff --git a/desktop/design/bios-setup-screen-handoff.md b/desktop/design/bios-setup-screen-handoff.md
index b13b6a227..c29e87d3c 100644
--- a/desktop/design/bios-setup-screen-handoff.md
+++ b/desktop/design/bios-setup-screen-handoff.md
@@ -141,12 +141,26 @@ Three earlier designs were rejected, and the reasons still apply:
| Key | On the items | With the list live |
| --- | --- | --- |
| `↑↓` | move between rows | move within the list |
-| `←→` | change the focused value in place | — |
-| `↵` | **Pick from List** — hand the arrows to the right column | take the value |
+| `→` | **hand the keys to the right column** (Worktree: flip it) | move the caret |
+| `←` | — (Worktree: flip it) | empty search: **back to the items**; otherwise move the caret |
+| `PgDn` `PgUp` | change the focused value in place | — |
+| `↵` | hand the keys to the right column | take the value |
| `Esc` | close | back to the items |
| `Tab` | walk the rows | walk the list |
| typing | fuzzy search the focused row | narrow further |
+**Changed 2026-09-24, on the owner's request, and loudly rather than
+quietly.** The arrows used to change the focused value where it stood, the way
+a BIOS screen does, and `↵` alone handed the keys across. But this screen is
+two columns side by side, which a BIOS is not: people read the choices on the
+right and reach for `→` to get at them, and what they got instead was the
+value on the LEFT changing under them. `→` now goes where the eye already
+went. Stepping a value in place keeps `PgUp`/`PgDn`, which this document
+already picked for it, and `↵` is unchanged so nobody's hands have to be
+re-taught. Worktree is the one exception both arrows keep: two values and
+nothing to browse, so there is no column to go to (and
+`new-harness-entry-rules.md` still describes it exactly as before).
+
Two rules hold it together:
1. **Only `New Harness` starts an agent.** Return on a value row never
diff --git a/desktop/design/new-harness-entry-rules.md b/desktop/design/new-harness-entry-rules.md
index 6d2f2f9e9..46a30d79b 100644
--- a/desktop/design/new-harness-entry-rules.md
+++ b/desktop/design/new-harness-entry-rules.md
@@ -13,8 +13,9 @@ Tasks carried from search or Store examples remain part of the draft.
Values and search use the terminal's selected font, size, and line height.
The right pane previews choices without a selection highlight while the left
-has focus. Return or typing activates the list; accepting a value returns to
-its field. The three project actions have icons. Clone, folder path, and new
+has focus. Right arrow, Return, or typing activates the list, and Left arrow
+gives the keys back to the rows once the search is empty; accepting a value
+returns to its field. The three project actions have icons. Clone, folder path, and new
project prompts return to Project after acceptance; only New Harness starts.
Project, machine, branch, and approval options occupy one line. Only the local
machine has a note, **This machine**. Approvals come from the chosen agent's
diff --git a/desktop/lib/core/models.dart b/desktop/lib/core/models.dart
index e790e5e73..dbd1ba73a 100644
--- a/desktop/lib/core/models.dart
+++ b/desktop/lib/core/models.dart
@@ -117,6 +117,25 @@ class Machine {
? name!
: 'machine-${machineId.length > 8 ? machineId.substring(0, 8) : machineId}';
+ /// What the machine list says about this computer being up — `null` when it
+ /// says a word neither side has agreed on, which is not the same as "down".
+ ///
+ /// This is the ONE signal that speaks for a machine we have never reached:
+ /// our own socket goes to the local daemon, so its being up says nothing
+ /// about whether the far end answered. Kept on the model rather than in
+ /// `AppNotifier` because the box reads it too, and two copies of a word list
+ /// are two chances to disagree about what "stopped" means.
+ bool? get reportedOnline => switch (status?.trim().toLowerCase()) {
+ 'running' || 'online' || 'connected' || 'ready' => true,
+ 'offline' ||
+ 'stopped' ||
+ 'disconnected' ||
+ 'unreachable' ||
+ 'error' ||
+ 'failed' => false,
+ _ => null,
+ };
+
factory Machine.fromJson(Map<String, dynamic> j) => Machine(
machineId: j['machineId'] as String,
apiKey: j['apiKey'] as String? ?? '',
diff --git a/desktop/lib/state/app_state.dart b/desktop/lib/state/app_state.dart
index ff24d8edd..6836b3ebf 100644
--- a/desktop/lib/state/app_state.dart
+++ b/desktop/lib/state/app_state.dart
@@ -338,6 +338,25 @@ class MachineState {
bool get isLocalMachine => localOnly || localEndpoint != null;
bool get usesLocalTransport => localEndpoint != null;
+ /// Whether this machine can be given work right now.
+ ///
+ /// Two witnesses, and neither is always right. [nodeOnline] is what has been
+ /// heard ABOUT the far end — but it is also set hopefully, the moment our
+ /// own socket connects (`_onMachineConnected`), and that socket only reaches
+ /// the LOCAL daemon: it proves nothing about a computer on the other side of
+ /// the relay. The machine list is the backend's own view, and a computer it
+ /// calls `offline` is one that stopped heartbeating to it.
+ ///
+ /// So the list's `offline` counts even against a hopeful `nodeOnline`, and
+ /// the one machine exempt is this one — the computer the app is running on
+ /// is not offline, whatever a stale row says about it. Erring this way is
+ /// deliberate: the cost of being wrong is a machine that looks unavailable
+ /// for a few seconds longer, against starting work on a computer that is
+ /// not there and finding out a minute later.
+ bool get isOffline =>
+ nodeOnline == false ||
+ (!isLocalMachine && machine.reportedOnline == false);
+
AgentProject? projectOf(Agent agent) =>
agent.project ??
localProjects[agent.id] ??
@@ -2371,25 +2390,6 @@ class AppNotifier extends ChangeNotifier {
: machineStates[expandedMachines.first];
}
- bool? _nodeOnlineFromStatus(String? status) {
- switch (status?.trim().toLowerCase()) {
- case 'running':
- case 'online':
- case 'connected':
- case 'ready':
- return true;
- case 'offline':
- case 'stopped':
- case 'disconnected':
- case 'unreachable':
- case 'error':
- case 'failed':
- return false;
- default:
- return null;
- }
- }
-
Future<void> selectAutonomousEnv(String value) async {
if (value != 'prod' && value != 'stag') return;
_autonomousEnv = value;
@@ -4211,7 +4211,7 @@ class AppNotifier extends ChangeNotifier {
localComputerId != null &&
_normalizeComputerId(machine.computerId) == localComputerId;
_applyLocalTransport(state, localEndpoint, localComputerId);
- final reportedOnline = _nodeOnlineFromStatus(machine.status);
+ final reportedOnline = machine.reportedOnline;
if (!state.isLocalMachine &&
reportedOnline != null &&
(state.nodeOnline == null || state.nodeOnline != reportedOnline)) {
@@ -4794,7 +4794,7 @@ class AppNotifier extends ChangeNotifier {
(item) => item.machineId == machineId,
);
if (latest.isEmpty) return;
- final reportedOnline = _nodeOnlineFromStatus(latest.first.status);
+ final reportedOnline = latest.first.reportedOnline;
if (reportedOnline == null) return;
machine.machine = latest.first;
await _applyNodeStatus(machine, reportedOnline);
@@ -8552,6 +8552,7 @@ class AppNotifier extends ChangeNotifier {
String machineId,
String agentId, {
bool fromQuestion = false,
+
/// The dial's own opens are [AttachIntent.automatic]; the Store's Resume
/// button borrows this door and IS a person, so it says so.
AttachIntent intent = AttachIntent.automatic,
@@ -8704,11 +8705,8 @@ class AppNotifier extends ChangeNotifier {
final existing = paneOfAgent(machineId, agentId);
if (existing == null) {
await _fromDevice(
- () => addAgentToSwarm(
- machineId,
- agentId,
- intent: AttachIntent.automatic,
- ),
+ () =>
+ addAgentToSwarm(machineId, agentId, intent: AttachIntent.automatic),
);
return;
}
@@ -8812,6 +8810,7 @@ class AppNotifier extends ChangeNotifier {
PaneSplitRequest? split,
bool autoTile = false,
bool focus = true,
+
/// A rail click, a drag, a picker — a person. The device's own doors pass
/// [AttachIntent.automatic]: they put an agent on screen without anybody
/// touching this Mac, so the terminal they show must not be taken from
@@ -10053,7 +10052,11 @@ class AppNotifier extends ChangeNotifier {
_persistLayout();
for (final machine in machineStates.values) {
// A desk another Mac wrote arriving here.
- _attachPendingPanes(machine, retryExisting: false, intent: AttachIntent.automatic);
+ _attachPendingPanes(
+ machine,
+ retryExisting: false,
+ intent: AttachIntent.automatic,
+ );
}
_announceAppFocus();
notifyListeners();
diff --git a/desktop/lib/state/new_harness.dart b/desktop/lib/state/new_harness.dart
index abb142223..74cb1daba 100644
--- a/desktop/lib/state/new_harness.dart
+++ b/desktop/lib/state/new_harness.dart
@@ -1856,6 +1856,10 @@ class NewHarnessController extends ChangeNotifier {
state.isLocalMachine,
state.needsLink,
state.nodeOnline,
+ // The machine list's own word, which moves without `nodeOnline` ever
+ // changing — a machine that goes offline while nothing has been heard
+ // from it would otherwise keep its old row.
+ state.isOffline,
],
machine?.engines.loaded,
for (final identity in allEngines)
@@ -2210,10 +2214,14 @@ class NewHarnessController extends ChangeNotifier {
machine.isLocalMachine ? 'This computer' : 'Remote',
if (machine.needsLink)
'link required'
- else if (machine.nodeOnline == false)
+ else if (machine.isOffline)
'offline',
].join(' · '),
- enabled: !machine.needsLink && machine.nodeOnline != false,
+ // `isOffline`, not `nodeOnline == false`: a machine nothing has been
+ // heard from yet still has the machine list's word for it, and a
+ // computer the list calls offline cannot start an agent — offering
+ // it is offering a failure a minute from now.
+ enabled: !machine.needsLink && !machine.isOffline,
why: machine.needsLink
? '${machine.machine.displayName} is not linked to this '
'computer yet. Link it from the Machines menu.'
@@ -2292,7 +2300,7 @@ class NewHarnessController extends ChangeNotifier {
detail: location(folder),
project: NewHarnessProject.folder(folder),
machineId: _machineId,
- enabled: _machine?.needsLink != true && _machine?.nodeOnline != false,
+ enabled: _machine?.needsLink != true && _machine?.isOffline != true,
why: _machine?.needsLink == true
? '$machineLabel needs linking. Open Machines to link it.'
: '$machineLabel is offline.',
diff --git a/desktop/lib/widgets/new_harness_form.dart b/desktop/lib/widgets/new_harness_form.dart
index c47588069..24b2eeea9 100644
--- a/desktop/lib/widgets/new_harness_form.dart
+++ b/desktop/lib/widgets/new_harness_form.dart
@@ -281,6 +281,21 @@ class _NewHarnessFormState extends State<NewHarnessForm> {
box.applyOption(_wheel[_at]);
}
+ /// Hand the keys back to the rows, leaving the choices on screen.
+ ///
+ /// One implementation for the two ways out that are not Escape: ← from the
+ /// live list, and the narrow layout's back chevron. They used to be written
+ /// twice, which is how a back button and a back key drift apart.
+ void _backToRows() {
+ if (_prompts.contains(box.field)) {
+ box.focusField(NewHarnessField.projectMenu);
+ }
+ box.setQuery('');
+ setState(() => _listOpen = false);
+ _focus.requestFocus();
+ _revealRow();
+ }
+
/// Folder paths, project names and repository URLs keep their prompt active
/// even before anything is typed.
static const _prompts = {
@@ -481,16 +496,31 @@ class _NewHarnessFormState extends State<NewHarnessForm> {
case LogicalKeyboardKey.arrowUp:
_picking ? _stepMatch(-1) : _moveRow(-1);
case LogicalKeyboardKey.arrowRight:
- case LogicalKeyboardKey.pageDown:
- if (_picking && event.logicalKey == LogicalKeyboardKey.arrowRight) {
- return KeyEventResult.ignored;
+ // → goes to the COLUMN on the right, it does not edit the value on
+ // the left. Two columns side by side, and the arrow follows the eye:
+ // reading the choices and reaching for → to get at them is what
+ // everybody tried first. A row with no column to enter — Worktree,
+ // which is two values and nothing to browse — still flips in place.
+ if (_picking) return KeyEventResult.ignored; // the caret's key now
+ if (_hasChoices) {
+ setState(() => _listOpen = true);
+ } else {
+ _stepValue(1);
}
- if (!_picking) _stepValue(1);
case LogicalKeyboardKey.arrowLeft:
- case LogicalKeyboardKey.pageUp:
- if (_picking && event.logicalKey == LogicalKeyboardKey.arrowLeft) {
- return KeyEventResult.ignored;
+ if (_picking) {
+ // With something typed, ← is an editing key: it moves through the
+ // characters rather than walking out of the search they are in.
+ if (box.query.isNotEmpty) return KeyEventResult.ignored;
+ _backToRows();
+ } else if (!_hasChoices) {
+ _stepValue(-1);
}
+ case LogicalKeyboardKey.pageDown:
+ // The wheel's home now that the arrows have left it — as documented
+ // long before this: hyphens are values, so - and + cannot serve.
+ if (!_picking) _stepValue(1);
+ case LogicalKeyboardKey.pageUp:
if (!_picking) _stepValue(-1);
case LogicalKeyboardKey.enter:
case LogicalKeyboardKey.numpadEnter:
@@ -725,15 +755,7 @@ class _NewHarnessFormState extends State<NewHarnessForm> {
padding: const EdgeInsets.only(bottom: 16),
child: InkWell(
canRequestFocus: false,
- onTap: () {
- if (_prompts.contains(box.field)) {
- box.focusField(NewHarnessField.projectMenu);
- }
- box.setQuery('');
- setState(() => _listOpen = false);
- _focus.requestFocus();
- _revealRow();
- },
+ onTap: _backToRows,
child: Row(
children: [
Icon(
@@ -897,11 +919,26 @@ class _NewHarnessFormState extends State<NewHarnessForm> {
);
}
+ /// The word at the right of a machine row.
+ ///
+ /// A row that cannot be chosen has to SAY so: dimmed text alone reads as a
+ /// theme, and the reason — offline, or never linked — is the one thing the
+ /// person needs in order to do something about it. Machine rows are the only
+ /// ones that carry a note, so "This machine" keeps the slot when there is no
+ /// bad news to put in it.
+ String? _machineNote(String machineId) {
+ final machine = box.app.stateOf(machineId);
+ if (machine == null) return null;
+ if (machine.needsLink) return 'Link required';
+ if (machine.isOffline) return 'Offline';
+ return machine.isLocalMachine ? 'This machine' : null;
+ }
+
Widget _matchRow(NewHarnessOption option) {
final on = identical(option, box.selected);
- final local =
- box.field == NewHarnessField.machine &&
- box.app.stateOf(option.id)?.isLocalMachine == true;
+ final note = box.field == NewHarnessField.machine
+ ? _machineNote(option.id)
+ : null;
final actionIcon = switch (option.id) {
NewHarnessController.repositoryId => LucideIcons.gitBranch300,
NewHarnessController.existingProjectId ||
@@ -960,13 +997,13 @@ class _NewHarnessFormState extends State<NewHarnessForm> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- if (local)
+ if (note != null)
Row(
children: [
Expanded(child: title),
const SizedBox(width: 12),
Text(
- 'This machine',
+ note,
style: _ink(
kBoxFaint,
).copyWith(fontSize: terminalFontStore.size * .85),
diff --git a/desktop/test/new_harness_box_test.dart b/desktop/test/new_harness_box_test.dart
index 46cca6b87..d1175090e 100644
--- a/desktop/test/new_harness_box_test.dart
+++ b/desktop/test/new_harness_box_test.dart
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/core/engine_availability.dart';
+import 'package:harness/core/models.dart';
import 'package:harness/core/dsh_catalog.dart';
import 'package:harness/core/local_key_value_store.dart';
import 'package:harness/core/project_folder.dart';
@@ -581,6 +582,90 @@ void main() {
expect(shell.error, contains('will not be sent'));
});
+ // The machine LIST is the only witness for a computer nothing has been heard
+ // from: our socket reaches the local daemon, and its being up says nothing
+ // about the far end of the relay. A machine the list calls offline used to be
+ // offered like any other, and the failure arrived a minute later.
+ test('a machine the list calls offline cannot be chosen', () async {
+ final app = createApp();
+ seedMixedAgents(app);
+ app.machineStates['studio']!
+ ..nodeOnline = null
+ ..machine = const Machine(
+ machineId: 'studio',
+ name: 'iMac · Office',
+ authMode: MachineAuthMode.remote,
+ status: 'offline',
+ );
+ final box = NewHarnessController(app, machineId: 'm', engine: 'claude');
+ addTearDown(box.dispose);
+ box.focusField(NewHarnessField.machine);
+ final row = box.options.firstWhere((option) => option.id == 'studio');
+ expect(row.enabled, isFalse);
+ expect(row.detail, contains('offline'));
+ box.accept(row);
+ expect(box.error, contains('offline'));
+ expect(box.machineId, 'm', reason: 'and the machine did not change');
+ });
+
+ // `nodeOnline` is set hopefully the instant OUR socket connects, and that
+ // socket reaches the local daemon — not the computer across the relay. So a
+ // true from it does not outrank the backend's own view.
+ test('the list is believed over a hopeful socket', () async {
+ final app = createApp();
+ seedMixedAgents(app);
+ app.machineStates['studio']!
+ ..nodeOnline = true
+ ..machine = const Machine(
+ machineId: 'studio',
+ name: 'iMac · Office',
+ authMode: MachineAuthMode.remote,
+ status: 'offline',
+ );
+ final box = NewHarnessController(app, machineId: 'm', engine: 'claude');
+ addTearDown(box.dispose);
+ box.focusField(NewHarnessField.machine);
+ final row = box.options.firstWhere((option) => option.id == 'studio');
+ expect(row.enabled, isFalse);
+ });
+
+ // ...and the computer the app is running on is never called offline, however
+ // stale its row in the list is.
+ test('this computer is never disabled by the list', () async {
+ final app = createApp();
+ seedMixedAgents(app);
+ app.machineStates['m']!
+ ..localOnly = true
+ ..nodeOnline = null
+ ..machine = const Machine(
+ machineId: 'm',
+ name: 'MacBook',
+ authMode: MachineAuthMode.remote,
+ status: 'offline',
+ );
+ expect(app.machineStates['m']!.isOffline, isFalse);
+ });
+
+ test('a machine the list calls running stays choosable', () async {
+ final app = createApp();
+ seedMixedAgents(app);
+ app.machineStates['studio']!
+ ..nodeOnline = null
+ ..machine = const Machine(
+ machineId: 'studio',
+ name: 'iMac · Office',
+ authMode: MachineAuthMode.remote,
+ status: 'running',
+ );
+ final box = NewHarnessController(app, machineId: 'm', engine: 'claude');
+ addTearDown(box.dispose);
+ box.focusField(NewHarnessField.machine);
+ expect(
+ box.options.firstWhere((option) => option.id == 'studio').enabled,
+ isTrue,
+ );
+ });
+
test('Return and ⌘↵ are never silent, and a dropped task is said', () async {
final app = createApp();
app.machineStates['m']!.nodeOnline = false;
diff --git a/desktop/test/new_harness_form_test.dart b/desktop/test/new_harness_form_test.dart
index 97127f66d..a7d39fde3 100644
--- a/desktop/test/new_harness_form_test.dart
+++ b/desktop/test/new_harness_form_test.dart
@@ -132,7 +132,10 @@ void main() {
expect(box.field, NewHarnessField.projectMenu);
});
- testWidgets('right walks every agent instead of bouncing between two', (
+ // Page Up/Down are where stepping a value in place lives — the arrows are
+ // the two columns' own keys. `-` and `+` cannot serve: folder and branch
+ // names are full of hyphens.
+ testWidgets('page down walks every agent instead of bouncing between two', (
tester,
) async {
final box = await mount(tester);
@@ -140,36 +143,97 @@ void main() {
expect(box.field, NewHarnessField.agent);
final seen = <String>{box.engine};
for (var i = 0; i < 6; i++) {
- await press(tester, LogicalKeyboardKey.arrowRight);
+ await press(tester, LogicalKeyboardKey.pageDown);
seen.add(box.engine);
}
expect(
seen.length,
greaterThan(2),
- reason: 'Stepping from the cursor made the arrows flip between a pair.',
+ reason: 'Stepping from the cursor made the keys flip between a pair.',
);
});
- testWidgets('left and right step opposite ways and return', (tester) async {
+ testWidgets('the page keys step opposite ways and return', (tester) async {
final box = await mount(tester);
await press(tester, LogicalKeyboardKey.arrowDown);
final first = box.engine;
- await press(tester, LogicalKeyboardKey.arrowRight);
+ await press(tester, LogicalKeyboardKey.pageDown);
expect(box.engine, isNot(first));
- await press(tester, LogicalKeyboardKey.arrowLeft);
- expect(box.engine, first, reason: 'Left must undo right.');
+ await press(tester, LogicalKeyboardKey.pageUp);
+ expect(box.engine, first, reason: 'Page up must undo page down.');
});
- testWidgets('right walks the projects', (tester) async {
+ testWidgets('page down walks the projects', (tester) async {
final box = await mount(tester);
final seen = <String>{box.projectLabel};
for (var i = 0; i < 4; i++) {
- await press(tester, LogicalKeyboardKey.arrowRight);
+ await press(tester, LogicalKeyboardKey.pageDown);
seen.add(box.projectLabel);
}
expect(seen.length, greaterThan(2));
});
+ // What the arrows do instead, and the whole point of the change: the right
+ // column is a place you GO, not a value the left column edits under you.
+ testWidgets('right hands the keys to the choices without taking a value', (
+ tester,
+ ) async {
+ final box = await mount(tester);
+ await press(tester, LogicalKeyboardKey.arrowDown);
+ expect(box.field, NewHarnessField.agent);
+ final engine = box.engine;
+ expect(harnessChoicesActive(tester), isFalse);
+ await press(tester, LogicalKeyboardKey.arrowRight);
+ expect(harnessChoicesActive(tester), isTrue);
+ expect(box.engine, engine, reason: 'Arriving is not choosing.');
+ await press(tester, LogicalKeyboardKey.arrowDown);
+ expect(
+ box.field,
+ NewHarnessField.agent,
+ reason: 'The list owns the arrows now; the rows must not move.',
+ );
+ });
+
+ testWidgets('left gives the keys back to the rows', (tester) async {
+ final box = await mount(tester);
+ await press(tester, LogicalKeyboardKey.arrowDown);
+ await press(tester, LogicalKeyboardKey.arrowRight);
+ expect(harnessChoicesActive(tester), isTrue);
+ final engine = box.engine;
+ await press(tester, LogicalKeyboardKey.arrowLeft);
+ expect(harnessChoicesActive(tester), isFalse);
+ expect(box.engine, engine, reason: 'Leaving is not choosing either.');
+ expect(
+ find.byKey(const ValueKey('new-harness-choices')),
+ findsOneWidget,
+ reason: 'The choices stay on screen, they just stop holding the keys.',
+ );
+ await press(tester, LogicalKeyboardKey.arrowDown);
+ expect(box.field, NewHarnessField.machine, reason: 'Rows move again.');
+ });
+
+ testWidgets('left edits the search text before it leaves it', (tester) async {
+ final box = await mount(tester);
+ await press(tester, LogicalKeyboardKey.arrowDown);
+ await type(tester, 'cod');
+ expect(harnessChoicesActive(tester), isTrue);
+ await press(tester, LogicalKeyboardKey.arrowLeft);
+ expect(box.query, 'cod', reason: 'The caret moved; the search stands.');
+ expect(harnessChoicesActive(tester), isTrue);
+ });
+
+ testWidgets('left on the rows changes nothing', (tester) async {
+ final box = await mount(tester);
+ await press(tester, LogicalKeyboardKey.arrowDown);
+ final engine = box.engine;
+ await press(tester, LogicalKeyboardKey.arrowLeft);
+ expect(box.engine, engine);
+ expect(box.field, NewHarnessField.agent);
+ expect(harnessChoicesActive(tester), isFalse);
+ });
+
+ // The exception, and the reason it is one: two values and nothing to
+ // browse, so there is no column to go to.
testWidgets('worktree flips on its own row, without a list', (tester) async {
final box = await mount(tester);
for (var i = 0; i < 4; i++) {
@@ -383,6 +447,42 @@ void main() {
expect(box.field, NewHarnessField.projectMenu);
});
+ // A door's prompt is picking with nothing typed, which is the one place ←
+ // could have walked further than intended: out of the door is right, out of
+ // the box is not.
+ testWidgets('left backs out of a door without closing the setup', (
+ tester,
+ ) async {
+ final box = await mount(tester);
+ await type(tester, 'harness');
+ var guard = 0;
+ while (box.selected?.id != NewHarnessController.newProjectId &&
+ guard++ < 60) {
+ await press(tester, LogicalKeyboardKey.arrowDown);
+ }
+ await press(tester, LogicalKeyboardKey.enter);
+ expect(box.field, NewHarnessField.projectName);
+ await press(tester, LogicalKeyboardKey.arrowLeft);
+ expect(box.field, NewHarnessField.projectMenu);
+ expect(
+ find.byType(NewHarnessForm),
+ findsOneWidget,
+ reason: 'One step back, not out.',
+ );
+ // Typed text is the caret's, not a way out.
+ await type(tester, 'harness');
+ while (box.selected?.id != NewHarnessController.newProjectId &&
+ guard++ < 120) {
+ await press(tester, LogicalKeyboardKey.arrowDown);
+ }
+ await press(tester, LogicalKeyboardKey.enter);
+ expect(box.field, NewHarnessField.projectName);
+ await type(tester, 'blog');
+ await press(tester, LogicalKeyboardKey.arrowLeft);
+ expect(box.query, 'blog');
+ expect(box.field, NewHarnessField.projectName);
+ });
+
testWidgets('the doors are still listed', (tester) async {
await mount(tester);
await type(tester, 'harness');
diff --git a/desktop/test/new_harness_scenarios_test.dart b/desktop/test/new_harness_scenarios_test.dart
index 5bd8ef459..9fba21948 100644
--- a/desktop/test/new_harness_scenarios_test.dart
+++ b/desktop/test/new_harness_scenarios_test.dart
@@ -284,6 +284,20 @@ void main() {
findsNothing,
);
expect(find.text('Remote'), findsNothing);
+ // Dimmed text alone reads as a theme. A row that cannot be chosen says
+ // which of the two things is wrong with it, because they need different
+ // answers from the person: one is a link, the other is a power button.
+ expect(
+ find.descendant(
+ of: _option('studio'),
+ matching: find.text('Link required'),
+ ),
+ findsOneWidget,
+ );
+ expect(
+ find.descendant(of: _option('build'), matching: find.text('Offline')),
+ findsOneWidget,
+ );
for (final (id, message) in [
('studio', 'not linked'),
('build', 'offline'),