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 sidebar in Slack's order: # product-managers among the projects, direct messages below (#1792)
0xken15a396c8a88853
diff --git a/desktop/lib/super_tabs/pm_chat_rows.dart b/desktop/lib/super_tabs/pm_chat_rows.dartindex d9e6b6012..bcffeafa8 100644--- a/desktop/lib/super_tabs/pm_chat_rows.dart+++ b/desktop/lib/super_tabs/pm_chat_rows.dart@@ -50,8 +50,8 @@ class SuperTabPmUnread extends StatelessWidget {}/// A person's Chat with PM as a direct message: the Product Manager's avatar-/// and name, like a chat app's direct messages, with the project named after-/// it when the Swarm has several.+/// and name, like a chat app's direct messages, with the project in brackets+/// after it when the Swarm has several: "Finn (web-2)".class SuperTabPmChatRow extends StatelessWidget {const SuperTabPmChatRow({super.key,@@ -138,7 +138,7 @@ class SuperTabPmChatRow extends StatelessWidget {const SizedBox(width: 8),Flexible(child: Text(- project,+ '($project)',maxLines: 1,overflow: TextOverflow.ellipsis,style: DesktopChrome.metadata(),diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dartindex 25f1249b1..89a6269d5 100644--- a/desktop/lib/super_tabs/project_sidebar.dart+++ b/desktop/lib/super_tabs/project_sidebar.dart@@ -18,6 +18,17 @@ import 'pm_chat_rows.dart';import 'section_heading.dart';import 'workgroup_name.dart';+/// The Swarm's Product Managers' conversation, listed as a channel among the projects.+const kProductManagersChannel = 'product-managers';++/// A project's Product Manager by name, as its Chat with PM is listed.+String pmChatName(SuperTabSnapshot snapshot, SuperTabProject project) {+ final pmId = snapshot.conversation(project.leadConversationId)?.leadId;+ return pmId == null+ ? 'Product Manager'+ : snapshot.agentName(pmId, fallback: 'Product Manager');+}+class ProjectSidebar extends StatelessWidget {const ProjectSidebar({super.key,@@ -134,7 +145,7 @@ class ProjectSidebar extends StatelessWidget {),);- /// A project reads as a channel: "# openharness".+ /// A project, or the Product Managers' conversation, reads as a channel: "# openharness".Widget _channelMark() => Text('#',textAlign: TextAlign.center,@@ -150,7 +161,6 @@ class ProjectSidebar extends StatelessWidget {SuperTabConversation group, {SuperTabProject? project,String? label,- IconData? icon,String? key,}) {final selected =@@ -195,15 +205,7 @@ class ProjectSidebar extends StatelessWidget {SizedBox(width: SuperTabSectionHeading.indentFor(0)),SizedBox(width: _iconColumn,- child: project != null- ? _channelMark()- : icon == null- ? null- : Icon(- icon,- size: AppIcons.inlineSize,- color: DesktopChrome.muted,- ),+ child: project != null || label != null ? _channelMark() : null,),Expanded(child: Semantics(@@ -394,8 +396,8 @@ class ProjectSidebar extends StatelessWidget {}/// The signed-in person's private chat with each project's Product- /// Manager, as direct messages pinned above the projects so a collapsed- /// project never hides them; the first click opens one.+ /// Manager, as direct messages below the projects so a collapsed project+ /// never hides them; the first click opens one.List<Widget> _pmChats(List<SuperTabProject> projects) => [for (final project in projects)?_pmChat(project, named: projects.length > 1),@@ -409,9 +411,7 @@ class ProjectSidebar extends StatelessWidget {return SuperTabPmChatRow(key: ValueKey('super-pm-chat-${project.id}'),agentId: pmId,- name: pmId == null- ? 'Product Manager'- : snapshot.agentName(pmId, fallback: 'Product Manager'),+ name: pmChatName(snapshot, project),project: named ? project.name : null,selected:chat != null &&@@ -458,6 +458,29 @@ class ProjectSidebar extends StatelessWidget {: [for (final group in groups) _row(group)];}+ /// Every project with its workgroups, and the Product Managers'+ /// conversation, which every person in the Swarm reads, by name from A to Z.+ List<(String, Widget)> _channels(SuperTabSnapshot? snapshot) => [+ if (snapshot?.conversation(snapshot.leadsConversationId ?? '')+ case final leads?)+ (kProductManagersChannel, _row(leads, label: kProductManagersChannel)),+ for (final project in snapshot?.projects ?? const <SuperTabProject>[])+ if (snapshot?.conversation(project.leadConversationId) case final lead?)+ (+ project.name,+ Column(+ mainAxisSize: MainAxisSize.min,+ children: [+ _row(lead, project: project),+ if (controller.expandedProjects.contains(project.id)) ...[+ ..._workgroups(project),+ ..._closed(project),+ ],+ ],+ ),+ ),+ ]..sort((a, b) => a.$1.toLowerCase().compareTo(b.$1.toLowerCase()));+@overrideWidget build(BuildContext context) {final snapshot = controller.snapshot;@@ -467,15 +490,6 @@ class ProjectSidebar extends StatelessWidget {child: ListView(padding: const EdgeInsets.all(8),children: [- if (pmChats.isNotEmpty) ...[- SuperTabSectionHeading(- 'Direct messages',- endInset: 0,- startInset: SuperTabSectionHeading.indentFor(0),- ),- ...pmChats,- const SizedBox(height: 16),- ],if (onNewProject != null)_navigationRow(key: 'super-new-project',@@ -518,12 +532,6 @@ class ProjectSidebar extends StatelessWidget {controller.isOwner ||snapshot?.localModels?.enabled == true)const SizedBox(height: 20),- // Every person in the Swarm reads where the Product Managers talk.- if (snapshot?.conversation(snapshot.leadsConversationId ?? '')- case final leads?) ...[- _row(leads, label: 'Product Managers', icon: AppIcons.users),- const SizedBox(height: 16),- ],SuperTabSectionHeading('Projects',onAdd: controller.canWrite ? onNewProject : null,@@ -533,21 +541,17 @@ class ProjectSidebar extends StatelessWidget {onToggleCollapsed: controller.toggleProjectsGroup,),if (controller.projectsGroupOpen)- for (final project- in snapshot?.projects ?? const <SuperTabProject>[])- if (snapshot?.conversation(project.leadConversationId)- case final lead?)- Column(- mainAxisSize: MainAxisSize.min,- children: [- _row(lead, project: project),- if (controller.expandedProjects.contains(project.id)) ...[- ..._workgroups(project),- ..._closed(project),- ],- ],- ),+ for (final (_, channel) in _channels(snapshot)) channel,const SizedBox(height: 16),+ if (pmChats.isNotEmpty) ...[+ SuperTabSectionHeading(+ 'Direct messages',+ endInset: 0,+ startInset: SuperTabSectionHeading.indentFor(0),+ ),+ ...pmChats,+ const SizedBox(height: 16),+ ],// Machine online/offline, unread marks and theme changes do not touch// the controller the rest of this sidebar rebuilds on, so this group// watches them itself — the same sources the roster merged before thediff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex 48420328a..ba781082b 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -925,8 +925,9 @@ class _SuperTabViewState extends State<SuperTabView>bool _isPmChat(SuperTabConversation group) =>c.pmChat(group.projectId)?.id == group.id;- /// The open conversation's name, or what the pane shows instead of one. A- /// workgroup's is named as the sidebar names it ([SuperTabWorkgroupName]).+ /// The open conversation's name, or what the pane shows instead of one,+ /// named as the sidebar names it: "# openharness", or a workgroup's+ /// [SuperTabWorkgroupName].Widget _title(SuperTabConversation? group) {final style = DesktopChrome.text(medium: true);final name = _devicesVisible@@ -938,9 +939,9 @@ class _SuperTabViewState extends State<SuperTabView>? c.snapshot!.name: 'Choose a project': c.snapshot!.isProjectLead(group.id)- ? c.snapshot!.projectFor(group.id)!.name+ ? '# ${c.snapshot!.projectFor(group.id)!.name}': group.id == c.snapshot!.leadsConversationId- ? 'Product Managers'+ ? '# $kProductManagersChannel': _isPmChat(group)? kChatWithPm: null;@@ -953,6 +954,22 @@ class _SuperTabViewState extends State<SuperTabView>);}+ /// The composer's hint, naming the open conversation as its sidebar row+ /// does: "Message #openharness", "Message #product-managers", "Message Wren".+ String _messageHint(SuperTabConversation group) {+ final snapshot = c.snapshot!;+ if (snapshot.isProjectLead(group.id)) {+ return 'Message #${snapshot.projectFor(group.id)!.name}';+ }+ if (group.id == snapshot.leadsConversationId) {+ return 'Message #$kProductManagersChannel';+ }+ if (_isPmChat(group)) {+ return 'Message ${pmChatName(snapshot, snapshot.projectFor(group.id)!)}';+ }+ return 'Message ${group.title}';+ }+Widget _boardButton() {final shown = _boardRoomy && _boardOpen;return AppIconButton(@@ -1920,17 +1937,7 @@ class _SuperTabViewState extends State<SuperTabView>: group == null? 'Loading conversation…': c.canWrite- ? c.snapshot!.isProjectLead(- group.id,- ) ||- _isPmChat(group)- ? 'Message Product Manager'- : group.id ==- c- .snapshot!- .leadsConversationId- ? 'Message Product Managers'- : 'Message ${group.title}'+ ? _messageHint(group): 'Read-only conversation',border: InputBorder.none,enabledBorder: InputBorder.none,diff --git a/desktop/test/super_tab_composer_layout_test.dart b/desktop/test/super_tab_composer_layout_test.dartindex 5b7a7915e..278a2030f 100644--- a/desktop/test/super_tab_composer_layout_test.dart+++ b/desktop/test/super_tab_composer_layout_test.dart@@ -87,7 +87,7 @@ void main() {final editableRect = editor.localToGlobal(Offset.zero) & editor.size;final hint = find.descendant(of: field,- matching: find.text('Message Product Manager'),+ matching: find.text('Message #Pilot'),);measurements[name] = {'surfaceHeight': rect.height,diff --git a/desktop/test/super_tab_leads_test.dart b/desktop/test/super_tab_leads_test.dartindex 502a86535..dda907e3b 100644--- a/desktop/test/super_tab_leads_test.dart+++ b/desktop/test/super_tab_leads_test.dart@@ -111,7 +111,7 @@ void main() {final projects = find.text('Projects');testWidgets(- 'lists the Product Managers conversation above Projects, and opens and posts in it',+ 'lists the Product Managers conversation as # product-managers among Projects, and opens and posts in it',(tester) async {final server = swarm();server.append(@@ -135,15 +135,18 @@ void main() {};server.messages.last['source'] = {'kind': 'overlap'};final controller = await show(tester, server);+ // An open project's heading and composer read as its row too.+ expect(find.text('# openharness'), findsOneWidget);+ expect(find.text('Message #openharness'), findsOneWidget);expect(leadsRow, findsOneWidget);expect(- find.descendant(of: leadsRow, matching: find.text('Product Managers')),+ find.descendant(of: leadsRow, matching: find.text('product-managers')),findsOneWidget,);expect(- tester.getTopLeft(leadsRow).dy,- lessThan(tester.getTopLeft(projects).dy),+ tester.getTopLeft(projects).dy,+ lessThan(tester.getTopLeft(leadsRow).dy),);// It belongs to no project: never listed again as a workgroup of the first one.await tester.tap(find.byKey(const ValueKey('super-project-expand-lead')));@@ -153,8 +156,8 @@ void main() {await tester.tap(leadsRow);await tester.pumpAndSettle();- // Its heading names it as people know it, and it has no rename or archive.- expect(find.text('Product Managers'), findsNWidgets(2));+ // Its heading reads as its row, and it has no rename or archive.+ expect(find.text('# product-managers'), findsOneWidget);expect(find.byKey(const ValueKey('super-group-options')), findsNothing);expect(find.text('I will take the roster file after #12 lands.'),@@ -200,7 +203,7 @@ void main() {expect(find.descendant(of: composer,- matching: find.text('Message Product Managers'),+ matching: find.text('Message #product-managers'),),findsOneWidget,);@@ -263,7 +266,7 @@ void main() {(tester) async {final controller = await show(tester, swarm(leads: false));expect(leadsRow, findsNothing);- expect(find.text('Product Managers'), findsNothing);+ expect(find.text('product-managers'), findsNothing);expect(projects, findsOneWidget);await close(tester, controller);},diff --git a/desktop/test/super_tab_pm_chat_pinned_test.dart b/desktop/test/super_tab_pm_chat_pinned_test.dartindex a007d264c..441508f62 100644--- a/desktop/test/super_tab_pm_chat_pinned_test.dart+++ b/desktop/test/super_tab_pm_chat_pinned_test.dart@@ -332,7 +332,7 @@ void main() {final projectRow = find.byKey(const ValueKey('super-group-lead'));testWidgets(- 'pins Chat with PM as a direct message above the projects, shown with the project and the list collapsed',+ 'lists Chat with PM as a direct message below the projects, shown with the project and the list collapsed',(tester) async {final c = await show(tester, riverSwarm());expect(c.expandedProjects, isNot(contains('lead')));@@ -350,16 +350,16 @@ void main() {findsOne,);expect(- tester.getTopLeft(find.text('Direct messages')).dy,- lessThan(tester.getTopLeft(entry).dy),+ tester.getTopLeft(find.text('Projects')).dy,+ lessThan(tester.getTopLeft(find.text('Direct messages')).dy),);expect(tester.getTopLeft(find.text('Direct messages')).dx,tester.getTopLeft(find.text('Projects')).dx,);expect(- tester.getTopLeft(entry).dy,- lessThan(tester.getTopLeft(find.text('Projects')).dy),+ tester.getTopLeft(find.text('Direct messages')).dy,+ lessThan(tester.getTopLeft(entry).dy),);c.toggleProjectsGroup();@@ -443,12 +443,13 @@ void main() {Future<void> shortcutOverNotifications() async {await tester.tap(find.byKey(const ValueKey('super-notifications')));await tester.pumpAndSettle();- expect(find.text('Message Product Manager'), findsNothing);+ expect(find.text('Message River'), findsNothing);// What ⇧⌘K runs (openActivePmChat).expect(await c.openCurrentPmChat(), isTrue);await tester.pumpAndSettle();expect(c.selectedId, c.pmChat('lead')?.id);- expect(find.text('Message Product Manager'), findsOneWidget);+ // The composer names the direct message as its row does.+ expect(find.text('Message River'), findsOneWidget);}await shortcutOverNotifications();@@ -495,13 +496,13 @@ void main() {final c = await show(tester, pmChatSwarm());await tester.tap(find.byKey(const ValueKey('super-notifications')));await tester.pumpAndSettle();- expect(find.text('Message Product Manager'), findsNothing);+ expect(find.text('Message Lead'), findsNothing);await tester.tap(entry);await tester.pumpAndSettle();expect(c.selectedId, c.pmChat('lead')!.id);- expect(find.text('Message Product Manager'), findsOneWidget);+ expect(find.text('Message Lead'), findsOneWidget);await close(tester, c);});@@ -519,7 +520,7 @@ void main() {]) {expect(find.descendant(of: row, matching: find.text(pm)), findsOne);expect(- find.descendant(of: row, matching: find.text(project)),+ find.descendant(of: row, matching: find.text('($project)')),findsOne,);expect(diff --git a/desktop/test/super_tab_pm_chat_test.dart b/desktop/test/super_tab_pm_chat_test.dartindex 3d3d5ad78..14b833d22 100644--- a/desktop/test/super_tab_pm_chat_test.dart+++ b/desktop/test/super_tab_pm_chat_test.dart@@ -214,7 +214,7 @@ void main() {final entry = find.byKey(const ValueKey('super-pm-chat-lead'));- testWidgets('a project shows Chat with PM above its workgroups', (+ testWidgets('Chat with PM is listed below a project\'s workgroups', (tester,) async {final c = await show(tester, pmChatSwarm());@@ -225,8 +225,8 @@ void main() {);final workgroup = find.byKey(const ValueKey('super-group-offline'));expect(- tester.getTopLeft(entry).dy,- lessThan(tester.getTopLeft(workgroup).dy),+ tester.getTopLeft(workgroup).dy,+ lessThan(tester.getTopLeft(entry).dy),);await close(tester, c);});@@ -245,7 +245,7 @@ void main() {expect(find.byKey(ValueKey('super-group-${chat.id}')), findsNothing);// The header names the chat; the sidebar names its Product Manager.expect(find.text('Chat with PM'), findsOneWidget);- expect(find.text('Message Product Manager'), findsOneWidget);+ expect(find.text('Message Lead'), findsOneWidget);await tester.tap(find.byKey(const ValueKey('super-group-offline')));await tester.pumpAndSettle();diff --git a/desktop/test/super_tab_sidebar_test.dart b/desktop/test/super_tab_sidebar_test.dartindex 9af6630e1..ed22913f0 100644--- a/desktop/test/super_tab_sidebar_test.dart+++ b/desktop/test/super_tab_sidebar_test.dart@@ -245,6 +245,68 @@ void main() {});}+ testWidgets('reads like a chat app: utilities, Projects A to Z with their '+ 'workgroups and # product-managers, Direct messages, then Machines', (+ tester,+ ) async {+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final app = createApp(connected: true);+ addTearDown(app.dispose);+ final server = ConversationServer();+ (server.state['conversations'] as List).add({+ ...conversationFixture('leads', 'Leads'),+ 'kind': 'leads',+ });+ server.state['leadsConversationId'] = 'leads';+ final controller = await projectSidebar(server);+ controller+ ..toggleProject('lead')+ ..toggleProject('empty');+ await pumpSidebar(tester, controller, app);++ final order = [+ find.byKey(const ValueKey('super-new-project')),+ find.byKey(const ValueKey('super-local-models')),+ find.byKey(const ValueKey('super-your-devices')),+ find.text('Projects'),+ find.byKey(const ValueKey('super-group-leads')),+ find.byKey(const ValueKey('super-group-empty-lead')),+ find.text('No workgroups yet'),+ find.byKey(const ValueKey('super-group-lead')),+ find.byKey(const ValueKey('super-group-offline')),+ find.text('Direct messages'),+ find.byKey(const ValueKey('super-pm-chat-lead')),+ find.byKey(const ValueKey('super-pm-chat-empty')),+ find.text('Machines'),+ ];+ for (var i = 1; i < order.length; i++) {+ expect(+ tester.getTopLeft(order[i - 1]).dy,+ lessThan(tester.getTopLeft(order[i]).dy),+ reason: '${order[i - 1]} above ${order[i]}',+ );+ }+ for (final (key, name) in [+ ('leads', 'product-managers'),+ ('empty-lead', 'sample-project'),+ ('lead', 'web-project'),+ ]) {+ expect(inRow('super-group-$key', find.text('#')), findsOneWidget);+ expect(inRow('super-group-$key', find.text(name)), findsOneWidget);+ }+ // The product managers' channel has no workgroups to disclose.+ expect(+ inRow('super-group-leads', find.byIcon(AppIcons.chevronRight)),+ findsNothing,+ );+ expect(+ inRow('super-pm-chat-lead', find.text('(web-project)')),+ findsOneWidget,+ );+ expect(tester.takeException(), isNull);+ await disposeSidebar(tester, controller);+ });+testWidgets('section disclosure follows its label and + aligns with the ''right disclosure column', (tester) async {addTearDown(() => tester.binding.setSurfaceSize(null));diff --git a/desktop/test/super_tab_view_test.dart b/desktop/test/super_tab_view_test.dartindex 2c1313767..c12768a95 100644--- a/desktop/test/super_tab_view_test.dart+++ b/desktop/test/super_tab_view_test.dart@@ -335,7 +335,8 @@ void main() {),);await tester.pumpAndSettle();- expect(find.text('Pilot'), findsNWidgets(2));+ expect(find.text('Pilot'), findsOneWidget);+ expect(find.text('# Pilot'), findsOneWidget);expect(find.text('CHATS'), findsNothing);expect(find.byKey(const ValueKey('super-group-lead')), findsOneWidget);expect(find.byKey(const ValueKey('super-group-offline')), findsNothing);diff --git a/docs/naming-system.md b/docs/naming-system.mdindex d85c51149..05e3ecf93 100644--- a/docs/naming-system.md+++ b/docs/naming-system.md@@ -98,16 +98,19 @@ no CLI keeps its maker's name (Fo).A pane is a view, so closing a pane or tab closes views. **Stop Harness** ends therunning harness. Adding harnesses to a tab groups them without a separate teamsetup. A **Swarm** occupies one tab in that same tab bar. A person can belong to several Swarms.-Its sidebar reads like a chat app's. It starts with **Direct messages**: the person's-**Chat with PM** for each project, listed by the product manager's name and avatar, with the-project's name in grey when the Swarm has several and a count of new messages. Hovering says-**Chat with PM**, and ⇧⌘K opens the current project's. **New project** and **Your devices**-follow. Projects and Machines have section headings with disclosure after the label and an add-action at the right. Project rows read as channels: **#** at the left, then their name, status-and a right-hand disclosure. Project names open their product manager chats; disclosure reveals-workgroups, shown by their number in grey with no **#** and then their title-(`12 Offline editing`), aligned with the project name. An expanded project without workgroups-says **No workgroups yet**.+Its sidebar reads like a chat app's. It starts with **New project**, **Manage models**,+**Your devices** and **Notifications**, then three sections in this order: **Projects**,+**Direct messages** and **Machines**. Projects and Machines have section headings with disclosure+after the label and an add action at the right. Project rows read as channels, from A to Z:+**#** at the left, then their name, status and a right-hand disclosure. The Product Managers'+conversation is one of them, **# product-managers**, with no workgroups. Project names open their+product manager chats; disclosure reveals workgroups, shown by their number in grey with no **#**+and then their title (`12 Offline editing`), aligned with the project name. An expanded project+without workgroups says **No workgroups yet**. An open channel's heading reads as its row+(`# openharness`). **Direct messages** holds the person's **Chat with PM** for each project,+listed by the product manager's name and avatar, with the project's name in grey brackets when+the Swarm has several (`Finn (web-2)`) and a count of new messages. Hovering says+**Chat with PM**, and ⇧⌘K opens the current project's.**Your devices** opens the Devices dashboard and its existing agent conversation inside thecurrent Swarm, preserving project drafts and the selected workgroup. Ordinary tabs retaintheir standalone Devices workspace. The navigation, conversation and people panes have