The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Swarm chat: 36-point rounded-square avatars and roomier spacing, like Slack (Huy) (#2791)
0xken15f4cf02179231
diff --git a/desktop/design/desktop-design-system.md b/desktop/design/desktop-design-system.mdindex af1a1f37c..5f5ac802f 100644--- a/desktop/design/desktop-design-system.md+++ b/desktop/design/desktop-design-system.md@@ -244,6 +244,8 @@ dots remain solid at their intended size; color is accompanied by status text.| Standard / compact control minimum height | 32 / 28 || Standard field minimum height | 36 || Inline icon / search identity mark | 16 / 28 |+| Chat and thread message avatar (rounded square) / corner | 36 / 8 |+| Above a new sender in the chat / above its name | 16 / 8 (group / control gap) || Small form / destination chooser width | 460 || Creation composer maximum width | 680 || Search maximum width / height | 1120 / 680 |diff --git a/desktop/lib/shared/theme/app_theme.dart b/desktop/lib/shared/theme/app_theme.dartindex d42166e7e..eb34a26e6 100644--- a/desktop/lib/shared/theme/app_theme.dart+++ b/desktop/lib/shared/theme/app_theme.dart@@ -1492,6 +1492,11 @@ abstract final class AppDesktop {static const double menuInset = 6;static const double iconSize = 16;static const double identitySize = 28;++ /// A chat or thread message's avatar: a rounded square, as Slack draws one+ /// (Huy, 2026-11-03). Avatars elsewhere stay round.+ static const double messageAvatarSize = 36;+ static const double messageAvatarRadius = 8;static const double formWidth = 460;static const double focusWidth = 1.5;diff --git a/desktop/lib/super_tabs/avatar_art.dart b/desktop/lib/super_tabs/avatar_art.dartindex c4cdb9320..822fafd01 100644--- a/desktop/lib/super_tabs/avatar_art.dart+++ b/desktop/lib/super_tabs/avatar_art.dart@@ -44,8 +44,9 @@ Color _tone(BuildContext context, double hue) => HSLColor.fromAHSL();}-/// The round face inside an avatar: [picture] when there is one, else the-/// agent pattern when [pattern] is set, else the name's initial.+/// The face inside an avatar: [picture] when there is one, else the agent+/// pattern when [pattern] is set, else the name's initial. Round, or a rounded+/// square with [radius] corners.class SuperTabAvatarFace extends StatelessWidget {const SuperTabAvatarFace({super.key,@@ -54,16 +55,18 @@ class SuperTabAvatarFace extends StatelessWidget {required this.size,this.picture,this.pattern = false,+ this.radius,});final String identity, name;final double size;final SuperTabAvatarPicture? picture;final bool pattern;+ final double? radius;@overrideWidget build(BuildContext context) => switch (picture) {- SuperTabUploadedAvatar(:final url) => ClipOval(- child: Image.network(+ SuperTabUploadedAvatar(:final url) => _clip(+ Image.network(url.toString(),width: size,height: size,@@ -82,6 +85,14 @@ class SuperTabAvatarFace extends StatelessWidget {null => _fallback(context),};+ Widget _clip(Widget child) => switch (radius) {+ final radius? => ClipRRect(+ borderRadius: BorderRadius.circular(radius),+ child: child,+ ),+ null => ClipOval(child: child),+ };+Widget _fallback(BuildContext context) =>pattern ? _pattern(context) : _initial(context);@@ -91,7 +102,11 @@ class SuperTabAvatarFace extends StatelessWidget {alignment: Alignment.center,decoration: BoxDecoration(color: (color ?? _tone(context, _hue(identity))).withValues(alpha: .14),- shape: BoxShape.circle,+ shape: radius == null ? BoxShape.circle : BoxShape.rectangle,+ borderRadius: switch (radius) {+ final radius? => BorderRadius.circular(radius),+ null => null,+ },),child: child,);diff --git a/desktop/lib/super_tabs/identity.dart b/desktop/lib/super_tabs/identity.dartindex c8379c3e7..b0eb11e90 100644--- a/desktop/lib/super_tabs/identity.dart+++ b/desktop/lib/super_tabs/identity.dart@@ -22,6 +22,7 @@ class SuperTabAvatar extends StatelessWidget {this.status,this.pattern = false,this.now,+ this.radius,});SuperTabAvatar.person(@@ -29,6 +30,7 @@ class SuperTabAvatar extends StatelessWidget {super.key,this.size = 30,this.now,+ this.radius,}) : identity = 'person:${person.id}',name = person.username,picture = person.avatar,@@ -44,6 +46,7 @@ class SuperTabAvatar extends StatelessWidget {String? name,this.size = 30,bool engineBadge = true,+ this.radius,}) : identity = 'agent:${agent.id}',name = name ?? agent.displayName ?? agent.name,picture = agent.avatar,@@ -72,6 +75,9 @@ class SuperTabAvatar extends StatelessWidget {/// Draw the agent pattern rather than an initial when there is no picture.final bool pattern;+ /// The corner of a rounded-square face, as a message's; round when null.+ final double? radius;+@overrideWidget build(BuildContext context) {final badge = size * .46;@@ -81,6 +87,7 @@ class SuperTabAvatar extends StatelessWidget {size: size,picture: picture,pattern: pattern,+ radius: radius,);return SuperTabUntil(until: now == null ? status?.until : null,diff --git a/desktop/lib/super_tabs/message_row.dart b/desktop/lib/super_tabs/message_row.dartindex 0ee736fe7..33e8213dd 100644--- a/desktop/lib/super_tabs/message_row.dart+++ b/desktop/lib/super_tabs/message_row.dart@@ -138,10 +138,13 @@ class SuperTabMessageRow extends StatefulWidget {// Routing notes share the message body column, including grouped messages.static const horizontalInset = 24.0;- static const avatarSize = 28.0;+ static const avatarSize = grid.AppDesktop.messageAvatarSize;static const avatarGap = 12.0;static const bodyInset = horizontalInset + avatarSize + avatarGap;+ /// Above and below a grouped line, and below a sender's last line.+ static const rowPad = 6.0;+/// Compact only a few short updates. Reports and long runs retain their own/// speaker identity, so scrolling through agent output does not lose the who.static Set<String> consecutiveUpdates(List<SuperTabMessage> messages) {@@ -242,16 +245,18 @@ class _SuperTabMessageRowState extends State<SuperTabMessageRow> {Widget _avatar(SuperTabMessage message) {const size = SuperTabMessageRow.avatarSize;+ const radius = grid.AppDesktop.messageAvatarRadius;if (widget.agent case final agent?) {return SuperTabAvatar.agent(agent,name: widget.author,size: size,engineBadge: false,+ radius: radius,);}if (widget.person case final person? when !message.fromAgent) {- return SuperTabAvatar.person(person, size: size);+ return SuperTabAvatar.person(person, size: size, radius: radius);}// Someone no longer in the Swarm keeps the face their recorded name gives.return SuperTabAvatar(@@ -261,6 +266,7 @@ class _SuperTabMessageRowState extends State<SuperTabMessageRow> {: superTabPersonName(message.authorName),size: size,pattern: message.fromAgent,+ radius: radius,);}@@ -281,8 +287,15 @@ class _SuperTabMessageRowState extends State<SuperTabMessageRow> {final phone = workspaceIsCompact(context);final finger = phone && !widget.grouped;final slack = finger ? 12.0 : 0.0;+ // A new sender starts a group gap down, and its name a control gap below+ // that, as Slack spaces its senders (Huy, 2026-11-03). A grouped follow-up+ // line keeps its tight spacing.+ final above = widget.grouped ? 0.0 : grid.AppDesktop.groupGap - slack;+ final headerTop = widget.grouped+ ? SuperTabMessageRow.rowPad+ : grid.AppDesktop.controlGap;return Padding(- padding: EdgeInsets.only(top: widget.grouped ? 0 : 12 - slack),+ padding: EdgeInsets.only(top: above),child: MouseRegion(onEnter: (_) => setState(() => _hovered = true),onExit: (_) => setState(() => _hovered = false),@@ -338,9 +351,11 @@ class _SuperTabMessageRowState extends State<SuperTabMessageRow> {child: Stack(children: [Padding(- padding: const EdgeInsets.symmetric(- horizontal: SuperTabMessageRow.horizontalInset,- vertical: 6,+ padding: EdgeInsets.only(+ left: SuperTabMessageRow.horizontalInset,+ right: SuperTabMessageRow.horizontalInset,+ top: headerTop,+ bottom: SuperTabMessageRow.rowPad,),child: Row(crossAxisAlignment: CrossAxisAlignment.start,diff --git a/desktop/test/super_tab_message_avatar_test.dart b/desktop/test/super_tab_message_avatar_test.dartnew file mode 100644index 000000000..7923d3447--- /dev/null+++ b/desktop/test/super_tab_message_avatar_test.dart@@ -0,0 +1,129 @@+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/identity.dart';+import 'package:harness/super_tabs/message_row.dart';+import 'package:harness/super_tabs/model.dart';++/// Huy (11-03): the chat and the thread draw avatars as Slack does, 36 px+/// rounded squares, with more room above each new sender.+SuperTabMessage _message(String id) => SuperTabMessage.fromJson({+ 'id': id,+ 'conversationId': 'lead',+ 'text': 'Shipped the fix',+ 'sequence': 1,+ 'author': {'kind': 'person', 'id': 'peer', 'name': '[email protected]'},+});++Widget _row(SuperTabMessage message, {bool grouped = false}) =>+ SuperTabMessageRow(+ message: message,+ author: 'ivy',+ receipts: const [],+ onReturnToComposer: () {},+ readerId: 'owner',+ grouped: grouped,+ );++Future<void> _show(WidgetTester tester, List<Widget> rows) => tester.pumpWidget(+ MaterialApp(+ home: Scaffold(+ body: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: rows,+ ),+ ),+ ),+);++/// The face's rounded-square fill: no circle, an 8-point corner.+bool _roundedSquare(Widget w) =>+ w is Container &&+ w.decoration is BoxDecoration &&+ (w.decoration! as BoxDecoration).shape == BoxShape.rectangle &&+ (w.decoration! as BoxDecoration).borderRadius == BorderRadius.circular(8);++void main() {+ testWidgets('a message avatar is a 36-point rounded square', (tester) async {+ await _show(tester, [_row(_message('m1'))]);+ final avatar = find.byType(SuperTabAvatar);+ expect(tester.getSize(avatar), const Size.square(36));+ expect(+ find.descendant(+ of: avatar,+ matching: find.byWidgetPredicate(_roundedSquare),+ ),+ findsOneWidget,+ );+ });++ testWidgets('a message photo is clipped to the same rounded square', (+ tester,+ ) async {+ await _show(tester, [+ SuperTabMessageRow(+ message: _message('m1'),+ author: 'ivy',+ receipts: const [],+ onReturnToComposer: () {},+ readerId: 'owner',+ person: SuperTabPerson.fromJson({+ 'id': 'peer',+ 'email': '[email protected]',+ 'role': 'collaborator',+ 'avatar': {+ 'kind': 'upload',+ 'url': 'https://storage.googleapis.com/avatars/ivy.png',+ },+ }),+ ),+ ]);+ final avatar = find.byType(SuperTabAvatar);+ expect(+ find.descendant(of: avatar, matching: find.byType(ClipOval)),+ findsNothing,+ );+ final clip = tester.widget<ClipRRect>(+ find.descendant(of: avatar, matching: find.byType(ClipRRect)),+ );+ expect(clip.borderRadius, BorderRadius.circular(8));+ });++ testWidgets('avatars outside messages stay round', (tester) async {+ await tester.pumpWidget(+ const MaterialApp(+ home: SuperTabAvatar(identity: 'person:peer', name: 'ivy'),+ ),+ );+ final fill = tester.widget<Container>(+ find.descendant(+ of: find.byType(SuperTabAvatar),+ matching: find.byWidgetPredicate(+ (w) => w is Container && w.decoration is BoxDecoration,+ ),+ ),+ );+ expect((fill.decoration! as BoxDecoration).shape, BoxShape.circle);+ });++ testWidgets('a new sender starts a group gap and a control gap down', (+ tester,+ ) async {+ await _show(tester, [_row(_message('m1'))]);+ final rowTop = tester.getTopLeft(find.byType(SuperTabMessageRow)).dy;+ final avatarTop = tester.getTopLeft(find.byType(SuperTabAvatar)).dy;+ expect(+ avatarTop - rowTop,+ grid.AppDesktop.groupGap + grid.AppDesktop.controlGap,+ );+ });++ testWidgets('a grouped follow-up line keeps today\'s tight spacing', (+ tester,+ ) async {+ await _show(tester, [_row(_message('m2'), grouped: true)]);+ final rowTop = tester.getTopLeft(find.byType(SuperTabMessageRow)).dy;+ final textTop = tester.getTopLeft(find.text('Shipped the fix')).dy;+ expect(textTop - rowTop, 6);+ });+}diff --git a/desktop/test/super_tab_native_messages_test.dart b/desktop/test/super_tab_native_messages_test.dartindex 6de9f2aeb..717c077b2 100644--- a/desktop/test/super_tab_native_messages_test.dart+++ b/desktop/test/super_tab_native_messages_test.dart@@ -6,6 +6,7 @@ import 'package:flutter/rendering.dart';import 'package:flutter/services.dart';import 'package:flutter_test/flutter_test.dart';import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/message_row.dart';import 'package:harness/super_tabs/view.dart';import 'support/super_tab_fixture.dart';@@ -202,8 +203,22 @@ void main() {final source = find.text('Terminal input · session opened by [email protected]',);+ // The first of the chat's messages: with Slack's spacing (Huy,+ // 2026-11-03) it is above what the chat builds at this window size.+ await tester.scrollUntilVisible(+ source,+ -100,+ scrollable: find+ .ancestor(+ of: find.byType(SuperTabMessageRow).last,+ matching: find.byType(Scrollable),+ )+ .first,+ );expect(source, findsOneWidget);- await tester.ensureVisible(source);+ await tester.ensureVisible(+ find.ancestor(of: source, matching: find.byType(SuperTabMessageRow)),+ );await tester.pumpAndSettle();expect(tester.takeException(), isNull);if (capture != null) {diff --git a/scripts/ui-style-allowlist/desktop.json b/scripts/ui-style-allowlist/desktop.jsonindex 8902e743e..e5c86f4e5 100644--- a/scripts/ui-style-allowlist/desktop.json+++ b/scripts/ui-style-allowlist/desktop.json@@ -36,7 +36,7 @@"border-radius": 1},"desktop/lib/super_tabs/message_row.dart": {- "edge-insets": 5+ "edge-insets": 4},"desktop/lib/super_tabs/notifications.dart": {"edge-insets": 8