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.

feat(desktop): add native File and History menus

deef2878d3f749b
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index d3b393b77..499bd72c2 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -134,7 +134,20 @@ class _SwarmScreenState extends State<SwarmScreen> {
'activeId': app.activeSwarmId,
'canReopen': app.canReopenClosedSwarm,
'canFind': _canFindTerminal,
+ 'canClosePane': app.focusedPane != null,
'attention': _attention,
+ 'history': [
+ for (final entry in _navigation.menuDestinations(app))
+ {
+ 'id': entry.id,
+ 'title': entry.isSwarm
+ ? entry.title
+ : '${entry.title} — ${app.stateOf(entry.machineId!)?.machine.displayName ?? entry.machineId}',
+ 'detail': entry.detail,
+ 'swarm': entry.isSwarm,
+ 'current': entry.current,
+ },
+ ],
'tabs': [
for (final swarm in app.swarms)
{
@@ -189,6 +202,27 @@ class _SwarmScreenState extends State<SwarmScreen> {
}
case 'addAgent':
await _addAgent();
+ case 'newAgent':
+ await _newAgent(swarmId: app.activeSwarmId);
+ case 'addProject':
+ await _addProject();
+ case 'linkMachine':
+ await _dialog(() => showSwarmLinkDialog(context, app));
+ case 'jump':
+ await _jump();
+ case 'historyDestination':
+ final entry = _navigation
+ .menuDestinations(app)
+ .where((entry) => entry.id == args['id'])
+ .firstOrNull;
+ if (entry != null) {
+ _preparePaneFocus();
+ await activateSwarmDestination(
+ app,
+ entry,
+ destinationSwarmId: app.activeSwarmId,
+ );
+ }
case 'closePane':
if (app.focusedPaneId != null) await app.closePane(app.focusedPaneId!);
case 'findTerminal':
diff --git a/desktop/lib/state/swarm_navigation.dart b/desktop/lib/state/swarm_navigation.dart
index fbc1ef7c3..0444d4c15 100644
--- a/desktop/lib/state/swarm_navigation.dart
+++ b/desktop/lib/state/swarm_navigation.dart
@@ -1,3 +1,5 @@
+import 'package:flutter/foundation.dart' show listEquals;
+
import '../core/fuzzy_match.dart';
import '../core/models.dart';
import 'app_state.dart';
@@ -13,11 +15,15 @@ class SwarmNavigationHistory {
static const capacity = 64;
final _recent = <String>[];
(String, int?)? _location;
+ int _revision = 0;
+ List<Object?>? _menuPresentation;
+ List<SwarmDestination> _menuDestinations = const [];
List<String> get recent => List.unmodifiable(_recent);
void record(AppNotifier app) {
final location = (app.activeSwarmId, app.focusedPaneId);
if (_location == location) return;
+ _revision++;
if (_location?.$1 != location.$1) {
_remember(swarmDestinationId(location.$1));
}
@@ -33,6 +39,39 @@ class SwarmNavigationHistory {
_recent.insert(0, id);
if (_recent.length > capacity) _recent.removeLast();
}
+
+ /// Native menus are ready before opening. Ordinary terminal output reuses
+ /// this snapshot; navigation, membership and discovery invalidate it.
+ List<SwarmDestination> menuDestinations(AppNotifier app) {
+ final presentation = <Object?>[
+ _revision,
+ app.activeSwarmId,
+ app.focusedPaneId,
+ for (final swarm in app.swarms) ...[
+ swarm.id,
+ swarm.name,
+ for (final pane in swarm.panes)
+ (pane.id, pane.machineId, pane.agentId, pane.session?.agentName),
+ ],
+ for (final machine in app.machineStates.values)
+ (
+ machine.machine,
+ machine.nodeOnline,
+ machine.agents,
+ machine.agents.length,
+ machine.localEndpoint?.agentProjects,
+ ),
+ ];
+ if (listEquals(_menuPresentation, presentation)) return _menuDestinations;
+ _menuPresentation = presentation;
+ final catalog = {
+ for (final entry in swarmDestinations(app, recent: _recent))
+ if (entry.hasView) entry.id: entry,
+ };
+ return _menuDestinations = List.unmodifiable([
+ for (final id in _recent) ?catalog[id],
+ ]);
+ }
}
/// A searchable snapshot. Resolving a result again at activation prevents live
diff --git a/desktop/macos/Runner/SwarmTitlebar.swift b/desktop/macos/Runner/SwarmTitlebar.swift
index 8b19476c8..6677150db 100644
--- a/desktop/macos/Runner/SwarmTitlebar.swift
+++ b/desktop/macos/Runner/SwarmTitlebar.swift
@@ -13,6 +13,11 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation {
private var actionsEnabled = false
private var canReopen = false
private var canFind = false
+ private var canClosePane = false
+ private var canCreateSwarm = false
+ private let recentAgentsMenu = NSMenu(title: "Recent Agents")
+ private let recentSwarmsMenu = NSMenu(title: "Recent Swarms")
+ private var history: [SwarmHistoryEntry] = []
init(window: NSWindow, messenger: FlutterBinaryMessenger) {
self.window = window
@@ -30,6 +35,9 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation {
self.actionsEnabled = state["enabled"] as? Bool == true
self.canReopen = state["canReopen"] as? Bool == true
self.canFind = state["canFind"] as? Bool == true
+ self.canClosePane = state["canClosePane"] as? Bool == true
+ self.canCreateSwarm = (state["tabs"] as? [Any] ?? []).count < 24
+ self.updateHistory(state["history"] as? [[String: Any]] ?? [])
self.strip.update(state)
result(nil)
default: result(FlutterMethodNotImplemented)
@@ -82,42 +90,93 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation {
guard let main = NSApp.mainMenu, main.item(withTitle: "Swarm") == nil else { return }
// The stock Flutter nib includes a disabled Preferences placeholder. Make
// the app-menu command work, and give ⌘, a single native owner.
- var settingsInAppMenu = false
- if let appMenu = main.item(at: 0)?.submenu,
- let settings = appMenu.items.first(where: { $0.keyEquivalent == "," && $0.action == nil }) {
+ if let appMenu = main.item(at: 0)?.submenu {
+ let settings = appMenu.items.first(where: { $0.keyEquivalent == "," }) ??
+ NSMenuItem(title: "Settings…", action: nil, keyEquivalent: ",")
settings.title = "Settings…"
settings.target = self
settings.action = #selector(menuAction(_:))
settings.representedObject = "settings"
settings.keyEquivalentModifierMask = [.command]
- settingsInAppMenu = true
+ if settings.menu == nil { appMenu.insertItem(settings, at: min(2, appMenu.numberOfItems)) }
}
- let menu = NSMenu(title: "Swarm")
- func add(_ title: String, _ key: String, _ action: String, _ modifiers: NSEvent.ModifierFlags = [.command]) {
+ func add(_ menu: NSMenu, _ title: String, _ key: String, _ action: String, _ modifiers: NSEvent.ModifierFlags = [.command]) {
let item = NSMenuItem(title: title, action: #selector(menuAction(_:)), keyEquivalent: key)
item.keyEquivalentModifierMask = modifiers
item.target = self
item.representedObject = action
menu.addItem(item)
}
- add("New Swarm", "t", "new")
- add("Reopen Closed Swarm", "t", "reopen", [.command, .shift])
- add("Close Swarm", "w", "closeActive")
- add("Rename Swarm…", "r", "renameActive", [.command, .shift])
- menu.addItem(.separator())
- add("Next Swarm", "]", "next", [.command, .shift])
- add("Previous Swarm", "[", "previous", [.command, .shift])
- menu.addItem(.separator())
- add("Add Agent…", "f", "addAgent", [.command, .shift])
- add("Close Agent View", "w", "closePane", [.command, .shift])
- add("Agents Needing Input…", "i", "notifications", [.command, .shift])
- if !settingsInAppMenu { add("Settings…", ",", "settings") }
- let item = NSMenuItem(title: "Swarm", action: nil, keyEquivalent: "")
- item.submenu = menu
- main.insertItem(item, at: min(2, main.numberOfItems))
+ func install(_ menu: NSMenu, at index: Int) {
+ let item = NSMenuItem(title: menu.title, action: nil, keyEquivalent: "")
+ item.submenu = menu
+ main.insertItem(item, at: index)
+ }
+ let file = NSMenu(title: "File")
+ add(file, "New Swarm", "t", "new")
+ add(file, "New Agent…", "", "newAgent")
+ add(file, "Add Agent to Swarm…", "f", "addAgent", [.command, .shift])
+ file.addItem(.separator())
+ add(file, "Link Machine…", "", "linkMachine")
+ add(file, "Add Project…", "", "addProject")
+ file.addItem(.separator())
+ add(file, "Close Agent View", "w", "closePane", [.command, .shift])
+ add(file, "Close Swarm", "w", "closeActive")
+ install(file, at: 1)
+
+ let historyMenu = NSMenu(title: "History")
+ add(historyMenu, "Jump to Agent or Swarm…", "p", "jump")
+ historyMenu.addItem(.separator())
+ for menu in [recentAgentsMenu, recentSwarmsMenu] {
+ let item = NSMenuItem(title: menu.title, action: nil, keyEquivalent: "")
+ item.submenu = menu
+ historyMenu.addItem(item)
+ }
+ populateHistoryMenu(recentAgentsMenu, entries: history.filter { !$0.swarm }, empty: "No Recent Agents")
+ populateHistoryMenu(recentSwarmsMenu, entries: history.filter(\.swarm), empty: "No Recent Swarms")
+ historyMenu.addItem(.separator())
+ add(historyMenu, "Reopen Closed Swarm", "t", "reopen", [.command, .shift])
+ let windowIndex = main.items.firstIndex(where: { $0.title == "Window" }) ?? main.numberOfItems
+ install(historyMenu, at: windowIndex)
+
+ let swarm = NSMenu(title: "Swarm")
+ add(swarm, "Rename Swarm…", "r", "renameActive", [.command, .shift])
+ swarm.addItem(.separator())
+ add(swarm, "Next Swarm", "]", "next", [.command, .shift])
+ add(swarm, "Previous Swarm", "[", "previous", [.command, .shift])
+ swarm.addItem(.separator())
+ add(swarm, "Agents Needing Input…", "i", "notifications", [.command, .shift])
+ install(swarm, at: windowIndex + 1)
installTerminalFindMenu(main)
}
+ private func updateHistory(_ rows: [[String: Any]]) {
+ let entries = rows.prefix(64).compactMap(SwarmHistoryEntry.init)
+ guard entries != history else { return }
+ history = entries
+ populateHistoryMenu(recentAgentsMenu, entries: entries.filter { !$0.swarm }, empty: "No Recent Agents")
+ populateHistoryMenu(recentSwarmsMenu, entries: entries.filter(\.swarm), empty: "No Recent Swarms")
+ }
+
+ private func populateHistoryMenu(_ menu: NSMenu, entries: [SwarmHistoryEntry], empty: String) {
+ menu.removeAllItems()
+ for entry in entries.prefix(12) {
+ let item = NSMenuItem(title: entry.title, action: #selector(historyAction(_:)), keyEquivalent: "")
+ item.target = self
+ item.representedObject = entry.id
+ item.toolTip = entry.detail
+ item.state = entry.current ? .on : .off
+ item.image = NSImage(systemSymbolName: entry.swarm ? "rectangle.split.2x2" : "terminal",
+ accessibilityDescription: nil)
+ menu.addItem(item)
+ }
+ if menu.items.isEmpty {
+ let item = NSMenuItem(title: empty, action: nil, keyEquivalent: "")
+ item.isEnabled = false
+ menu.addItem(item)
+ }
+ }
+
private func installTerminalFindMenu(_ main: NSMenu) {
guard let edit = main.items.first(where: { $0.title == "Edit" })?.submenu,
let find = edit.items.first(where: { $0.title == "Find" }) else { return }
@@ -140,7 +199,11 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation {
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
let action = menuItem.representedObject as? String ?? ""
+ if menuItem.action == #selector(historyAction(_:)) {
+ return actionsEnabled && history.contains(where: { $0.id == action })
+ }
return actionsEnabled && (action != "reopen" || canReopen) &&
+ (action != "new" || canCreateSwarm) && (action != "closePane" || canClosePane) &&
(!["findTerminal", "findNext", "findPrevious"].contains(action) || canFind)
}
@@ -148,6 +211,27 @@ final class SwarmTitlebar: NSObject, NSMenuItemValidation {
guard validateMenuItem(sender), let action = sender.representedObject as? String else { return }
channel.invokeMethod(action, arguments: nil)
}
+
+ @objc private func historyAction(_ sender: NSMenuItem) {
+ guard validateMenuItem(sender), let id = sender.representedObject as? String else { return }
+ channel.invokeMethod("historyDestination", arguments: ["id": id])
+ }
+}
+
+private struct SwarmHistoryEntry: Equatable {
+ let id: String
+ let title: String
+ let detail: String
+ let swarm: Bool
+ let current: Bool
+ init?(_ row: [String: Any]) {
+ guard let id = row["id"] as? String, let title = row["title"] as? String else { return nil }
+ self.id = id
+ self.title = title
+ detail = row["detail"] as? String ?? ""
+ swarm = row["swarm"] as? Bool == true
+ current = row["current"] as? Bool == true
+ }
}
private let swarmPasteboardType = NSPasteboard.PasteboardType("ai.autonomous.harness.v2.swarm")
@@ -160,7 +244,6 @@ private final class SwarmTabStrip: NSView {
private let document = NSView()
private let newButton = NSButton()
private let notifications = NSButton()
- private let settings = NSButton()
private var tabs: [SwarmTabButton] = []
private var activeId = ""
private var actionsEnabled = false
@@ -187,7 +270,6 @@ private final class SwarmTabStrip: NSView {
}
button(newButton, "plus", "New swarm (⌘T)", #selector(newSwarm))
button(notifications, "bell", "Needs input", #selector(showNotifications))
- button(settings, "gearshape", "Settings (⌘,)", #selector(showSettings))
registerForDraggedTypes([swarmPasteboardType])
}
required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }
@@ -218,7 +300,6 @@ private final class SwarmTabStrip: NSView {
document.setAccessibilityChildren(tabs)
newButton.isEnabled = actionsEnabled && tabs.count < 24
notifications.isEnabled = actionsEnabled
- settings.isEnabled = actionsEnabled
let count = state["attention"] as? Int ?? 0
let attentionLabel = count > 0 ? "\(count) agents need input" : "Needs input"
notifications.image = NSImage(systemSymbolName: count > 0 ? "bell.badge" : "bell",
@@ -242,7 +323,7 @@ private final class SwarmTabStrip: NSView {
override func layout() {
super.layout()
- let available = max(120, bounds.width - 112)
+ let available = max(120, bounds.width - 78)
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: bounds.height)
@@ -253,8 +334,7 @@ private final class SwarmTabStrip: NSView {
}
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)
+ notifications.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)
}
@@ -271,7 +351,6 @@ private final class SwarmTabStrip: NSView {
}
@objc private func newSwarm() { emit?("new", nil) }
@objc private func showNotifications() { emit?("notifications", nil) }
- @objc private func showSettings() { emit?("settings", nil) }
override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation { actionsEnabled ? .move : [] }
override func draggingUpdated(_ sender: NSDraggingInfo) -> NSDragOperation { actionsEnabled ? .move : [] }
override func performDragOperation(_ sender: NSDraggingInfo) -> Bool {
diff --git a/desktop/test/swarm_history_test.dart b/desktop/test/swarm_history_test.dart
new file mode 100644
index 000000000..a25ffa8b8
--- /dev/null
+++ b/desktop/test/swarm_history_test.dart
@@ -0,0 +1,173 @@
+import 'dart:async';
+
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/core/models.dart';
+import 'package:harness/screens/swarm_screen.dart';
+import 'package:harness/settings/settings_screen.dart';
+import 'package:harness/state/swarm_catalog.dart';
+import 'package:harness/state/swarm_navigation.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+import 'package:xterm/xterm.dart';
+
+import 'swarm_screen_test.dart' show terminal;
+import 'swarm_state_test.dart' show createApp;
+import 'swarm_switcher_test.dart' show jumpField;
+
+void main() {
+ test(
+ 'recent menus retain snapshots through output and refresh live identities',
+ () async {
+ final app = createApp();
+ addTearDown(app.dispose);
+ final history = SwarmNavigationHistory();
+ app.addListener(() => history.record(app));
+ final first = app.adoptSessionForTest(terminal('a0', []));
+ history.record(app);
+ app.adoptSessionForTest(terminal('a1', []));
+ history.record(app);
+ final before = history.menuDestinations(app);
+ expect(before.first.agentId, 'a1');
+ for (var i = 0; i < 100; i++) {
+ app.dismissError();
+ expect(history.menuDestinations(app), same(before));
+ }
+ app.machineStates['m']!.agents = [
+ const Agent(id: 'a0', name: 'Renamed agent', terminalAvailable: true),
+ const Agent(id: 'a1', name: 'Agent 1', terminalAvailable: true),
+ ];
+ app.renameSwarm(app.activeSwarmId, 'Renamed Swarm');
+ final renamed = history.menuDestinations(app);
+ expect(
+ renamed.firstWhere((e) => e.agentId == 'a0').title,
+ 'Renamed agent',
+ );
+ expect(renamed.firstWhere((e) => e.isSwarm).title, 'Renamed Swarm');
+ app.machineStates['m']!.nodeOnline = false;
+ expect(history.menuDestinations(app).first.detail, contains('Offline'));
+ await app.closePane(first.id);
+ expect(
+ history.menuDestinations(app).where((e) => e.agentId == 'a0'),
+ isEmpty,
+ );
+ expect(history.recent, contains(agentDestinationId('m', 'a0')));
+ },
+ );
+
+ testWidgets(
+ 'native History focuses its agent, refuses stale entries and respects Settings',
+ (tester) async {
+ const channel = MethodChannel('harness/swarm_tabs');
+ final messenger = tester.binding.defaultBinaryMessenger;
+ final updates = <Map>[];
+ messenger.setMockMethodCallHandler(channel, (call) async {
+ if (call.method == 'update') updates.add(call.arguments as Map);
+ return true;
+ });
+ addTearDown(() => messenger.setMockMethodCallHandler(channel, null));
+ Future<void> native(String method, [Map<String, Object?>? args]) {
+ final done = Completer<void>();
+ messenger.handlePlatformMessage(
+ channel.name,
+ const StandardMethodCodec().encodeMethodCall(
+ MethodCall(method, args),
+ ),
+ (_) => done.complete(),
+ );
+ return done.future;
+ }
+
+ final app = createApp();
+ app.machineStates['m']!.nodeOnline = true;
+ final input = <TerminalBinaryFrame>[];
+ final firstSession = terminal('a0', input);
+ final first = app.adoptSessionForTest(firstSession);
+ final otherInput = <TerminalBinaryFrame>[];
+ final second = app.adoptSessionForTest(terminal('a1', otherInput));
+ final projects = SwarmProjectStore();
+ await tester.pumpWidget(
+ MaterialApp(
+ home: SwarmScreen(
+ notifier: app,
+ nativeTabs: true,
+ projectStore: projects,
+ ),
+ ),
+ );
+ await tester.pump();
+ app.focusPane(first.id);
+ app.focusPane(second.id);
+ await tester.pump();
+ final id = agentDestinationId('m', 'a0');
+ final row = (updates.last['history'] as List).cast<Map>().firstWhere(
+ (row) => row['id'] == id,
+ );
+ expect(row['title'], 'Agent 0 — Test host');
+ final before = updates.length;
+ for (var i = 0; i < 20; i++) {
+ app.dismissError();
+ }
+ await tester.pump();
+ expect(
+ updates.length,
+ before,
+ reason: 'Output/state churn emits no unchanged native menu update',
+ );
+ await native('historyDestination', {'id': id});
+ await tester.pump();
+ expect(app.focusedPaneId, first.id);
+ final focused = tester.widget<TerminalView>(
+ find.byWidgetPredicate(
+ (w) =>
+ w is TerminalView && identical(w.terminal, firstSession.terminal),
+ ),
+ );
+ expect(focused.focusNode!.hasFocus, isTrue);
+ await tester.sendKeyEvent(LogicalKeyboardKey.arrowLeft);
+ await tester.pump(const Duration(milliseconds: 10));
+ expect(input.single.bytes, [27, 91, 68]);
+ expect(otherInput, isEmpty);
+
+ final settings = native('settings');
+ await tester.pump();
+ expect(find.byType(SettingsScreen), findsOneWidget);
+ await native('historyDestination', {'id': agentDestinationId('m', 'a1')});
+ await native('jump');
+ await native('newAgent');
+ await native('linkMachine');
+ await native('addProject');
+ expect(app.focusedPaneId, first.id);
+ expect(jumpField, findsNothing);
+ Navigator.of(tester.element(find.byType(SettingsScreen))).pop();
+ await tester.pump();
+ await settings;
+
+ // Native Command-P reaches the same picker even when the terminal owns focus.
+ final jumping = native('jump');
+ await tester.pump();
+ expect(jumpField, findsOneWidget);
+ await tester.enterText(jumpField, 'Agent 1');
+ await tester.pump();
+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);
+ await tester.pump();
+ await jumping;
+ expect(app.focusedPaneId, second.id);
+ await tester.sendKeyEvent(LogicalKeyboardKey.arrowLeft);
+ await tester.pump(const Duration(milliseconds: 10));
+ expect(otherInput.single.bytes, [27, 91, 68]);
+
+ await app.closePane(first.id);
+ await tester.pump();
+ await native('historyDestination', {'id': id});
+ await tester.pump();
+ expect(app.panes, [
+ second,
+ ], reason: 'Stale history cannot recreate a closed view');
+ expect(app.focusedPaneId, second.id);
+ await tester.pumpWidget(const SizedBox());
+ projects.dispose();
+ app.dispose();
+ },
+ );
+}
diff --git a/desktop/tool/swarm_titlebar_checks.swift b/desktop/tool/swarm_titlebar_checks.swift
index 0bc20cd21..b64b92bc6 100644
--- a/desktop/tool/swarm_titlebar_checks.swift
+++ b/desktop/tool/swarm_titlebar_checks.swift
@@ -101,6 +101,8 @@ private extension SwarmTabStrip {
try checkTitlebar(newButton.isEnabled, "New tab returns below capacity")
try checkTitlebar(notifications.accessibilityLabel() == "2 agents need input", "Attention has a readable accessible label")
try checkTitlebar(notifications.toolTip == "2 agents need input (⇧⌘I)", "Attention tooltip advertises its keyboard shortcut")
+ try checkTitlebar(subviews.compactMap { $0 as? NSButton }.count == 2, "Titlebar keeps only New swarm and Needs input; Settings belongs to the app menu")
+ try checkTitlebar(newButton.frame.maxX + 12 <= notifications.frame.minX, "New swarm leaves balanced space before Needs input")
try original.checkEnabled(true)
original.clickBothActions()
try checkTitlebar(events == ["select", "close"], "Native selection and close dispatch once each")
@@ -108,11 +110,10 @@ private extension SwarmTabStrip {
events.removeAll()
update(state([["id": "swarm-0", "name": "Renamed tab"]], active: "swarm-0", enabled: false))
try original.checkEnabled(false)
- try checkTitlebar(!newButton.isEnabled && !notifications.isEnabled && !settings.isEnabled, "Titlebar actions disable with a modal")
+ try checkTitlebar(!newButton.isEnabled && !notifications.isEnabled, "Titlebar actions disable with a modal")
original.clickBothActions()
newButton.performClick(nil)
notifications.performClick(nil)
- settings.performClick(nil)
try checkTitlebar(events.isEmpty, "Disabled controls emit no actions")
}
}
@@ -129,7 +130,10 @@ private extension SwarmTitlebar {
func checkNativeContainer() throws {
guard let window else { throw TitlebarCheckFailure(message: "Native test window exists") }
let main = NSMenu()
- main.addItem(NSMenuItem(title: "Harness V2", action: nil, keyEquivalent: ""))
+ let appItem = NSMenuItem(title: "Harness V2", action: nil, keyEquivalent: "")
+ appItem.submenu = NSMenu(title: "Harness V2")
+ appItem.submenu?.addItem(NSMenuItem(title: "Preferences…", action: nil, keyEquivalent: ","))
+ main.addItem(appItem)
let edit = NSMenuItem(title: "Edit", action: nil, keyEquivalent: "")
edit.submenu = NSMenu(title: "Edit")
let find = NSMenuItem(title: "Find", action: nil, keyEquivalent: "")
@@ -137,8 +141,56 @@ private extension SwarmTitlebar {
find.submenu?.addItem(NSMenuItem(title: "Find and Replace…", action: nil, keyEquivalent: "f"))
edit.submenu?.addItem(find)
main.addItem(edit)
+ for title in ["View", "Window", "Help"] {
+ let item = NSMenuItem(title: title, action: nil, keyEquivalent: "")
+ item.submenu = NSMenu(title: title)
+ main.addItem(item)
+ }
NSApp.mainMenu = main
configure()
+ try checkTitlebar(main.items.map(\.title) == ["Harness V2", "File", "Edit", "View", "History", "Swarm", "Window", "Help"], "Menus follow the familiar macOS order")
+ let settings = appItem.submenu!.items[0]
+ try checkTitlebar(settings.title == "Settings…" && settings.representedObject as? String == "settings", "Settings stays in the application menu")
+ let file = main.item(withTitle: "File")!.submenu!
+ let historyMenu = main.item(withTitle: "History")!.submenu!
+ try checkTitlebar(file.items.compactMap { $0.representedObject as? String } == ["new", "newAgent", "addAgent", "linkMachine", "addProject", "closePane", "closeActive"], "File exposes creation, connection and view-closing actions")
+ let jump = historyMenu.items.first(where: { $0.representedObject as? String == "jump" })!
+ try checkTitlebar(jump.keyEquivalent == "p" && jump.keyEquivalentModifierMask == [.command], "Command-P has a native menu owner while a terminal has focus")
+ let reopen = historyMenu.items.first(where: { $0.representedObject as? String == "reopen" })!
+ actionsEnabled = true
+ canReopen = false
+ try checkTitlebar(!validateMenuItem(reopen), "Closed-Swarm recovery is disabled with an empty history")
+ canReopen = true
+ try checkTitlebar(validateMenuItem(reopen), "Closed-Swarm recovery becomes available")
+ let closePane = file.items.first(where: { $0.representedObject as? String == "closePane" })!
+ canClosePane = false
+ try checkTitlebar(!validateMenuItem(closePane), "Close Agent View is disabled in New swarm")
+ canClosePane = true
+ try checkTitlebar(validateMenuItem(closePane), "Close Agent View is enabled for a focused pane")
+ let create = file.items.first(where: { $0.representedObject as? String == "new" })!
+ canCreateSwarm = false
+ try checkTitlebar(!validateMenuItem(create), "Native New Swarm respects the tab capacity")
+ canCreateSwarm = true
+ try checkTitlebar(validateMenuItem(create), "Native New Swarm returns below capacity")
+ let recentRows: [[String: Any]] = (0..<20).map {
+ ["id": "agent:\($0)", "title": "Agent \($0) — Machine", "detail": "Project \($0)", "current": $0 == 0]
+ } + [["id": "swarm:recent", "title": "Recent Swarm", "swarm": true]]
+ updateHistory(recentRows)
+ try checkTitlebar(recentAgentsMenu.numberOfItems == 12 && recentSwarmsMenu.numberOfItems == 1, "Recent menus stay bounded and separate agents from Swarms")
+ let recent = recentAgentsMenu.items[0]
+ try checkTitlebar(recent.state == .on && recent.toolTip == "Project 0", "Recent work includes current selection and project context")
+ updateHistory(recentRows)
+ try checkTitlebar(recentAgentsMenu.items[0] === recent, "Unchanged history retains native menu items")
+ try checkTitlebar(validateMenuItem(recent), "Recent navigation is available in the shell")
+ actionsEnabled = false
+ try checkTitlebar(!validateMenuItem(recent) && !validateMenuItem(jump) && !validateMenuItem(settings), "History, jump and Settings cannot act behind a modal")
+ for item in file.items where !item.isSeparatorItem {
+ try checkTitlebar(!validateMenuItem(item), "File commands cannot change a covered Swarm")
+ }
+ actionsEnabled = true
+ updateHistory([])
+ try checkTitlebar(!validateMenuItem(recent), "A stale recent menu item cannot dispatch after its view disappears")
+ try checkTitlebar(recentAgentsMenu.items[0].action == nil && !recentAgentsMenu.items[0].isEnabled, "An empty recent menu is an inert placeholder")
guard let menu = main.items.first(where: { $0.title == "Swarm" })?.submenu,
let attention = menu.items.first(where: { $0.representedObject as? String == "notifications" }) else {
throw TitlebarCheckFailure(message: "Swarm menu exposes agents needing input")
diff --git a/docs/harness-v2-developer-tools-research.md b/docs/harness-v2-developer-tools-research.md
index 3657a7a5f..1187833e8 100644
--- a/docs/harness-v2-developer-tools-research.md
+++ b/docs/harness-v2-developer-tools-research.md
@@ -6,6 +6,19 @@ Harness should make three things excellent: **keep work alive, reach any work in
This is a qualitative sample of firsthand accounts and tool authors' documentation, not a survey of all exceptional developers. “World-class” has no objective tool list. Publication dates matter: several authors have changed their workflows. Product documentation establishes advertised behavior; it does not independently establish performance, reliability or developer affection.
+## Current implementation queue
+
+Updated 2026-09-13. This is the working list; [the progress log](harness-v2-progress.md) records checks and remaining gaps.
+
+| Status | Work |
+| --- | --- |
+| In the preview | Real machine/project data; native Swarm tabs; wallpaper only in New swarm; Cmd+P jump, Needs input and terminal Find. |
+| Fixed and rebuilt | Cmd+P stale focus/offscreen targets; retained offline output and composer drafts; blocking frozen overlays removed. |
+| In the rebuilt preview | Settings gear removed on macOS; native File/History menus; recent agents and Swarms; native Cmd+P routing. Menus and picker typing verified live; focus/input regression tests pass. |
+| Next | Preserve Find, scroll and draft context through the actual reconnect/keyframe handoff. |
+| Next | Live keyboard/tab/drag review and native input-to-display measurements under output load. |
+| Keep deferred | Workflow canvases, autonomous manager layers, a full IDE/Git client and a marketplace. |
+
## What people actually describe using
| Developer / primary evidence | Tools and behavior in the account | What Harness can learn |
@@ -54,7 +67,8 @@ The opportunity for Harness is to make movement among real agents across real ma
| **Removed blocking chrome** | Full-pane frozen and reconnect overlays | Read-only status and explicit Reconnect/Take control actions live in the header. Retained output, selection, search and unsent composer text survive unavailable-machine presentation. Ordinary tab navigation never retries a dead stream. |
| **Preserve compatibility** | Real agent terminals and user shell environments | Verify selection, multiline/image paste, scrollback, nested tmux/Vim and escape/control keys. Before promising a full terminal replacement, verify a straightforward ordinary-shell workflow too; the current New agent UI centers on detected agent engines. |
| **Remove from active work — implemented** | Wallpaper behind populated Swarms | Use `#463746`, matching the selected native tab. Wallpaper fills only an empty New swarm canvas and its decoded cache entry is evicted when that view is disposed. |
-| **Reduce prominence** | “Next wallpaper” button, repeated metadata, permanent Settings gear | Keep appearance choices in a secondary location. Keep machine identity legible where needed to distinguish remote work. Settings already has `Cmd+,` and the app menu; consider reclaiming the extra toolbar control. These are proposals, not removed features. |
+| **Implemented in the preview** | Native File/History menus; redundant Settings gear removed | Settings stays in the macOS app menu with `Cmd+,`. File groups creation, linking and closing views. History exposes Cmd+P, recent agents/Swarms and closed-Swarm recovery. Recent lists are bounded, session-local and contain open views only; selecting a stale item cannot recreate a closed view. The non-macOS toolbar retains Settings access. |
+| **Reduce prominence** | “Next wallpaper” button and repeated metadata | Keep appearance choices in a secondary location and machine identity legible where needed to distinguish remote work. These remaining reductions are proposals. |
| **Removed avoidable waiting** | Settings route transitions and section cross-fades | Implemented: Settings now opens/closes and switches sections immediately. Removed the 170/120 ms route and 200/90 ms section fades; existing route/modal checks pass. Reserve animation for feedback that helps understanding. |
| **Keep optional; stop expanding** | Usage ledger and hardware/dial settings | Usage can answer a real cost question; hardware supports existing users. Keep these away from the main work loop. Do not delete capabilities or data merely because they were absent from this small research sample. |
| **Keep absent** | Models/Grid dashboard, permanent workspace sidebar, pane footers | The authenticated V2 shell already removed these. Avoid introducing equivalent clutter through new agent-management panels. |
@@ -62,6 +76,12 @@ The opportunity for Harness is to make movement among real agents across real ma
Source inspection: `desktop/lib/screens/swarm_screen.dart`, `widgets/swarm_dialogs.dart`, `state/swarm_catalog.dart`, `shortcuts/app_shortcuts.dart`, `settings/settings_screen.dart`, `settings/settings_section.dart`, `widgets/new_agent_dialog.dart`, and `macos/Runner/SwarmTitlebar.swift`. Existing checks and implementation details are recorded in [the handoff](harness-v2-progress.md) and [performance notes](harness-v2-performance.md).
+## Native menu convention
+
+Apple's [native menu documentation](https://developer.apple.com/documentation/swiftui/building-and-customizing-the-menu-bar-with-swiftui) shows File handling New Message, Close and opening a conversation in a window. File represents creating/opening/closing the app's work, beyond documents on disk. For Harness, the corresponding work is a Swarm or agent view. Keep Edit's standard text actions, View's layout/font controls, and the system Window menu.
+
+Safari places recent visits and closed-tab recovery in [History](https://support.apple.com/en-mide/guide/safari/ibrw1009/mac). Harness applies that navigation pattern to existing agent views and Swarms. It does not collect terminal commands, prompts or output as navigation history. Current history is limited to this app session: at most 64 identities, with 12 recent agents and 12 recent Swarms shown in the native menus. Closed-Swarm recovery uses the existing in-memory recovery list for this app session.
+
## The next small product milestone
1. **A terminal workspace people trust.** Finish the current native polish and verify typing, paste, selection, scrollback, resize, tab changes, input ownership and reconnect. No lost sessions, duplicate input or hidden layout changes. New swarms can be welcoming; active work stays visually quiet.
diff --git a/docs/harness-v2-performance.md b/docs/harness-v2-performance.md
index 0845b9e5e..d52487424 100644
--- a/docs/harness-v2-performance.md
+++ b/docs/harness-v2-performance.md
@@ -181,11 +181,17 @@ Retained terminals stay mounted while offline, unlinked or temporarily missing f
The full desktop suite passes 1,039 tests with one skip; the final combined suite and isolated render passes 1,040 with one skip. Focus regressions cover repeated and same-Swarm jumps, zoom, offscreen/cross-Swarm targets, the first input frame and unavailable destinations. Offline checks preserve renderer identity, dimensions, selection, scroll, Find and composer text while refusing input. The ready retry fixture verifies that an explicit retry still opens a fresh stream when prerequisites return. Actual reattachment still replaces the session before its first keyframe; retaining context through that handoff remains follow-up work. These are behavior and frame-order checks, not physical-display latency measurements.
+## Native menu update
+
+History shares the 64-identity session-local navigation record and shows at most 12 recent agents and 12 recent Swarms. Navigation and discovery refresh its lightweight destination snapshots; ordinary terminal notifications reuse them. Unchanged state sends no native update and AppKit retains identical menu items. Menu selection resolves its identity against current open views before focusing, and cannot recreate a closed pane. Cmd+P now has an explicit native menu owner in History, sharing the tested picker handoff. The macOS Settings gear is removed, leaving that space for tabs while keeping Settings in the app menu.
+
+The full desktop suite passes 1,041 tests with one skip; 221 AppKit checks pass, including native menu order, shortcut ownership, stale history actions and modal guards. These checks establish behavior and avoidance of redundant work, not measured native input-to-display latency.
+
## Native follow-up
-The optimized real-data app builds and runs locally. The native tab/canvas polish was visually reviewed before the navigation and retained-canvas continuations; CUA access returned after the pane-focus Release rebuild. The empty wallpaper and tab strip were captured; newer navigation interactions still need live native review. 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 optimized real-data app builds and runs locally. The native tab/canvas polish was visually reviewed before the navigation and retained-canvas continuations; CUA access returned after the pane-focus Release rebuild. The empty wallpaper and tab strip were captured. After the native-menu build, live checks verified File/History, Cmd+P opening, immediate focused search typing and Escape return. At that point no agent views were open, so live terminal destination/input checks remain pending; fake-session regression tests cover them. 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 195 assertions total, including hover separators and native Find/attention shortcuts and modal guards. No Flutter engine, account or terminal is accessed.
+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 221 assertions total, including File/History menus, modal/stale-action guards, hover separators and native Find/attention shortcuts and modal guards. 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.
diff --git a/docs/harness-v2-progress.md b/docs/harness-v2-progress.md
index e1b1f3fac..eb9aa86fe 100644
--- a/docs/harness-v2-progress.md
+++ b/docs/harness-v2-progress.md
@@ -1,6 +1,6 @@
# Harness App V2 — development handoff
-Updated 2026-09-13 after the pane-focus and disconnected-terminal continuation. This is a working preview, not a release.
+Updated 2026-09-13 after the pane-focus, disconnected-terminal and native-menu continuations. This is a working preview, not a release.
## Resume here
@@ -17,12 +17,14 @@ Updated 2026-09-13 after the pane-focus and disconnected-terminal continuation.
- Cmd+Shift+I now opens **Needs input** from the existing bell or native Swarm menu. It searches live questions and agent/project/machine context, keeps the oldest first when search is blank, and shares focus-only navigation with Cmd+P. Cmd+P, Return takes you back to the prior agent. Both pickers scroll and highlight keyboard selections in the same frame. Nine new state/widget checks pass, including large text and the full terminal-input round trip.
- Swarm terminals now keep the same widget ancestry across tabs, zoom and presets, retaining unchanged cells and headers. The paired headless check reduced median tab-switch CPU time from 20.924 to 12.226 ms with 16 terminals and from 14.151 to 8.925 ms with 48; focus changes also improved. Settings route and section fades are removed. These are debug CPU measurements, not native input-to-display timings.
- Cursor timers now follow the active, focused terminal, stopping for hidden/covered views and inactive windows. With 48 retained terminals, the isolated five-second observation fell from 480 periodic callbacks to 10 in the foreground and zero when inactive. New swarm retains only its search caret timer. Link-modifier keyboard listeners exist only while hovering a visible link. The idle-work continuation's full suite passed 1,010 tests with one skip.
-- Ordinary hidden output now updates the buffer without scheduling a renderer frame. The paired 16/48-terminal debug benchmark reduced hidden-output median CPU cost by 88%/84%; mixed visible/hidden output improved by 32%/51%. Restoring a view reconciles its current buffer, scroll and dimensions once; native caret coordinates coalesce after the frame. That continuation passed 1,014 tests with one skip; the current full suite passes 1,039 with one skip.
-- The pane-focus Release preview was rebuilt and normally relaunched; PID **41137** was the sole V2 instance at the last check. Revalidate before any later restart. CUA access returned after this rebuild: the real New swarm, native tab strip and edge-to-edge wallpaper were captured. The user is actively changing window size and Swarms; refresh UI state before actions. Live picker focus verification is still in progress. Earlier `cgWindowNotFound` failures no longer establish a current block. First-frame renderer pixels and native caret messages remain covered by isolated Flutter checks.
+- Ordinary hidden output now updates the buffer without scheduling a renderer frame. The paired 16/48-terminal debug benchmark reduced hidden-output median CPU cost by 88%/84%; mixed visible/hidden output improved by 32%/51%. Restoring a view reconciles its current buffer, scroll and dimensions once; native caret coordinates coalesce after the frame. That continuation passed 1,014 tests with one skip; the current full suite passes 1,041 with one skip.
+- The native-menu Release preview was rebuilt and normally relaunched; PID **50524** was the sole V2 instance at the last check. Revalidate before any later restart. CUA now accesses the real preview. Live review confirmed the native menu order, no Settings gear, File actions and disabled Close Agent View in New swarm, History menus/empty states, and Cmd+P opening with immediate typing into its focused search field. Escape returned to the unchanged New swarm. At this check the user had closed all agent views, so selecting/focusing a real pane was not exercised; isolated native-channel/widget regressions cover destination focus and the first terminal key. Do not add views or send real-agent input just to test. User window/menu activity interrupted a later menu-dismiss action; refresh state before any further UI actions. Earlier `cgWindowNotFound` failures no longer establish a current block.
- Cmd+F now searches retained output in the focused terminal; Cmd+G / Cmd+Shift+G and Enter / Shift+Enter move through matches. Escape restores the previous scroll position and input focus. The field occupies the existing header without resizing the terminal. Find pauses and releases its index when hidden or covered. A keyframe keeps the field, caret and query; read-only rendered panes remain searchable without taking control. Retained offline output is now searchable; only never-attached panes keep the setup guide.
-- The latest hover pass uses 13-point native titles, 14-point leading space inside the 28-point hover shape, a 12-point corner radius and a 10-point close symbol. Both neighboring separators disappear on hover. The title layout is cached across hover redraws. Native selected shoulders still meet the flat canvas. Isolated native before/after images were inspected; CUA still could not capture the live window after the normal Release relaunch.
+- The latest hover pass uses 13-point native titles, 14-point leading space inside the 28-point hover shape, a 12-point corner radius and a 10-point close symbol. Both neighboring separators disappear on hover. The title layout is cached across hover redraws. Native selected shoulders still meet the flat canvas. Isolated native before/after images were inspected. CUA later captured the real strip and wallpaper; pointer-hover/drag review still needs an uninterrupted live window.
- The user reported that Cmd+P did not focus the selected agent. New tests reproduced two failures: the closing picker could restore the old terminal and overwrite the selected pane, and an offscreen result stayed outside the viewport. Both pickers now clear that stale focus restoration before activating their result. Explicit jumps refocus even the currently selected pane and reveal it before paint, accounting for changed canvas padding when leaving New swarm. Checks cover same-Swarm, repeated, zoomed, offscreen and cross-Swarm jumps, including the first key arriving only at the destination.
- Retained sessions now keep the same terminal renderer through offline, missing-machine, link-required and unavailable-agent presentation. The large frozen overlay and redundant connection overlays are removed; status and explicit Reconnect/Take control actions occupy the header. Offline output stays selectable/searchable, and disabled composer text remains intact. Tab switches no longer retry existing dead streams; unavailable retries keep the old session. A never-attached pane still shows setup guidance.
+- The user asked for File/History menus like Safari/Chrome and removal of the duplicate Settings gear. The macOS menu order is now Harness, File, Edit, View, History, Swarm, Window, Help. File groups existing creation/link/project/close actions. History owns native Cmd+P, 12 recent agents (with machine names), 12 recent Swarms and existing closed-Swarm recovery. Settings stays in the app menu; non-macOS fallback keeps its Settings control. History reuses the bounded 64-identity session-local navigation record, caches presentation across output notifications, and revalidates open-view identities on selection. It does not store terminal text or recreate stale closed views. Native/channel focus, modal, cache and stale-action checks pass.
+- The user asked where the research suggestions live and whether implementation follows them. The developer-tool audit now starts with a compact status/next-work table; keep it current alongside this handoff.
- Continue implementation here. Do not create another repository or fork for V2.
```bash
@@ -169,13 +171,13 @@ The reopen binding follows the documented Mac tab-recovery shortcut in [Safari](
| --- | --- |
| 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. 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 | **1,039 passed, 1 skipped** on the pane-focus and disconnected-terminal code, including terminal, modal, persistence, layout and shortcut regressions. |
+| Full Flutter suite | **1,041 passed, 1 skipped** on the pane-focus, disconnected-terminal and native-menu code, including terminal, modal, persistence, layout and shortcut regressions. |
| Hidden rendering and native caret | Four new checks cover binary output arriving without hidden layout/frame requests; retained selection, manual scroll and follow-tail; first-visible-frame raster pixels; changed emulator dimensions and preserved TUI scroll regions; covered routes; and coalesced/fresh caret coordinates. The focused restoration/IME/key-ownership run passed 22 checks. |
| Cursor and link activity | Four new checks cover one cursor clock across retained Swarms/focus/zoom, immediate suspension for inactive windows and disabled ticker mode, session replacement and read-only/connection ownership, and stationary link hover across session replacement/modifier release. The earlier focused cursor/session run passed 74 checks. |
| Retained canvas and header | Five new checks cover stable element ancestry and terminal State across tabs/zoom/presets, first-frame per-Swarm scrolling, tall splits and hidden geometry, font metrics at unchanged point size, and fresh header metadata/callbacks. Layout checks compare legacy and Swarm geometry for all fixed presets and auto layouts at two sizes. |
| Jump navigation | 13 new state/widget checks cover fuzzy context, shared/offline views, focus-only navigation, preserved layout and terminal state, bounded recents, stale results, captured destinations, immediate focus, keyboard scrolling, live discovery and Add separation. The three widget checks also pass after adding assertions that the first terminal key reaches only the destination session. |
| Needs input | Nine new state/widget checks cover oldest-first search, live prompt/context matching, missing terminals, resolved/replaced request guards, shared ownership, captured targets, stale views, first-frame open and scrolling, Ctrl-N/P, large text, cancellation, and the Cmd+P return path with the first terminal key reaching only its destination. Existing native modal tests now exercise the notifications channel too. The isolated render was inspected with SF font files and engine icons; live native review remains pending. |
-| Jump visual review | Isolated render inspected with SF font files and engine icons; selected-result text now stays white on a quiet highlight. Four checks (the three widget cases plus the temporary visual fixture) passed after this contrast adjustment. Final Release build passed. Live CUA review remains unavailable with `cgWindowNotFound`. |
+| Jump visual review | Isolated render inspected with SF font files and engine icons; selected-result text now stays white on a quiet highlight. Four checks (the three widget cases plus the temporary visual fixture) passed after this contrast adjustment. Final Release build passed. Live Cmd+P opening, immediate search typing/filtering and Escape return were verified after the native-menu rebuild; no real agent input was submitted. |
| 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. |
| Local CLI discovery | 25 passed, including older-daemon folder parsing and continuous snapshots without spawning/reconnecting. |
@@ -185,7 +187,7 @@ The reopen binding follows the documented Mac tab-recovery shortcut in [Safari](
| Headless performance | The prior five-case catalog/terminal/output benchmark passed. The paired retained-canvas continuation reran both 16/48-terminal cases with new focus measurements: tab medians 12.226 / 8.925 ms and focus medians 5.284 / 4.586 ms. Reproducible commands and limits in `docs/harness-v2-performance.md`. |
| Idle-work measurement | Both isolated timer scenarios passed: 16/48 retained terminals now share one focused cursor clock, with 10 callbacks in five seconds, and zero terminal cursor callbacks when the window is inactive or an empty Swarm is shown. Empty New swarm keeps its search field's caret timer. These are fake-clock structural counts, not native process CPU/battery measurements. |
| Background output measurement | Both 16/48-terminal cases passed with hidden-only and mixed output. Hidden dirty renderers fell from 12/44 to zero; hidden-only bursts schedule no frame in this workload. Final CPU medians are 0.110/0.206 ms for hidden output and 0.757/0.766 ms for all-terminal output. See performance notes for scope and paired results. |
-| AppKit components and container | **195 assertions passed**: component, hover separator behavior, terminal Find/attention shortcut/menu/modal 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. |
+| AppKit components and container | **221 assertions passed**: File/History menu order and guarded commands, cached/stale recent entries, Settings ownership, tab capacity, titlebar spacing, hover separators, terminal Find/attention shortcuts and 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.
@@ -194,6 +196,12 @@ Tests now exercise the actual V2 welcome/settings/linking flow. Usage pricing ag
Evidence on this Mac under `/private/tmp`:
+- `harness-v2-menu-full-tests.log`: **1,041 passed, one existing skip**.
+- `harness-v2-menu-focused.log`: 25 navigation/History/picker/modal checks.
+- `harness-v2-menu-native.log`: 221 native AppKit/menu/container checks.
+- `harness-v2-menu-release-build.log`: successful optimized build; sole preview PID 50524 after normal relaunch. Live CUA results are described above.
+- `harness-v2-menu-analyze.log`: zero errors/warnings, 12 existing vendored infos.
+
- `harness-v2-jump-focus-before.log`: reproduces stale terminal focus and an offscreen selected pane; the extended viewport case also caught the padding change when leaving New swarm.
- `harness-v2-focus-offline-tests.log`: 41 focused terminal, picker, Find, composer and retained-view checks.
- `harness-v2-focus-offline-full-tests.log`: 1,039 passed, one existing skip.
@@ -246,7 +254,7 @@ Earlier logs contain superseded failures. Temporary logs and toolchains are loca
## Remaining work
-1. Continue live CUA review of the jump workflow, stable canvas, restored terminal output/caret, project starters and keyboard navigation. Access returned after the pane-focus rebuild. The user is actively changing window size and Swarms; re-read UI state before actions and preserve their arrangement.
+1. Continue live CUA review of an existing-agent jump, stable canvas, restored output/caret, project starters and keyboard navigation. Cmd+P opening/filtering/Escape and the File/History menus are now verified in the real app. Access returned after the pane-focus rebuild. 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.