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.

Make first-agent setup concise and keyboard accessible

dee364f1fb5b7f1
diff --git a/desktop/lib/shared/widgets/app_menu.dart b/desktop/lib/shared/widgets/app_menu.dart
index 66a5d84f6..ac97e2d95 100644
--- a/desktop/lib/shared/widgets/app_menu.dart
+++ b/desktop/lib/shared/widgets/app_menu.dart
@@ -124,6 +124,7 @@ class AppMenuItem extends StatefulWidget {
this.detail,
this.leading,
this.trailing,
+ this.focusNode,
this.metrics = AppMenuRowMetrics.compact,
});
@@ -146,6 +147,7 @@ class AppMenuItem extends StatefulWidget {
/// meeting it for the first time, and there is nowhere else in a menu row to
/// put the sentence.
final Widget? trailing;
+ final FocusNode? focusNode;
/// A quiet SECOND LINE under the label, for a row whose label alone does not
/// say what picking it does — "Most tokens read in the last 24h" under
@@ -216,12 +218,14 @@ class _AppMenuItemState extends State<AppMenuItem> {
color: Colors.transparent,
borderRadius: BorderRadius.circular(8),
child: InkWell(
+ focusNode: widget.focusNode,
onTap: widget.onPressed,
onHover: (hovered) => setState(() => _hovered = hovered),
borderRadius: BorderRadius.circular(8),
hoverColor: widget.danger
? error.withValues(alpha: 0.09)
: AppSurface.hoverFill,
+ focusColor: AppSurface.hoverFill,
splashFactory: NoSplash.splashFactory,
child: Ink(
decoration: BoxDecoration(
diff --git a/desktop/lib/shared/widgets/app_select_field.dart b/desktop/lib/shared/widgets/app_select_field.dart
index 62965010b..055ccd3ff 100644
--- a/desktop/lib/shared/widgets/app_select_field.dart
+++ b/desktop/lib/shared/widgets/app_select_field.dart
@@ -1,6 +1,7 @@
import 'dart:math' as math;
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
import '../theme/app_theme.dart';
import 'app_menu.dart';
@@ -87,7 +88,25 @@ class AppSelectField<T> extends StatefulWidget {
class _AppSelectFieldState<T> extends State<AppSelectField<T>> {
final _controller = MenuController();
+ final _fieldFocus = FocusNode(debugLabel: 'Select field');
+ final _selectedFocus = FocusNode(debugLabel: 'Selected option');
bool _hovered = false;
+ bool _focused = false;
+
+ @override
+ void dispose() {
+ _fieldFocus.dispose();
+ _selectedFocus.dispose();
+ super.dispose();
+ }
+
+ void _open() {
+ if (widget.options.isEmpty || _controller.isOpen) return;
+ _controller.open();
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted && _controller.isOpen) _selectedFocus.requestFocus();
+ });
+ }
/// How tall this panel may draw.
///
@@ -151,6 +170,7 @@ class _AppSelectFieldState<T> extends State<AppSelectField<T>> {
Widget _anchor(SelectOption<T>? current, double? panelWidth) {
return MenuAnchor(
controller: _controller,
+ childFocusNode: _fieldFocus,
// Below the control, by the app's one menu gap — and the panel takes its
// fill, rim and radius from [AppMenu], the app's single panel recipe.
alignmentOffset: const Offset(0, AppControl.menuGap),
@@ -176,6 +196,11 @@ class _AppSelectFieldState<T> extends State<AppSelectField<T>> {
// control, it is read down rather than glanced at, and it is the
// only place these choices are ever shown.
metrics: AppMenuRowMetrics.roomy,
+ focusNode:
+ option == current ||
+ (current == null && option == widget.options.first)
+ ? _selectedFocus
+ : null,
selected: option.value == widget.value,
label: option.label,
note: option.note,
@@ -184,6 +209,7 @@ class _AppSelectFieldState<T> extends State<AppSelectField<T>> {
trailing: option.trailing?.call(),
onPressed: () {
_controller.close();
+ _fieldFocus.requestFocus();
if (option.value != widget.value) {
widget.onChanged(option.value);
}
@@ -195,77 +221,91 @@ class _AppSelectFieldState<T> extends State<AppSelectField<T>> {
cursor: SystemMouseCursors.click,
onEnter: (_) => setState(() => _hovered = true),
onExit: (_) => setState(() => _hovered = false),
- child: GestureDetector(
- onTap: () =>
- controller.isOpen ? controller.close() : controller.open(),
- behavior: HitTestBehavior.opaque,
- child: AnimatedContainer(
- duration: AppMotion.hover,
- curve: AppMotion.curve,
- width: widget.width,
- height: AppControl.height,
- padding: const EdgeInsets.only(left: 10, right: 8),
- decoration: BoxDecoration(
- // A recessed well rather than a bordered box: §1, depth from fill.
- color: _hovered || controller.isOpen
- ? AppSurface.recessHover
- : AppSurface.recess,
- borderRadius: BorderRadius.circular(AppControl.radius),
- ),
- child: Row(
- children: [
- Expanded(
- child: Row(
- children: [
- if (current?.leading != null) ...[
- current!.leading!(),
- const SizedBox(width: 8),
- ],
- Flexible(
- child: Text(
- current?.label ?? '—',
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontFamily: AppFont.sans,
- fontFamilyFallback: AppFont.sansFallback,
- fontSize: AppControl.fontSize,
- fontWeight: AppControl.fontWeight,
- letterSpacing: AppFont.trackingFor(
- AppControl.fontSize,
- ),
- color: AppPalette.textPrimary,
- ),
- ),
- ),
- if (current?.note != null) ...[
- const SizedBox(width: 8),
+ child: CallbackShortcuts(
+ bindings: {
+ const SingleActivator(LogicalKeyboardKey.arrowDown): _open,
+ const SingleActivator(LogicalKeyboardKey.arrowUp): _open,
+ },
+ child: InkWell(
+ focusNode: _fieldFocus,
+ onFocusChange: (value) => setState(() => _focused = value),
+ onTap: () => controller.isOpen ? controller.close() : _open(),
+ splashFactory: NoSplash.splashFactory,
+ hoverColor: Colors.transparent,
+ focusColor: Colors.transparent,
+ borderRadius: BorderRadius.circular(AppControl.radius),
+ child: AnimatedContainer(
+ duration: AppMotion.hover,
+ curve: AppMotion.curve,
+ width: widget.width,
+ height: AppControl.height,
+ padding: const EdgeInsets.only(left: 10, right: 8),
+ decoration: BoxDecoration(
+ color: _hovered || _focused || controller.isOpen
+ ? AppSurface.recessHover
+ : AppSurface.recess,
+ borderRadius: BorderRadius.circular(AppControl.radius),
+ border: Border.all(
+ color: _focused
+ ? AppPalette.accentOnSurface
+ : Colors.transparent,
+ ),
+ ),
+ child: Row(
+ children: [
+ Expanded(
+ child: Row(
+ children: [
+ if (current?.leading != null) ...[
+ current!.leading!(),
+ const SizedBox(width: 8),
+ ],
Flexible(
child: Text(
- current!.note!,
+ current?.label ?? '—',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: AppFont.sans,
fontFamilyFallback: AppFont.sansFallback,
- fontSize: 11.5,
- color: AppPalette.textFaint,
+ fontSize: AppControl.fontSize,
+ fontWeight: AppControl.fontWeight,
+ letterSpacing: AppFont.trackingFor(
+ AppControl.fontSize,
+ ),
+ color: AppPalette.textPrimary,
),
),
),
+ if (current?.note != null) ...[
+ const SizedBox(width: 8),
+ Flexible(
+ child: Text(
+ current!.note!,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: TextStyle(
+ fontFamily: AppFont.sans,
+ fontFamilyFallback: AppFont.sansFallback,
+ fontSize: 11.5,
+ color: AppPalette.textFaint,
+ ),
+ ),
+ ),
+ ],
],
- ],
+ ),
),
- ),
- const SizedBox(width: 6),
- Icon(
- Icons.expand_more_rounded,
- size: AppControl.iconSize,
- color: _hovered || controller.isOpen
- ? AppPalette.textPrimary
- : AppPalette.textSecondary,
- ),
- ],
+ const SizedBox(width: 6),
+ Icon(
+ Icons.expand_more_rounded,
+ size: AppControl.iconSize,
+ color: _hovered || controller.isOpen
+ ? AppPalette.textPrimary
+ : AppPalette.textSecondary,
+ ),
+ ],
+ ),
),
),
),
diff --git a/desktop/lib/widgets/new_agent_dialog.dart b/desktop/lib/widgets/new_agent_dialog.dart
index 0891c4179..86d67119c 100644
--- a/desktop/lib/widgets/new_agent_dialog.dart
+++ b/desktop/lib/widgets/new_agent_dialog.dart
@@ -50,6 +50,9 @@ Future<void> showNewAgentDialog(
analytics.newAgentOpened(source: source);
return showAppDialog<void>(
context: context,
+ transitionDuration: Duration.zero,
+ veilBlur: 0,
+ veilTint: const Color(0x66000000),
builder: (context) => _NewAgentDialog(
notifier: notifier,
machineId: machineId,
@@ -80,6 +83,7 @@ class _NewAgentDialog extends StatefulWidget {
}
class _NewAgentDialogState extends State<_NewAgentDialog> {
+ final _folderFocus = FocusNode(debugLabel: 'Project folder');
late String _engine = allEngines.first.id;
bool _engineChosenByUser = false;
late String _machineId = widget.machineId;
@@ -95,6 +99,12 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
bool _advancedOpen = false;
bool _submitting = false;
+ @override
+ void dispose() {
+ _folderFocus.dispose();
+ super.dispose();
+ }
+
@override
void initState() {
super.initState();
@@ -240,6 +250,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
bool _picking = false;
bool _folderHovered = false;
+ bool _folderFocused = false;
bool _bypassHovered = false;
String? _error;
@@ -266,6 +277,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
Future<void> _browse() async {
if (_picking) return;
+ final restoreFocus = _folderFocus.hasFocus;
// The agent runs on the MACHINE, so the folder has to exist on the machine
// — which is the whole reason this branches.
//
@@ -308,6 +320,14 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
_error = 'Could not open the folder picker: $error';
}
});
+ } finally {
+ if (mounted && restoreFocus) {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted && !_submitting && pickingRevision == _machineRevision) {
+ _folderFocus.requestFocus();
+ }
+ });
+ }
}
}
@@ -392,7 +412,10 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
// everybody who never turns it on.
AbsorbPointer(
absorbing: _submitting,
- child: _choices(bypassFlag),
+ child: ExcludeFocus(
+ excluding: _submitting,
+ child: _choices(bypassFlag),
+ ),
),
if (_error != null) ...[
const SizedBox(height: _gapBlock),
@@ -409,6 +432,9 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
actions: [
TextButton(
onPressed: _submitting ? null : () => Navigator.of(context).pop(),
+ style: TextButton.styleFrom(
+ foregroundColor: grid.AppPalette.textSecondary,
+ ),
child: const Text('Cancel'),
),
FilledButton(
@@ -468,8 +494,11 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
machineName: _machineName,
machineIsThisComputer: _machineIsThisComputer,
picking: _picking,
+ focusNode: _folderFocus,
hovered: _folderHovered,
+ focused: _folderFocused,
onHover: (value) => setState(() => _folderHovered = value),
+ onFocusChange: (value) => setState(() => _folderFocused = value),
onPressed: _browse,
),
const SizedBox(height: _gapField),
@@ -525,29 +554,13 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
const SizedBox(height: 6),
Text(
_willInstall
- ? 'Not here yet — Harness will install '
- '${engineIdentity(_engine).label} first.'
- // Faint and phrased as an absence, not a fault: nothing is
- // wrong with the launch, we simply could not look, and painting
- // that as a problem would cry wolf on every older remote box.
- //
- // THE WHOLE PARAGRAPH, not a headline. It was tempting to leave
- // this at "Could not check this machine" — the dialog is being
- // made smaller, after all — but the sentence that got cut was
- // the one naming the way out. This line only appears when the
- // check actually failed, so its length costs nothing on the
- // launches that work.
- : '$_machineName did not say which engines it has, so Harness '
- 'could not check for '
- '${engineIdentity(_engine).label} before offering to '
- 'launch it. The create will still run — if the engine is '
- 'missing there, that will only show up when it fails. '
- 'Updating the Harness CLI on $_machineName lets this be '
- 'checked first.',
+ ? 'Harness will install ${engineIdentity(_engine).label} before starting.'
+ : 'Couldn’t check whether ${engineIdentity(_engine).label} is installed. '
+ 'You can still try creating an agent.',
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: _willInstall
? grid.AppPalette.accentOnSurface
- : grid.AppPalette.textFaint,
+ : grid.AppPalette.textSecondary,
),
),
],
@@ -565,6 +578,14 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {
state: _advancedState(),
onToggle: () => setState(() => _advancedOpen = !_advancedOpen),
children: [
+ if (_engineCheckFailed) ...[
+ Text(
+ 'If $_machineName uses an older Harness CLI, update it to enable engine checks.',
+ style: Theme.of(context).textTheme.bodySmall
+ ?.copyWith(color: grid.AppPalette.textSecondary),
+ ),
+ const SizedBox(height: 10),
+ ],
if (_engine == 'codex') ...[
if (_availability('codex')?.supportsCodexHome == true)
CodexProfileField(
@@ -810,12 +831,15 @@ class _Advanced extends StatelessWidget {
// Offstage builds and runs it, and merely declines to paint it.
Offstage(
offstage: !open,
- child: Padding(
- padding: const EdgeInsets.only(top: 4, bottom: 2),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- mainAxisSize: MainAxisSize.min,
- children: children,
+ child: ExcludeFocus(
+ excluding: !open,
+ child: Padding(
+ padding: const EdgeInsets.only(top: 4, bottom: 2),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ mainAxisSize: MainAxisSize.min,
+ children: children,
+ ),
),
),
),
@@ -830,8 +854,11 @@ class _FolderControl extends StatelessWidget {
required this.machineName,
required this.machineIsThisComputer,
required this.picking,
+ required this.focusNode,
required this.hovered,
+ required this.focused,
required this.onHover,
+ required this.onFocusChange,
required this.onPressed,
});
@@ -839,8 +866,11 @@ class _FolderControl extends StatelessWidget {
final String machineName;
final bool machineIsThisComputer;
final bool picking;
+ final FocusNode focusNode;
final bool hovered;
+ final bool focused;
final ValueChanged<bool> onHover;
+ final ValueChanged<bool> onFocusChange;
final VoidCallback onPressed;
@override
@@ -852,18 +882,22 @@ class _FolderControl extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
- // [MouseRegion] + [AnimatedContainer], the shape every hoverable control
- // in this app takes — not `InkWell`, whose ripple is a phone idiom and
- // whose hover is instant where the app's is [AppMotion.hover].
MouseRegion(
cursor: picking
? SystemMouseCursors.progress
: SystemMouseCursors.click,
onEnter: (_) => onHover(true),
onExit: (_) => onHover(false),
- child: GestureDetector(
+ child: InkWell(
+ key: const Key('new-agent-folder'),
+ focusNode: focusNode,
onTap: picking ? null : onPressed,
- behavior: HitTestBehavior.opaque,
+ canRequestFocus: !picking,
+ onFocusChange: onFocusChange,
+ splashFactory: NoSplash.splashFactory,
+ hoverColor: Colors.transparent,
+ focusColor: Colors.transparent,
+ borderRadius: BorderRadius.circular(grid.AppControl.radius),
child: AnimatedContainer(
duration: grid.AppMotion.hover,
curve: grid.AppMotion.curve,
@@ -874,13 +908,15 @@ class _FolderControl extends StatelessWidget {
// this column share one left edge and one right edge.
padding: const EdgeInsets.only(left: 10, right: 8),
decoration: BoxDecoration(
- // §1: depth from fill, never a rim. [AppSurface.recess] is the
- // same well [AppSelectField] sits in — a folder is picked the
- // same way an engine is, so it looks the same at rest.
- color: hovered && !picking
+ color: (hovered || focused) && !picking
? grid.AppSurface.recessHover
: grid.AppSurface.recess,
borderRadius: BorderRadius.circular(grid.AppControl.radius),
+ border: Border.all(
+ color: focused
+ ? grid.AppPalette.accentOnSurface
+ : Colors.transparent,
+ ),
),
child: Row(
children: [
diff --git a/desktop/test/app_select_field_test.dart b/desktop/test/app_select_field_test.dart
index c25a3a39c..d5c02a193 100644
--- a/desktop/test/app_select_field_test.dart
+++ b/desktop/test/app_select_field_test.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
@@ -48,6 +49,57 @@ Future<void> _open(WidgetTester tester) async {
void main() {
tearDown(() => grid.AppTheme.brightness.value = Brightness.light);
+ testWidgets(
+ 'Tab, Enter, arrows and Escape operate the picker',
+ (tester) async {
+ String? picked = 'unset';
+ await tester.pumpWidget(
+ _host(
+ AppSelectField<String?>(
+ value: 'Helvetica Neue',
+ options: _options,
+ onChanged: (value) => picked = value,
+ width: 240,
+ ),
+ ),
+ );
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ final anchor = tester.widget<InkWell>(
+ find.descendant(of: _field, matching: find.byType(InkWell)),
+ );
+ expect(anchor.focusNode!.hasPrimaryFocus, isTrue);
+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);
+ await tester.pumpAndSettle();
+ expect(find.byType(AppMenuItem), findsNWidgets(3));
+ final selected = tester.widget<AppMenuItem>(
+ find.widgetWithText(AppMenuItem, 'Helvetica Neue'),
+ );
+ expect(selected.focusNode!.hasPrimaryFocus, isTrue);
+ await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
+ await tester.pump();
+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);
+ await tester.pumpAndSettle();
+ expect(picked, 'Menlo');
+ expect(find.byType(AppMenuItem), findsNothing);
+ expect(anchor.focusNode!.hasPrimaryFocus, isTrue);
+ await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
+ await tester.pumpAndSettle();
+ expect(find.byType(AppMenuItem), findsNWidgets(3));
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pumpAndSettle();
+ expect(find.byType(AppMenuItem), findsNothing);
+ expect(anchor.focusNode!.hasPrimaryFocus, isTrue);
+ expect(picked, 'Menlo');
+ expect(tester.takeException(), isNull);
+ },
+ variant: const TargetPlatformVariant({
+ TargetPlatform.macOS,
+ TargetPlatform.linux,
+ TargetPlatform.windows,
+ }),
+ );
+
testWidgets('an unpicked row draws NO glyph — not an empty checkbox', (
tester,
) async {
diff --git a/desktop/test/first_workspace_test.dart b/desktop/test/first_workspace_test.dart
index 462071828..f46882241 100644
--- a/desktop/test/first_workspace_test.dart
+++ b/desktop/test/first_workspace_test.dart
@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:file_selector_platform_interface/file_selector_platform_interface.dart';
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/auth/auth_session.dart';
import 'package:harness/core/config.dart';
@@ -69,17 +70,100 @@ class _FirstUseApp extends AppNotifier {
class _FolderPicker extends FileSelectorPlatform {
var opened = 0;
+ Completer<String?>? pending;
@override
Future<String?> getDirectoryPath({
String? initialDirectory,
String? confirmButtonText,
}) async {
opened++;
+ if (pending != null) return pending!.future;
return '/work/my-project';
}
}
void main() {
+ testWidgets(
+ 'new agent is keyboard accessible without hidden focus stops',
+ (tester) async {
+ final app = _FirstUseApp();
+ app.machineStates['m']!.engines.replace(const [
+ EngineAvailability(engine: 'codex', installed: true),
+ ]);
+ final oldPicker = FileSelectorPlatform.instance;
+ final picker = _FolderPicker()..pending = Completer<String?>();
+ FileSelectorPlatform.instance = picker;
+ addTearDown(() => FileSelectorPlatform.instance = oldPicker);
+ await mount(tester, app);
+ await tester.tap(find.text('New agent'));
+ await tester.pump();
+
+ bool fieldFocused(String key) => tester
+ .widget<InkWell>(
+ find.descendant(
+ of: find.byKey(Key(key)),
+ matching: find.byType(InkWell),
+ ),
+ )
+ .focusNode!
+ .hasPrimaryFocus;
+
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ expect(fieldFocused('new-agent-machine-field'), isTrue);
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ final folder = tester.widget<InkWell>(
+ find.byKey(const Key('new-agent-folder')),
+ );
+ expect(folder.focusNode!.hasPrimaryFocus, isTrue);
+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);
+ await tester.pump();
+ expect(picker.opened, 1);
+ expect(find.text('Waiting for the folder picker…'), findsOneWidget);
+ picker.pending!.complete('/work/my-project');
+ await tester.pump();
+ await tester.pump();
+ expect(folder.focusNode!.hasPrimaryFocus, isTrue);
+ expect(find.text('/work/my-project'), findsOneWidget);
+
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ expect(fieldFocused('new-agent-engine-field'), isTrue);
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ expect(
+ Focus.of(tester.element(find.text('Advanced'))).hasPrimaryFocus,
+ isTrue,
+ );
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ expect(
+ Focus.of(tester.element(find.text('Cancel'))).hasPrimaryFocus,
+ isTrue,
+ );
+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);
+ await tester.pump();
+ expect(
+ Focus.of(tester.element(find.text('Create agent'))).hasPrimaryFocus,
+ isTrue,
+ );
+ expect(app.launches, isEmpty);
+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);
+ await tester.pump();
+ expect(app.launches.single.folder, '/work/my-project');
+ expect(app.input, isEmpty);
+ expect(tester.takeException(), isNull);
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ },
+ variant: const TargetPlatformVariant({
+ TargetPlatform.macOS,
+ TargetPlatform.linux,
+ TargetPlatform.windows,
+ }),
+ );
+
testWidgets('fresh workspace reaches an agent with an installed default', (
tester,
) async {
diff --git a/desktop/test/new_agent_engine_check_test.dart b/desktop/test/new_agent_engine_check_test.dart
index 2177dd22a..e07751258 100644
--- a/desktop/test/new_agent_engine_check_test.dart
+++ b/desktop/test/new_agent_engine_check_test.dart
@@ -79,25 +79,18 @@ void main() {
(engines) => engines.error = 'This machine could not report its engines',
);
- // "Ready to launch" is gone with the summary card, and so is the promise it
- // was making. What survives is the half that could not be said anywhere
- // else: that this machine was never reached.
+ // Failed checks remain distinct from a missing engine; creation can still
+ // be attempted and troubleshooting stays in the optional details.
+ expect(find.textContaining('Couldn’t check whether'), findsOneWidget);
expect(
- find.textContaining('did not say which engines it has'),
+ find.textContaining('You can still try creating an agent.'),
findsOneWidget,
);
- // The way out is named, and so is what happens if it is ignored — the
- // create still runs, and a missing engine surfaces only as its failure.
+ expect(find.textContaining('uses an older Harness CLI'), findsNothing);
+ await tester.tap(find.byKey(const Key('new-agent-advanced')));
+ await tester.pump();
expect(
- find.textContaining('did not say which engines it has'),
- findsOneWidget,
- );
- expect(
- find.textContaining('will only show up when it fails'),
- findsOneWidget,
- );
- expect(
- find.textContaining('Updating the Harness CLI on harness-remote-box'),
+ find.textContaining('If harness-remote-box uses an older Harness CLI'),
findsOneWidget,
);
});
@@ -117,7 +110,7 @@ void main() {
// somebody the default is the default; the line below only appears when
// there is something to say.
expect(
- find.textContaining('did not say which engines it has'),
+ find.textContaining('Couldn’t check whether'),
findsNothing,
reason: 'a probe that landed is not a probe that failed',
);
diff --git a/docs/harness-v2-appearance-onboarding.md b/docs/harness-v2-appearance-onboarding.md
index 2fb36a04f..825a651f5 100644
--- a/docs/harness-v2-appearance-onboarding.md
+++ b/docs/harness-v2-appearance-onboarding.md
@@ -36,6 +36,7 @@ Implemented first-use changes:
- Sign-in leads with the value and a static example of two familiar coding agents in one swarm. The example cannot run or submit a task. Browser progress, cancellation, errors and the privacy footer remain in the same card; the primary action is visible at the minimum window size.
- An empty first workspace offers up to three existing, available agents directly. A ready local computer with no agents gets a simple folder → coding agent → work explanation instead of empty Machines and Projects columns. The full machine list stays visible for multiple machines, linking issues, offline hosts and ongoing discovery. Existing work removes the first-workspace guidance. No persistent tour state is added.
- New agent places **Project folder** before **Coding agent** and names the local target **This computer**. It prefers an installed coding agent when that fact is known; an asynchronous probe may improve the default but cannot replace an explicit user choice or a submitted launch. Existing profile, installation and permission behavior is preserved.
+- New agent opens immediately against a dimmed backdrop. Failed engine checks get a short explanation; troubleshooting remains in Advanced. Machine, folder and coding-agent pickers are reachable with Tab; selection works with Enter/Space and arrows, and Escape closes an open picker. Folder selection restores focus when it returns. Hidden Advanced controls cannot receive Tab focus, while their profile discovery continues. Isolated keyboard tests complete the first-agent path on macOS, Windows and Linux variants without sending a task to an agent.
- Both actual search fields remain available and continue showing results at the field being edited. The first-use agent rows use the existing, revalidated navigation action. Returning users retain the regular New swarm screen.
First-use validation uses isolated state and stubbed machines, agent creation, folder selection and provisioning. It checks direct existing-agent navigation, a new agent becoming visible with no automatic task input, an installed default, explicit-choice preservation after a late probe, and one deliberate install action reaching sign-in. The first visual pass also led to keeping the setup action beside its content and preserving machine-linking rows. Rendered fixtures cover sign-in at 880×560, setup and both empty/populated discovery states at 1280×800.
diff --git a/docs/harness-v2-progress.md b/docs/harness-v2-progress.md
index bb16f287d..8c05c0965 100644
--- a/docs/harness-v2-progress.md
+++ b/docs/harness-v2-progress.md
@@ -2,7 +2,16 @@
Updated 2026-09-13 with coordinated palettes, Models, combined closed-work History and faster unified search. This is a working preview, not a release.
-## Active follow-up: deliberate splits
+## Active follow-up: keyboard-accessible first use
+
+- New agent opens immediately with a simple dimmed backdrop. The failed engine-check explanation is brief and readable; conditional CLI troubleshooting lives in Advanced. Cancel uses neutral secondary text. Explicit installation and creation behavior is unchanged.
+- Machine, project folder and coding-agent controls now participate in Tab traversal. The shared select field supports Enter/Space, arrow navigation, Escape and return to the field after selection. Focus is visible without a thick glow. Folder selection restores keyboard focus after the native or remote picker completes.
+- Collapsed Advanced content remains mounted for profile discovery, but cannot receive invisible keyboard focus. Submitting also excludes the choices from keyboard focus while the explicit operation is running.
+- Validation: **1,144 Flutter tests passed, one existing skip** (`/private/tmp/harness-v2-form-full-tests.log`), including keyboard-only first-agent creation and picker selection on macOS, Windows and Linux test variants. Analyzer has no errors/warnings and 12 existing vendored infos. Isolated renders of the form and focused folder were reviewed (`/private/tmp/harness-v2-form-{form,keyboard}.png`); the render test also passed. These are fixture results, not real first-install conversion measurements.
+- Next: optional bounded search preview and file-remapping ownership across AppKit and Flutter. Keep the approved simple shortcuts unchanged.
+- Release build succeeded (`/private/tmp/harness-v2-form-build.log`) and the exact development preview was reopened. Preview PID 14152 was normally quit and confirmed exited before writing its bundle; no real agent received test input. Re-observe the next preview PID before any native interaction.
+
+## Deliberate splits checkpoint
- `> Split right` and `> Split down` open New agent with the focused agent's machine and known folder preselected. Creation remains explicit. The new agent takes half that agent's rectangle; neighboring agents retain their rectangles, terminal elements and pins. These commands are available only when both resulting agents meet the measured minimum size. No existing key was reassigned.
- The captured split is checked before creation and again after its asynchronous reply. It remains tied to the original Swarm and pane order, even after tab navigation. If the original layout closes, changes or becomes too small while creation is in flight, the agent remains in Search and an honest notice explains why it was not inserted; no second creation or destructive cleanup occurs.
@@ -10,7 +19,7 @@ Updated 2026-09-13 with coordinated palettes, Models, combined closed-work Histo
- Visual review exposed an existing assignment edge case: a machine without a terminal-capability report could receive new membership without notifying the screen. That path now publishes its change immediately; the new split renders with retained output or the existing unavailable state.
- Validation: **1,138 Flutter tests passed, one existing skip** in the final full run after the notification correction (`/private/tmp/harness-v2-split-full-tests.log`). Focused split checks and the isolated render also passed. Analyzer has no errors/warnings and 12 existing vendored infos. Other artifacts: `/private/tmp/harness-v2-split-{tests,final-checks,analyze,render,build}.log` and `/private/tmp/harness-v2-split-{placed,form}.png`. The rendered form and actual five-agent split were reviewed with system fonts; this remains isolated UI evidence.
- The Release build succeeded and was relaunched. The verified preview PID 820 was normally quit and confirmed exited before rebuilding. Re-observe the relaunched preview before later native interaction. No real agent received test input.
-- Next: optional bounded search preview, file-remapping ownership across AppKit and Flutter, and a small onboarding copy pass. The New agent form's unavailable-engine explanation is too wordy; shorten it while preserving the distinction between unavailable checks and a known missing engine.
+- The subsequent onboarding copy and keyboard pass is recorded above. Optional bounded search preview and file-remapping ownership across AppKit and Flutter remain next.
## Controlled resizing checkpoint