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
Desktop: a Board card opens its task, and the left pane lights the row you're on (#4441) (#3528)
0xken15120a1971bb98
diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dartindex 64e35e40c..0eb19b57f 100644--- a/desktop/lib/super_tabs/project_sidebar.dart+++ b/desktop/lib/super_tabs/project_sidebar.dart@@ -128,6 +128,13 @@ class ProjectSidebar extends StatelessWidget {/// the main pane.bool get _paneCovered => manageSelected || devicesSelected || page != null;+ /// Whether an open My agents lists an agent whose chat is [chat], so that agent's row is the lit one.+ bool _litInMyAgents(SuperTabConversation chat, _SidebarReading? reading) =>+ board &&+ controller.agentsGroupOpen &&+ reading != null &&+ reading.myAgents.any((row) => row.$2?.id == chat.id);+/// A project's Board holds the Desktop's middle: no chat's row is lit.bool get _boardOpen => board && boardProjectId != null;@@ -306,10 +313,11 @@ class ProjectSidebar extends StatelessWidget {String? key,}) {final project = reading?.project;- // On the Desktop the lit project is the one whose Board is in the middle (task #4220).+ // On the Desktop the lit project is the one whose Board is in the middle (task #4220), and never the one whose chat+ // a My agents row has lit: a PM's chat is its project's (#4441).final selected = _boardOpen? !_paneCovered && project?.id == boardProjectId- : _chatLit(group);+ : _chatLit(group) && !_litInMyAgents(group, reading?.sidebar);// A project's row is bold for its own chat (Huy, 11-04, task #2638): a// person's message or a tag of the reader there, never agents' progress// alone (#2427). A task's unread is on its card and in Activity.@@ -654,10 +662,6 @@ class ProjectSidebar extends StatelessWidget {_SidebarReading reading,) {if (snapshot == null) return const [];- final mine = [- for (final agent in superTabMyAgents(snapshot, controller.accountId))- if (agent.buddyOf == null) agent,- ];return [SuperTabSectionHeading(key: const ValueKey('project-sidebar-agents'),@@ -673,7 +677,8 @@ class ProjectSidebar extends StatelessWidget {?_swarmBuddyRow()else..._buddies([...snapshot.projects], reading),- for (final agent in mine) _agentRow(snapshot, agent),+ for (final (agent, chat) in reading.myAgents)+ _agentRow(snapshot, agent, chat),// The last row opens the creation dialog, where Regular or PM is chosen.if (controller.canWrite && onNewAgent != null)_navigationRow(@@ -687,8 +692,11 @@ class ProjectSidebar extends StatelessWidget {];}- Widget _agentRow(SuperTabSnapshot snapshot, SuperTabAgent agent) {- final chat = superTabAgentChat(snapshot, agent);+ Widget _agentRow(+ SuperTabSnapshot snapshot,+ SuperTabAgent agent,+ SuperTabConversation? chat,+ ) {final name = snapshot.agentName(agent.id, fallback: agent.name);final pm = superTabAgentIsPm(snapshot, agent);return SuperTabBuddyRow(@@ -1058,6 +1066,14 @@ class _SidebarReading {/// The project of the open conversation.late final selectedProjectId = controller.selected?.projectId;++ /// My agents' rows after the Buddy, each agent with the chat it opens: drawn by the rows, and asked by the project+ /// rows, so a chat lit there is not lit twice (#4441).+ late final List<(SuperTabAgent, SuperTabConversation?)> myAgents = [+ if (controller.snapshot case final snapshot?)+ for (final agent in superTabMyAgents(snapshot, controller.accountId))+ if (agent.buddyOf == null) (agent, superTabAgentChat(snapshot, agent)),+ ];}/// One build's reading of a project, each part asked once and only when adiff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex 767895280..d1dad0d6c 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -3561,8 +3561,10 @@ class _SuperTabViewState extends State<SuperTabView>}/// A task's chat, opened from its card: read first when it is one of the- /// shipped tasks only the Tasks view holds.+ /// shipped tasks only the Tasks view holds. With the Tasks pane on the right the chat has no room beside the Board,+ /// so it opens in the middle as a Tasks card's does (audit of 1.3.89, #4441: the card only turned grey).Future<void> _openTask(String id) async {+ if (_hasTasksPane) return _openPersonalTask(id);if (!await c.loadGroup(id) || !mounted) return;_openConversation(id);}@@ -3574,6 +3576,10 @@ class _SuperTabViewState extends State<SuperTabView>setState(() => _taskInMiddle = id);}+ /// Whether the right pane is the Tasks slot (Swarm v3), so no chat sits beside the Board.+ bool get _hasTasksPane =>+ widget.rightPane != null || c.personalTasks?.supported == true;+/// The task opened from its Tasks card, shown under the task's header while it stays the selected chat; the same/// chat chosen another way is under its agent's header.String? _taskInMiddle;@@ -6233,9 +6239,7 @@ class _SuperTabViewState extends State<SuperTabView>final agentChat =widget.board && _agentChatId != null && c.selectedId == _agentChatId;// The chat is in the middle, by the reader's choice of an agent or once the right pane is the Tasks slot.- final hasTasksPane =- widget.rightPane != null || c.personalTasks?.supported == true;- final chatInMiddle = agentChat || hasTasksPane;+ final chatInMiddle = agentChat || _hasTasksPane;final boardLayout =widget.board &&(!_projectChatOnly || chatInMiddle) &&@@ -6251,7 +6255,7 @@ class _SuperTabViewState extends State<SuperTabView>// side (task #4220).final tasksStay =widget.board &&- hasTasksPane &&+ _hasTasksPane &&thread == null &&!_rosterOpen &&!_terminalsVisible;@@ -6281,7 +6285,7 @@ class _SuperTabViewState extends State<SuperTabView>c.snapshot?.projects.isEmpty != true;// With the Tasks slot, a project that is selected shows its Board first, though its chat is the selected// conversation (Swarm v3, task #4118).- final impliedBoard = hasTasksPane && !agentChat+ final impliedBoard = _hasTasksPane && !agentChat? c.snapshot?.projects.where((p) => p.leadConversationId == c.selectedId).firstOrNulldiff --git a/desktop/test/super_tab_board_navigation_test.dart b/desktop/test/super_tab_board_navigation_test.dartnew file mode 100644index 000000000..1fb4b4ddd--- /dev/null+++ b/desktop/test/super_tab_board_navigation_test.dart@@ -0,0 +1,201 @@+import 'dart:io';++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/state/app_state.dart';+import 'package:harness/super_tabs/buddy_rows.dart';+import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/view.dart';++import 'super_tab_activity_lists_test.dart' show swarm;+import 'support/capture.dart';+import 'support/super_tab_fixture.dart';+import 'swarm_state_test.dart' show createApp;++/// Set to a folder to write the PR's screenshots there.+final shots = Platform.environment['SUPER_TAB_BOARD_NAV_SHOTS'];++Map<String, dynamic> _agent(String id, String name, String kind) => {+ 'id': id,+ 'projectId': 'lead',+ 'name': name,+ 'displayName': name,+ 'machineId': 'host',+ 'harnessId': 'session',+ 'contributorId': 'owner',+ 'configuration': {'engine': 'codex'},+ 'kind': kind,+ 'myAgent': true,+};++/// The v3 Swarm (task #4441, audit of 1.3.89 findings 1 and 5): the reader's Buddy, a PM Orion leading `# web-project`+/// and a task "Windows credential fix" on its Board, with the Tasks pane on the right.+Future<SuperTabController> _open(+ WidgetTester tester,+ Brightness brightness,+) async {+ await tester.binding.setSurfaceSize(const Size(1500, 800));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final before = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = before);+ final server = swarm();+ final groups = (server.state['conversations'] as List)+ .cast<Map<String, dynamic>>();+ server.state['swarmBuddy'] = true;+ server.state['agents'] = [+ {+ ..._agent('buddy', 'Buddy', 'buddy'),+ 'buddyScope': 'swarm',+ 'buddyOf': {'personId': 'owner'},+ 'chatId': 'swarm-buddy-owner',+ },+ {..._agent('orion', 'Orion', 'pm'), 'chatId': 'lead'},+ {..._agent('kestrel', 'Kestrel', 'regular'), 'myAgent': false},+ ];+ groups.add({+ ...conversationFixture('swarm-buddy-owner', 'Buddy'),+ 'kind': 'swarm-buddy',+ 'buddyOwnerId': 'owner',+ 'agentIds': ['buddy'],+ });+ groups.firstWhere((g) => g['id'] == 'lead')['leadId'] = 'orion';+ server.append('Working on the fix.', conversationId: 'offline');+ final c = server.controller(+ account: 'owner',+ initial: {+ 'tabId': 'tab',+ 'accountId': 'owner',+ 'selectedId': 'swarm-buddy-owner',+ 'projectsGroupOpen': true,+ },+ );+ await tester.runAsync(c.refresh);+ final AppNotifier app = createApp();+ addTearDown(app.dispose);+ await tester.pumpWidget(+ MaterialApp(+ debugShowCheckedModeBanner: false,+ theme: grid.buildAppTheme(brightness: brightness),+ home: Scaffold(+ body: SuperTabView(+ controller: c,+ app: app,+ onNewSwarm: () {},+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Mac Studio',+ board: true,+ rightPane: (_) => Center(+ child: Text(+ 'Tasks pane (stand-in)',+ style: TextStyle(color: grid.AppPalette.textFaint),+ ),+ ),+ ),+ ),+ ),+ );+ await _settle(tester);+ return c;+}++/// [body] in both appearances, its window captured as [shot] for the PR; the Swarm closed after it, passed or failed.+void _scene(+ String name,+ String shot,+ Future<void> Function(WidgetTester tester, SuperTabController c) body,+) {+ for (final brightness in Brightness.values) {+ testWidgets('$name (${brightness.name})', (tester) async {+ final c = await _open(tester, brightness);+ try {+ await body(tester, c);+ await captureWindow(tester, shots, '$shot-${brightness.name}');+ } finally {+ await tester.pumpWidget(const SizedBox());+ await tester.runAsync(c.flush);+ c.dispose();+ await tester.pump(const Duration(seconds: 5));+ }+ });+ }+}++Future<void> _settle(WidgetTester tester) async {+ for (var i = 0; i < 3; i++) {+ await tester.runAsync(+ () => Future<void>.delayed(const Duration(milliseconds: 30)),+ );+ await tester.pump(const Duration(milliseconds: 50));+ }+}++/// Whether the left pane's row [key] is lit: an agent's row says so itself; a project's row by its selected fill.+bool _lit(WidgetTester tester, String key) {+ final row = find.byKey(ValueKey(key));+ final widget = tester.widget(row);+ if (widget is SuperTabBuddyRow) return widget.selected;+ final ground = tester.widget<Material>(+ find.ancestor(of: row, matching: find.byType(Material)).first,+ );+ return ground.color == grid.SidebarInk.selected;+}++/// The rows the left pane lights, of Buddy, the PM Orion and the project `# web-project`.+List<String> _litRows(WidgetTester tester) => [+ for (final key in [+ 'super-swarm-buddy',+ 'super-agent-orion',+ 'super-group-lead',+ ])+ if (_lit(tester, key)) key,+];++void main() {+ setUpAll(() => loadCaptureFonts(shots));++ _scene('a Board card opens its task in the middle', 'board-card-opens-task', (+ tester,+ c,+ ) async {+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));+ await _settle(tester);+ await tester.tap(find.byKey(const ValueKey('super-task-card-offline')));+ await _settle(tester);++ expect(c.selectedId, 'offline');+ expect(find.byKey(const ValueKey('super-board-tab-board')), findsNothing);+ expect(+ find.descendant(+ of: find.byKey(const ValueKey('super-middle-chat')),+ matching: find.text('Working on the fix.'),+ ),+ findsOneWidget,+ );+ });++ _scene('a Board lights its project row, not Buddy', 'board-lights-project', (+ tester,+ c,+ ) async {+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));+ await _settle(tester);++ expect(find.byKey(const ValueKey('super-board-tab-board')), findsOneWidget);+ expect(_litRows(tester), ['super-group-lead']);+ });++ _scene('a PM lights its own row alone', 'pm-lights-one-row', (+ tester,+ c,+ ) async {+ await tester.tap(find.byKey(const ValueKey('super-agent-orion')));+ await _settle(tester);++ expect(c.selectedId, 'lead');+ expect(_litRows(tester), ['super-agent-orion']);+ });+}diff --git a/docs/plans/2026-11-07-board-card-and-left-highlight-plan.md b/docs/plans/2026-11-07-board-card-and-left-highlight-plan.mdnew file mode 100644index 000000000..ee94332f2--- /dev/null+++ b/docs/plans/2026-11-07-board-card-and-left-highlight-plan.md@@ -0,0 +1,58 @@+# Board card opens its task; the left pane lights one row: plan++Task #4441. Findings 1 and 5 of the Desktop 1.3.89 audit (#4436, `docs/audits/2026-11-07-desktop-1.3.89.md` on #3526).++**Goal:** clicking a Board card opens its task in the middle, as a Tasks card does; the left pane lights exactly one row,+the one for what the middle shows.++**Architecture:** both are in the Swarm view's navigation (`desktop/lib/super_tabs/view.dart`) and the left pane+(`project_sidebar.dart`). With the Tasks pane on the right, a Board card's chat has no place beside the Board, so the+card takes the Tasks card's path (`_openPersonalTask`). The left pane is told which project's Board the middle shows;+while one does, only that project's row is lit, and otherwise a chat chosen in My agents lights its agent's row and not+also its project's.++**Tech Stack:** Flutter widget tests with the in-memory conversation server and a fake sign-in.++**Spec:** the audit's findings 1 and 5 and their proposed tasks:+- 1: "Clicking a Board card shows the task under its header, as a Tasks card does; a widget test clicks a card and+ finds the task's chat."+- 5: "A Board lights its project row and not Buddy; a PM lights one row; tests for both."++This plan is implemented test first by its Engineer, task by task; the pull request's review is the one review.++## Global Constraints++- Desktop only; no server change.+- Reuse the existing middle chat (`_middleChat`), task header and row styles; no new widget.+- Tests use the memory store and a fake sign-in; nobody signs in.+- Shared Flutter code: the same on macOS, Windows and Linux.++## Review Focus++- The layout without the Tasks pane (an older backend) keeps a Board card's chat on the right.+- Every other way into a chat (a link, a notice, the Tasks pane, the Chat tab) still lights a row.++## Task 1: a Board card opens its task in the middle++**Files:** `desktop/lib/super_tabs/view.dart`; test `desktop/test/super_tab_board_navigation_test.dart`.++**Interfaces:** `_openTask(id)` goes to `_openPersonalTask(id)` while the Tasks pane holds the right.++- [ ] Test: in the v3 layout, tap the Board card of a task; the middle shows `super-middle-chat` with the task+ selected, and the Board's tabs are gone. Watch it fail (the Board stays).+- [ ] Code: `_openTask` takes the Tasks card's path when the Tasks pane is on the right.+- [ ] Run the new test and `super_tab_personal_tasks_middle_test.dart`.++## Task 2: the left pane lights one row++**Files:** `desktop/lib/super_tabs/project_sidebar.dart`, `desktop/lib/super_tabs/view.dart`; same test file.++**Interfaces:** `ProjectSidebar.boardProjectId`: the project whose Board the middle shows.++- [ ] Tests: clicking `# web-project` lights its row and not Buddy; clicking the PM Orion lights Orion's row and not+ `# web-project`. Watch both fail.+- [ ] Code: pass the Board's project to the left pane; with a Board shown, only its project row is lit; a chat that is+ one of My agents' lights that agent's row alone.+- [ ] Run the new tests and the left-pane tests (`super_tab_v3_left_shots_test.dart`, `super_tab_sidebar_pages_test.dart`,+ `super_tab_one_buddy_shots_test.dart`, `super_tab_workspace_test.dart`).+- [ ] Light and dark screenshots of both findings for the pull request.diff --git a/docs/plans/assets/board-navigation/board-card-opens-task-dark.png b/docs/plans/assets/board-navigation/board-card-opens-task-dark.pngnew file mode 100644index 000000000..7e3c5a8a3Binary files /dev/null and b/docs/plans/assets/board-navigation/board-card-opens-task-dark.png differdiff --git a/docs/plans/assets/board-navigation/board-card-opens-task-light.png b/docs/plans/assets/board-navigation/board-card-opens-task-light.pngnew file mode 100644index 000000000..711af9774Binary files /dev/null and b/docs/plans/assets/board-navigation/board-card-opens-task-light.png differdiff --git a/docs/plans/assets/board-navigation/board-lights-project-dark.png b/docs/plans/assets/board-navigation/board-lights-project-dark.pngnew file mode 100644index 000000000..196ba2933Binary files /dev/null and b/docs/plans/assets/board-navigation/board-lights-project-dark.png differdiff --git a/docs/plans/assets/board-navigation/board-lights-project-light.png b/docs/plans/assets/board-navigation/board-lights-project-light.pngnew file mode 100644index 000000000..2c5ae51ccBinary files /dev/null and b/docs/plans/assets/board-navigation/board-lights-project-light.png differdiff --git a/docs/plans/assets/board-navigation/pm-lights-one-row-dark.png b/docs/plans/assets/board-navigation/pm-lights-one-row-dark.pngnew file mode 100644index 000000000..3c83ff19cBinary files /dev/null and b/docs/plans/assets/board-navigation/pm-lights-one-row-dark.png differdiff --git a/docs/plans/assets/board-navigation/pm-lights-one-row-light.png b/docs/plans/assets/board-navigation/pm-lights-one-row-light.pngnew file mode 100644index 000000000..ff2b2a12bBinary files /dev/null and b/docs/plans/assets/board-navigation/pm-lights-one-row-light.png differ