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.

Give Harness Monitor its stacked-terminal identity

dee84d44de60458
diff --git a/desktop/assets/harnesses.png b/desktop/assets/harnesses.png
new file mode 100644
index 000000000..ea422d15b
Binary files /dev/null and b/desktop/assets/harnesses.png differ
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index 955dae3b8..1156af41d 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -3392,7 +3392,7 @@ class _SwarmScreenState extends State<SwarmScreen>
),
IconButton(
key: _sessionsButton,
- tooltip: 'Harnesses',
+ tooltip: 'Harness Monitor',
onPressed: _toggleSessions,
isSelected: _sessionsOverlay != null,
icon: Badge(
@@ -3410,10 +3410,12 @@ class _SwarmScreenState extends State<SwarmScreen>
fontWeight: FontWeight.w600,
),
),
- child: const Icon(
- Icons.terminal_rounded,
- size: 20,
- semanticLabel: 'Harnesses',
+ child: Image.asset(
+ 'assets/harnesses.png',
+ width: 24,
+ height: 24,
+ filterQuality: FilterQuality.high,
+ semanticLabel: 'Harness Monitor',
),
),
),
diff --git a/desktop/lib/widgets/harness_session_manager.dart b/desktop/lib/widgets/harness_session_manager.dart
index 051da90d6..499c2a115 100644
--- a/desktop/lib/widgets/harness_session_manager.dart
+++ b/desktop/lib/widgets/harness_session_manager.dart
@@ -258,10 +258,10 @@ class _HarnessSessionManagerState extends State<HarnessSessionManager> {
child: Row(
children: [
Expanded(
- child: Text('Harnesses', style: AppType.heading()),
+ child: Text('Harness Monitor', style: AppType.heading()),
),
IconButton(
- tooltip: 'Close harnesses',
+ tooltip: 'Close Harness Monitor',
onPressed: widget.onClose,
icon: const Icon(LucideIcons.x, size: 16),
),
diff --git a/desktop/macos/Runner/SwarmTitlebar.swift b/desktop/macos/Runner/SwarmTitlebar.swift
index 02048f346..4f2ed6dbc 100644
--- a/desktop/macos/Runner/SwarmTitlebar.swift
+++ b/desktop/macos/Runner/SwarmTitlebar.swift
@@ -1250,7 +1250,7 @@ private struct SwarmHistoryEntry: Equatable {
}
/// Reuse the same bundled engine artwork as pane headers. Each menu mark is
-/// decoded once to at most 32 pixels, rather than retaining a full-size bitmap
+/// decoded once at twice its display size, rather than retaining a full-size bitmap
/// or reopening assets on every history/focus update.
private final class SwarmHistoryIcons {
/// The Flutter assets this opens: engine and harness artwork, and the app
@@ -1258,7 +1258,7 @@ private final class SwarmHistoryIcons {
/// lib/store/store_mark.dart). Any other path draws the engine's initial,
/// which is how the store tab once read "S".
static func opens(_ asset: String) -> Bool {
- !asset.contains("..") && (asset == "assets/app_icon.png" || asset == "assets/store/polymath.png"
+ !asset.contains("..") && (asset == "assets/app_icon.png" || asset == "assets/harnesses.png" || asset == "assets/store/polymath.png"
|| asset.hasPrefix("assets/engine-icons/") && asset.hasSuffix(".png"))
}
@@ -1277,11 +1277,11 @@ private final class SwarmHistoryIcons {
cache.countLimit = 32
}
- func image(engine: String?, asset: String?) -> NSImage {
+ func image(engine: String?, asset: String?, pointSize: CGFloat = 16) -> NSImage {
let id = engine?.trimmingCharacters(in: .whitespacesAndNewlines).lowercased() ?? ""
- let key = "\(id):\(asset ?? "")" as NSString
+ let key = "\(id):\(asset ?? ""):\(pointSize)" as NSString
if let image = cache.object(forKey: key) { return image }
- let size = NSSize(width: 16, height: 16)
+ let size = NSSize(width: pointSize, height: pointSize)
let image: NSImage
if let asset, SwarmHistoryIcons.opens(asset),
let url = assetURL(asset),
@@ -1289,15 +1289,15 @@ private final class SwarmHistoryIcons {
let thumbnail = CGImageSourceCreateThumbnailAtIndex(source, 0, [
kCGImageSourceCreateThumbnailFromImageAlways: true,
kCGImageSourceCreateThumbnailWithTransform: true,
- kCGImageSourceThumbnailMaxPixelSize: 32,
+ kCGImageSourceThumbnailMaxPixelSize: Int(ceil(pointSize * 2)),
kCGImageSourceShouldCacheImmediately: true,
] as CFDictionary) {
let bitmap = NSImage(cgImage: thumbnail, size: .zero)
- let scale = 16 / CGFloat(max(thumbnail.width, thumbnail.height))
+ let scale = pointSize / CGFloat(max(thumbnail.width, thumbnail.height))
let width = CGFloat(thumbnail.width) * scale
let height = CGFloat(thumbnail.height) * scale
image = NSImage(size: size, flipped: false) { _ in
- bitmap.draw(in: NSRect(x: (16 - width) / 2, y: (16 - height) / 2, width: width, height: height))
+ bitmap.draw(in: NSRect(x: (pointSize - width) / 2, y: (pointSize - height) / 2, width: width, height: height))
return true
}
} else if id == "store", let appIcon = NSApp.applicationIconImage {
@@ -1311,13 +1311,13 @@ private final class SwarmHistoryIcons {
image = NSImage(size: size, flipped: false) { _ in
NSColor(srgbRed: 204.0 / 255, green: 124.0 / 255, blue: 94.0 / 255, alpha: 1).setStroke()
let path = NSBezierPath()
- path.lineWidth = 16 * 0.098
+ path.lineWidth = pointSize * 0.098
path.lineCapStyle = .round
for i in 0..<4 {
let angle = CGFloat(i) * .pi / 4
- let dx = 16 * 0.39 * cos(angle), dy = 16 * 0.39 * sin(angle)
- path.move(to: NSPoint(x: 8 - dx, y: 8 - dy))
- path.line(to: NSPoint(x: 8 + dx, y: 8 + dy))
+ let dx = pointSize * 0.39 * cos(angle), dy = pointSize * 0.39 * sin(angle)
+ path.move(to: NSPoint(x: pointSize / 2 - dx, y: pointSize / 2 - dy))
+ path.line(to: NSPoint(x: pointSize / 2 + dx, y: pointSize / 2 + dy))
}
path.stroke()
return true
@@ -1329,12 +1329,12 @@ private final class SwarmHistoryIcons {
let name = id.split(separator: "/").last.map(String.init) ?? id
let initial = String(name.first ?? "A").uppercased() as NSString
let attributes: [NSAttributedString.Key: Any] = [
- // Raster artwork for a fixed 16px fallback icon, not a UI text label.
- .font: NSFont.monospacedSystemFont(ofSize: 11, weight: .bold),
+ // Raster artwork for a fallback icon, not a UI text label.
+ .font: NSFont.monospacedSystemFont(ofSize: pointSize * 11 / 16, weight: .bold),
.foregroundColor: NSColor.black,
]
let bounds = initial.size(withAttributes: attributes)
- initial.draw(at: NSPoint(x: (16 - bounds.width) / 2, y: (16 - bounds.height) / 2), withAttributes: attributes)
+ initial.draw(at: NSPoint(x: (pointSize - bounds.width) / 2, y: (pointSize - bounds.height) / 2), withAttributes: attributes)
return true
}
image.isTemplate = true
@@ -1567,9 +1567,11 @@ private final class SwarmTabStrip: NSView {
button(newButton, "plus", "New Tab", #selector(newSwarm))
newButton.setAccessibilityLabel("New Tab")
newButton.isEnabled = false
- button(sessionsButton, "terminal", "Harnesses", #selector(openSessions))
+ button(sessionsButton, "terminal", "Harness Monitor", #selector(openSessions))
+ sessionsButton.image = icons.image(engine: "harnesses", asset: "assets/harnesses.png", pointSize: 24)
+ sessionsButton.symbolConfiguration = nil
sessionsButton.isEnabled = false
- sessionsButton.toolTip = "Harnesses"
+ sessionsButton.toolTip = "Harness Monitor"
newButton.toolTip = "New Tab ⌘T"
storeButton.isBordered = false
storeButton.palette = palette
@@ -1677,12 +1679,12 @@ private final class SwarmTabStrip: NSView {
sessionsButton.running = state["runningSessions"] as? Int ?? 0
sessionsButton.expanded = state["sessionsOpen"] as? Bool == true
let expandedState = sessionsButton.expanded ? "Expanded" : "Collapsed"
- sessionsButton.toolTip = sessionsButton.running > 0 ? "Harnesses · \(sessionsButton.running) running" : "Harnesses"
+ sessionsButton.toolTip = sessionsButton.running > 0 ? "Harness Monitor · \(sessionsButton.running) running" : "Harness Monitor"
let attention = state["attention"] as? Int ?? 0
sessionsButton.attention = attention
let attentionState = "\(attention) \(attention == 1 ? "needs" : "need") input"
sessionsButton.setAccessibilityValue(attention > 0 ? "\(expandedState), \(attentionState)" : expandedState)
- if attention > 0 { sessionsButton.toolTip = "Harnesses · \(attentionState)" }
+ if attention > 0 { sessionsButton.toolTip = "Harness Monitor · \(attentionState)" }
needsLayout = true
layoutSubtreeIfNeeded()
if ids != previousOrder {
diff --git a/desktop/pubspec.yaml b/desktop/pubspec.yaml
index c7170b23a..702ebfbf8 100644
--- a/desktop/pubspec.yaml
+++ b/desktop/pubspec.yaml
@@ -116,6 +116,8 @@ flutter:
# loaded from the bundle: Flutter can't read an .icns, and About should show
# the mark the Dock shows, not a stand-in drawn in Dart.
- assets/app_icon.png
+ # Original stacked-terminal logo, retained for Harness Monitor.
+ - assets/harnesses.png
- assets/harness_device.png
- assets/harness_device_studio.png
- assets/harness_store_card.png
diff --git a/desktop/test/first_workspace_test.dart b/desktop/test/first_workspace_test.dart
index 5207a5f34..2b3fdd936 100644
--- a/desktop/test/first_workspace_test.dart
+++ b/desktop/test/first_workspace_test.dart
@@ -514,7 +514,7 @@ void main() {
find.byKey(const ValueKey('swarm-new-pane-button')),
findsNothing,
);
- expect(find.byTooltip('Harnesses'), findsOneWidget);
+ expect(find.byTooltip('Harness Monitor'), findsOneWidget);
expect(
find.byKey(const ValueKey('swarm-new-harness-button')),
findsNothing,
diff --git a/desktop/test/harness_session_manager_test.dart b/desktop/test/harness_session_manager_test.dart
index f7bcc2d23..578ca9897 100644
--- a/desktop/test/harness_session_manager_test.dart
+++ b/desktop/test/harness_session_manager_test.dart
@@ -67,7 +67,7 @@ void main() {
find.byKey(ValueKey('session-toggle:${agentDestinationId('m', id)}'));
Future<void> open(WidgetTester tester) async {
await mount(tester, app);
- await tester.tap(find.byTooltip('Harnesses'));
+ await tester.tap(find.byTooltip('Harness Monitor'));
await tester.pumpAndSettle();
}
@@ -165,13 +165,13 @@ void main() {
await app.addAgentToSwarm('m', 'a0');
app.machineStates['m']!.blockedAgents['a0'] = question('a0');
await mount(tester, app);
- await tester.tap(find.byTooltip('Harnesses'));
+ await tester.tap(find.byTooltip('Harness Monitor'));
await tester.pump(const Duration(milliseconds: 300));
expect(
find.byKey(const ValueKey('swarm-notifications-button')),
findsNothing,
);
- final managerIcon = tester.getRect(find.byTooltip('Harnesses'));
+ final managerIcon = tester.getRect(find.byTooltip('Harness Monitor'));
expect(
managerIcon.right,
lessThan(
@@ -308,7 +308,7 @@ void main() {
(tester) async {
await open(tester);
expect(find.byType(HarnessSessionManager), findsOneWidget);
- expect(find.text('Harnesses'), findsOneWidget);
+ expect(find.text('Harness Monitor'), findsOneWidget);
expect(find.text('Running 1'), findsOneWidget);
expect(find.text('Paused 1'), findsOneWidget);
expect(find.text('Ready'), findsNothing);
@@ -448,7 +448,7 @@ void main() {
await tester.pump();
connection.stopReplies.single.complete({'deleted': true});
await tester.pump();
- await tester.tap(find.byTooltip('Harnesses'));
+ await tester.tap(find.byTooltip('Harness Monitor'));
await tester.pump();
expect(toggle('a0'), findsNothing);
expect(find.byTooltip('Pausing…'), findsOneWidget);
@@ -717,7 +717,7 @@ void main() {
expect(app.panes, [sibling]);
expect(app.stateOf('m')!.agents.first.isStopped, isFalse);
expect(connection.stops, isEmpty);
- await tester.tap(find.byTooltip('Harnesses'));
+ await tester.tap(find.byTooltip('Harness Monitor'));
await tester.pumpAndSettle();
expect(find.text(_running.name), findsOneWidget);
},
diff --git a/desktop/test/swarm_attention_picker_test.dart b/desktop/test/swarm_attention_picker_test.dart
index c3cf58c56..d79f880ea 100644
--- a/desktop/test/swarm_attention_picker_test.dart
+++ b/desktop/test/swarm_attention_picker_test.dart
@@ -232,7 +232,7 @@ void main() {
app.dismissError();
await tester.pump();
expect(find.text('No harnesses need your input'), findsOneWidget);
- await tester.tap(find.byTooltip('Close harnesses'));
+ await tester.tap(find.byTooltip('Close Harness Monitor'));
await tester.pump();
expect(app.panes, isEmpty);
await tester.pumpWidget(const SizedBox());
diff --git a/desktop/tool/swarm_titlebar_checks.swift b/desktop/tool/swarm_titlebar_checks.swift
index eb2fbb187..bb954a1d7 100644
--- a/desktop/tool/swarm_titlebar_checks.swift
+++ b/desktop/tool/swarm_titlebar_checks.swift
@@ -269,7 +269,7 @@ private extension SwarmTabStrip {
"The Store action has a visible and accessible name")
try checkTitlebar(newButton.frame.maxX < sessionsButton.frame.minX && sessionsButton.frame.maxX < storeButton.frame.minX && storeButton.frame.maxX <= bounds.width,
"Harnesses sits to the left of the Store without overlapping its hit target")
- try checkTitlebar(sessionsButton.accessibilityLabel() == "Harnesses", "Harnesses has an accessible name")
+ try checkTitlebar(sessionsButton.accessibilityLabel() == "Harness Monitor", "Harnesses has an accessible name")
try checkTitlebar(!subviews.contains(where: { $0 is NSTextField }), "The titlebar has no competing text editor")
events.removeAll()
newButton.performClick(nil)