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): balance native swarm tabs and simplify the terminal canvas

dee228c0deb8677
diff --git a/desktop/lib/core/desktop_window.dart b/desktop/lib/core/desktop_window.dart
index 051224fa6..2b414c9f9 100644
--- a/desktop/lib/core/desktop_window.dart
+++ b/desktop/lib/core/desktop_window.dart
@@ -5,16 +5,11 @@ import 'package:flutter/services.dart';
import 'build_identity.dart';
-/// Puts the window into the same shape Grid's uses, before the first frame.
+/// Configures the native window before the first Flutter frame.
///
-/// On macOS the title bar is hidden and the traffic lights float over the
-/// rail, which leaves room for them (see `railTopInset` in
-/// `widgets/window_chrome.dart`) and doubles as the drag handle. Windows and
-/// Linux keep their native caption bar: they draw no controls over a hidden
-/// one, so hiding it would leave a window with no close button.
-///
-/// The sizes are Grid's too, so the two apps open to the same frame on a desk
-/// where both are running.
+/// On macOS, AppKit places Swarm tabs beside the system traffic lights in a
+/// compact unified title bar. Flutter starts below that row. Windows and Linux
+/// keep their native caption bar and use the Flutter Swarm-tab fallback.
Future<void> configureDesktopWindow() async {
await windowManager.ensureInitialized();
final options = WindowOptions(
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index 633d86068..3b087ceff 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -22,6 +22,7 @@ import '../widgets/new_agent_dialog.dart';
import '../widgets/pane_grid.dart';
import '../widgets/shortcuts_sheet.dart';
import '../widgets/swarm_dialogs.dart';
+import '../widgets/swarm_wallpaper.dart';
import '../widgets/swarm_welcome.dart';
import '../widgets/task_palette.dart';
@@ -559,61 +560,74 @@ class _SwarmScreenState extends State<SwarmScreen> {
),
),
Expanded(
- child: Padding(
- padding: const EdgeInsets.all(10),
- child: Stack(
- children: [
- Positioned.fill(
- child: PaneGrid(
- notifier: app,
- swarmMode: true,
- empty: SwarmWelcome(
- key: ValueKey(app.activeSwarmId),
- notifier: app,
- projects: _projects.projects,
- onNewAgent: _newAgent,
- onAddProject: _addProject,
- onLinkMachine: () => _dialog(
- () => showSwarmLinkDialog(context, app),
- ),
- onMachine: _machine,
- onProject: _project,
- onAgent: (entry) => app.addAgentToSwarm(
- entry.machineId,
- entry.agent.id,
- ),
- ),
+ child: Stack(
+ fit: StackFit.expand,
+ children: [
+ if (app.panes.isEmpty)
+ RepaintBoundary(
+ child: SwarmWallpaper(
+ index: app.activeSwarm.wallpaper,
),
),
- if (app.panes.isNotEmpty)
- Positioned(
- right: 10,
- bottom: 10,
- child: Material(
- color: grid.AppPalette.swarmTabBar,
- elevation: 6,
- borderRadius: BorderRadius.circular(8),
- child: IconButton(
- tooltip: withShortcutHint(
- 'Add agent',
- ShortcutAction.switchAgent,
- ),
- onPressed: _addAgent,
- constraints: const BoxConstraints.tightFor(
- width: 34,
- height: 34,
- ),
- padding: EdgeInsets.zero,
- icon: Icon(
- Icons.add,
- size: 21,
- color: grid.AppPalette.swarmAccent,
+ Padding(
+ padding: app.panes.isEmpty
+ ? EdgeInsets.zero
+ : const EdgeInsets.all(10),
+ child: Stack(
+ children: [
+ Positioned.fill(
+ child: PaneGrid(
+ notifier: app,
+ swarmMode: true,
+ empty: SwarmWelcome(
+ key: ValueKey(app.activeSwarmId),
+ notifier: app,
+ projects: _projects.projects,
+ onNewAgent: _newAgent,
+ onAddProject: _addProject,
+ onLinkMachine: () => _dialog(
+ () => showSwarmLinkDialog(context, app),
+ ),
+ onMachine: _machine,
+ onProject: _project,
+ onAgent: (entry) => app.addAgentToSwarm(
+ entry.machineId,
+ entry.agent.id,
+ ),
),
),
),
- ),
- ],
- ),
+ if (app.panes.isNotEmpty)
+ Positioned(
+ right: 10,
+ bottom: 10,
+ child: Material(
+ color: grid.AppPalette.swarmTabBar,
+ elevation: 6,
+ borderRadius: BorderRadius.circular(8),
+ child: IconButton(
+ tooltip: withShortcutHint(
+ 'Add agent',
+ ShortcutAction.switchAgent,
+ ),
+ onPressed: _addAgent,
+ constraints: const BoxConstraints.tightFor(
+ width: 34,
+ height: 34,
+ ),
+ padding: EdgeInsets.zero,
+ icon: Icon(
+ Icons.add,
+ size: 21,
+ color: grid.AppPalette.swarmAccent,
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
),
),
],
diff --git a/desktop/lib/widgets/swarm_wallpaper.dart b/desktop/lib/widgets/swarm_wallpaper.dart
new file mode 100644
index 000000000..8133f2b06
--- /dev/null
+++ b/desktop/lib/widgets/swarm_wallpaper.dart
@@ -0,0 +1,69 @@
+import 'dart:async';
+
+import 'package:flutter/material.dart';
+
+import '../state/swarm.dart';
+
+/// Wallpaper belongs only to the empty new-swarm canvas.
+class SwarmWallpaper extends StatefulWidget {
+ const SwarmWallpaper({super.key, required this.index});
+
+ final int index;
+
+ @override
+ State<SwarmWallpaper> createState() => _SwarmWallpaperState();
+}
+
+class _SwarmWallpaperState extends State<SwarmWallpaper> {
+ late AssetImage _image = _wallpaper(widget.index);
+ ImageConfiguration _configuration = ImageConfiguration.empty;
+
+ static AssetImage _wallpaper(int index) => AssetImage(
+ 'assets/swarm-wallpapers/swarm-welcome-${swarmWallpapers[index % swarmWallpapers.length]}.jpg',
+ );
+
+ @override
+ void didChangeDependencies() {
+ super.didChangeDependencies();
+ _configuration = createLocalImageConfiguration(context);
+ }
+
+ @override
+ void didUpdateWidget(SwarmWallpaper oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ final next = _wallpaper(widget.index);
+ if (next == _image) return;
+ unawaited(_image.evict(configuration: _configuration));
+ _image = next;
+ }
+
+ @override
+ void dispose() {
+ // Populated swarms do not retain a decoded welcome image in Flutter's
+ // keep-alive cache. Evict only our asset, leaving terminal images alone.
+ unawaited(_image.evict(configuration: _configuration));
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) => Stack(
+ fit: StackFit.expand,
+ children: [
+ Image(
+ image: _image,
+ fit: BoxFit.cover,
+ gaplessPlayback: true,
+ excludeFromSemantics: true,
+ ),
+ const DecoratedBox(
+ decoration: BoxDecoration(
+ gradient: LinearGradient(
+ begin: Alignment.topCenter,
+ end: Alignment.bottomCenter,
+ colors: [Color(0x1211111c), Color(0x750c111e)],
+ ),
+ ),
+ ),
+ ],
+ );
+}
diff --git a/desktop/lib/widgets/swarm_welcome.dart b/desktop/lib/widgets/swarm_welcome.dart
index 6c1fdeee5..af18b5cf8 100644
--- a/desktop/lib/widgets/swarm_welcome.dart
+++ b/desktop/lib/widgets/swarm_welcome.dart
@@ -6,7 +6,6 @@ import 'package:flutter/services.dart';
import '../shared/theme/app_theme.dart' as grid;
import '../shared/widgets/skeleton.dart';
import '../state/app_state.dart';
-import '../state/swarm.dart';
import '../state/swarm_catalog.dart';
import 'engine_identity.dart';
import 'swarm_agent_selection.dart';
@@ -44,218 +43,195 @@ class _SwarmWelcomeState extends State<SwarmWelcome> {
final app = widget.notifier;
final groups = swarmProjects(app, widget.projects);
final results = swarmAgents(app, _query);
- final wallpaper =
- swarmWallpapers[app.activeSwarm.wallpaper % swarmWallpapers.length];
- return ClipRRect(
- borderRadius: BorderRadius.circular(12),
- child: Stack(
- fit: StackFit.expand,
- children: [
- Image.asset(
- 'assets/swarm-wallpapers/swarm-welcome-$wallpaper.jpg',
- fit: BoxFit.cover,
- excludeFromSemantics: true,
- ),
- const DecoratedBox(
- decoration: BoxDecoration(
- gradient: LinearGradient(
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- colors: [Color(0x1211111c), Color(0x750c111e)],
- ),
- ),
- ),
- LayoutBuilder(
- builder: (context, constraints) => SingleChildScrollView(
- child: ConstrainedBox(
- constraints: BoxConstraints(minHeight: constraints.maxHeight),
- child: Center(
- child: Container(
- constraints: const BoxConstraints(maxWidth: 1000),
- padding: const EdgeInsets.fromLTRB(56, 40, 56, 62),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- 'Start a swarm',
- style: TextStyle(
- fontSize: 32,
- fontWeight: FontWeight.w500,
- letterSpacing: -0.7,
- color: Colors.white,
- shadows: [
- Shadow(blurRadius: 16, color: Colors.black54),
- ],
- ),
+ return Stack(
+ fit: StackFit.expand,
+ children: [
+ LayoutBuilder(
+ builder: (context, constraints) => SingleChildScrollView(
+ child: ConstrainedBox(
+ constraints: BoxConstraints(minHeight: constraints.maxHeight),
+ child: Center(
+ child: Container(
+ constraints: const BoxConstraints(maxWidth: 1000),
+ padding: const EdgeInsets.fromLTRB(56, 40, 56, 62),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const Text(
+ 'Start a swarm',
+ style: TextStyle(
+ fontSize: 32,
+ fontWeight: FontWeight.w500,
+ letterSpacing: -0.7,
+ color: Colors.white,
+ shadows: [
+ Shadow(blurRadius: 16, color: Colors.black54),
+ ],
),
- const SizedBox(height: 10),
- const Text(
- 'Choose a machine or project, or add agents individually.',
- style: TextStyle(
- fontSize: 13,
- color: Color(0xffe0dce3),
- ),
+ ),
+ const SizedBox(height: 10),
+ const Text(
+ 'Choose a machine or project, or add agents individually.',
+ style: TextStyle(
+ fontSize: 13,
+ color: Color(0xffe0dce3),
),
- const SizedBox(height: 28),
- Row(
- children: [
- Expanded(
- child: SwarmSearchField(
- autofocus: true,
- onChanged: (v) => setState(() {
- _query = v;
- _selection.reset();
- }),
- onMove: (delta) {
- if (_query.trim().isNotEmpty) {
- setState(
- () => _selection.move(results, delta),
- );
- }
- },
- onSubmitted: () {
- final selected = _selection.selected(results);
- if (_query.trim().isNotEmpty &&
- selected != null) {
- widget.onAgent(selected);
- }
- },
- ),
+ ),
+ const SizedBox(height: 28),
+ Row(
+ children: [
+ Expanded(
+ child: SwarmSearchField(
+ autofocus: true,
+ onChanged: (v) => setState(() {
+ _query = v;
+ _selection.reset();
+ }),
+ onMove: (delta) {
+ if (_query.trim().isNotEmpty) {
+ setState(
+ () => _selection.move(results, delta),
+ );
+ }
+ },
+ onSubmitted: () {
+ final selected = _selection.selected(results);
+ if (_query.trim().isNotEmpty &&
+ selected != null) {
+ widget.onAgent(selected);
+ }
+ },
),
- const SizedBox(width: 12),
- FilledButton.icon(
- onPressed: widget.onNewAgent,
- icon: const Icon(Icons.add, size: 17),
- label: const Text('New agent'),
- style: FilledButton.styleFrom(
- minimumSize: const Size(126, 44),
- backgroundColor: grid.AppPalette.swarmAccent,
- foregroundColor: grid.AppPalette.swarmTabBar,
- ),
+ ),
+ const SizedBox(width: 12),
+ FilledButton.icon(
+ onPressed: widget.onNewAgent,
+ icon: const Icon(Icons.add, size: 17),
+ label: const Text('New agent'),
+ style: FilledButton.styleFrom(
+ minimumSize: const Size(126, 44),
+ backgroundColor: grid.AppPalette.swarmAccent,
+ foregroundColor: grid.AppPalette.swarmTabBar,
),
- ],
- ),
- const SizedBox(height: 34),
- _Glass(
- child: _query.trim().isNotEmpty
- ? SizedBox(
- height: 300,
- child: SwarmAgentRows(
- notifier: app,
- agents: results,
- selectedIndex: _selection.index(results),
- onAgent: widget.onAgent,
- ),
- )
- : LayoutBuilder(
- builder: (context, size) {
- final machines = _section(
- 'Machines',
- 'Link machine',
- widget.onLinkMachine,
- [
- if (app.machinesLoading &&
- app.machineStates.isEmpty)
- const SkeletonList(rows: 3),
- for (final machine
- in app.machineStates.values)
- _StarterRow(
- icon: Icons.computer_outlined,
- name: machine.machine.displayName,
- note: machine.needsLink
- ? 'Link required'
- : machine.nodeOnline == false
- ? 'Offline'
- : machine.isLocalMachine
- ? 'Local'
- : null,
- count: machine.agents.length,
- onTap: () =>
- widget.onMachine(machine),
+ ),
+ ],
+ ),
+ const SizedBox(height: 34),
+ _Glass(
+ child: _query.trim().isNotEmpty
+ ? SizedBox(
+ height: 300,
+ child: SwarmAgentRows(
+ notifier: app,
+ agents: results,
+ selectedIndex: _selection.index(results),
+ onAgent: widget.onAgent,
+ ),
+ )
+ : LayoutBuilder(
+ builder: (context, size) {
+ final machines = _section(
+ 'Machines',
+ 'Link machine',
+ widget.onLinkMachine,
+ [
+ if (app.machinesLoading &&
+ app.machineStates.isEmpty)
+ const SkeletonList(rows: 3),
+ for (final machine
+ in app.machineStates.values)
+ _StarterRow(
+ icon: Icons.computer_outlined,
+ name: machine.machine.displayName,
+ note: machine.needsLink
+ ? 'Link required'
+ : machine.nodeOnline == false
+ ? 'Offline'
+ : machine.isLocalMachine
+ ? 'Local'
+ : null,
+ count: machine.agents.length,
+ onTap: () =>
+ widget.onMachine(machine),
+ ),
+ if (!app.machinesLoading &&
+ app.machineStates.isEmpty)
+ const Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: 18,
),
- if (!app.machinesLoading &&
- app.machineStates.isEmpty)
- const Padding(
- padding: EdgeInsets.symmetric(
- vertical: 18,
- ),
- child: Text(
- 'Link a machine to find its agents.',
- ),
+ child: Text(
+ 'Link a machine to find its agents.',
),
- ],
- );
- final projects = _section(
- 'Projects',
- 'Add project',
- widget.onAddProject,
- [
- for (final group in groups)
- _StarterRow(
- icon: Icons.folder_outlined,
- name: group.name,
- count: group.agents.length,
- onTap: () =>
- widget.onProject(group),
+ ),
+ ],
+ );
+ final projects = _section(
+ 'Projects',
+ 'Add project',
+ widget.onAddProject,
+ [
+ for (final group in groups)
+ _StarterRow(
+ icon: Icons.folder_outlined,
+ name: group.name,
+ count: group.agents.length,
+ onTap: () => widget.onProject(group),
+ ),
+ if (groups.isEmpty)
+ const Padding(
+ padding: EdgeInsets.symmetric(
+ vertical: 18,
),
- if (groups.isEmpty)
- const Padding(
- padding: EdgeInsets.symmetric(
- vertical: 18,
- ),
- child: Text(
- 'Add a working folder to start a project.',
- style: TextStyle(
- color: Color(0xffc5bece),
- fontSize: 12,
- ),
+ child: Text(
+ 'Add a working folder to start a project.',
+ style: TextStyle(
+ color: Color(0xffc5bece),
+ fontSize: 12,
),
),
- ],
- );
- return size.maxWidth < 570
- ? Column(
- children: [
- machines,
- const SizedBox(height: 24),
- projects,
- ],
- )
- : Row(
- crossAxisAlignment:
- CrossAxisAlignment.start,
- children: [
- Expanded(child: machines),
- const SizedBox(width: 36),
- Expanded(child: projects),
- ],
- );
- },
- ),
- ),
- ],
- ),
+ ),
+ ],
+ );
+ return size.maxWidth < 570
+ ? Column(
+ children: [
+ machines,
+ const SizedBox(height: 24),
+ projects,
+ ],
+ )
+ : Row(
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
+ children: [
+ Expanded(child: machines),
+ const SizedBox(width: 36),
+ Expanded(child: projects),
+ ],
+ );
+ },
+ ),
+ ),
+ ],
),
),
),
),
),
- Positioned(
- right: 14,
- bottom: 10,
- child: TextButton.icon(
- onPressed: app.nextSwarmWallpaper,
- icon: const Icon(Icons.wallpaper_outlined, size: 14),
- label: const Text(
- 'Next wallpaper',
- style: TextStyle(fontSize: 11),
- ),
- style: TextButton.styleFrom(foregroundColor: Colors.white70),
- ),
+ ),
+ Positioned(
+ right: 14,
+ bottom: 10,
+ child: TextButton.icon(
+ onPressed: app.nextSwarmWallpaper,
+ icon: const Icon(Icons.wallpaper_outlined, size: 14),
+ label: const Text('Next wallpaper', style: TextStyle(fontSize: 11)),
+ style: TextButton.styleFrom(foregroundColor: Colors.white70),
),
- ],
- ),
+ ),
+ ],
);
}
diff --git a/desktop/macos/Runner/SwarmTitlebar.swift b/desktop/macos/Runner/SwarmTitlebar.swift
index 74977b23e..11779d577 100644
--- a/desktop/macos/Runner/SwarmTitlebar.swift
+++ b/desktop/macos/Runner/SwarmTitlebar.swift
@@ -53,8 +53,16 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation {
window.titlebarAppearsTransparent = true
window.styleMask.remove(.fullSizeContentView)
window.backgroundColor = NSColor(srgbRed: 0.20, green: 0.16, blue: 0.21, alpha: 1)
+ // AppKit fixes a right accessory's height to the title bar. A taller view
+ // alone is clipped. A compact unified toolbar gives the native traffic
+ // lights and the tab strip one 40-point row, without a second toolbar row.
+ let toolbar = NSToolbar(identifier: "harness.swarm.titlebar")
+ toolbar.displayMode = .iconOnly
+ toolbar.allowsUserCustomization = false
+ window.toolbar = toolbar
+ window.toolbarStyle = .unifiedCompact
+ window.titlebarSeparatorStyle = .none
accessory.layoutAttribute = .right
- accessory.fullScreenMinHeight = 40
accessory.view = strip
window.addTitlebarAccessoryViewController(accessory)
resize()
@@ -63,7 +71,8 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation {
private func resize() {
guard let window else { return }
- strip.setFrameSize(NSSize(width: max(200, window.frame.width - 92), height: 40))
+ // AppKit owns height; only width is configurable for a right accessory.
+ strip.setFrameSize(NSSize(width: max(200, window.frame.width - 88), height: strip.frame.height))
strip.needsLayout = true
}
@@ -116,6 +125,8 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation {
}
private let swarmPasteboardType = NSPasteboard.PasteboardType("ai.autonomous.harness.v2.swarm")
+// Matches AppPalette.swarmField exactly, joining the tab to the terminal canvas.
+private let swarmSelectedTabColor = NSColor(srgbRed: 70.0 / 255, green: 55.0 / 255, blue: 70.0 / 255, alpha: 1)
private final class SwarmTabStrip: NSView {
var emit: ((String, Any?) -> Void)?
@@ -139,6 +150,7 @@ private final class SwarmTabStrip: NSView {
addSubview(scroll)
func button(_ button: NSButton, _ symbol: String, _ label: String, _ action: Selector) {
button.image = NSImage(systemSymbolName: symbol, accessibilityDescription: label)
+ button.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 13, weight: .regular)
button.isBordered = false
button.contentTintColor = NSColor(srgbRed: 0.80, green: 0.75, blue: 0.83, alpha: 1)
button.target = self
@@ -174,6 +186,9 @@ private final class SwarmTabStrip: NSView {
tab.needsDisplay = true
return tab
}
+ for (index, tab) in tabs.enumerated() {
+ tab.showsDivider = !tab.selected && index + 1 < tabs.count && !tabs[index + 1].selected
+ }
// Moving frames alone leaves AppKit's child traversal in insertion order.
document.setAccessibilityChildren(tabs)
newButton.isEnabled = actionsEnabled && tabs.count < 24
@@ -193,21 +208,29 @@ private final class SwarmTabStrip: NSView {
override func layout() {
super.layout()
- let available = max(120, bounds.width - 106)
- let width = min(204, max(124, available / CGFloat(max(1, tabs.count))))
+ let available = max(120, bounds.width - 112)
+ let width = min(220, max(132, available / CGFloat(max(1, tabs.count))))
let occupied = min(available, CGFloat(tabs.count) * width)
- scroll.frame = NSRect(x: 0, y: 0, width: occupied, height: 40)
- document.frame = NSRect(x: 0, y: 0, width: max(occupied, CGFloat(tabs.count) * width), height: 40)
+ scroll.frame = NSRect(x: 0, y: 0, width: occupied, height: bounds.height)
+ document.frame = NSRect(x: 0, y: 0, width: max(occupied, CGFloat(tabs.count) * width), height: bounds.height)
for (index, tab) in tabs.enumerated() {
- tab.frame = NSRect(x: CGFloat(index) * width, y: 0, width: width - 2, height: 36)
+ tab.frame = NSRect(x: CGFloat(index) * width, y: 0, width: width, height: bounds.height - 6)
+ tab.contentCenterY = bounds.midY
}
- newButton.frame = NSRect(x: occupied + 3, y: 4, width: 30, height: 30)
- notifications.frame = NSRect(x: bounds.width - 69, y: 4, width: 30, height: 30)
- settings.frame = NSRect(x: bounds.width - 35, y: 4, width: 30, height: 30)
+ let buttonY = (bounds.height - 28) / 2
+ newButton.frame = NSRect(x: occupied + 4, y: buttonY, width: 28, height: 28)
+ notifications.frame = NSRect(x: bounds.width - 68, y: buttonY, width: 28, height: 28)
+ settings.frame = NSRect(x: bounds.width - 34, y: buttonY, width: 28, height: 28)
if let active = tabs.first(where: { $0.swarmId == activeId }) {
document.scrollToVisible(active.frame)
}
}
+ override func draw(_ dirtyRect: NSRect) {
+ // The selected tab meets this edge; its bottom corners are shoulders,
+ // rather than the rounded bottom of a separate pill.
+ swarmSelectedTabColor.setFill()
+ NSRect(x: 0, y: 0, width: bounds.width, height: 1).fill()
+ }
override func mouseDown(with event: NSEvent) {
if event.clickCount == 2 { window?.performZoom(nil) }
else { window?.performDrag(with: event) }
@@ -233,6 +256,8 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidati
var name = "New swarm" { didSet { updateAccessibility() } }
var selected = false { didSet { updateAccessibility() } }
var attention = false
+ var showsDivider = false
+ var contentCenterY: CGFloat = 20
var emit: ((String, Any?) -> Void)?
private let closeButton = NSButton()
private let selectButton = SwarmSelectButton()
@@ -243,6 +268,8 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidati
}
}
private var downPoint = NSPoint.zero
+ private var hovered = false
+ private var hoverTracking: NSTrackingArea?
override var acceptsFirstResponder: Bool { false }
override var mouseDownCanMoveWindow: Bool { false }
@@ -258,7 +285,8 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidati
selectButton.action = #selector(selectSwarm)
addSubview(selectButton)
closeButton.image = NSImage(systemSymbolName: "xmark", accessibilityDescription: "Close swarm")
- closeButton.imageScaling = .scaleProportionallyDown
+ closeButton.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 9, weight: .semibold)
+ closeButton.contentTintColor = NSColor(white: 0.78, alpha: 1)
closeButton.isBordered = false
closeButton.target = self
closeButton.action = #selector(closeSwarm)
@@ -276,22 +304,55 @@ private final class SwarmTabButton: NSView, NSDraggingSource, NSMenuItemValidati
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
override func layout() {
super.layout()
- selectButton.frame = NSRect(x: 0, y: 0, width: max(0, bounds.width - 29), height: bounds.height)
- closeButton.frame = NSRect(x: bounds.width - 27, y: 9, width: 18, height: 18)
+ selectButton.frame = NSRect(x: 0, y: 0, width: max(0, bounds.width - 36), height: bounds.height)
+ closeButton.frame = NSRect(x: bounds.width - 36, y: contentCenterY - 12, width: 24, height: 24)
+ }
+ override func updateTrackingAreas() {
+ super.updateTrackingAreas()
+ if let hoverTracking { removeTrackingArea(hoverTracking) }
+ let area = NSTrackingArea(rect: .zero, options: [.mouseEnteredAndExited, .activeAlways, .inVisibleRect],
+ owner: self, userInfo: nil)
+ addTrackingArea(area)
+ hoverTracking = area
}
+ override func mouseEntered(with event: NSEvent) { hovered = true; needsDisplay = true }
+ override func mouseExited(with event: NSEvent) { hovered = false; needsDisplay = true }
override func draw(_ dirtyRect: NSRect) {
if selected {
- NSColor(srgbRed: 0.275, green: 0.216, blue: 0.275, alpha: 1).setFill()
- NSBezierPath(roundedRect: bounds, xRadius: 9, yRadius: 9).fill()
+ let w = bounds.width, h = bounds.height
+ let shape = NSBezierPath()
+ shape.move(to: NSPoint(x: 0, y: 0))
+ shape.curve(to: NSPoint(x: 8, y: 8), controlPoint1: NSPoint(x: 4.4, y: 0), controlPoint2: NSPoint(x: 8, y: 3.6))
+ shape.line(to: NSPoint(x: 8, y: h - 10))
+ shape.curve(to: NSPoint(x: 18, y: h), controlPoint1: NSPoint(x: 8, y: h - 4.5), controlPoint2: NSPoint(x: 12.5, y: h))
+ shape.line(to: NSPoint(x: w - 18, y: h))
+ shape.curve(to: NSPoint(x: w - 8, y: h - 10), controlPoint1: NSPoint(x: w - 12.5, y: h), controlPoint2: NSPoint(x: w - 8, y: h - 4.5))
+ shape.line(to: NSPoint(x: w - 8, y: 8))
+ shape.curve(to: NSPoint(x: w, y: 0), controlPoint1: NSPoint(x: w - 8, y: 3.6), controlPoint2: NSPoint(x: w - 4.4, y: 0))
+ shape.close()
+ swarmSelectedTabColor.setFill()
+ shape.fill()
+ } else if hovered && actionsEnabled {
+ NSColor(white: 1, alpha: 0.05).setFill()
+ let hoverRect = NSRect(x: 8, y: contentCenterY - 14, width: bounds.width - 16, height: 28)
+ NSBezierPath(roundedRect: hoverRect, xRadius: 10, yRadius: 10).fill()
+ }
+ if showsDivider && !hovered {
+ NSColor(white: 1, alpha: 0.16).setFill()
+ NSBezierPath(roundedRect: NSRect(x: bounds.width - 0.5, y: contentCenterY - 8, width: 1, height: 16),
+ xRadius: 0.5, yRadius: 0.5).fill()
}
let paragraph = NSMutableParagraphStyle()
paragraph.lineBreakMode = .byTruncatingTail
- (name as NSString).draw(in: NSRect(x: 13, y: 9, width: bounds.width - 45, height: 19),
- withAttributes: [.font: NSFont.systemFont(ofSize: 12, weight: selected ? .medium : .regular),
+ let label = NSAttributedString(string: name,
+ attributes: [.font: NSFont.systemFont(ofSize: 12, weight: selected ? .medium : .regular),
.foregroundColor: selected ? NSColor.white : NSColor(white: 0.72, alpha: 1), .paragraphStyle: paragraph])
+ let labelHeight = label.size().height
+ label.draw(in: NSRect(x: 24, y: contentCenterY - labelHeight / 2,
+ width: bounds.width - 64, height: labelHeight))
if attention {
NSColor.systemOrange.setFill()
- NSBezierPath(ovalIn: NSRect(x: 4, y: 16, width: 4, height: 4)).fill()
+ NSBezierPath(ovalIn: NSRect(x: 13, y: contentCenterY - 2, width: 4, height: 4)).fill()
}
}
// Overflowed tabs might not be drawn. Their names and selection still need
diff --git a/desktop/tool/check_swarm_titlebar.sh b/desktop/tool/check_swarm_titlebar.sh
index f634dd374..429b7f7f8 100644
--- a/desktop/tool/check_swarm_titlebar.sh
+++ b/desktop/tool/check_swarm_titlebar.sh
@@ -22,4 +22,6 @@ xcrun swiftc -swift-version 5 -module-cache-path "$check_dir/module-cache" \
-F "$framework_dir" -framework FlutterMacOS \
-Xlinker -rpath -Xlinker "$framework_dir" \
"$check_dir/main.swift" -o "$check_dir/check-titlebar"
-"$check_dir/check-titlebar"
+# Optional native-container checks create a hidden NSWindow. They never show
+# the window, boot Flutter, connect to agents or read saved app data.
+"$check_dir/check-titlebar" "${2:-}"
diff --git a/desktop/tool/swarm_titlebar_checks.swift b/desktop/tool/swarm_titlebar_checks.swift
index 74c2d8b3b..4a3e2af7b 100644
--- a/desktop/tool/swarm_titlebar_checks.swift
+++ b/desktop/tool/swarm_titlebar_checks.swift
@@ -36,6 +36,20 @@ private extension SwarmTabButton {
}
private extension SwarmTabStrip {
+ func checkWindowGeometry(_ window: NSWindow) throws {
+ let stripFrame = convert(bounds, to: nil)
+ let close = window.standardWindowButton(.closeButton)!
+ let zoom = window.standardWindowButton(.zoomButton)!
+ let closeFrame = close.convert(close.bounds, to: nil)
+ let zoomFrame = zoom.convert(zoom.bounds, to: nil)
+ let newFrame = newButton.convert(newButton.bounds, to: nil)
+ try checkTitlebar(bounds.height >= 40, "Native title bar does not clip the requested tab row")
+ try checkTitlebar(stripFrame.minX >= zoomFrame.maxX + 12, "Tab row leaves room beside native traffic lights")
+ try checkTitlebar(abs(newFrame.midY - closeFrame.midY) <= 1, "Tab controls align vertically with native traffic lights")
+ try checkTitlebar(abs(stripFrame.minY - window.contentLayoutRect.maxY) <= 1, "Tab row meets content without a second toolbar row")
+ try checkActiveVisible()
+ }
+
func checkActiveVisible() throws {
guard let active = tabs.first(where: { $0.swarmId == activeId }) else {
throw TitlebarCheckFailure(message: "Selected tab exists")
@@ -94,6 +108,34 @@ private extension SwarmTabStrip {
}
}
+// No engine, account, terminal or transport is involved in native layout.
+private final class TitlebarCheckMessenger: NSObject, FlutterBinaryMessenger {
+ func send(onChannel channel: String, message: Data?) {}
+ func send(onChannel channel: String, message: Data?, binaryReply callback: FlutterBinaryReply?) { callback?(nil) }
+ func setMessageHandlerOnChannel(_ channel: String, binaryMessageHandler handler: FlutterBinaryMessageHandler?) -> FlutterBinaryMessengerConnection { 1 }
+ func cleanUpConnection(_ connection: FlutterBinaryMessengerConnection) {}
+}
+
+private extension SwarmTitlebar {
+ func checkNativeContainer() throws {
+ guard let window else { throw TitlebarCheckFailure(message: "Native test window exists") }
+ configure()
+ strip.update([
+ "enabled": true, "activeId": "swarm-11",
+ "tabs": (0..<12).map { ["id": "swarm-\($0)", "name": "Swarm \($0)"] },
+ ])
+ for width in [880.0, 1280.0, 1920.0] {
+ window.setContentSize(NSSize(width: width, height: 700))
+ window.contentView?.superview?.layoutSubtreeIfNeeded()
+ resize()
+ window.contentView?.superview?.layoutSubtreeIfNeeded()
+ strip.layoutSubtreeIfNeeded()
+ try strip.checkWindowGeometry(window)
+ }
+ try checkTitlebar(!window.isVisible, "Native layout check never displays its window")
+ }
+}
+
let titlebarCheckApp = NSApplication.shared
titlebarCheckApp.setActivationPolicy(.prohibited)
titlebarCheckApp.appearance = NSAppearance(named: .darkAqua)
@@ -101,7 +143,17 @@ do {
let strip = SwarmTabStrip(frame: NSRect(x: 0, y: 0, width: 900, height: 40))
try strip.runChecks()
try checkTitlebar(titlebarCheckApp.windows.isEmpty, "Checks never open an application window")
- print("AppKit Swarm titlebar: \(titlebarCheckCount) checks passed; no windows opened.")
+ if CommandLine.arguments.contains("--window-layout") {
+ let window = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 1280, height: 700),
+ styleMask: [.titled, .closable, .miniaturizable, .resizable], backing: .buffered, defer: false)
+ window.isReleasedWhenClosed = false
+ let titlebar = SwarmTitlebar(window: window, messenger: TitlebarCheckMessenger())
+ try titlebar.checkNativeContainer()
+ window.close()
+ print("AppKit Swarm titlebar: \(titlebarCheckCount) checks passed, including native window layout; no windows displayed.")
+ } else {
+ print("AppKit Swarm titlebar: \(titlebarCheckCount) checks passed; no windows opened.")
+ }
} catch {
let message = (error as? TitlebarCheckFailure)?.message ?? String(describing: error)
FileHandle.standardError.write(Data("AppKit Swarm titlebar failed: \(message)\n".utf8))
diff --git a/docs/harness-v2-performance.md b/docs/harness-v2-performance.md
index 69055ffc7..3590d4ba8 100644
--- a/docs/harness-v2-performance.md
+++ b/docs/harness-v2-performance.md
@@ -10,16 +10,18 @@ flutter test --no-pub --reporter expanded test/benchmarks/swarm_benchmark.dart
It prints `SWARM_BENCH` JSON records. Its filename deliberately does not end in `_test.dart`, so ordinary correctness runs do not include timing measurements.
-## Current measurements
+## Recorded measurements
-| Operation | Median CPU time | p95 CPU time |
+| Operation | Earlier median / p95 | Latest median / p95 |
| --- | ---: | ---: |
-| Search 2,000 agents across 8 machines | 1.06 ms | 1.13 ms |
-| Group the same catalog into 50 projects | 1.14 ms | 1.27 ms |
-| Switch tab and pump a frame: 4 swarms, 16 terminals | 18.45 ms | 25.88 ms |
-| Switch tab and pump a frame: 12 swarms, 48 terminals | 14.51 ms | 16.95 ms |
-| Decode and parse a 16 KiB ASCII output frame | 0.51 ms | 0.68 ms |
-| Decode and parse a 16 KiB Unicode output frame | 0.31 ms | 0.35 ms |
+| Search 2,000 agents across 8 machines | 1.06 / 1.13 ms | 1.16 / 1.34 ms |
+| Group the same catalog into 50 projects | 1.14 / 1.27 ms | 1.31 / 1.52 ms |
+| Switch tab and pump a frame: 4 swarms, 16 terminals | 18.45 / 25.88 ms | 24.32 / 31.76 ms |
+| Switch tab and pump a frame: 12 swarms, 48 terminals | 14.51 / 16.95 ms | 19.40 / 22.14 ms |
+| Decode and parse a 16 KiB ASCII output frame | 0.51 / 0.68 ms | 0.55 / 0.73 ms |
+| Decode and parse a 16 KiB Unicode output frame | 0.31 / 0.35 ms | 0.34 / 0.43 ms |
+
+The latest repetition followed the native/canvas polish while the workstation was in active use. All five benchmark cases passed and retained rebuild counts stayed at 1,491 and 1,625, but timings were higher across all workloads. This was not a controlled paired comparison, so it neither isolates a cause nor establishes unchanged user-visible performance. Preserve this result and measure under controlled load in the native release app; do not report only the faster earlier run. The latest local log is `/private/tmp/harness-v2-benchmark-polish.log`.
Catalog operations use 20 warmups and 100 samples. Each terminal has 1,000 scrollback lines; the window is 1280 × 800 with four visible terminals. Tab checks warm up for three full cycles, then take 60 samples. They retain one renderer per session and include Flutter frame work and test-runner overhead. Network, persistence I/O, AppKit titlebar rendering and physical display latency are outside these measurements.
@@ -45,4 +47,10 @@ In the paired headless checks, median decoding-and-parsing time fell from 0.683
## Native follow-up
-The optimized real-data app builds and runs locally. A separate windowless AppKit check covers tab overflow geometry, resizing, accessibility order and disabled actions (`bash tool/check_swarm_titlebar.sh`, with an optional Flutter SDK path). Measure release input-to-display and tab-switch latency in the unlocked native window before making latency claims. The screen was locked during this pass, so native end-to-end drag and visual inspection remain in the development handoff.
+The optimized real-data app builds and runs locally. The desktop is now unlocked, and native visual review is underway. The tab strip uses AppKit's compact unified title bar: the old right accessory was clipped to 32 points; the container now supplies 40 points and aligns controls with the system traffic lights.
+
+The native check covers overflow, resizing, accessibility order and disabled actions. `bash tool/check_swarm_titlebar.sh /path/to/flutter --window-layout` adds actual container checks in a hidden window at three widths, for 170 assertions total. No Flutter engine, account or terminal is accessed.
+
+Wallpaper is built only for the empty New swarm. Populated Swarms paint a flat color matching the selected native tab, and the disposed wallpaper evicts its own decoded cache entry. This removes wallpaper painting/cache retention from the active terminal canvas; no process-memory reduction has been measured yet.
+
+Measure release input-to-display, focus, search, scrolling, layout and tab-switch latency before making user-visible performance claims. The first App Launch Instruments recording overlapped a stale Debug preview and is not a clean baseline. Native end-to-end timings and drag/overflow review remain in the development handoff; passing headless CPU checks does not establish zero latency.
diff --git a/docs/harness-v2-progress.md b/docs/harness-v2-progress.md
index 8046b5618..407652201 100644
--- a/docs/harness-v2-progress.md
+++ b/docs/harness-v2-progress.md
@@ -10,6 +10,9 @@ Updated 2026-09-12 after the implementation continuation and live-data review. T
- Desktop: `desktop/`. CLI: `cli/`. Backend: `backend/`.
- The user resumed implementation here, requested real machines/projects after seeing the temporary QA app, and then asked Codex to keep working while away for a couple of hours. The original active goal is a polished, very fast, keyboard-first native app with each tab representing a Swarm.
- The QA app was closed, unregistered from Launch Services and retained as `/private/tmp/Harness V2 QA.disabled`. Review uses the normal `lib/main.dart` entry point, the existing Harness account, and saved V2 Swarms. Keep sample fixtures out of the foreground review app.
+- The desktop is now unlocked and the user is actively reviewing the app. A stale Debug build briefly ran alongside Release and obscured the latest changes. Both previews were quit normally, the stale Debug bundle was unregistered and retained as `/private/tmp/Harness V2.previous-debug-1789267673713820000.disabled`, and only the updated Release preview was relaunched. Preserve the user's current saved arrangement; do not restore an earlier snapshot or launch duplicate V2 instances.
+- Latest design direction: wallpaper fills an empty New swarm only. Populated Swarms use a flat `#463746` canvas matching the selected native tab. Tab hover, spacing and alignment are being compared with the user's Chrome references.
+- The user requested research into expert developers' tools and a smaller feature set. [Developer-tool research and the keep/improve/remove/defer audit](harness-v2-developer-tools-research.md) documents firsthand sources and a proposed three-part focus: durable sessions, instant navigation, and steering agents without losing concentration.
- Continue implementation here. Do not create another repository or fork for V2.
```bash
@@ -34,7 +37,7 @@ Harness is one place to work with all your agents. Swarms are named, chosen coll
- The same agent may belong to multiple swarms. Reuse one session/controller and buffer for it.
- Closing a pane or swarm removes views and must never stop/delete the agent.
- Per-swarm layout, focus, zoom, and wallpaper. Canceling Add agent preserves the view and zoom.
-- Rounded dark panes with padding/gaps over plum. Compact header: original colored engine mark, agent, available project/branch, machine, close.
+- Rounded dark panes with padding/gaps over a flat canvas matching the selected native tab. Wallpaper is limited to empty Swarms. Compact header: original colored engine mark, agent, available project/branch, machine, close.
- Small Add agent `+` overlays a pane corner and opens a stable dialog.
- Preserve terminal input, clipboard, resize, remote transports, spoken tasks, and dial routing. Cmd+Enter zoom and Cmd+HJKL directional focus remain.
- Notifications reflect actual pending questions, never fabricated sample statuses.
@@ -74,7 +77,7 @@ Approved reference: `/Users/ab/code/harness-new-ui`, React prototype commit `f83
### Shell and dialogs
- `desktop/lib/screens/swarm_screen.dart` is wired into the authenticated case in `main.dart`.
-- `widgets/swarm_welcome.dart`: wallpapers, live search, real machines/projects, New agent. Wallpaper rotates for a new swarm, stays stable, and supports manual next.
+- `widgets/swarm_welcome.dart`: live search, real machines/projects, New agent. `SwarmWallpaper` fills the empty canvas without an inset or rounded frame. It is absent from populated Swarms and evicts its own decoded image cache entry when replaced or disposed. Wallpaper rotates for a new swarm, stays stable, and supports manual next.
- `widgets/swarm_dialogs.dart`: fixed-size Add agent picker, rename, Add project, Link machine entry points.
- Add project saves an **existing folder**, via native local picker or existing remote folder browser. It does not clone a GitHub URL.
- `NewAgentDialog`: machine chooser, initial folder, captured destination swarm; local default when available. Reuses engine probes, Codex profiles, advanced permission behavior, and remote browsing. Profile/folder responses are rejected after a machine switch, including switching away and back. Launch replies are ignored after notifier disposal or machine replacement.
@@ -89,6 +92,7 @@ Approved reference: `/Users/ab/code/harness-new-ui`, React prototype commit `f83
- `desktop/macos/Runner/SwarmTitlebar.swift`, registered in Xcode and owned by `MainFlutterWindow`.
- `NSTitlebarAccessoryViewController` with native scrollable tabs, new button, notification bell, settings. Automatic native window tabbing disabled; Flutter content begins below title bar.
+- An empty native toolbar with `.unifiedCompact` supplies a single 40-point title row. A `.right` accessory cannot set its own height; the prior standalone view was clipped to 32 points. AppKit now owns height, traffic lights align with the tab controls, and the selected tab has flared lower shoulders at the canvas edge. The selected fill matches Dart's `#463746` exactly. Hover rectangles, measured text and close controls share one vertical center, with balanced horizontal padding.
- Method channel `harness/swarm_tabs`: Dart sends tab ID/name/selection/attention and recovery availability; Swift sends new/reopen/select/close/rename/reorder/navigation/settings/notifications.
- Native tab click, double-click rename, context menu, close, drag/drop reorder. Tab button instances are retained across refreshes.
- Accessibility names/selection update with state, including overflowed tabs that have never painted. Tab context menus obey modal-disabled state. Layout reveals the selected tab after window resize.
@@ -143,7 +147,7 @@ The reopen binding follows the documented Mac tab-recovery shortcut in [Safari](
| Check | Result |
| --- | --- |
| macOS debug build | Passed and launched from the monorepo with real saved Swarms and terminals. |
-| macOS optimized local build | Passed and running with the real entry point and saved V2 state. Local ad hoc signing requires the command-line `ENABLE_HARDENED_RUNTIME=NO` override for Flutter's framework; distribution signing settings remain unchanged. The distribution Developer ID certificate is unavailable; nothing was uploaded. Normal asynchronous quit and relaunch were verified. The screen remains locked, so final native visual review is pending. |
+| macOS optimized local build | Passed and running with the real entry point and saved V2 state. Local ad hoc signing requires the command-line `ENABLE_HARDENED_RUNTIME=NO` override for Flutter's framework; distribution signing settings remain unchanged. The distribution Developer ID certificate is unavailable; nothing was uploaded. Normal asynchronous quit and relaunch were verified. Unlocked native review confirmed the taller tab container, edge-to-edge empty wallpaper, and the flat populated canvas joining the selected tab. The native hover rendering was also inspected in a local image. |
| Full Flutter suite | **987 passed, 1 skipped** after persistence, modal menus, retained-terminal performance, stream dispatch, closed-Swarm recovery and output decoding changes. |
| Focused interaction checks | 8 passed: picker navigation/scroll/refresh, welcome keys, shared-view close, composer, native modal guard, profile and folder races. |
| Closed-Swarm recovery | 7 passed: arrangement and shared-view restoration, untouched welcome replacement, rapid close/reopen with delayed cleanup, capacity, bounded history, sign-out isolation and the keyboard command. Native command availability and modal behavior also pass in the interaction suite. |
@@ -152,7 +156,7 @@ The reopen binding follows the documented Mac tab-recovery shortcut in [Safari](
| CLI targeted tests | 135 passed across project/frame, registry/restore, and terminal recovery files. Project/frame tests rerun after port normalization: 9 passed. |
| Flutter analyzer | **0 errors, 0 warnings, 12 existing vendored xterm infos**; passes with `--no-fatal-infos`. |
| Headless performance | 5 explicit benchmarks passed: 2,000-agent catalog, 16/48 retained terminals and two terminal output workloads. Reproducible commands and limits in `docs/harness-v2-performance.md`. |
-| AppKit components | **151 assertions passed** for overflow, selected-tab visibility after resize, pre-paint labels, accessible order after reorder, retained tab controls, capacity and modal-disabled actions. No window opened. This complements the pending native end-to-end visual audit. |
+| AppKit components and container | **170 assertions passed**: the original 151 component checks plus native-container checks at 880, 1280 and 1920 points. These verify height, traffic-light clearance/alignment, direct contact with the content edge and active-tab visibility. The optional container check creates a hidden native window; no window is displayed and no engine, account or terminal is accessed. |
| Remote terminals / production release | No remote takeover, release, installer, or production CLI update/restart. Cross-platform and end-to-end latency measurements remain. |
Tests now exercise the actual V2 welcome/settings/linking flow. Usage pricing again explains a partial estimate as a lower bound. Small offline panes avoid overflowing the full connection guide. No remaining full-suite failures are being dismissed as baseline.
@@ -171,8 +175,10 @@ Evidence on this Mac under `/private/tmp`:
- `harness-v2-retained-tests.log`: 27 terminal/menu/layout checks.
- `harness-v2-persistence-tests.log`: 21 state/async checks including rapid writes and bounded quit.
- `harness-v2-benchmark-final.log`: latest catalog and retained-terminal CPU measurements.
+- `harness-v2-benchmark-polish.log`: subsequent five-case pass after native/canvas polish; identical retained rebuild counts, higher debug timings across workloads. Both runs and the comparison limits are recorded in the performance notes.
- `harness-v2-output-before.log`, `harness-v2-output-after.log`: paired production terminal decode-and-parse CPU measurements.
- `harness-v2-native-titlebar-tests.log`: windowless checks against the actual AppKit tab source.
+- `harness-v2-native-titlebar-layout.log`: 170 component/native-container checks.
- `harness-v2-routing-tests.log`: 68 stream-routing, binary protocol and terminal session checks.
- `harness-v2-reopen-tests.log`: 23 Swarm recovery, state and interaction checks.
@@ -180,12 +186,12 @@ Earlier logs contain superseded failures. Temporary logs and toolchains are loca
## Remaining work
-1. Review the running optimized real-data build after the Mac is unlocked; verify actual local project starters and keyboard navigation in the native shell.
+1. Continue the unlocked native review of actual project starters and keyboard navigation. The user is actively changing window size and Swarms; re-read UI state before actions and preserve their arrangement.
2. Audit native drag/reorder, overflow, close-last-tab, renaming and accessibility without changing the user's saved agent memberships. Keep any integration runner separate and out of the foreground review app.
3. Measure native terminal input and tab-switch responsiveness before making end-to-end latency claims. Headless CPU benchmarks are now recorded. Preserve the existing immediate first-input flush and shared retained renderers.
4. Visually confirm app-menu modal behavior and overflow accessibility in AppKit; route/shortcut behavior is covered by passing Flutter tests.
5. Build/review Linux and Windows when their toolchains are available. Remote full project/branch metadata requires daemons running the new wire format; do not upgrade them automatically.
-6. Continue the agreed goal autonomously. The user has stepped away; lack of immediate replies is not a reason to stop independent implementation, checks, or app-v2 publishing.
+6. Continue the agreed goal and apply the latest steering. The research proposes a focused roadmap and specific subtraction candidates; do not mistake proposals for already-implemented removals.
## Toolchain and workflow
@@ -201,8 +207,6 @@ export XDG_CONFIG_HOME=/private/tmp/harness-v2-tool-config
/private/tmp/harness-v2-flutter/bin/flutter --suppress-analytics analyze --no-pub
/private/tmp/harness-v2-flutter/bin/flutter --suppress-analytics test --no-pub test/swarm_state_test.dart test/swarm_screen_test.dart test/crash_log_test.dart
/private/tmp/harness-v2-flutter/bin/flutter --suppress-analytics test --no-pub
-/private/tmp/harness-v2-flutter/bin/flutter --suppress-analytics build macos --debug --no-pub
-open -n 'build/macos/Build/Products/Debug/Harness V2.app'
```
Use online `pub get` if packages are not cached. Enable SPM before pub get; do not accept CocoaPods fallback rewriting the project. Do not commit generated build/ephemeral files or caches. Use `--no-fatal-infos` for the existing vendored xterm infos; do not modify vendored style merely to erase them.
@@ -222,14 +226,15 @@ open -n 'build/macos/Build/Products/Release/Harness V2.app'
Quit an existing V2 preview normally before rebuilding its bundle. Flutter's asynchronous termination may make AppleScript report `User canceled (-128)` even though the process exits; verify the process state before interpreting that as a refused quit. The final optimized preview was launched and its process verified running. Do not launch a second V2 instance while one remains active.
-Native component checks can run while the desktop is locked. They require Xcode and Flutter's already-cached macOS release engine. The SDK path is read from the generated Flutter config, or can be passed explicitly:
+Native component checks require Xcode and Flutter's already-cached macOS release engine. The SDK path is read from the generated Flutter config, or can be passed explicitly. Add `--window-layout` after the SDK path to verify the real AppKit container in a hidden window:
```bash
cd /Users/ab/code/autonomous-harness/desktop
bash tool/check_swarm_titlebar.sh /private/tmp/harness-v2-flutter
+bash tool/check_swarm_titlebar.sh /private/tmp/harness-v2-flutter --window-layout
```
-The script appends same-file assertions to the actual `SwarmTitlebar.swift` in a disposable temporary directory. It uses AppKit with activation prohibited, creates no windows, and does not launch the app, an engine, or any account/transport code.
+The script appends same-file assertions to the actual `SwarmTitlebar.swift` in a disposable temporary directory. It uses AppKit with activation prohibited. By default it creates no windows; `--window-layout` creates a hidden native window and never displays it. Neither mode launches the app, an engine, or any account/transport code.
```bash
cd /Users/ab/code/autonomous-harness/cli