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
Merge batch 11-03 cb: #2732 (#2765)
0xken15c79d239b21c7
diff --git a/desktop/lib/super_tabs/message_row.dart b/desktop/lib/super_tabs/message_row.dartindex 41d9e35c7..40fc03877 100644--- a/desktop/lib/super_tabs/message_row.dart+++ b/desktop/lib/super_tabs/message_row.dart@@ -19,6 +19,7 @@ import 'message_text.dart';import 'model.dart';import 'pull_requests.dart';import 'reactions.dart';+import 'swarm_type.dart';/// Presentation only. Message identity and reply routing use backend IDs.class SuperTabMessageRow extends StatefulWidget {@@ -273,8 +274,7 @@ class _SuperTabMessageRowState extends State<SuperTabMessageRow> {final taggedYou =widget.readerId.isNotEmpty &&message.mentions.contains(widget.readerId);- final authorStyle = DesktopChrome.text(medium: true)- .copyWith(fontWeight: FontWeight.w600);+ final authorStyle = SwarmType.name(context);// A phone's author is a finger tall, 44 over its 20 px line. The gap// above the row gives up the half that would push the name down and the// avatar moves down with it, so both stay where they were.@@ -407,7 +407,7 @@ class _SuperTabMessageRowState extends State<SuperTabMessageRow> {TimeOfDay.fromDateTime(time.toLocal(),).format(context),- style: DesktopChrome.metadata(),+ style: SwarmType.time(context),),),],diff --git a/desktop/lib/super_tabs/message_text.dart b/desktop/lib/super_tabs/message_text.dartindex d8a4031c6..3c21a0292 100644--- a/desktop/lib/super_tabs/message_text.dart+++ b/desktop/lib/super_tabs/message_text.dart@@ -5,8 +5,8 @@ import 'package:markdown/markdown.dart' as md;import '../core/open_in_browser.dart';import '../shared/theme/app_theme.dart' as grid;import '../widgets/desktop_chrome.dart';-import '../widgets/markdown_style.dart';import 'code_block.dart';+import 'swarm_type.dart';/// Shared content is selectable, never executable. Markdown images are labels,/// not automatic network requests or reads from a collaborator's local disk.@@ -102,7 +102,7 @@ class SuperTabMessageText extends StatelessWidget {),},paddingBuilders: {'a': _CompactLinkLabel()},- styleSheet: desktopMarkdownStyleSheet(context),+ styleSheet: swarmMarkdownStyleSheet(context),onTapLink: (_, href, _) {final number = href?.startsWith('workgroup:') == true? int.tryParse(href!.substring(10))diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dartindex 03ff609e5..73153f42a 100644--- a/desktop/lib/super_tabs/project_sidebar.dart+++ b/desktop/lib/super_tabs/project_sidebar.dart@@ -33,6 +33,7 @@ import 'task_status.dart';import 'workgroup_name.dart';import 'project_github.dart';import '../widgets/laid_out_list.dart';+import 'swarm_type.dart';/// The reader's one Buddy for the whole Swarm, listed first among the projects/// as a channel (Dee, 10-31).@@ -67,8 +68,12 @@ class ProjectSidebar extends StatelessWidget {this.attention,this.activity,this.onOpenBuddyChat,+ this.compact = false,});final SuperTabController controller;++ /// A phone's layout: its rows keep the app's sizes, not Slack desktop's ([SwarmType]).+ final bool compact;final ValueChanged<String> onSelect;final int Function(SuperTabConversation group) needsHuman;final AppNotifier? app;@@ -114,6 +119,16 @@ class ProjectSidebar extends StatelessWidget {static const _iconColumn = SuperTabSectionHeading.actionWidth;static const _rowEnd = 10.0;+ /// A sidebar section's heading, as Slack's "Channels": the row's size, medium and muted. A phone keeps the+ /// heading's own.+ TextStyle? get _headingStyle => compact+ ? null+ : SwarmType.sidebar(+ compact: false,+ color: DesktopChrome.muted,+ medium: true,+ );+Widget _navigationRow({required String key,required String label,@@ -153,9 +168,16 @@ class ProjectSidebar extends StatelessWidget {),Expanded(child: ConstrainedBox(- constraints: const BoxConstraints(minHeight: 36),+ constraints: BoxConstraints(+ minHeight: SwarmType.sidebarRowHeight(compact: compact),+ ),child: Padding(- padding: const EdgeInsets.fromLTRB(0, 8, 12, 8),+ padding: EdgeInsets.fromLTRB(+ 0,+ SwarmType.sidebarRowPadding(compact: compact),+ 12,+ SwarmType.sidebarRowPadding(compact: compact),+ ),child: Text(label,maxLines: 1,@@ -164,7 +186,8 @@ class ProjectSidebar extends StatelessWidget {// conversations are: muted when read, full strength// and bold when not.style:- DesktopChrome.control(+ SwarmType.sidebar(+ compact: compact,medium: selected,color:onTap == null || (unread == false && !selected)@@ -193,7 +216,11 @@ class ProjectSidebar extends StatelessWidget {Widget _channelMark() => Text('#',textAlign: TextAlign.center,- style: DesktopChrome.control(color: DesktopChrome.muted, medium: true),+ style: SwarmType.sidebar(+ compact: compact,+ color: DesktopChrome.muted,+ medium: true,+ ),);void _openBuddyChat(String projectId) => onOpenBuddyChat != null@@ -300,7 +327,8 @@ class ProjectSidebar extends StatelessWidget {// A muted chat stays listed, greyed, never bold (Slack); the open one// keeps its highlight.final muted = controller.notifyOf(group.id) == SuperTabNotify.muted;- final style = DesktopChrome.control(+ final style = SwarmType.sidebar(+ compact: compact,medium: highlighted,color: highlighted || (unread && !muted)? DesktopChrome.foreground@@ -369,12 +397,16 @@ class ProjectSidebar extends StatelessWidget {superTabTaskStatusText(status),].join('\n'),child: ConstrainedBox(- constraints: const BoxConstraints(- minHeight: 36,+ constraints: BoxConstraints(+ minHeight: SwarmType.sidebarRowHeight(+ compact: compact,+ ),),child: Padding(- padding: const EdgeInsets.symmetric(- vertical: 8,+ padding: EdgeInsets.symmetric(+ vertical: SwarmType.sidebarRowPadding(+ compact: compact,+ ),),child: Row(children: [@@ -582,14 +614,17 @@ class ProjectSidebar extends StatelessWidget {const SizedBox(width: _iconColumn),Expanded(child: ConstrainedBox(- constraints: const BoxConstraints(minHeight: 36),+ constraints: BoxConstraints(+ minHeight: SwarmType.sidebarRowHeight(compact: compact),+ ),child: Align(alignment: Alignment.centerLeft,child: Text('Closed (${groups.length})',maxLines: 1,overflow: TextOverflow.ellipsis,- style: DesktopChrome.control(+ style: SwarmType.sidebar(+ compact: compact,color: DesktopChrome.muted,),),@@ -777,14 +812,17 @@ class ProjectSidebar extends StatelessWidget {const SizedBox(width: _iconColumn),Expanded(child: ConstrainedBox(- constraints: const BoxConstraints(minHeight: 36),+ constraints: BoxConstraints(+ minHeight: SwarmType.sidebarRowHeight(compact: compact),+ ),child: Align(alignment: Alignment.centerLeft,child: Text('… $hidden more',maxLines: 1,overflow: TextOverflow.ellipsis,- style: DesktopChrome.control(+ style: SwarmType.sidebar(+ compact: compact,color: DesktopChrome.muted,),),@@ -944,6 +982,7 @@ class ProjectSidebar extends StatelessWidget {SuperTabSectionHeading(key: const ValueKey('project-sidebar-projects'),'Projects',+ titleStyle: _headingStyle,// Slack's unread filter: only chats with something unread.actions: [AppIconButton(@@ -972,6 +1011,7 @@ class ProjectSidebar extends StatelessWidget {if (!controller.oneBuddy) ...[SuperTabSectionHeading('Buddies',+ titleStyle: _headingStyle,onAdd:controller.canWrite &&!controller.saving &&diff --git a/desktop/lib/super_tabs/reply_box.dart b/desktop/lib/super_tabs/reply_box.dartindex a3dc68910..0571a6d54 100644--- a/desktop/lib/super_tabs/reply_box.dart+++ b/desktop/lib/super_tabs/reply_box.dart@@ -12,6 +12,7 @@ import '../widgets/new_harness_paste.dart';import 'composer_files.dart';import 'composer_newline.dart';import 'controller.dart';+import 'swarm_type.dart';/// A thread's reply box, one everywhere a reply is written (the thread pane,/// the Threads view): files dropped, pasted or attached, Enter sends and@@ -135,12 +136,15 @@ class SuperTabReplyBox extends StatelessWidget {maxLength: kComposerMaxLength,inputFormatters: inputFormatters,keyboardType: TextInputType.multiline,- style: DesktopChrome.text(),+ style: SwarmType.composer(context),decoration: InputDecoration(isCollapsed: true,constraints: const BoxConstraints(),hintText: hint,- hintStyle: DesktopChrome.text(color: DesktopChrome.muted),+ hintStyle: SwarmType.composer(+ context,+ color: DesktopChrome.muted,+ ),contentPadding: EdgeInsets.zero,border: InputBorder.none,enabledBorder: InputBorder.none,diff --git a/desktop/lib/super_tabs/section_heading.dart b/desktop/lib/super_tabs/section_heading.dartindex e97a173e9..89a1a7548 100644--- a/desktop/lib/super_tabs/section_heading.dart+++ b/desktop/lib/super_tabs/section_heading.dart@@ -19,9 +19,13 @@ class SuperTabSectionHeading extends StatelessWidget {this.collapsed,this.onToggleCollapsed,this.titleTooltip,+ this.titleStyle,});final String title;++ /// The title's style, where a screen sets its own: the Swarm sidebar's are Slack's ([SwarmType.sidebar]).+ final TextStyle? titleStyle;final VoidCallback? onAdd;final String? addTooltip;@@ -89,9 +93,9 @@ class SuperTabSectionHeading extends StatelessWidget {constraints: const BoxConstraints(minHeight: 32),child: LayoutBuilder(builder: (context, constraints) {- final titleStyle = DesktopChrome.metadata().copyWith(- fontWeight: FontWeight.w600,- );+ final titleStyle =+ this.titleStyle ??+ DesktopChrome.metadata().copyWith(fontWeight: FontWeight.w600);final titleMeasure = TextPainter(text: TextSpan(text: title, style: titleStyle),textDirection: Directionality.of(context),diff --git a/desktop/lib/super_tabs/swarm_type.dart b/desktop/lib/super_tabs/swarm_type.dartnew file mode 100644index 000000000..d27f11fb2--- /dev/null+++ b/desktop/lib/super_tabs/swarm_type.dart@@ -0,0 +1,92 @@+import 'package:flutter/material.dart';+import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';++import '../shared/theme/app_theme.dart' as grid;+import '../widgets/desktop_chrome.dart';+import '../widgets/finger_target.dart';+import '../widgets/markdown_style.dart';++/// The Swarm's text, at Slack desktop's sizes, weights and line heights, in the system font (task #2312, Huy,+/// 2026-11-03). Slack reads a message at 15 px on 22 px lines with its sender in the heaviest weight and the time at+/// 12 px, and lists its sidebar at 15 px on 28 px rows; the app's own defaults (14 px on 1.45, names semibold, a 13 px+/// sidebar) made a Swarm chat read smaller and flatter beside it. Only the Swarm's screens use these: the terminal,+/// Settings and every other screen keep [DesktopChrome]'s.+///+/// A phone's layout (`workspaceIsCompact`) keeps the app's sizes: its rows, composer and finger targets were measured+/// on them (Huy, 2026-11-02), and Slack's numbers are its desktop app's.+abstract final class SwarmType {+ static const double bodySize = 15;+ static const double bodyLine = 22;+ static const double timeSize = 12;+ static const double sidebarSize = 15;+ static const double sidebarRow = 28;++ /// Slack's names are Lato Black; the system font draws its heaviest face for it.+ static const FontWeight nameWeight = FontWeight.w900;++ static TextStyle body(BuildContext context, {Color? color}) =>+ workspaceIsCompact(context)+ ? DesktopChrome.text(color: color)+ : _body(color);++ static TextStyle name(BuildContext context, {Color? color}) =>+ workspaceIsCompact(context)+ ? DesktopChrome.text(+ color: color,+ medium: true,+ ).copyWith(fontWeight: FontWeight.w600)+ : _body(color).copyWith(fontWeight: nameWeight);++ static TextStyle time(BuildContext context, {Color? color}) =>+ DesktopChrome.metadata(color: color).copyWith(fontSize: timeSize);++ static TextStyle composer(BuildContext context, {Color? color}) =>+ body(context, color: color);++ /// A sidebar row's text: 15 px on 22 px lines, as Slack lists its channels; a phone's ([compact]) the app's 13 px.+ static TextStyle sidebar({+ required bool compact,+ Color? color,+ bool medium = false,+ }) => compact+ ? DesktopChrome.control(color: color, medium: medium)+ : DesktopChrome.text(+ color: color,+ size: sidebarSize,+ height: bodyLine / sidebarSize,+ medium: medium,+ ).copyWith(letterSpacing: grid.AppType.trackingFor(sidebarSize));++ /// A sidebar row's least height: 26 px and the 2 px gap under it make Slack's 28 px pitch. A phone keeps 36.+ static double sidebarRowHeight({required bool compact}) =>+ compact ? 36 : sidebarRow - 2;++ /// The room above and below a sidebar row's line.+ static double sidebarRowPadding({required bool compact}) =>+ compact ? 8 : (sidebarRow - 2 - bodyLine) / 2;++ static TextStyle _body(Color? color) => DesktopChrome.text(+ color: color,+ size: bodySize,+ height: bodyLine / bodySize,+ ).copyWith(letterSpacing: grid.AppType.trackingFor(bodySize));+}++/// A Swarm message's markdown: the app's sheet, its prose at [SwarmType.body] and bold at Slack's 700. A phone keeps+/// the app's sheet.+MarkdownStyleSheet swarmMarkdownStyleSheet(BuildContext context) {+ final base = desktopMarkdownStyleSheet(context);+ if (workspaceIsCompact(context)) return base;+ final body = SwarmType.body(context);+ final heading = body.copyWith(fontWeight: FontWeight.w700);+ return base.copyWith(+ p: body,+ listBullet: body,+ blockquote: body.copyWith(color: DesktopChrome.muted),+ strong: const TextStyle(fontWeight: FontWeight.w700),+ h3: heading,+ h4: heading,+ h5: heading,+ h6: heading,+ );+}diff --git a/desktop/lib/super_tabs/thread_panel.dart b/desktop/lib/super_tabs/thread_panel.dartindex 2d504434f..df3f76f1c 100644--- a/desktop/lib/super_tabs/thread_panel.dart+++ b/desktop/lib/super_tabs/thread_panel.dart@@ -18,6 +18,7 @@ import 'jump_to_latest.dart';import 'model.dart';import 'thread_scroll.dart';import '../widgets/laid_out_list.dart';+import 'swarm_type.dart';/// One thread beside the chat (Dee, 2026-10-29): its root, a "N replies"/// divider, the replies, and a composer whose reply goes to the root.@@ -354,10 +355,7 @@ class _SuperTabThreadPanelState extends State<SuperTabThreadPanel> {Expanded(child: Semantics(header: true,- child: Text(- 'Thread',- style: DesktopChrome.text(medium: true),- ),+ child: Text('Thread', style: SwarmType.name(context)),),),AppIconButton(diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex a3d99ed6c..5def2c203 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -69,6 +69,7 @@ import 'switch_pm.dart';import 'task_line.dart';import 'pane_layout.dart';import 'view_room.dart';+import 'swarm_type.dart';import 'visible_tick.dart';import '../widgets/dial_list_scroll.dart';import '../widgets/laid_out_list.dart';@@ -1606,6 +1607,7 @@ class _SuperTabViewState extends State<SuperTabView>Widget _sidebar() => ProjectSidebar(controller: c,+ compact: _phone,app: widget.app,onNewProject: widget.onNewProject,onNewSwarm: widget.onNewSwarm,@@ -4152,14 +4154,15 @@ class _SuperTabViewState extends State<SuperTabView>inputFormatters: [_tagBackspace],keyboardType: TextInputType.multiline,textAlignVertical: TextAlignVertical.center,- style: DesktopChrome.text(),+ style: SwarmType.composer(context),decoration: InputDecoration(// The row centers the line. Inheriting a decorated// field's minimum height leaves slack below its text.isCollapsed: true,constraints: const BoxConstraints(),visualDensity: VisualDensity.standard,- hintStyle: DesktopChrome.text(+ hintStyle: SwarmType.composer(+ context,color: DesktopChrome.muted,),contentPadding: EdgeInsets.zero,diff --git a/desktop/test/super_tab_new_messages_shots_test.dart b/desktop/test/super_tab_new_messages_shots_test.dartindex be9c35693..22177b258 100644--- a/desktop/test/super_tab_new_messages_shots_test.dart+++ b/desktop/test/super_tab_new_messages_shots_test.dart@@ -92,6 +92,8 @@ void main() {await tester.pumpAndSettle();expect(find.byKey(const ValueKey('super-jump-unread')), findsNothing);await shot('read-on');+ // Reading to the end saves the read mark a moment later (controller.dart `_saveSoon`).+ await tester.pump(const Duration(milliseconds: 300));});}}diff --git a/desktop/test/super_tab_typography_shots_test.dart b/desktop/test/super_tab_typography_shots_test.dartnew file mode 100644index 000000000..664c50a1d--- /dev/null+++ b/desktop/test/super_tab_typography_shots_test.dart@@ -0,0 +1,98 @@+import 'dart:io';+import 'dart:ui' as ui;++import 'package:flutter/material.dart';+import 'package:flutter/rendering.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/view.dart';++import 'box_render_preview_test.dart' show loadPreviewFonts;+import 'support/super_tab_fixture.dart';++/// Set to a folder to write the PR's screenshots there: a Swarm chat with a thread open, at Slack desktop's Actual+/// Size on a Retina screen (2x), to lay beside Slack's (task #2312).+final shots = Platform.environment['SUPER_TAB_TYPE_SHOTS'];++const _peer = {'kind': 'person', 'id': 'peer', 'name': '[email protected]'};+const _lead = {'kind': 'agent', 'id': 'lead-agent', 'name': 'Lead'};++void main() {+ setUpAll(() async {+ if (shots != null) await loadPreviewFonts();+ });+ for (final brightness in Brightness.values) {+ testWidgets('screenshots for review (${brightness.name})', (tester) async {+ final picture = GlobalKey();+ final server = ConversationServer()..threads = true;+ (server.state['people'] as List).add({+ 'id': 'peer',+ 'email': '[email protected]',+ 'role': 'collaborator',+ });+ server.append(+ 'Can the Swarm chat read like Slack? Same text size, the names in '+ 'bold and a little more room between lines, so a long thread is easy '+ 'to follow.',+ );+ server.messages.last['author'] = _peer;+ server.append(+ 'Yes: messages at 15 px on 22 px lines, names in the '+ 'heaviest weight, times at 12 px.',+ );+ server.messages.last+ ..['thread'] = 'message-1'+ ..['replyTo'] = 'message-1'+ ..['author'] = _lead;+ server.append(+ 'The sidebar too:\n\n- items at 15 px\n- rows 28 px apart\n\n'+ '**Phones** keep their sizes, and `code` keeps its face.',+ );+ server.messages.last['author'] = _lead;+ server.append('Looks right. Ship it once the screenshots match.');+ server.messages.last['author'] = _peer;+ final c = server.controller();+ addTearDown(c.dispose);+ await c.refresh();+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = Brightness.light);+ await tester.binding.setSurfaceSize(const Size(1400, 820));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: brightness),+ builder: (context, child) =>+ RepaintBoundary(key: picture, child: child),+ home: Scaffold(+ body: SuperTabView(+ controller: c,+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Mac Studio',+ ),+ ),+ ),+ );+ await tester.pumpAndSettle();+ c.openThread('message-1');+ await tester.pumpAndSettle();+ expect(find.text('Thread'), findsOneWidget);+ if (shots != null) {+ await tester.runAsync(() async {+ final boundary =+ picture.currentContext!.findRenderObject()!+ as RenderRepaintBoundary;+ final image = await boundary.toImage(pixelRatio: 2);+ final bytes = await image.toByteData(format: ui.ImageByteFormat.png);+ await Directory(shots!).create(recursive: true);+ await File('$shots/swarm-type-${brightness.name}.png')+ .writeAsBytes(bytes!.buffer.asUint8List());+ image.dispose();+ });+ }+ // Reading to the end saves the read mark a moment later.+ await tester.pump(const Duration(milliseconds: 300));+ });+ }+}diff --git a/desktop/test/super_tab_typography_test.dart b/desktop/test/super_tab_typography_test.dartnew file mode 100644index 000000000..d47048278--- /dev/null+++ b/desktop/test/super_tab_typography_test.dart@@ -0,0 +1,196 @@+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/super_tabs/message_row.dart';+import 'package:harness/super_tabs/project_sidebar.dart';+import 'package:harness/theme/app_theme.dart';+import 'package:harness/widgets/desktop_chrome.dart';+import 'package:harness/widgets/markdown_style.dart';++import 'super_tab_mentions_test.dart' show showView;+import 'support/super_tab_fixture.dart';+import 'support/super_tab_phone.dart';++/// Task #2312 (Huy, 2026-11-03): the Swarm's text at Slack desktop's sizes, weights and line heights, in the system font.++/// The style a [RichText] draws [text] in: its spans' styles, merged from the root down to the span holding it.+TextStyle? styleOf(WidgetTester tester, String text) {+ for (final element in find.byType(RichText).evaluate()) {+ final found = _within(+ (element.widget as RichText).text,+ text,+ const TextStyle(),+ );+ if (found != null) return found;+ }+ return null;+}++TextStyle? _within(InlineSpan span, String text, TextStyle above) {+ final style = above.merge(span.style);+ if (span is TextSpan) {+ if (span.text?.contains(text) ?? false) return style;+ for (final child in span.children ?? const <InlineSpan>[]) {+ final found = _within(child, text, style);+ if (found != null) return found;+ }+ }+ return null;+}++double lineOf(TextStyle style) => style.fontSize! * style.height!;++void main() {+ testWidgets('a message body reads at 15 px on 22 px lines', (tester) async {+ final server = ConversationServer()+ ..append('Shipped the search field. It wraps when the line runs long.');+ await showView(tester, server);+ final body = styleOf(tester, 'Shipped the search field')!;+ expect(body.fontSize, 15);+ expect(lineOf(body), closeTo(22, 0.01));+ expect(body.fontWeight ?? FontWeight.w400, FontWeight.w400);+ });++ testWidgets(+ 'the sender is named at 15 px in the heaviest weight, the time at 12 px',+ (tester) async {+ final server = ConversationServer()..append('Shipped');+ await showView(tester, server);+ final row = find.byType(SuperTabMessageRow);+ final texts = tester+ .widgetList<Text>(+ find.descendant(of: row, matching: find.byType(Text)),+ )+ .toList();+ // The reader's own message: its author reads You.+ final name = texts.firstWhere((t) => t.data == 'You');+ expect(name.style!.fontSize, 15);+ expect(name.style!.fontWeight, FontWeight.w900);+ final time = texts.firstWhere(+ (t) => RegExp(r'^\d{1,2}:\d{2}').hasMatch(t.data ?? ''),+ );+ expect(time.style!.fontSize, 12);+ expect(time.style!.color, DesktopChrome.muted);+ },+ );++ testWidgets('markdown in a message keeps the body size, and code its face', (+ tester,+ ) async {+ final server = ConversationServer()+ ..append(+ '- a listed item\n\n> a quoted line\n\n**bold words** and `the code`',+ );+ await showView(tester, server);+ for (final text in ['a listed item', 'a quoted line', 'bold words']) {+ expect(styleOf(tester, text)!.fontSize, 15, reason: text);+ }+ expect(styleOf(tester, 'bold words')!.fontWeight, FontWeight.w700);+ expect(styleOf(tester, 'the code')!.fontFamily, AppFonts.mono);+ });++ testWidgets('other screens\' markdown keeps its size', (tester) async {+ TextStyle? body;+ await tester.pumpWidget(+ MaterialApp(+ home: Builder(+ builder: (context) {+ body = desktopMarkdownStyleSheet(context).p;+ return const SizedBox();+ },+ ),+ ),+ );+ expect(body!.fontSize, 14);+ });++ testWidgets('the thread view heads at 15 px in the heaviest weight, and its '+ 'replies read as the chat does', (tester) async {+ final server = ConversationServer()..threads = true;+ server.append('Should we do thread replies?');+ server.append('Yes, like Slack.');+ server.messages.last+ ..['thread'] = 'message-1'+ ..['replyTo'] = 'message-1';+ final c = await showView(tester, server);+ c.openThread('message-1');+ await tester.pumpAndSettle();+ final header = tester.widget<Text>(find.text('Thread'));+ expect(header.style!.fontSize, 15);+ expect(header.style!.fontWeight, FontWeight.w900);+ final reply = styleOf(tester, 'Yes, like Slack.')!;+ expect(reply.fontSize, 15);+ expect(lineOf(reply), closeTo(22, 0.01));+ });++ testWidgets('the composer writes at 15 px on 22 px lines', (tester) async {+ await showView(tester, ConversationServer());+ final field = tester.widget<EditableText>(+ find.descendant(+ of: find.byKey(const ValueKey('super-message-composer')),+ matching: find.byType(EditableText),+ ),+ );+ expect(field.style.fontSize, 15);+ expect(lineOf(field.style), closeTo(22, 0.01));+ });++ testWidgets('sidebar items read at 15 px on rows 28 px apart', (+ tester,+ ) async {+ await showView(tester, ConversationServer());+ final side = find.byType(ProjectSidebar);+ final project = find.byKey(const ValueKey('super-group-lead'));+ final name = tester.widget<Text>(+ find.descendant(of: project, matching: find.text('Pilot')),+ );+ expect(name.style!.fontSize, 15);+ expect(lineOf(name.style!), closeTo(22, 0.01));+ // A 26 px row and its 2 px gap: Slack's 28 px pitch.+ expect(tester.getSize(project).height, 26);+ final activity = tester.widget<Text>(+ find.descendant(of: side, matching: find.text('Activity')),+ );+ expect(activity.style!.fontSize, 15);+ expect(+ tester.getSize(find.byKey(const ValueKey('super-activity'))).height,+ 26,+ );+ final heading = tester.widget<Text>(+ find.descendant(of: side, matching: find.text('Projects')),+ );+ expect(heading.style!.fontSize, 15);+ });++ testWidgets('a phone keeps the app\'s sizes, which its finger rows were '+ 'measured on', (tester) async {+ final (_, controller) = await mountPhoneSuperTab(+ tester,+ const Size(390, 844),+ seed: (server) => server.append('Shipped the search field'),+ );+ expect(styleOf(tester, 'Shipped the search field')!.fontSize, 14);+ await unmountPhoneSuperTab(tester, controller);+ });++ testWidgets('a phone\'s sidebar keeps the app\'s 13 px on 36 px rows', (+ tester,+ ) async {+ final (_, controller) = await mountPhoneSuperTab(+ tester,+ const Size(390, 844),+ );+ await tester.tap(find.byTooltip('Conversations'));+ await tester.pumpAndSettle();+ final project = find.byKey(const ValueKey('super-group-lead'));+ final name = tester.widget<Text>(+ find.descendant(of: project, matching: find.text('Pilot')),+ );+ expect(name.style!.fontSize, 13);+ expect(tester.getSize(project).height, 36);+ expect(+ tester.getSize(find.byKey(const ValueKey('super-activity'))).height,+ 36,+ );+ await unmountPhoneSuperTab(tester, controller);+ });+}diff --git a/docs/plans/2026-11-03-swarm-slack-typography-plan.md b/docs/plans/2026-11-03-swarm-slack-typography-plan.mdnew file mode 100644index 000000000..bf6d25ea3--- /dev/null+++ b/docs/plans/2026-11-03-swarm-slack-typography-plan.md@@ -0,0 +1,125 @@+# Swarm Text Matches Slack Desktop Implementation Plan++> **How this is worked:** by the project's instructions, task by task, each failing test committed before its code.++**Goal:** The Swarm screens (chat messages, sender names and times, sidebar, composer, thread view) use Slack desktop's+text sizes, weights and line heights, in the system font, on Desktop and on the web build.++**Architecture:** One set of Swarm text tokens, `SwarmType` in `desktop/lib/super_tabs/swarm_type.dart`, holds Slack's+numbers. The Swarm widgets that draw these texts take their styles from it instead of the app-wide `DesktopChrome`+defaults (14 px on 1.45, names 14 px semibold, sidebar 13 px on 36 px rows). Message bodies get a Swarm markdown sheet+built on `desktopMarkdownStyleSheet`, so other screens' markdown is unchanged. The web app is the same Flutter code+(`lib/web`), so it changes with Desktop. A phone layout (`workspaceIsCompact`) keeps its 44 px finger targets.++**Tech Stack:** Flutter 3.47.2, flutter_test render tests.++**Spec:** Task #2312 (Huy), brief by the PM, 2026-11-03.++## Slack's numbers++To be measured from Huy's Slack desktop screenshots at Actual Size (asked in the task's thread). Until then these are the+values Slack's own web client sets, which the desktop app renders. The measurement replaces any that differ, before+Ready.++| Text | Size | Line | Weight |+|---|---|---|---|+| Message body | 15 px | 22 px | regular (400) |+| Sender name | 15 px | 22 px | black (900; the system font draws its heaviest) |+| Time beside the name | 12 px | 22 px line of the name | regular, muted |+| Sidebar item | 15 px | 28 px row | regular; unread bold (700) |+| Sidebar section heading | 15 px | 28 px row | medium (500), muted |+| Composer | 15 px | 22 px | regular |+| Thread view header | 15 px | 22 px | black (900) |++## Global Constraints++- The PR body starts with: `Requested by [email protected] through Harness.`+- Harness design language; the font family stays the system font unless Dee asks for Lato before the build starts.+- Swarm screens only: terminal, settings and other screens keep their styles (`DesktopChrome` and the shared markdown+ sheet are not changed).+- Keyboard focus and hit targets stay: no row gets shorter than its pointer target, and phone rows keep 44 px.+- Huy's look is the merge gate; side-by-side screenshots in the PR.+- Desktop tests use a memory store and a fake sign-in; nothing signs this Mac out of the real CLI.++## Review Focus++1. A long message wraps on 22 px lines with no clipped descenders: the line height is set on the text, not on a fixed+ box. (Task 1 test: a two-line body is 44 px tall.)+2. Markdown inside a message (lists, quotes, bold, links) uses the same 15/22 body, and inline code keeps the mono face.+ (Task 1 test.)+3. The sidebar's unread row stays bold and its selected row stays medium at the new size. (Task 2 test.)+4. The other screens that share `DesktopChrome.text` and `desktopMarkdownStyleSheet` (Finder's markdown view) are+ unchanged. (Task 1 test.)+5. Sidebar rows at 28 px on a pointer layout stay focusable and clickable over their whole width; a phone layout keeps+ 44 px. (Task 2 test.)++## Design++- **Growth, concurrency, read cost, migration, audience, identity:** N/A because this stores, syncs and exposes no data:+ it changes text styles only.+- **Scale:** N/A because style constants cost nothing per message.+- **Compatibility:** N/A because no data or protocol changes; old and new clients only look different.+- **Rollback:** reverting the PR restores the old styles.+- **Failure:** N/A because nothing can fail at run time.+- **Platforms:** macOS, Windows and Linux Desktop and the web build share the code; phones keep their finger sizes.++---++### Task 1: Message text, names, times and the composer++**Files:**+- Create: `desktop/lib/super_tabs/swarm_type.dart`+- Modify: `desktop/lib/super_tabs/message_row.dart`, `desktop/lib/super_tabs/message_text.dart`,+ `desktop/lib/super_tabs/reply_box.dart`, `desktop/lib/super_tabs/thread_panel.dart`+- Test: `desktop/test/super_tab_typography_test.dart`++**Interfaces:**+- Produces: `abstract final class SwarmType` with `static const double bodySize = 15, bodyLine = 22, timeSize = 12,+ sidebarSize = 15, sidebarRow = 28` and `static TextStyle body({Color? color})`, `name({Color? color})`,+ `time({Color? color})`, `sidebar({Color? color, FontWeight? weight})`, `composer({Color? color})`;+ `MarkdownStyleSheet swarmMarkdownStyleSheet(BuildContext context)`.++- [ ] **Step 1: Write the failing tests** in `super_tab_typography_test.dart`, pumping a `SuperTabMessageRow` and a reply+ box from the existing test fixtures:+ - `it reads a message body at 15 px on 22 px lines`: the body's `RichText` style has `fontSize == 15` and+ `height * fontSize == 22`; a body of two lines in a narrow box renders 44 px tall.+ - `it names the sender at 15 px in the heaviest weight, and the time at 12 px`: name `fontSize 15`, `fontWeight w900`;+ time `fontSize 12`, muted colour.+ - `it writes in the composer at 15 px on 22 px lines`, hint included.+ - `it keeps markdown in the body at 15 px and code in the mono face`: a list item, a quote and bold at 15 px; inline+ code's family is `AppFonts.mono`.+ - `it leaves other screens' markdown as it was`: `desktopMarkdownStyleSheet(context).p!.fontSize == 14`.+ - `it heads the thread view at 15 px in the heaviest weight`.+- [ ] **Step 2: Run them and watch them fail:** `flutter test test/super_tab_typography_test.dart` (sizes are 14).+- [ ] **Step 3: Add `SwarmType` and `swarmMarkdownStyleSheet`; use them** for the body, name, time, composer and thread+ header.+- [ ] **Step 4: Run them and see them pass**, with the Swarm widget tests:+ `flutter test test/super_tab_typography_test.dart test/super_tab*_test.dart`.+- [ ] **Step 5: Commit** the tests first, then the code.++### Task 2: The sidebar++**Files:**+- Modify: `desktop/lib/super_tabs/project_sidebar.dart`+- Test: `desktop/test/super_tab_typography_test.dart`++**Interfaces:**+- Consumes: `SwarmType.sidebar`, `SwarmType.sidebarRow` (Task 1).++- [ ] **Step 1: Write the failing tests:**+ - `it draws sidebar items at 15 px on 28 px rows`: an item's text `fontSize 15`; its row 28 px tall on a pointer layout.+ - `it keeps an unread item bold and a selected one medium`.+ - `it keeps a phone's sidebar rows a finger tall`: 44 px under a compact layout.+- [ ] **Step 2: Run them and watch them fail.**+- [ ] **Step 3: Use `SwarmType.sidebar` and the 28 px row** in the item and section-heading rows.+- [ ] **Step 4: Run them and the Swarm widget tests and see them pass.**+- [ ] **Step 5: Commit** the tests first, then the code.++### Task 3: Measure Slack and show the result side by side++- [ ] Measure Huy's Slack screenshots (text cap height, row pitch, weight) and correct the table above and `SwarmType`+ where they differ, with the tests' numbers.+- [ ] Render the Swarm chat, sidebar and thread at Slack's zoom in the system font (a screenshot test run locally with+ macOS's own font loaded; not committed as a golden, since CI's fonts differ) and put each beside Slack's in the PR.+- [ ] `flutter analyze` and the Desktop test suite; red/green evidence in a PR comment; mark Ready; a Team-account+ Reviewer by Routing.diff --git a/docs/plans/assets/swarm-slack-typography/after-dark.png b/docs/plans/assets/swarm-slack-typography/after-dark.pngnew file mode 100644index 000000000..5a836b37cBinary files /dev/null and b/docs/plans/assets/swarm-slack-typography/after-dark.png differdiff --git a/docs/plans/assets/swarm-slack-typography/after-light.png b/docs/plans/assets/swarm-slack-typography/after-light.pngnew file mode 100644index 000000000..ef050cd63Binary files /dev/null and b/docs/plans/assets/swarm-slack-typography/after-light.png differdiff --git a/docs/plans/assets/swarm-slack-typography/before-light.png b/docs/plans/assets/swarm-slack-typography/before-light.pngnew file mode 100644index 000000000..5699811efBinary files /dev/null and b/docs/plans/assets/swarm-slack-typography/before-light.png differdiff --git a/scripts/ui-style-allowlist/desktop.json b/scripts/ui-style-allowlist/desktop.jsonindex 9a3e4710c..8902e743e 100644--- a/scripts/ui-style-allowlist/desktop.json+++ b/scripts/ui-style-allowlist/desktop.json@@ -45,7 +45,7 @@"font-size": 1},"desktop/lib/super_tabs/project_sidebar.dart": {- "edge-insets": 9+ "edge-insets": 8},"desktop/lib/super_tabs/pull_requests.dart": {"edge-insets": 12,