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(super-tabs): real computer names in Machines; avatars stand 16 px clear of the figures

bitcoinbuilder3f653d330a5a
diff --git a/desktop/lib/super_tabs/identity.dart b/desktop/lib/super_tabs/identity.dart
index 191a2195c..5a84f086c 100644
--- a/desktop/lib/super_tabs/identity.dart
+++ b/desktop/lib/super_tabs/identity.dart
@@ -55,27 +55,11 @@ class SuperTabAvatar extends StatelessWidget {
String superTabPersonName(String email) => email.split('@').first;
-/// A Bonjour hostname is useful in details, but noisy in a member list.
-/// Only normalize generated hostnames; names chosen by a person stay intact.
+/// A computer as it calls itself: a Bonjour hostname without its `.local` suffix ("MacBookPro2021"), never mapped
+/// to a model name, so two machines of one model stay told apart. A name a person chose stays as it is.
String superTabMachineName(String name) {
- if (!name.toLowerCase().endsWith('.local')) return name;
- final host = name.substring(0, name.length - '.local'.length);
- for (final model in const [
- ('mac-?book-?pro', 'MacBook Pro'),
- ('mac-?book-?air', 'MacBook Air'),
- ('mac-?book', 'MacBook'),
- ('mac-?mini', 'Mac mini'),
- ('mac-?studio', 'Mac Studio'),
- ('mac-?pro', 'Mac Pro'),
- ('i-?mac-?pro', 'iMac Pro'),
- ('i-?mac', 'iMac'),
- ]) {
- if (RegExp(
- '(?:^|-)${model.$1}(?:-?[0-9]+(?:,[0-9]+)?)?\$',
- caseSensitive: false,
- ).hasMatch(host)) {
- return model.$2;
- }
- }
- return host;
+ const suffix = '.local';
+ return name.length > suffix.length && name.toLowerCase().endsWith(suffix)
+ ? name.substring(0, name.length - suffix.length)
+ : name;
}
diff --git a/desktop/lib/super_tabs/machines.dart b/desktop/lib/super_tabs/machines.dart
index 803539036..4a1557479 100644
--- a/desktop/lib/super_tabs/machines.dart
+++ b/desktop/lib/super_tabs/machines.dart
@@ -1051,13 +1051,13 @@ class _SuperTabMachinesState extends State<SuperTabMachines> {
final ringed = _MachineLine.ringed;
final full = most == 0
? 0.0
- : _MachineLine.gap +
+ : _MachineLine.avatarsGap +
ringed +
(ringed - _MachineLine.overlap) * (stacked - 1) +
(rest > 0 ? 4 + measure('+$rest', count) : 0);
final counted = most == 0
? 0.0
- : _MachineLine.gap + measure('+$most', count);
+ : _MachineLine.countGap + measure('+$most', count);
// With agents, their last avatar centers on the heading +; without, the row ends where project dots do.
final end = most == 0
? _anchor - _MachineLine.dotHalf
@@ -1333,6 +1333,12 @@ class _MachineLine extends StatelessWidget {
/// Before each column, and between the name and the first.
static const gap = 6.0;
+ /// Before the agents column when it shows their avatars, so the avatars stand apart from the figures. A count
+ /// is a figure like the others and keeps their [gap], which leaves Claude's column room in the default 204 px
+ /// sidebar.
+ static const avatarsGap = 16.0;
+ static const countGap = gap;
+
/// What the name keeps, at the default text size, before a column gives way: a readable start of it, small
/// enough that Claude's allowance still fits beside it in the default 204 px sidebar.
static const minName = 48.0;
diff --git a/desktop/test/super_tab_machines_test.dart b/desktop/test/super_tab_machines_test.dart
index f423f4ff8..f76921442 100644
--- a/desktop/test/super_tab_machines_test.dart
+++ b/desktop/test/super_tab_machines_test.dart
@@ -83,28 +83,27 @@ Finder _option(String id) => find.byKey(ValueKey('swarm-machine-option-$id'));
void main() {
final capture = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];
setUpAll(() => loadCaptureFonts(capture));
- test(
- 'generated computer names are readable and custom names stay intact',
- () {
- for (final hostname in [
- 'MacBookPro2021.local',
- 'MacBooks-MacBook-Pro-19.local',
- 'MacbookPro.local',
- ]) {
- expect(superTabMachineName(hostname), 'MacBook Pro');
- }
- expect(superTabMachineName('Mac-mini.local'), 'Mac mini');
- expect(superTabMachineName('build-server.local'), 'build-server');
- for (final name in [
- 'Ada’s Mac',
- 'M2',
- 'MacBook Pro lab',
- 'Build server',
- ]) {
- expect(superTabMachineName(name), name);
- }
- },
- );
+ test('a computer is shown by its real hostname without ".local", and a name a person chose stays as it is', () {
+ for (final (hostname, shown) in [
+ ('MacBookPro2021.local', 'MacBookPro2021'),
+ ('MacBooks-MacBook-Pro-19.local', 'MacBooks-MacBook-Pro-19'),
+ ('MacbookPro.local', 'MacbookPro'),
+ ('Mac-mini.local', 'Mac-mini'),
+ ('build-server.LOCAL', 'build-server'),
+ ]) {
+ expect(superTabMachineName(hostname), shown);
+ }
+ for (final name in [
+ 'Ada’s Mac',
+ 'M2',
+ 'MacBook Pro lab',
+ 'Build server',
+ 'locally.local.test',
+ '.local',
+ ]) {
+ expect(superTabMachineName(name), name);
+ }
+ });
testWidgets(
'a machine is one line; its numbers and age are in its tooltip, and an offline one waits under "Offline · 1"',
(tester) async {
@@ -318,7 +317,7 @@ void main() {
);
testWidgets(
- 'a row never names its owner, even when another machine has the same name; its tooltip does',
+ 'two machines of one model keep their real names, and a row never names its owner; its tooltip does',
(tester) async {
final server = ConversationServer();
final now = DateTime.now().millisecondsSinceEpoch;
@@ -347,7 +346,8 @@ void main() {
),
);
await tester.pumpAndSettle();
- expect(_lineOf(tester, 't'), 'MacBook Pro');
+ // Two MacBook Pros keep their real names, never a model name or an owner.
+ expect(_lineOf(tester, 't'), 'MacBooks-MacBook-Pro-9');
expect(_lineOf(tester, 'd'), 'MacBook Pro');
expect(find.textContaining('tony'), findsNothing);
expect(find.textContaining('dee'), findsNothing);
@@ -355,7 +355,7 @@ void main() {
expect(_tipOf(tester, row), 'Owned by tony');
expect(
tester.getSemantics(row).label,
- startsWith('MacBook Pro, Live, Owned by tony'),
+ startsWith('MacBooks-MacBook-Pro-9, Live, Owned by tony'),
);
semantics.dispose();
await tester.pumpWidget(const SizedBox());
@@ -744,6 +744,19 @@ void main() {
expect(stacked.single, isTrue, reason: reason);
expect(has('super-machine-figure-both-claude'), isTrue);
expect(has('super-machine-figure-both-codex'), isTrue);
+ // The avatars stand 16 px clear of the figures before them.
+ final stackLeft = find
+ .descendant(
+ of: key('super-machine-agents-both'),
+ matching: find.byType(SuperTabAvatar),
+ )
+ .evaluate()
+ .map((e) => tester.getTopLeft(find.byWidget(e.widget)).dx)
+ .reduce(math.min);
+ expect(
+ stackLeft - right('super-machine-figure-both-codex'),
+ greaterThanOrEqualTo(16 - .01),
+ );
// Claude's column comes before Codex's, and the agents after both.
expect(
right('super-machine-figure-both-claude'),
diff --git a/desktop/test/super_tab_sidebar_test.dart b/desktop/test/super_tab_sidebar_test.dart
index 6a7f25b08..767dcb246 100644
--- a/desktop/test/super_tab_sidebar_test.dart
+++ b/desktop/test/super_tab_sidebar_test.dart
@@ -332,11 +332,12 @@ void main() {
.map((e) => (e.widget as RichText).text.toPlainText())
.join();
expect(shared, isNot(contains('tony')), reason: reason);
- if (!shared.startsWith('MacBook Pro')) {
+ // Its real hostname, without .local; cut short, it shows itself whole on hover.
+ if (shared != 'MacBooks-MacBook-Pro-9') {
expect(
find.descendant(
of: find.byKey(const ValueKey('super-machine-mbp-b')),
- matching: find.byTooltip('MacBook Pro'),
+ matching: find.byTooltip('MacBooks-MacBook-Pro-9'),
),
findsOneWidget,
reason: reason,
diff --git a/docs/swarms.md b/docs/swarms.md
index c20508464..440ff35d8 100644
--- a/docs/swarms.md
+++ b/docs/swarms.md
@@ -97,9 +97,10 @@ a report every 15 seconds, so that a silent machine can be told from a quiet one
that fails waits a whole 15 seconds before the next.
Each machine in the sidebar is one line, at a project row's height and on its columns: a
-status dot where the project chevrons sit, the name where project names start, then three
+status dot where the project chevrons sit, the name where project names start (a computer's
+real hostname without `.local`, such as `MacBookPro2021`, or the name a person gave it), then three
columns every row shares, so their figures line up down the list: Claude's allowance, Codex's,
-and the agents. An allowance is the engine's mark and the share left of its tightest window,
+and the agents, whose avatars stand 16 points clear of the figures. An allowance is the engine's mark and the share left of its tightest window,
right-aligned so the % signs line up; only a known, unexpired allowance shows, and a machine
without one, or an offline or unreachable machine, leaves its slot blank. The share is amber
below 20% and red below 10%, and hovering it shows its windows ("5-hour: 48% remaining ·