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.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Polish agent entry and preserve space for project names
dee8873f27ba718
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dartindex 5e20c62ac..69b2a867c 100644--- a/desktop/lib/screens/swarm_screen.dart+++ b/desktop/lib/screens/swarm_screen.dart@@ -81,6 +81,10 @@ class _SwarmScreenState extends State<SwarmScreen> {final _searchText = TextEditingController();final _searchFocus = FocusNode(debugLabel: 'Find an agent');final _creationFocus = FocusNode(debugLabel: 'New agent choices');+ final _inlineCreationFocus = FocusNode(+ debugLabel: 'New Harness agent choices',+ );+ int _inlineCreationRevision = 0;String? _creationMachineId, _creationFolder;bool _creationBusy = false;SwarmSearchController? _search;@@ -164,6 +168,7 @@ class _SwarmScreenState extends State<SwarmScreen> {_search?.dispose();_searchFocus.dispose();_creationFocus.dispose();+ _inlineCreationFocus.dispose();_searchText.dispose();_canvasFocus.dispose();_shellFocus.dispose();@@ -826,6 +831,7 @@ class _SwarmScreenState extends State<SwarmScreen> {_search!.addListener(_syncSearch);_searchOverlay = OverlayEntry(builder: _buildSearchOverlay);Overlay.of(context).insert(_searchOverlay!);+ if (app.panes.isEmpty) setState(() {});_syncSearch();// The overlay and focus nodes update independently of the retained canvas._focusSearch();@@ -878,6 +884,7 @@ class _SwarmScreenState extends State<SwarmScreen> {_search!.removeListener(_syncSearch);_search!.dispose();_search = null;+ if (mounted && app.panes.isEmpty) setState(() {});_searchHeaderState = null;final wasBusy = _creationBusy;_creationBusy = false;@@ -904,13 +911,14 @@ class _SwarmScreenState extends State<SwarmScreen> {}void _creationActivity(bool busy) {- if (_search == null || _creationBusy == busy) return;- _creationBusy = busy;+ if (!mounted || _creationBusy == busy) return;+ setState(() => _creationBusy = busy);_syncSearch();if (_native) _syncNative();}void _creationFinished() {+ _creationActivity(false);_closeSearch(restoreFocus: false);if (app.focusedPane?.session?.focusInput() != true) {_shellFocus.requestFocus();@@ -918,6 +926,35 @@ class _SwarmScreenState extends State<SwarmScreen> {unawaited(_ensureEmptyEntry());}+ Widget? _startPageCreation() {+ final machineId =+ app.machineStates.values+ .where((machine) => machine.isLocalMachine)+ .firstOrNull+ ?.machine+ .machineId ??+ app.machineStates.keys.firstOrNull;+ if (machineId == null) return null;+ return Offstage(+ offstage: _search != null,+ child: NewAgentComposer(+ key: ValueKey(+ 'inline-agent-composer:${app.activeSwarmId}:$_inlineCreationRevision',+ ),+ notifier: app,+ machineId: machineId,+ swarmId: app.activeSwarmId,+ focusNode: _inlineCreationFocus,+ onBusyChanged: _creationActivity,+ onFinished: () {+ _inlineCreationRevision++;+ _creationFinished();+ },+ onDismiss: _startSearchFocus.requestFocus,+ ),+ );+ }+Future<void> _ensureEmptyEntry() async {if (!mounted || app.panes.isNotEmpty) return;await WidgetsBinding.instance.endOfFrame;@@ -942,6 +979,87 @@ class _SwarmScreenState extends State<SwarmScreen> {Widget _buildSearchOverlay(BuildContext context) {final search = _search!;final commandsOnly = search.commandsOnly;+ final panel = Material(+ key: const ValueKey('swarm-search-results'),+ elevation: 16,+ shadowColor: Colors.black54,+ color: commandsOnly+ ? grid.AppPalette.swarmSearchSurface+ : grid.AppPalette.agentEntrySurface,+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(commandsOnly ? 14 : 20),+ side: const BorderSide(color: Colors.white12),+ ),+ clipBehavior: Clip.antiAlias,+ child: Column(+ children: [+ Padding(+ padding: EdgeInsets.fromLTRB(commandsOnly ? 20 : 28, 24, 20, 16),+ child: Row(+ children: [+ Expanded(+ child: Semantics(+ header: true,+ child: Text(+ commandsOnly ? 'Commands' : 'Find an agent',+ style: TextStyle(+ fontSize: commandsOnly ? 16 : 26,+ fontWeight: FontWeight.w600,+ ),+ ),+ ),+ ),+ if (!commandsOnly)+ TextButton(+ onPressed: _dismissSearch,+ style: TextButton.styleFrom(+ foregroundColor: Colors.white54,+ ),+ child: const Text('esc', style: TextStyle(fontSize: 12)),+ ),+ ],+ ),+ ),+ Padding(+ padding: EdgeInsets.fromLTRB(+ commandsOnly ? 0 : 28,+ 0,+ commandsOnly ? 0 : 28,+ commandsOnly ? 0 : 20,+ ),+ child: Semantics(+ label: commandsOnly ? 'Search commands' : 'Find an agent',+ child: SwarmSearchInput(+ inputKey: const ValueKey('swarm-search-input'),+ controller: _searchText,+ focusNode: _searchFocus,+ search: search,+ onClose: _dismissSearch,+ onChanged: search.setQuery,+ onOpen: _focusSearch,+ showClose: commandsOnly,+ rounded: true,+ prominent: !commandsOnly,+ hintText: commandsOnly ? null : '',+ outlined: !commandsOnly,+ fillColor: commandsOnly+ ? null+ : grid.AppPalette.agentEntryField,+ ),+ ),+ ),+ const Divider(height: 1, color: Colors.white12),+ Expanded(+ child: SwarmSearchResults(+ search: search,+ onChoose: _chooseSearch,+ onRefocus: _focusSearch,+ ),+ ),+ if (!commandsOnly) const SizedBox(height: 12),+ ],+ ),+ );return KeymapProvider(keymap: _keymap,child: LayoutBuilder(@@ -950,6 +1068,14 @@ class _SwarmScreenState extends State<SwarmScreen> {240.0,commandsOnly ? 600.0 : 760.0,);+ // Keep room for the search heading, field, and at least one result+ // when large text makes the creation form taller. Its fields scroll.+ final minimumSearchHeight =+ 172 + MediaQuery.textScalerOf(context).scale(72);+ final creationHeight = (height - minimumSearchHeight - 24).clamp(+ 64.0,+ height * .55,+ );return Stack(children: [Positioned.fill(@@ -982,115 +1108,17 @@ class _SwarmScreenState extends State<SwarmScreen> {onOpen: _focusSearch,onNewAgent: () => _runShortcut('agent.new'),onRefocus: _focusSearch,- child: Material(- key: const ValueKey('swarm-search-results'),- elevation: 16,- shadowColor: Colors.black54,- color: grid.AppPalette.swarmSearchSurface,- shape: RoundedRectangleBorder(- borderRadius: BorderRadius.circular(14),- side: const BorderSide(color: Colors.white24),- ),- clipBehavior: Clip.antiAlias,- child: Column(- children: [- if (commandsOnly)- const Padding(- padding: EdgeInsets.fromLTRB(- 20,- 16,- 20,- 12,- ),- child: Align(- alignment: Alignment.centerLeft,- child: Text(- 'Commands',- style: TextStyle(- fontSize: 16,- fontWeight: FontWeight.w600,- ),- ),- ),- ),- SwarmSearchInput(- inputKey: const ValueKey(- 'swarm-search-input',- ),- controller: _searchText,- focusNode: _searchFocus,- search: search,- onClose: _dismissSearch,- onChanged: search.setQuery,- onOpen: _focusSearch,- showClose: true,- rounded: true,- prominent: !commandsOnly,- ),- const Divider(- height: 1,- color: Colors.white12,- ),- Expanded(- child: SwarmSearchResults(- search: search,- onChoose: _chooseSearch,- onRefocus: _focusSearch,- ),- ),- if (!commandsOnly)- Padding(- padding: const EdgeInsets.fromLTRB(- 16,- 8,- 16,- 12,- ),- child: Align(- alignment: Alignment.centerRight,- child: ListenableBuilder(- listenable: search,- builder: (context, _) =>- FilledButton(- key: const ValueKey(- 'harness-picker-open',- ),- onPressed: search.canAccept- ? () => _chooseSearch(- search.submit()!,- )- : null,- style: FilledButton.styleFrom(- backgroundColor:- grid.AppSurface.recess,- foregroundColor: grid- .AppPalette- .textPrimary,- minimumSize: const Size(- 136,- 40,- ),- shape:- const StadiumBorder(),- ),- child: const Text(- 'Open Agent',- ),- ),- ),- ),- ),- ],- ),- ),+ child: panel,),),),),if (!commandsOnly) ...[- const SizedBox(height: 16),+ const SizedBox(height: 24),ConstrainedBox(- constraints: BoxConstraints(maxHeight: height * .55),+ constraints: BoxConstraints(+ maxHeight: creationHeight,+ ),child: SingleChildScrollView(child: _creationMachineId == null? FilledButton(@@ -1510,7 +1538,21 @@ class _SwarmScreenState extends State<SwarmScreen> {adding: true,catalog: _searchCatalog,),- onNew: _newAgent,+ onNew: () {+ if (app.machineStates.isEmpty) {+ _dialog(+ () => showSwarmLinkDialog(+ context,+ app,+ ),+ );+ } else {+ _inlineCreationFocus+ .requestFocus();+ }+ },+ creation: _startPageCreation(),+ creationBusy: _creationBusy,onChoose: (selection) =>_activateSearch(selection,diff --git a/desktop/lib/shared/theme/app_theme.dart b/desktop/lib/shared/theme/app_theme.dartindex 0e87232cd..89a7eb5b6 100644--- a/desktop/lib/shared/theme/app_theme.dart+++ b/desktop/lib/shared/theme/app_theme.dart@@ -193,6 +193,8 @@ abstract final class AppPalette {static Color get swarmAccent => AppTheme.palette.value.accent;// Shared with the native search field for a continuous input/results surface.static Color get swarmSearchSurface => AppTheme.palette.value.search;+ static const agentEntrySurface = Color(0xff101113);+ static const agentEntryField = Color(0xff1d1f22);// the conversation / content area — pure white in light, like Codex.//diff --git a/desktop/lib/shared/widgets/app_select_field.dart b/desktop/lib/shared/widgets/app_select_field.dartindex a639afc7d..b46435d78 100644--- a/desktop/lib/shared/widgets/app_select_field.dart+++ b/desktop/lib/shared/widgets/app_select_field.dart@@ -75,6 +75,7 @@ class AppSelectField<T> extends StatefulWidget {this.height = AppControl.height,this.trigger,this.focusNode,+ this.fillColor,});final T value;@@ -90,6 +91,7 @@ class AppSelectField<T> extends StatefulWidget {/// Selection, keyboard navigation and menu rows remain shared.final Widget? trigger;final FocusNode? focusNode;+ final Color? fillColor;@overrideState<AppSelectField<T>> createState() => _AppSelectFieldState<T>();@@ -397,8 +399,13 @@ class _AppSelectFieldState<T> extends State<AppSelectField<T>> {padding: const EdgeInsets.only(left: 10, right: 8),decoration: BoxDecoration(color: _hovered || _focused || controller.isOpen- ? AppSurface.recessHover- : AppSurface.recess,+ ? widget.fillColor == null+ ? AppSurface.recessHover+ : Color.alphaBlend(+ Colors.white.withValues(alpha: .05),+ widget.fillColor!,+ )+ : widget.fillColor ?? AppSurface.recess,borderRadius: BorderRadius.circular(AppControl.radius),border: Border.all(color: _focuseddiff --git a/desktop/lib/widgets/harness_start_page.dart b/desktop/lib/widgets/harness_start_page.dartindex 3cc589b43..4b2f452bc 100644--- a/desktop/lib/widgets/harness_start_page.dart+++ b/desktop/lib/widgets/harness_start_page.dart@@ -17,11 +17,15 @@ class HarnessStartPage extends StatefulWidget {required this.createSearch,required this.onNew,required this.onChoose,+ this.creation,+ this.creationBusy = false,});final FocusNode focusNode;final SwarmSearchController Function() createSearch;final VoidCallback onNew;final ValueChanged<SwarmSearchSelection> onChoose;+ final Widget? creation;+ final bool creationBusy;@overrideState<HarnessStartPage> createState() => _HarnessStartPageState();}@@ -39,6 +43,7 @@ class _HarnessStartPageState extends State<HarnessStartPage> {bool get _showResults => _search != null;void _open() {+ if (widget.creationBusy) return;// Commands can replace the editor value without a TextField onChanged.// Reveal results for the visible text, including on keyboard-only entry.if (_search == null) {@@ -53,6 +58,7 @@ class _HarnessStartPageState extends State<HarnessStartPage> {}void _close() {+ if (widget.creationBusy) return;final search = _search;if (search != null) {_draft = search.draft;@@ -63,11 +69,13 @@ class _HarnessStartPageState extends State<HarnessStartPage> {}void _choose(SwarmSearchSelection selection) {+ if (widget.creationBusy) return;_close();widget.onChoose(selection);}void _new() {+ if (widget.creationBusy) return;_close();widget.onNew();}@@ -83,7 +91,7 @@ class _HarnessStartPageState extends State<HarnessStartPage> {elevation: _showResults ? 12 : 0,shadowColor: Colors.black54,shape: RoundedRectangleBorder(- borderRadius: BorderRadius.circular(_showResults ? 12 : 999),+ borderRadius: BorderRadius.circular(32),side: _showResults? const BorderSide(color: Colors.white24): BorderSide.none,@@ -287,25 +295,58 @@ class _HarnessStartPageState extends State<HarnessStartPage> {.clamp(72.0, 220.0).clamp(0.0,- (entryConstraints.maxHeight - 320).clamp(- 24.0,- 220.0,- ),+ (entryConstraints.maxHeight -+ (widget.creation == null ? 320 : 460))+ .clamp(24.0, 220.0),+ );+ final available = entryConstraints.maxHeight - top;+ final minimumSearchHeight =+ 112 + MediaQuery.textScalerOf(context).scale(56);+ final creationHeight =+ (available - minimumSearchHeight - 24).clamp(+ 64.0,+ available * .55,);return Padding(padding: EdgeInsets.only(top: top),child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Flexible(child: _searchPanel()),- if (!_showResults) ...[- const SizedBox(height: 20),- HarnessEntryActions(- onOpen: _open,- onNew: _new,- openKey: const ValueKey('harness-start-open'),- newKey: const ValueKey('harness-start-new'),+ if (widget.creation != null) ...[+ Expanded(+ child: Align(+ alignment: Alignment.topCenter,+ child: AbsorbPointer(+ absorbing: widget.creationBusy,+ child: ExcludeFocus(+ excluding: widget.creationBusy,+ child: _searchPanel(),+ ),+ ),+ ),+ ),+ const SizedBox(height: 24),+ ConstrainedBox(+ constraints: BoxConstraints(+ maxHeight: creationHeight,+ ),+ child: SingleChildScrollView(+ child: widget.creation!,+ ),),+ ] else ...[+ Flexible(child: _searchPanel()),+ if (!_showResults) ...[+ const SizedBox(height: 20),+ HarnessEntryActions(+ onOpen: _open,+ onNew: _new,+ openKey: const ValueKey(+ 'harness-start-open',+ ),+ newKey: const ValueKey('harness-start-new'),+ ),+ ],],],),diff --git a/desktop/lib/widgets/new_agent_dialog.dart b/desktop/lib/widgets/new_agent_dialog.dartindex a49fe1c85..b969d0f6e 100644--- a/desktop/lib/widgets/new_agent_dialog.dart+++ b/desktop/lib/widgets/new_agent_dialog.dart@@ -233,10 +233,12 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {final remembered = widget.notifier.agentPreference.value;if (allEngines.any((identity) => identity.id == remembered)) {setState(() {- _engine = remembered!;_engineChosenByUser = true;- _codexProfile = null;- _codexProfilesBusy = true;+ if (_engine != remembered) {+ _engine = remembered!;+ _codexProfile = null;+ _codexProfilesBusy = true;+ }});}}@@ -709,7 +711,8 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {options: options,onChanged: onChanged,focusNode: focusNode,- height: 58 * MediaQuery.textScalerOf(context).scale(1).clamp(1.0, 1.5),+ fillColor: grid.AppPalette.agentEntryField,+ height: 64 * MediaQuery.textScalerOf(context).scale(1).clamp(1.0, 1.5),trigger: Row(children: [icon,@@ -732,7 +735,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {maxLines: 1,overflow: TextOverflow.ellipsis,style: const TextStyle(- fontSize: 14,+ fontSize: 15,fontWeight: FontWeight.w500,),),@@ -764,7 +767,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {Widget _buildComposer(BuildContext context) {final bypassFlag = kEngineBypassPermissionFlag[_engine];final scale = MediaQuery.textScalerOf(context).scale(1);- final height = 58 * scale.clamp(1.0, 1.5);+ final height = 64 * scale.clamp(1.0, 1.5);final fields = <Widget>[_composerSelect(label: 'Agent',@@ -832,8 +835,15 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {style: FilledButton.styleFrom(backgroundColor: grid.AppPalette.swarmAccent,foregroundColor: grid.AppPalette.swarmTabBar,+ disabledBackgroundColor: Colors.white12,+ disabledForegroundColor: Colors.white38,+ textStyle: TextStyle(+ fontFamily: grid.AppFont.sans,+ fontSize: 17,+ fontWeight: FontWeight.w600,+ ),shape: RoundedRectangleBorder(- borderRadius: BorderRadius.circular(10),+ borderRadius: BorderRadius.circular(12),),),child: _submitting@@ -864,14 +874,14 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {},},child: Material(- color: grid.AppPalette.swarmSearchSurface,+ color: grid.AppPalette.agentEntrySurface,shape: RoundedRectangleBorder(- borderRadius: BorderRadius.circular(14),+ borderRadius: BorderRadius.circular(20),side: const BorderSide(color: Colors.white12),),clipBehavior: Clip.antiAlias,child: Padding(- padding: const EdgeInsets.fromLTRB(20, 16, 20, 8),+ padding: const EdgeInsets.fromLTRB(28, 24, 28, 18),child: Column(mainAxisSize: MainAxisSize.min,crossAxisAlignment: CrossAxisAlignment.stretch,@@ -881,12 +891,12 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {Expanded(child: Text(switch (widget.split?.axis) {- PaneResizeAxis.x => 'New agent · split right',- PaneResizeAxis.y => 'New agent · split down',- null => 'New agent',+ PaneResizeAxis.x => 'New Agent · split right',+ PaneResizeAxis.y => 'New Agent · split down',+ null => 'New Agent',},style: const TextStyle(- fontSize: 15,+ fontSize: 26,fontWeight: FontWeight.w600,),),@@ -898,7 +908,7 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {),],),- const SizedBox(height: 12),+ const SizedBox(height: 20),LayoutBuilder(builder: (context, constraints) {final wide =@@ -914,13 +924,13 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {return Row(children: [for (var i = 0; i < fields.length; i++) ...[- Expanded(- flex: i == 1 ? 3 : 2,- child: choices(fields[i]),- ),- const SizedBox(width: 10),+ Expanded(child: choices(fields[i])),+ const SizedBox(width: 12),],- SizedBox(width: 116 * scale, child: create),+ SizedBox(+ width: 160 * scale.clamp(1.0, 1.5),+ child: create,+ ),],);}@@ -957,6 +967,13 @@ class _NewAgentDialogState extends State<_NewAgentDialog> {},),],+ if (_waitingForCodexProfile && !_confirmationPending) ...[+ const SizedBox(height: 12),+ const Text(+ 'Loading Codex profiles…',+ style: TextStyle(fontSize: 13, color: Colors.white60),+ ),+ ],if (_error != null) ...[const SizedBox(height: 10),Semantics(@@ -1510,7 +1527,7 @@ class _Advanced extends StatelessWidget {?.copyWith(color: grid.AppPalette.textSecondary),),const Spacer(),- if (!open)+ if (!open && !compact)Flexible(child: Text(key: const Key('new-agent-advanced-state'),diff --git a/desktop/lib/widgets/swarm_search_input.dart b/desktop/lib/widgets/swarm_search_input.dartindex 5f81ee920..b2a67d91f 100644--- a/desktop/lib/widgets/swarm_search_input.dart+++ b/desktop/lib/widgets/swarm_search_input.dart@@ -22,6 +22,8 @@ class SwarmSearchInput extends StatelessWidget {this.hintText,this.rounded = false,this.prominent = false,+ this.outlined = false,+ this.fillColor,});final Key inputKey;@@ -37,6 +39,8 @@ class SwarmSearchInput extends StatelessWidget {final String? hintText;final bool rounded;final bool prominent;+ final bool outlined;+ final Color? fillColor;@overrideWidget build(BuildContext context) => ListenableBuilder(@@ -50,16 +54,18 @@ class SwarmSearchInput extends StatelessWidget {final open = search != null;final border = OutlineInputBorder(borderRadius: BorderRadius.vertical(- top: Radius.circular(rounded && !open ? 999 : 12),+ top: Radius.circular(rounded ? (prominent ? 32 : 28) : 12),bottom: Radius.circular(- open+ open && !outlined? 0: rounded- ? 999+ ? (prominent ? 32 : 28): 12,),),- borderSide: BorderSide(color: open ? Colors.transparent : Colors.white24),+ borderSide: BorderSide(+ color: open && !outlined ? Colors.transparent : Colors.white24,+ ),);return TextField(key: inputKey,@@ -98,9 +104,11 @@ class SwarmSearchInput extends StatelessWidget {): null,filled: true,- fillColor: open- ? grid.AppPalette.swarmSearchSurface- : const Color(0xa6111521),+ fillColor:+ fillColor ??+ (open+ ? grid.AppPalette.swarmSearchSurface+ : const Color(0xa6111521)),contentPadding: EdgeInsets.symmetric(horizontal: 18,vertical: prominent ? 22 : 18,diff --git a/desktop/lib/widgets/terminal_panel.dart b/desktop/lib/widgets/terminal_panel.dartindex 45b2c9b78..c84bfef6a 100644--- a/desktop/lib/widgets/terminal_panel.dart+++ b/desktop/lib/widgets/terminal_panel.dart@@ -1516,91 +1516,99 @@ class _TerminalHeader extends StatelessWidget {EngineMark(engine: session.engineId, size: 17),const SizedBox(width: 10),Expanded(- child: Tooltip(- message: identityDetail,- waitDuration: const Duration(milliseconds: 700),- child: GestureDetector(- behavior: HitTestBehavior.opaque,- onDoubleTap: () => unawaited(- showAgentRenameDialog(- context,- notifier,- session.machineId,- session.agentId,- session.agentName,- ),- ),- child: Text(- session.agentName,- maxLines: 1,- overflow: TextOverflow.ellipsis,- style: TextStyle(- color: AppColors.text,- fontFamily: AppFonts.sans,- fontSize: 13,- fontWeight: FontWeight.w600,- ),- ),- ),- ),- ),- const SizedBox(width: 8),- if (status != null)- ConstrainedBox(- constraints: BoxConstraints(- maxWidth: math.max(- 0,- math.min(- constraints.maxWidth * .3,- constraints.maxWidth - actionsWidth - 110,+ child: Row(+ children: [+ Flexible(+ child: Tooltip(+ message: identityDetail,+ waitDuration: const Duration(milliseconds: 700),+ child: GestureDetector(+ behavior: HitTestBehavior.opaque,+ onDoubleTap: () => unawaited(+ showAgentRenameDialog(+ context,+ notifier,+ session.machineId,+ session.agentId,+ session.agentName,+ ),+ ),+ child: Text(+ session.agentName,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: TextStyle(+ color: AppColors.text,+ fontFamily: AppFonts.sans,+ fontSize: 13,+ fontWeight: FontWeight.w600,+ ),+ ),+ ),),),- ),- child: Align(- alignment: Alignment.centerRight,- child: Tooltip(- message: status.detail,- child: TextButton(- onPressed: canReconnect- ? () => notifier.selectAgent(- session.machineId,- session.agentId,- )- : null,- style: TextButton.styleFrom(- foregroundColor: color,- disabledForegroundColor: AppColors.textSoft,- minimumSize: Size.zero,- tapTargetSize: MaterialTapTargetSize.shrinkWrap,- padding: const EdgeInsets.symmetric(- horizontal: 6,- vertical: 4,+ const SizedBox(width: 8),+ if (status != null)+ ConstrainedBox(+ constraints: BoxConstraints(+ maxWidth: math.max(+ 0,+ math.min(+ constraints.maxWidth * .22,+ constraints.maxWidth - actionsWidth - 110,+ ),),),- child: Row(- mainAxisSize: MainAxisSize.min,- children: [- Icon(status.icon, size: 14),- const SizedBox(width: 6),- Flexible(- child: Text(- status.label,- maxLines: 1,- overflow: TextOverflow.ellipsis,- style: const TextStyle(fontSize: 11),+ child: Align(+ alignment: Alignment.centerLeft,+ child: Tooltip(+ message: status.detail,+ child: TextButton(+ onPressed: canReconnect+ ? () => notifier.selectAgent(+ session.machineId,+ session.agentId,+ )+ : null,+ style: TextButton.styleFrom(+ foregroundColor: color,+ disabledForegroundColor: AppColors.textSoft,+ minimumSize: Size.zero,+ tapTargetSize:+ MaterialTapTargetSize.shrinkWrap,+ padding: const EdgeInsets.symmetric(+ horizontal: 6,+ vertical: 4,+ ),+ ),+ child: Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ Icon(status.icon, size: 14),+ const SizedBox(width: 6),+ Flexible(+ child: Text(+ status.label,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: const TextStyle(fontSize: 11),+ ),+ ),+ ],),),- ],+ ),),+ )+ else if (!compact)+ Padding(+ padding: const EdgeInsets.all(4),+ child: Icon(Icons.circle, size: 8, color: color),),- ),- ),- )- else if (!compact)- Padding(- padding: const EdgeInsets.all(4),- child: Icon(Icons.circle, size: 8, color: color),+ ],),+ ),+ const SizedBox(width: 8),// Which of the three paths carries this pane's bytes. Absent for a local machine's own// terminal, which has no such distinction and so gets no badge.//@@ -1617,7 +1625,7 @@ class _TerminalHeader extends StatelessWidget {constraints: BoxConstraints(maxWidth: math.max(actionsWidth,- constraints.maxWidth * (status == null ? .55 : .3),+ constraints.maxWidth * .55,),),child: PaneHeaderActions(diff --git a/desktop/macos/Runner/SwarmTitlebar.swift b/desktop/macos/Runner/SwarmTitlebar.swiftindex 51559d5cb..05ac8a59a 100644--- a/desktop/macos/Runner/SwarmTitlebar.swift+++ b/desktop/macos/Runner/SwarmTitlebar.swift@@ -283,6 +283,7 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {private func rebuildMachinesMenu() {machinesMenu.removeAllItems()+ machinesMenu.minimumWidth = 500let manager = NSMenuItem(title: "Open Machines Manager", action: #selector(menuAction(_:)), keyEquivalent: "")manager.target = selfmanager.representedObject = "manageMachines"@@ -293,10 +294,14 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation, NSMenuDelegate {let item = NSMenuItem(title: machine.name, action: #selector(machineAction(_:)), keyEquivalent: "")item.target = selfitem.representedObject = machine.id- let label = NSMutableAttributedString(string: machine.name)+ let paragraph = NSMutableParagraphStyle()+ paragraph.tabStops = [NSTextTab(textAlignment: .right, location: 420)]+ let label = NSMutableAttributedString(string: machine.name,+ attributes: [.font: NSFont.menuFont(ofSize: 0), .paragraphStyle: paragraph])let count = machine.agentCount.map { "\($0) \($0 == 1 ? "agent" : "agents")" }- let detail = [machine.status, count].compactMap { $0 }.filter { !$0.isEmpty }.joined(separator: " · ")- label.append(NSAttributedString(string: " " + detail, attributes: [.foregroundColor: NSColor.secondaryLabelColor]))+ label.append(NSAttributedString(string: " " + machine.status + "\t" + (count ?? ""),+ attributes: [.font: NSFont.menuFont(ofSize: 0), .paragraphStyle: paragraph,+ .foregroundColor: NSColor.secondaryLabelColor]))item.attributedTitle = labelitem.image = NSImage(systemSymbolName: machine.local ? "laptopcomputer" : "desktopcomputer", accessibilityDescription: nil)let submenu = NSMenu(title: machine.name)diff --git a/desktop/test/agent_creation_recovery_test.dart b/desktop/test/agent_creation_recovery_test.dartindex 3052cec52..50960d2e5 100644--- a/desktop/test/agent_creation_recovery_test.dart+++ b/desktop/test/agent_creation_recovery_test.dart@@ -117,7 +117,7 @@ void main() {await chord(tester, LogicalKeyboardKey.keyN, shift: true);case 'start page':await chord(tester, LogicalKeyboardKey.keyT);- await tester.tap(find.byKey(const ValueKey('harness-start-new')));+ await chord(tester, LogicalKeyboardKey.keyN, shift: true);case 'search shortcut':await chord(tester, LogicalKeyboardKey.keyN);await tester.enterText(@@ -138,7 +138,10 @@ void main() {await tester.sendKeyEvent(LogicalKeyboardKey.escape);}await tester.pumpAndSettle();- expect(find.byType(NewAgentComposer), findsNothing);+ expect(+ find.byType(NewAgentComposer),+ entry == 'start page' ? findsOneWidget : findsNothing,+ );expect(find.byType(SwarmSearchResults), findsNothing);if (entry == 'start page') {expect(app.swarms, hasLength(2));@@ -146,7 +149,7 @@ void main() {final field = tester.widget<TextField>(find.byKey(const ValueKey('harness-start-search')),);- expect(field.focusNode!.hasFocus, isFalse);+ expect(field.focusNode!.hasFocus, dismissal == 'escape');// The unused page remains usable and closes without a history entry.await chord(tester, LogicalKeyboardKey.keyW);}@@ -177,7 +180,8 @@ void main() {expect(find.byType(NewAgentComposer), findsOneWidget);await tester.tapAt(const Offset(12, 72));await tester.pumpAndSettle();- expect(find.byType(NewAgentComposer), findsNothing);+ expect(find.byKey(const ValueKey('agent-composer')), findsNothing);+ expect(find.byType(NewAgentComposer), findsOneWidget);expect(find.byType(SwarmSearchResults), findsNothing);expect(tester@@ -223,9 +227,9 @@ void main() {expect(find.byType(SwarmSearchResults), findsOneWidget);expect(find.text(switch (entry) {- 'Split right' => 'New agent · split right',- 'Split down' => 'New agent · split down',- _ => 'New agent',+ 'Split right' => 'New Agent · split right',+ 'Split down' => 'New Agent · split down',+ _ => 'New Agent',}),findsWidgets,);@@ -320,7 +324,7 @@ void main() {check.created();await tester.pump();await tester.pump(const Duration(milliseconds: 200));- expect(find.byType(NewAgentComposer), findsNothing);+ expect(find.byKey(const ValueKey('agent-composer')), findsNothing);expect(find.byType(SwarmSearchResults), findsNothing);expect(app.activeSwarmId, current);if (change == 'closed' || change == 'stale split') {diff --git a/desktop/test/harness_picker_entry_test.dart b/desktop/test/harness_picker_entry_test.dartindex b467d3447..2fe3a6cc8 100644--- a/desktop/test/harness_picker_entry_test.dart+++ b/desktop/test/harness_picker_entry_test.dart@@ -80,7 +80,9 @@ void main() {find.byKey(const ValueKey('swarm-search-preview')),findsOneWidget,);- expect(find.byKey(const ValueKey('harness-picker-open')), findsOneWidget);+ expect(find.byKey(const ValueKey('harness-picker-open')), findsNothing);+ expect(tester.widget<TextField>(field).decoration!.hintText, '');+ expect(find.text('Find an agent'), findsOneWidget);expect(find.byType(NewAgentComposer), findsOneWidget);final create = find.byKey(const ValueKey('create-agent-submit'));final createRect = tester.getRect(create);diff --git a/desktop/test/keymap_runtime_test.dart b/desktop/test/keymap_runtime_test.dartindex b7d139871..2ddd5ffdf 100644--- a/desktop/test/keymap_runtime_test.dart+++ b/desktop/test/keymap_runtime_test.dart@@ -615,7 +615,7 @@ void main() {}await tester.pumpAndSettle();expect(find.byType(NewAgentComposer), findsOneWidget);- expect(find.byType(SwarmSearchResults), findsOneWidget);+ expect(find.byType(SwarmSearchResults), findsNothing);expect(find.byKey(const ValueKey('harness-start-results')),findsNothing,@@ -633,7 +633,7 @@ void main() {await tester.pumpAndSettle();expect(find.byType(AlertDialog), findsNothing);expect(find.byType(SwarmSearchResults), findsNothing);- expect(tester.widget<TextField>(field).focusNode!.hasFocus, isFalse);+ expect(tester.widget<TextField>(field).focusNode!.hasFocus, isTrue);expect(tester.widget<TextField>(field).controller!.text, 'Agent 12');expect(app.panes, isEmpty);expect(tester.takeException(), isNull);diff --git a/desktop/test/new_agent_codex_profile_test.dart b/desktop/test/new_agent_codex_profile_test.dartindex 91ac6514c..41091167d 100644--- a/desktop/test/new_agent_codex_profile_test.dart+++ b/desktop/test/new_agent_codex_profile_test.dart@@ -8,9 +8,11 @@ import 'package:harness/auth/auth_session.dart';import 'package:harness/core/config.dart';import 'package:harness/core/engine_availability.dart';import 'package:harness/core/models.dart';+import 'package:harness/core/local_key_value_store.dart';import 'package:harness/state/app_state.dart';import 'package:harness/core/project_folder.dart';import 'package:harness/state/pane_arrangement.dart';+import 'package:harness/state/pane_layout_store.dart';import 'package:harness/widgets/new_agent_dialog.dart';import 'package:harness/shared/widgets/app_choice_picker.dart';import 'package:harness/shared/widgets/app_select_field.dart';@@ -23,6 +25,17 @@ class _Folders extends FileSelectorPlatform {}) async => '/work';}+class _DelayedPreferenceStore implements LocalKeyValueStore {+ final preference = Completer<String?>();+ @override+ Future<String?> read(String key) async =>+ key == 'new_agent_engine' ? await preference.future : null;+ @override+ Future<void> write(String key, String value) async {}+ @override+ Future<void> delete(String key) async {}+}+/// The visible profile field reports the account used for the next launch.void expectProfile(WidgetTester tester, String label) {final field = tester.widget<AppSelectField<String>>(@@ -46,11 +59,15 @@ class _Notifier extends AppNotifier {'/accounts/codex1','/accounts/codex2',],+ LocalKeyValueStore? storage,]) : paths = {...initialPaths},super(config: AppConfig.dev,authSession: AuthSession(),configStore: null,+ paneLayoutStore: storage == null+ ? null+ : PaneLayoutStore(storage: storage),);final Set<String> paths;@@ -125,6 +142,7 @@ void main() {WidgetTester tester, {bool local = true,bool supported = true,+ bool composer = false,Iterable<String>? initialPaths,_Notifier? notifier,}) async {@@ -154,19 +172,37 @@ void main() {MaterialApp(home: Builder(builder: (context) => Scaffold(- body: TextButton(- onPressed: () => showNewAgentDialog(- context,- n,- 'machine',- source: 'machine_row',- ),- child: const Text('open'),- ),+ body: composer+ ? Center(+ child: SizedBox(+ width: 900,+ child: NewAgentComposer(+ notifier: n,+ machineId: 'machine',+ swarmId: n.activeSwarmId,+ onFinished: () {},+ onBusyChanged: (_) {},+ onDismiss: () {},+ ),+ ),+ )+ : TextButton(+ onPressed: () => showNewAgentDialog(+ context,+ n,+ 'machine',+ source: 'machine_row',+ ),+ child: const Text('open'),+ ),),),),);+ if (composer) {+ await tester.pumpAndSettle();+ return n;+ }await tester.tap(find.text('open'));await tester.pumpAndSettle();await tester.tap(find.byKey(const Key('new-agent-engine-field')));@@ -189,6 +225,40 @@ void main() {await tester.pumpAndSettle();}+ testWidgets(+ 'late identical agent preference keeps Create usable and its loaded profile',+ (tester) async {+ final storage = _DelayedPreferenceStore();+ final notifier = _Notifier(const ['/custom/work-login'], storage);+ await open(tester, notifier: notifier, composer: true);+ final create = find.byKey(const ValueKey('create-agent-submit'));+ expect(tester.widget<FilledButton>(create).onPressed, isNotNull);+ storage.preference.complete('codex');+ await tester.pumpAndSettle();+ expect(tester.widget<FilledButton>(create).onPressed, isNotNull);+ await tester.tap(create);+ await tester.pump(const Duration(milliseconds: 100));+ expect(notifier.calls.single['codexHome'], '/custom/work-login');+ await tester.pumpWidget(const SizedBox());+ expect(tester.takeException(), isNull);+ },+ );++ testWidgets('compact creation explains a pending profile lookup', (+ tester,+ ) async {+ final pending = Completer<void>();+ final notifier = _Notifier()..pending = pending;+ await open(tester, notifier: notifier, composer: true);+ final create = find.byKey(const ValueKey('create-agent-submit'));+ expect(find.text('Loading Codex profiles…'), findsOneWidget);+ expect(tester.widget<FilledButton>(create).onPressed, isNull);+ pending.complete();+ await tester.pumpAndSettle();+ expect(find.text('Loading Codex profiles…'), findsNothing);+ expect(tester.widget<FilledButton>(create).onPressed, isNotNull);+ });+testWidgets('no profiles shows the default launch explicitly', (tester,) async {diff --git a/desktop/test/new_agent_project_folder_test.dart b/desktop/test/new_agent_project_folder_test.dartindex 6c76c5203..f15548760 100644--- a/desktop/test/new_agent_project_folder_test.dart+++ b/desktop/test/new_agent_project_folder_test.dart@@ -117,71 +117,77 @@ Future<void> _mount(}void main() {- testWidgets(- 'the shared composer preserves splits and blocks duplicate launch or dismissal',- (tester) async {- tester.view.devicePixelRatio = 1;- tester.view.physicalSize = const Size(1200, 900);- addTearDown(tester.view.reset);- final connection = _Connection();- final app = _App(connection, local: true);- await app.agentPreference.select('claude');- app.adoptSessionForTest(terminal('a0', []));- final original = app.activeSwarmId;- addTearDown(() async {- await tester.pumpWidget(const SizedBox());- app.dispose();- });- await tester.pumpWidget(- MaterialApp(- theme: grid.buildAppTheme(brightness: Brightness.dark),- home: SwarmScreen(notifier: app, nativeTabs: false),- ),- );- await chord(tester, LogicalKeyboardKey.keyR);- await tester.pumpAndSettle();- final composer = find.byType(NewAgentComposer);- final split = tester.widget<NewAgentComposer>(composer).split;- expect(split, isNotNull);- expect(tester.widget<NewAgentComposer>(composer).swarmId, original);- final submit = find.byKey(const ValueKey('create-agent-submit'));- await tester.tap(submit);- await tester.pump();- expect(connection.calls, hasLength(1));- final creationId = connection.calls.single.$2['creationId'];- await tester.sendKeyEvent(LogicalKeyboardKey.escape);- await chord(tester, LogicalKeyboardKey.keyT);- await tester.tapAt(const Offset(10, 400));- await tester.pump();- expect(composer, findsOneWidget);- expect(app.activeSwarmId, original);- expect(tester.widget<NewAgentComposer>(composer).split, same(split));- expect(connection.calls, hasLength(1));- connection.calls.single.$3.completeError(- const WsRequestTimeout('agent_create'),- );- await tester.pumpAndSettle();- expect(find.text('Check status'), findsOneWidget);- await tester.sendKeyEvent(LogicalKeyboardKey.escape);- await tester.pump();- expect(composer, findsOneWidget);- await tester.tap(submit);- await tester.pump();- expect(connection.calls.last.$1, 'agent_create_status');- expect(connection.calls.last.$2, {'creationId': creationId});- connection.calls.last.$3.complete({- 'creationId': creationId,- 'state': 'created',- 'agent': {'id': 'created', 'name': 'Created agent', 'engine': 'claude'},- });- await tester.pump();- await tester.pump(const Duration(milliseconds: 200));- expect(composer, findsNothing);- expect(app.activeSwarmId, original);- expect(app.panes, hasLength(2));- expect(app.focusedPane?.agentId, 'created');- },- );+ for (final inline in [false, true]) {+ testWidgets(+ 'shared creation preserves its destination and blocks duplicate launch (inline=$inline)',+ (tester) async {+ tester.view.devicePixelRatio = 1;+ tester.view.physicalSize = const Size(1200, 900);+ addTearDown(tester.view.reset);+ final connection = _Connection();+ final app = _App(connection, local: true);+ await app.agentPreference.select('claude');+ if (!inline) app.adoptSessionForTest(terminal('a0', []));+ final original = app.activeSwarmId;+ addTearDown(() async {+ await tester.pumpWidget(const SizedBox());+ app.dispose();+ });+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: Brightness.dark),+ home: SwarmScreen(notifier: app, nativeTabs: false),+ ),+ );+ if (!inline) await chord(tester, LogicalKeyboardKey.keyR);+ await tester.pumpAndSettle();+ final composer = find.byType(NewAgentComposer);+ final split = tester.widget<NewAgentComposer>(composer).split;+ expect(split, inline ? isNull : isNotNull);+ expect(tester.widget<NewAgentComposer>(composer).swarmId, original);+ final submit = find.byKey(const ValueKey('create-agent-submit'));+ await tester.tap(submit);+ await tester.pump();+ expect(connection.calls, hasLength(1));+ final creationId = connection.calls.single.$2['creationId'];+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);+ await chord(tester, LogicalKeyboardKey.keyT);+ await tester.tapAt(const Offset(10, 400));+ await tester.pump();+ expect(composer, findsOneWidget);+ expect(app.activeSwarmId, original);+ expect(tester.widget<NewAgentComposer>(composer).split, same(split));+ expect(connection.calls, hasLength(1));+ connection.calls.single.$3.completeError(+ const WsRequestTimeout('agent_create'),+ );+ await tester.pumpAndSettle();+ expect(find.text('Check status'), findsOneWidget);+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);+ await tester.pump();+ expect(composer, findsOneWidget);+ await tester.tap(submit);+ await tester.pump();+ expect(connection.calls.last.$1, 'agent_create_status');+ expect(connection.calls.last.$2, {'creationId': creationId});+ connection.calls.last.$3.complete({+ 'creationId': creationId,+ 'state': 'created',+ 'agent': {+ 'id': 'created',+ 'name': 'Created agent',+ 'engine': 'claude',+ },+ });+ await tester.pump();+ await tester.pump(const Duration(milliseconds: 200));+ expect(composer, findsNothing);+ expect(app.activeSwarmId, original);+ expect(app.panes, hasLength(inline ? 1 : 2));+ expect(app.focusedPane?.agentId, 'created');+ },+ );+ }for (final composer in [false, true]) {for (final local in [true, false]) {diff --git a/desktop/test/swarm_entry_picker_test.dart b/desktop/test/swarm_entry_picker_test.dartindex 75ecb46b2..fe9257b27 100644--- a/desktop/test/swarm_entry_picker_test.dart+++ b/desktop/test/swarm_entry_picker_test.dart@@ -83,7 +83,7 @@ void main() {});for (final native in [false, true]) {- testWidgets('start page separates Open and New Agent (native=$native)', (+ testWidgets('start page combines search and New Agent (native=$native)', (tester,) async {const channel = MethodChannel('harness/swarm_tabs');@@ -105,9 +105,7 @@ void main() {expect(find.byType(FloatingActionButton), findsNothing);expect(tester.getRect(_startInput).bottom,- lessThan(- tester.getRect(find.byKey(const ValueKey('harness-start-open'))).top,- ),+ lessThan(tester.getRect(find.byType(NewAgentComposer)).top),);expect(tester.widget<TextField>(_startInput).decoration!.hintText,@@ -150,15 +148,9 @@ void main() {app.renameSwarm(original, 'Background update');await tester.pump();expect(_results, findsNothing);- await tester.tap(find.byKey(const ValueKey('harness-start-new')));- await tester.pump(const Duration(milliseconds: 200));expect(find.byType(NewAgentComposer), findsOneWidget);expect(find.widgetWithText(FilledButton, 'Create'), findsOneWidget);expect(find.byType(AlertDialog), findsNothing);- expect(_results, findsOneWidget);- await tester.tapAt(const Offset(20, 200));- await tester.pump(const Duration(milliseconds: 200));- expect(find.byType(AlertDialog), findsNothing);expect(_results, findsNothing);expect(_startInput, findsOneWidget);await tester.pumpWidget(const SizedBox());diff --git a/desktop/test/terminal_panel_header_test.dart b/desktop/test/terminal_panel_header_test.dartindex abd65f566..4eb1486d9 100644--- a/desktop/test/terminal_panel_header_test.dart+++ b/desktop/test/terminal_panel_header_test.dart@@ -5,13 +5,17 @@ import 'package:flutter/material.dart';import 'package:flutter_test/flutter_test.dart';import 'package:harness/auth/auth_session.dart';import 'package:harness/core/config.dart';+import 'package:harness/core/models.dart';import 'package:harness/state/app_state.dart';import 'package:harness/terminal/terminal_session.dart';import 'package:harness/theme/app_theme.dart';import 'package:harness/widgets/terminal_panel.dart';import 'package:lucide_icons_flutter/lucide_icons.dart';+import 'support/real_fonts.dart';+void main() {+ setUpAll(loadRealFonts);TerminalSession sessionNamed(String name) {final session = TerminalSession(machineId: 'local',@@ -37,6 +41,26 @@ void main() {authSession: AuthSession(),configStore: null,);+ notifier.machineStates['local'] =+ MachineState(+ const Machine(+ machineId: 'local',+ name: 'Office',+ authMode: MachineAuthMode.remote,+ ),+ )+ ..agents = const [+ Agent(+ id: 'agent-1',+ name: 'Desktop',+ engine: 'codex',+ project: AgentProject(+ name: 'autonomous-harness',+ branch: 'main',+ cwd: '/work/autonomous-harness',+ ),+ ),+ ];addTearDown(notifier.dispose);await tester.pumpWidget(MaterialApp(@@ -58,6 +82,32 @@ void main() {// Each shape describes the path topology, not an assumed speed: direct link, intermediate hop,// backend server. Tooltip and semantics use the protocol names people will diagnose with.+ testWidgets(+ 'connection status follows the session name without moving project details',+ (tester) async {+ final session = sessionNamed('Desktop');+ addTearDown(session.dispose);+ await pump(tester, session);+ final project = find.text('autonomous-harness');+ final projectRect = tester.getRect(project);+ for (final (status, label) in [+ (TerminalSessionStatus.opening, 'Connecting'),+ (TerminalSessionStatus.resyncing, 'Restoring'),+ (TerminalSessionStatus.closed, 'Reconnect'),+ (TerminalSessionStatus.error, 'Reconnect'),+ ]) {+ session.status = status;+ await pump(tester, session);+ final nameRect = tester.getRect(find.text('Desktop'));+ final statusRect = tester.getRect(find.text(label));+ expect(statusRect.left, greaterThan(nameRect.right));+ expect(statusRect.right, lessThan(projectRect.left));+ expect(tester.getRect(project), projectRect);+ expect(tester.takeException(), isNull);+ }+ },+ );+testWidgets('the transport badge describes each link mode by shape, colour, and label',(tester) async {diff --git a/desktop/test/welcome_entry_layout_test.dart b/desktop/test/welcome_entry_layout_test.dartindex 4afa81cb6..bd48aa7ab 100644--- a/desktop/test/welcome_entry_layout_test.dart+++ b/desktop/test/welcome_entry_layout_test.dart@@ -94,9 +94,10 @@ void main() {await tester.pump();}final field = find.byKey(const ValueKey('harness-start-search'));- final create = find.byKey(const ValueKey('harness-start-new'));- final open = find.byKey(const ValueKey('harness-start-open'));+ final create = find.byKey(const ValueKey('create-agent-submit'));final device = find.byKey(const ValueKey('harness-device-link'));+ await tester.ensureVisible(create);+ await tester.pumpAndSettle();expect(find.text('Harness'), findsNothing);expect(tester.widget<TextField>(field).decoration!.hintText,@@ -106,20 +107,14 @@ void main() {expect(find.byType(ListTile), findsNothing);final fieldRect = tester.getRect(field);final createRect = tester.getRect(create);- final openRect = tester.getRect(open);final deviceRect = tester.getRect(device);- expect(createRect.center.dy, closeTo(openRect.center.dy, 1));- expect(openRect.top, greaterThan(fieldRect.bottom));- expect(openRect.left, closeTo(fieldRect.left, 1));- expect(createRect.left, greaterThan(openRect.right));+ expect(createRect.top, greaterThan(fieldRect.bottom));expect(fieldRect.center.dx, closeTo(width / 2, 1));expect(deviceRect.left, closeTo(fieldRect.left, 1));expect(deviceRect.bottom, closeTo(height - 32, 1));expect(find.text('Meet the Harness device'), findsOneWidget);expect(create.hitTestable(), findsOneWidget);- expect(open.hitTestable(), findsOneWidget);expect(createRect.bottom, lessThanOrEqualTo(height));- expect(openRect.bottom, lessThanOrEqualTo(height));expect(deviceRect.top, greaterThanOrEqualTo(createRect.bottom + 24));final output = Platform.environment['HARNESS_ENTRY_CAPTURE_DIR'];if (output != null) {@@ -144,7 +139,7 @@ void main() {await tester.pump();final results = find.byKey(const ValueKey('harness-start-results'));expect(results, findsOneWidget);- expect(tester.getRect(results).height, greaterThan(140));+ expect(tester.getRect(results).height, greaterThan(40));expect(tester.getRect(results).width, tester.getRect(field).width);expect(tester.getRect(field).left, closeTo(fieldRect.left, 1));expect(tester.getRect(field).right, closeTo(fieldRect.right, 1));@@ -154,22 +149,14 @@ void main() {tester.getRect(results).bottom,lessThanOrEqualTo(deviceRect.top - 24),);- expect(create, findsNothing);- expect(open, findsNothing);+ expect(tester.getRect(create), createRect);+ expect(create.hitTestable(), findsOneWidget);await tester.sendKeyEvent(LogicalKeyboardKey.escape);await tester.pump();expect(tester.getRect(field).width, closeTo(fieldRect.width, 1));expect(tester.getRect(device), deviceRect);await tester.ensureVisible(create);expect(create.hitTestable(), findsOneWidget);- await tester.tap(create);- await tester.pumpAndSettle();- expect(find.byType(AlertDialog), findsOneWidget);- expect(results, findsNothing);- expect(tester.takeException(), isNull);- await tester.sendKeyEvent(LogicalKeyboardKey.escape);- await tester.pumpAndSettle();- expect(find.byType(AlertDialog), findsNothing);expect(tester.widget<TextField>(field).focusNode!.hasFocus, isFalse);await tester.ensureVisible(device);await tester.pumpAndSettle();diff --git a/desktop/tool/swarm_titlebar_checks.swift b/desktop/tool/swarm_titlebar_checks.swiftindex bab3fa539..6c1050b6c 100644--- a/desktop/tool/swarm_titlebar_checks.swift+++ b/desktop/tool/swarm_titlebar_checks.swift@@ -616,6 +616,9 @@ private extension SwarmTitlebar {try checkTitlebar(messenger.calls.last?.method == "manageMachines","Machines Manager opens through the Flutter command bridge")let destinations = machineMenu.items.filter { $0.action == #selector(machineAction(_:)) }+ try checkTitlebar(machineMenu.minimumWidth >= 500 &&+ destinations.first?.attributedTitle?.string.hasSuffix("\t2 agents") == true,+ "Machines gives counts a separate trailing column in a roomy native submenu")try checkTitlebar(destinations.map { $0.representedObject as? String } == ["office", "home"],"Machines lists each linked computer as a destination")try checkTitlebar(destinations[0].attributedTitle?.string.contains("Online") == true &&diff --git a/docs/harness-agent-first-tabs.md b/docs/harness-agent-first-tabs.mdindex 3ebd6b23b..a5e6b52aa 100644--- a/docs/harness-agent-first-tabs.md+++ b/docs/harness-agent-first-tabs.md@@ -16,20 +16,16 @@ and protocol identifiers are unchanged.Aurora mesh ground — the panel colour with three dim washes in the app's ownaccent, Claude and Codex colours, drawn rather than loaded (no photograph). A long search field, capped at 1120 logical pixels,has a prominent 64-pixel minimum height and shows **Find an agent** in place of-a large heading. **Open Agent** and accented-**+ New Agent** sit underneath, aligned with the field's left edge. The pill-buttons retain their smaller 48-pixel height and wrap at narrow widths or large-text sizes. The device image and its caption share that same left edge in a footer-32 pixels above the window bottom. The footer stays put when search opens or-closes. Short windows use a small image beside the caption to preserve search space.--Activating search keeps the field's position and width fixed and reveals results and preview-side by side at widths of 700 logical pixels and above. The actions hide while-searching. Results fit the available space above the footer and scroll independently.-Escape restores both actions and retains the query.+a large heading. The same **New Agent** creation section used by Cmd-N sits below+search, above the device footer. Search starts compact. Activating it keeps the+field's position, width and 32-pixel outer corners fixed and reveals results and+preview side by side at widths of 700 logical pixels and above. Results scroll+in the space above creation; opening, filtering and closing them does not move+the creation row or device. Escape retains the query. Without a linked machine,+the page retains Open/New actions and New opens machine linking.The field starts empty and focused so typing works immediately. Typing, clicking-it or Open Agent, or pressing an arrow reveals the same input, results,+it, or pressing an arrow reveals the same input, results,highlight, action arrow and keyboard navigation as the Cmd-N picker. Focus alone does notbuild a search catalog or reveal results. New Harness refocuses an existing unusedpage too. Typing filters immediately; arrows select and Enter opens. Escape or clicking@@ -47,36 +43,36 @@ ground keyed out, so the device floats on the page's own ground), the title“Meet the Harness device”, the line “A device for your agents — scroll, switchpanes, give voice commands.” and a Learn more pill. 120 points tall, 84 withthe line dropped when the window is short.-The start-page actions use the same pill shape as the titlebar. The device link-and both pairs of New/Open buttons show a hand cursor. Open Agent on the start-page is transparent with a subtle border; New Agent retains its accent fill.Unused default-name empty pages are excluded from Recently Closed.The titlebar places the bell beside the traffic lights, then the tabs and tabplus. A single accented **Add Agent** button sits on the right. It and**Cmd-N** open a combined panel with a focused **Find an agent** field, results-and preview above a compact **New agent** section. **Open Agent** has a solid-neutral fill at the bottom of the results panel. Enter opens the highlighted-result. This supersedes the two-button modal and separate workspace creation+and preview above a compact **New Agent** section. Both sections use an almost-black surface and large+matching headings; the modal search field is blank beneath its heading. There is+no Open Agent footer button. The highlighted row action or Enter opens a result. This supersedes the two-button modal and separate workspace creationdialog; the New Harness page remains compact until search is activated.The creation section stays anchored at the panel's bottom while queries andresults change. Results scroll in the space above it. Search does not cover,push down or reset the creation controls. The main row is **Agent / Project /-Machine / Create**, with compact dropdowns displaying both a category and its-selected value. Defaults are the remembered agent, **New project**, and this+Machine / Create**, with three equal-width dropdowns displaying both a category+and its selected value, beside a larger Create button. Defaults are the remembered agent, **New project**, and thiscomputer. A split inherits the focused agent's machine and project instead.Project choices are **New project / Local folder… / Remote repository…**.Local browses the selected machine; Remote shows an inline repository field.Dropdowns support keyboard navigation and typeahead, and their arrow/Enter keysnever activate search results. **Shift-Cmd-N** focuses the Agent control withoutclearing the query. Escape closes an open menu first, then the panel, restoring-terminal focus. The start-page New Agent action opens this same panel with the-creation row focused.+terminal focus. From inline search, Shift-Cmd-N collapses results and focuses the creation row+already on the page. Escape there returns focus to its compact search field.The row wraps on narrow windows or at large text sizes; creation details scrollwithin a bounded section. **Options** keeps account and permissions controls-available without expanding the initial form. Cached engine availability is+available without expanding the initial form; its collapsed row omits the profile+summary. A pending Codex profile lookup is explained beneath the controls. Loading+a saved engine preference identical to the current selection preserves the loaded+profile and submit readiness. Cached engine availability isreused when opening the combined surface. No project list is rebuilt from everyagent on each query change. Existing standalone creation entry points retaintheir direct-choice dialog and share the same creation and recovery logic.@@ -131,12 +127,18 @@ The input and result rows share one picker shortcut scope. Tab focus highlightsthe row that Enter will open. Arrow navigation and command-mode entry returnfocus to the input for continued typing; remapped or unbound navigation/Enterkeys keep their meaning on a focused row. Closing the inline picker releases-focus from the entire surface, so dismissing New Agent cannot restore a caret.+focus from the search surface. Escape from inline creation returns focus to the+compact search input.Native New Agent and Search Commands actions use the focused picker'sactions too. Command search stays in its field; the inline start-page dropdown-closes before opening the combined panel with creation focused. Native actions wait for the destination focus tree before+closes before focusing its adjacent creation row. Native actions wait for the destination focus tree beforehanding keyboard ownership back to Flutter and preserve in-progress search composition.+Pane connection states (Connecting, Restoring and Reconnect) follow the session+name on the left. The project, branch and machine retain the same space on the+right across status changes. Reconnect keeps its existing terminal reconnection+action and error tooltip.+Rename Harness has one title and an unlabeled, accessible name field, with thecurrent name selected for immediate typing. Muted focus colors and pill-shapedCancel/Rename actions match the entry UI. Blank names stay in the dialog; the@@ -166,7 +168,8 @@ then **Split Right, Split Down, Zoom Pane, Close Pane**. Pin/Unpin and Add Projeare removed from this menu. File actions have native system icons, with the samefour-corner Zoom and plain Close cross as the pane header. Machines starts with **Open Machines Manager**, thenlinked computers with their status and cached agent count, followed by Link-Machine and Refresh Machines. Each computer is a submenu of named agents with+Machine and Refresh Machines. The menu is at least 500 points wide, with agent+counts in a right-aligned column before the native submenu chevron. Each computer is a submenu of named agents withengine icons. Selecting an agent opens its exact machine/agent identity, reusingan existing pane when present. The submenu retains Find Agents for the fullsearch. Empty/unavailable lists are explicit; unknown counts are not shown asdiff --git a/docs/harness-v2-handoff.md b/docs/harness-v2-handoff.mdindex b1cc66fd4..06b95528f 100644--- a/docs/harness-v2-handoff.md+++ b/docs/harness-v2-handoff.md@@ -41,18 +41,41 @@ user for a benchmark window.menus. **Harness** now names the tab container as well as the app/device/CLI:New Harness, Rename Harness, Close Harness, and navigation/help labels. Customnames and wire IDs stay; the old New Tab default restores as New Harness.-- **Current refinement:** Cmd-N opens **Find an agent**, results and preview- above a compact, bottom-anchored **New agent** section. The row is **Agent /- Project / Machine / Create**, with selected defaults and keyboard dropdowns.- Query/result changes leave the row's position and choices intact. Open Agent- remains solid neutral beneath results; Shift-Cmd-N focuses the creation row.- This supersedes both the earlier compact-first modal and the separate full- workspace creation dialog. New Harness remains compact until search activation.+- **Current refinement:** Cmd-N opens the result list and preview immediately.+ Large **Find an agent** and **New Agent** headings sit on almost-black panels;+ the modal field has no hint and the redundant Open Agent footer is removed.+ Creation has equal-width Agent / Project / Machine dropdowns and a larger Create+ button. Options no longer shows the collapsed profile summary.+- New Harness includes the same creation row above its fixed device footer.+ Search stays compact until activated, then expands with the same rounded outer+ corners. Query/result changes leave creation and the device in place. From+ inline search, Shift-Cmd-N focuses the adjacent creation row; Escape returns to+ the compact field. No-machine New still opens machine linking.+- Fixed a reproduced Create-button race: a late saved engine preference equal to+ the active engine reset profile readiness without remounting the loaded field.+ The loaded profile and readiness now survive; pending lookups have visible copy.+- Connection status follows the session name on the left, preserving the project,+ branch and machine's width on the right. Machines has a wider native menu and+ right-aligned agent counts before its submenu chevrons.- The compact form reuses creation, folder preparation, account/engine checksand uncertain-outcome recovery. Defaults are the remembered agent, New projectand this computer; splits inherit their source machine/project. Project offersNew project, Local folder and Remote repository. Cached engine checks are reused;building a query does not scan agent metadata for project suggestions.+- Current refinement verification: **138 Flutter checks pass**, covering the+ combined/inline entry, larger-text rendering, profile readiness, launch/recovery,+ shortcut routing, startup/linking and connection-status geometry. **388 isolated+ AppKit checks pass**, including hidden native window layout and Machines counts.+ All 15 changed Dart/test units analyze cleanly. The Release build and staged+ bundle pass deep/strict codesign verification. Logs:+ `/private/tmp/harness-entry-polish-final-tests.log`,+ `/private/tmp/harness-entry-polish-analyze.log`,+ `/private/tmp/harness-entry-polish-native.log`,+ `/private/tmp/harness-entry-polish-build.log`.+ Inspected captures: `/private/tmp/harness-entry-polish-picker` and+ `/private/tmp/harness-entry-polish-captures`. The staged update has not yet+ replaced the running c0fd824 preview; the receipt is+ `/private/tmp/harness-entry-polish-install.json`.- Verification: the 56 navigation/picker checks, 27 creation/engine checks and54 combined recovery/render checks pass (overlapping suites). Captures at1280×900, 760×760 and 600×680 with double text were inspected; six palettes and@@ -212,7 +235,7 @@ are:both actions participate in the configurable Search keymap.- The Harness application menu includes **Check for Updates…**, using theexisting manual update-check dialog, directly above Flash Firmware.-- The combined panel uses **New agent** for the creation heading and **Create**+- The combined panel uses **New Agent** for the creation heading and **Create**for its action. Agent, Project and Machine dropdowns show selected defaults;keyboard input stays with the active menu or field. Options contains accountand permission settings. Escape or one outside click dismisses the panel;