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.

Swarm v3 Desktop: My agents on the left, chat or Board/Chat in the middle (#3445)

harness-for-autonomous[bot]b39fbe09b48a
diff --git a/desktop/lib/shared/theme/app_icons.dart b/desktop/lib/shared/theme/app_icons.dart
index a4528b856..e062f92f5 100644
--- a/desktop/lib/shared/theme/app_icons.dart
+++ b/desktop/lib/shared/theme/app_icons.dart
@@ -194,6 +194,7 @@ abstract final class AppIcons {
static const sparkles = LucideIcons.sparkles400;
static const square = LucideIcons.square400;
static const squareCheck = LucideIcons.squareCheck400;
+ static const crown = LucideIcons.crown400;
static const squareKanban = LucideIcons.squareKanban400;
static const squarePlus = LucideIcons.squarePlus400;
static const squareTerminal = LucideIcons.squareTerminal400;
diff --git a/desktop/lib/super_tabs/buddy_rows.dart b/desktop/lib/super_tabs/buddy_rows.dart
index 40f78851d..85af99ba5 100644
--- a/desktop/lib/super_tabs/buddy_rows.dart
+++ b/desktop/lib/super_tabs/buddy_rows.dart
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
+import '../shared/theme/app_icons.dart';
import '../shared/theme/app_theme.dart' as grid;
import '../widgets/desktop_chrome.dart';
import 'buddy_chat.dart';
@@ -57,6 +58,7 @@ class SuperTabBuddyRow extends StatelessWidget {
this.note,
this.detail,
this.status,
+ this.crownKey,
});
/// The Buddy, for its avatar; null while none runs.
@@ -78,6 +80,9 @@ class SuperTabBuddyRow extends StatelessWidget {
/// A quiet word after the name, such as a Buddy's "offline".
final String? note;
+ /// Set on a PM: its crown, right after the name (Swarm v3, task #4118).
+ final Key? crownKey;
+
/// A line under the name, such as where a Buddy runs, with [status], its
/// activity mark, before it.
final String? detail;
@@ -154,6 +159,15 @@ class SuperTabBuddyRow extends StatelessWidget {
),
),
),
+ if (crownKey case final crownKey?) ...[
+ const SizedBox(width: 4),
+ Icon(
+ AppIcons.crown,
+ key: crownKey,
+ size: AppIcons.metadataSize,
+ color: color,
+ ),
+ ],
if (project case final project?) ...[
const SizedBox(width: 8),
Flexible(
diff --git a/desktop/lib/super_tabs/controller.dart b/desktop/lib/super_tabs/controller.dart
index 087e22f43..b04f58894 100644
--- a/desktop/lib/super_tabs/controller.dart
+++ b/desktop/lib/super_tabs/controller.dart
@@ -18,6 +18,7 @@ import 'message_link.dart';
import 'identity.dart' show superTabMachineName;
import 'machine_status.dart' show kSuperTabMachineOfflineAfter;
import 'model.dart';
+import 'my_agents.dart';
import 'task_groups.dart';
import 'buddy_chat.dart';
import 'project_github.dart';
@@ -248,6 +249,7 @@ class SuperTabController extends ChangeNotifier {
unreadOnly = initial['unreadOnly'] == true;
machinesGroupOpen = initial['machinesGroupOpen'] as bool? ?? true;
buddiesGroupOpen = initial['buddiesGroupOpen'] as bool? ?? true;
+ projectsGroupOpen = initial['projectsGroupOpen'] as bool?;
modelsGroupOpen = initial['modelsGroupOpen'] as bool? ?? true;
offlineMachinesOpen = initial['offlineMachinesOpen'] as bool? ?? false;
sessionProjectId = initial['sessionProjectId'] as String? ?? '';
@@ -1106,6 +1108,13 @@ class SuperTabController extends ChangeNotifier {
/// and Machines (Dee, 2026-10-30: every section the same).
bool buddiesGroupOpen = true, modelsGroupOpen = true;
+ /// Whether the left pane's Projects is open when the reader chose (Swarm v3, task #4118); null until they do: it is then
+ /// closed while they have an agent and open when they have none.
+ bool? projectsGroupOpen;
+ bool get projectsOpen =>
+ projectsGroupOpen ??
+ (snapshot == null || superTabMyAgents(snapshot!, accountId).isEmpty);
+
bool isMachineExpanded(String id) => expandedMachines.contains(id);
void toggleMachineExpanded(String id) {
@@ -1176,6 +1185,12 @@ class SuperTabController extends ChangeNotifier {
_changed();
}
+ void toggleProjectsGroup() {
+ projectsGroupOpen = !projectsOpen;
+ _saveSoon();
+ _changed();
+ }
+
void toggleBuddiesGroup() {
buddiesGroupOpen = !buddiesGroupOpen;
_saveSoon();
@@ -2818,6 +2833,7 @@ class SuperTabController extends ChangeNotifier {
'unreadOnly': unreadOnly,
'machinesGroupOpen': machinesGroupOpen,
'buddiesGroupOpen': buddiesGroupOpen,
+ if (projectsGroupOpen != null) 'projectsGroupOpen': projectsGroupOpen,
'modelsGroupOpen': modelsGroupOpen,
'offlineMachinesOpen': offlineMachinesOpen,
'sessionProjectId': sessionProjectId,
diff --git a/desktop/lib/super_tabs/message_receipt.dart b/desktop/lib/super_tabs/message_receipt.dart
index 045470eb8..dd1ee9fc7 100644
--- a/desktop/lib/super_tabs/message_receipt.dart
+++ b/desktop/lib/super_tabs/message_receipt.dart
@@ -206,8 +206,9 @@ class _SuperTabMessageReceiptState extends State<SuperTabMessageReceipt>
}
} else if (delivery == null &&
c.selected?.leadId == null &&
- // A Buddy chat has no Lead: its Buddy takes the message.
- c.selected?.isBuddyChat != true) {
+ // A Buddy chat has no Lead: its Buddy takes the message, and so does an agent's own chat its agent.
+ c.selected?.isBuddyChat != true &&
+ c.selected?.isAgentChat != true) {
// In a Personal Swarm this Desktop starts the project's Lead, which the
// server keeps the message for (task #2633); else, or when it could
// not start, Add a Lead.
diff --git a/desktop/lib/super_tabs/model.dart b/desktop/lib/super_tabs/model.dart
index 05b64988f..ecffc0f76 100644
--- a/desktop/lib/super_tabs/model.dart
+++ b/desktop/lib/super_tabs/model.dart
@@ -173,6 +173,8 @@ class SuperTabAgent {
machineOwnerId =
row['machineOwnerId'] as String? ?? _text(row, 'contributorId'),
role = row['role'] as String?,
+ kind = row['kind'] as String?,
+ chatId = row['chatId'] as String?,
roleId = row['roleId'] as String?,
roleName = row['roleName'] as String?,
buddyOf = switch (row['buddyOf']) {
@@ -220,6 +222,10 @@ class SuperTabAgent {
configuration = Map.unmodifiable(superTabMap(row['configuration']));
final String id, projectId, name, machineId, harnessId, contributorId;
+ /// What it is and where its person talks to it (Swarm v3, backend #4116): `buddy`, `pm` or `regular`, and the chat it
+ /// has, or none yet. An older backend sends neither.
+ final String? kind, chatId;
+
/// Set by its contributor or its project's Lead; null draws its pattern.
final SuperTabAvatarPicture? avatar;
@@ -470,6 +476,10 @@ class SuperTabConversation {
final String? kind;
bool get isBuddyChat => kind == 'buddy' || kind == 'swarm-buddy';
+ /// A person's chat with one of their own agents (Swarm v3, backend #4116): the agent takes the message, so it needs no
+ /// Lead, as a Buddy chat needs none.
+ bool get isAgentChat => kind == 'agent-chat';
+
/// A person's one Buddy chat for the whole Swarm (spec
/// 2026-10-31-one-buddy-per-swarm): in no project, keyed by the empty id.
bool get isSwarmBuddyChat => kind == 'swarm-buddy';
diff --git a/desktop/lib/super_tabs/my_agents.dart b/desktop/lib/super_tabs/my_agents.dart
new file mode 100644
index 000000000..933aa0be2
--- /dev/null
+++ b/desktop/lib/super_tabs/my_agents.dart
@@ -0,0 +1,46 @@
+import 'model.dart';
+
+/// The agents [accountId] brought to the Swarm, for the left pane's My agents (Swarm v3, task #4118): their Buddy first,
+/// then the others by name. Only the person's own: another person's agent, and another person's Buddy, never appear.
+List<SuperTabAgent> superTabMyAgents(
+ SuperTabSnapshot snapshot,
+ String accountId,
+) {
+ final own = [
+ for (final agent in snapshot.agents)
+ if (agent.contributorId == accountId &&
+ (agent.buddyOf == null || agent.buddyOf == accountId))
+ agent,
+ ];
+ String name(SuperTabAgent agent) =>
+ (agent.displayName ?? agent.name).toLowerCase();
+ return own..sort((a, b) {
+ final buddy = (b.buddyOf != null ? 1 : 0) - (a.buddyOf != null ? 1 : 0);
+ return buddy != 0 ? buddy : name(a).compareTo(name(b));
+ });
+}
+
+/// Whether [agent] is a PM, to wear the crown: the backend's kind when it sends one (#4116), else whether it leads a
+/// project, as before.
+bool superTabAgentIsPm(SuperTabSnapshot snapshot, SuperTabAgent agent) =>
+ agent.kind != null ? agent.kind == 'pm' : snapshot.isLead(agent.id);
+
+/// The chat that opens when [agent] is chosen in My agents: a PM's is its project's chat, a Regular agent's is the open task
+/// it works on now (the newest, when several); null while it has none.
+SuperTabConversation? superTabAgentChat(
+ SuperTabSnapshot snapshot,
+ SuperTabAgent agent,
+) {
+ // The chat the backend names is the one its person talks to it in (#4116); an older backend names none.
+ if (agent.chatId case final id? when snapshot.conversation(id) != null) {
+ return snapshot.conversation(id);
+ }
+ if (snapshot.leadProjectForAgent(agent.id) case final project?) {
+ return snapshot.conversation(project.leadConversationId);
+ }
+ final tasks = [
+ for (final group in snapshot.conversations)
+ if (!group.closed && group.assignment?['agentId'] == agent.id) group,
+ ]..sort((a, b) => (b.number ?? 0).compareTo(a.number ?? 0));
+ return tasks.firstOrNull;
+}
diff --git a/desktop/lib/super_tabs/pane_layout.dart b/desktop/lib/super_tabs/pane_layout.dart
index a241ee13b..0597e79f2 100644
--- a/desktop/lib/super_tabs/pane_layout.dart
+++ b/desktop/lib/super_tabs/pane_layout.dart
@@ -5,7 +5,6 @@ import 'dart:math' as math;
import 'package:flutter/material.dart';
import '../core/local_key_value_store.dart';
-import '../shared/theme/app_theme.dart' as grid;
import '../state/pane_arrangement.dart';
import '../widgets/desktop_chrome.dart';
import '../widgets/pane_resize_handle.dart';
@@ -21,6 +20,8 @@ class SuperTabPaneLayout extends StatefulWidget {
this.right,
this.storage,
this.rightDefault = rightWidth,
+ this.rightMinimum = rightWidth,
+ this.rightFixed = false,
this.over,
});
@@ -34,6 +35,16 @@ class SuperTabPaneLayout extends StatefulWidget {
/// the narrowest the pane goes.
static const threadWidth = 340.0;
+ /// The Board's floor: the room it keeps while text scaling widens the
+ /// side panes.
+ static const boardFloor = 280.0;
+
+ /// Under this the centre pane has no room for a header, let alone cards.
+ static const _centerFloor = 160.0;
+
+ /// The Desktop's right pane, the Tasks pane: a fixed width, the middle taking the rest (River, Swarm v3).
+ static const boardRightWidth = 340.0;
+
/// The roster drawer's share of a narrow window at most. On a phone it filled the screen, leaving no
/// veil to tap, so closing it was hard (owner, 2026-10-23).
static const drawerMaxFraction = 0.7;
@@ -52,6 +63,12 @@ class SuperTabPaneLayout extends StatefulWidget {
/// width, saved, wins): [threadWidth] while it shows a thread.
final double rightDefault;
+ /// The narrowest the right pane goes, before text scaling.
+ final double rightMinimum;
+
+ /// The right pane is always [rightDefault] wide: no divider, and a width saved earlier is not used.
+ final bool rightFixed;
+
/// Drawn over the left and centre panes, leaving the right one as it is:
/// the picture viewer beside an open thread, as in Slack (Huy, 11-04).
final Widget? over;
@@ -61,6 +78,7 @@ class SuperTabPaneLayout extends StatefulWidget {
}
class _SuperTabPaneLayoutState extends State<SuperTabPaneLayout> {
+ static const _leftBase = 180.0;
double _left = SuperTabPaneLayout.leftWidth;
// Null until a person sets it, or it is restored: the right pane then
// takes the widget's default for what it shows.
@@ -132,19 +150,41 @@ class _SuperTabPaneLayoutState extends State<SuperTabPaneLayout> {
final scale = MediaQuery.textScalerOf(context);
final hasLeft = widget.left != null, hasRight = widget.right != null;
final centerMin = math.min(scale.scale(360), width);
- final leftMin = hasLeft ? scale.scale(180) : 0.0;
- final rightMin = hasRight ? scale.scale(280) : 0.0;
- double limit(double value, double floor, double ceiling) => value
- .clamp(math.min(floor, ceiling), math.max(0, ceiling))
- .toDouble();
+ // Text scaling widens the side panes only while the Board keeps its
+ // floor: the chat's scaled minimum gives back first, down to its own
+ // 420, then projects, down to 180 (reviews of #3863). The centre then
+ // yields before either side pane: a side's minimum wins over the room
+ // the centre's own preference asks for.
+ var leftMin = hasLeft ? scale.scale(_leftBase) : 0.0;
+ var rightMin = hasRight ? scale.scale(widget.rightMinimum) : 0.0;
+ var short =
+ leftMin +
+ rightMin +
+ math.min(SuperTabPaneLayout.boardFloor, width) -
+ width;
+ if (hasRight && short > 0) {
+ final give = math.min(short, rightMin - widget.rightMinimum);
+ rightMin -= give;
+ short -= give;
+ }
+ if (hasLeft && short > 0) {
+ leftMin -= math.min(short, leftMin - _leftBase);
+ }
+ double limit(double value, double floor, double ceiling) =>
+ value.clamp(floor, math.max(floor, ceiling)).toDouble();
final left = hasLeft
- ? limit(_left, leftMin, width - centerMin - rightMin)
+ ? math.min(width, limit(_left, leftMin, width - centerMin - rightMin))
: 0.0;
final right = hasRight
- ? limit(
- _right ?? widget.rightDefault,
- rightMin,
- width - centerMin - left,
+ ? math.min(
+ width - left,
+ limit(
+ widget.rightFixed
+ ? widget.rightDefault
+ : _right ?? widget.rightDefault,
+ rightMin,
+ width - centerMin - left,
+ ),
)
: 0.0;
final arrangement = PaneArrangement([
@@ -165,7 +205,11 @@ class _SuperTabPaneLayoutState extends State<SuperTabPaneLayout> {
),
Expanded(
key: const ValueKey('super-center-pane'),
- child: widget.center,
+ // A centre squeezed under what any Board needs draws
+ // nothing rather than overflowing into its neighbours.
+ child: width - left - right < SuperTabPaneLayout._centerFloor
+ ? const SizedBox.shrink()
+ : widget.center,
),
if (hasRight)
SizedBox(
@@ -191,42 +235,44 @@ class _SuperTabPaneLayoutState extends State<SuperTabPaneLayout> {
child: ColoredBox(color: DesktopChrome.rim),
),
),
- PaneResizeHandle(
- key: ValueKey(
- 'super-resize-${hasLeft && index == 0 ? 'left' : 'right'}',
+ // A fixed right pane has no divider to drag.
+ if (!widget.rightFixed || (hasLeft && index == 0))
+ PaneResizeHandle(
+ key: ValueKey(
+ 'super-resize-${hasLeft && index == 0 ? 'left' : 'right'}',
+ ),
+ arrangement: arrangement,
+ divider: divider,
+ extent: constraints.biggest,
+ minimum: Size(
+ math.min(
+ leftMin == 0 ? rightMin : leftMin,
+ rightMin == 0 ? leftMin : rightMin,
+ ) /
+ width,
+ 0,
+ ),
+ onLeave: widget.onLeave,
+ onChanged: (next, persist) {
+ ++_edit;
+ setState(() {
+ if (hasLeft && index == 0) {
+ _left = limit(
+ next.tiles.first.width * width,
+ leftMin,
+ width - centerMin - right,
+ );
+ } else {
+ _right = limit(
+ next.tiles.last.width * width,
+ rightMin,
+ width - centerMin - left,
+ );
+ }
+ });
+ if (persist) _save();
+ },
),
- arrangement: arrangement,
- divider: divider,
- extent: constraints.biggest,
- minimum: Size(
- math.min(
- leftMin == 0 ? rightMin : leftMin,
- rightMin == 0 ? leftMin : rightMin,
- ) /
- width,
- 0,
- ),
- onLeave: widget.onLeave,
- onChanged: (next, persist) {
- ++_edit;
- setState(() {
- if (hasLeft && index == 0) {
- _left = limit(
- next.tiles.first.width * width,
- leftMin,
- width - centerMin - right,
- );
- } else {
- _right = limit(
- next.tiles.last.width * width,
- rightMin,
- width - centerMin - left,
- );
- }
- });
- if (persist) _save();
- },
- ),
],
),
),
diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dart
index 9c0993107..6d36b04fe 100644
--- a/desktop/lib/super_tabs/project_sidebar.dart
+++ b/desktop/lib/super_tabs/project_sidebar.dart
@@ -17,6 +17,7 @@ import 'attention.dart';
import 'controller.dart';
import 'buddies.dart';
import 'model.dart';
+import 'my_agents.dart';
import 'personal_projects.dart' show PersonalProjects;
import 'places.dart';
import 'buddy_rows.dart';
@@ -62,6 +63,8 @@ class ProjectSidebar extends StatelessWidget {
this.onOpenBuddyChat,
this.compact = false,
this.board = false,
+ this.onNewAgent,
+ this.onOpenAgentChat,
});
final SuperTabController controller;
@@ -70,6 +73,13 @@ class ProjectSidebar extends StatelessWidget {
/// Desktop's Board layout (anh Dee, task #3787): no Threads row and no Buddy entry, the Buddy being the right pane.
final bool board;
+
+ /// + New agent (Swarm v3, task #4118): opens the creation dialog, where Regular or PM is chosen. Without it the section
+ /// has no + .
+ final VoidCallback? onNewAgent;
+
+ /// Opens the chat of an agent chosen in My agents in the middle; [onSelect] when not given.
+ final ValueChanged<String>? onOpenAgentChat;
final ValueChanged<String> onSelect;
final AppNotifier? app;
final VoidCallback? onNewProject;
@@ -589,11 +599,71 @@ class ProjectSidebar extends StatelessWidget {
// Muted, it is greyed and never bold, as every chat (_drawRow).
unread: chat != null && controller.unreadShown(chat),
trailing: agent == null ? null : _buddyMark(agent),
- onTap: chat == null ? () => _openBuddyChat(key) : null,
+ // On the Desktop its chat opens in the middle (Swarm v3, task #4118), like any agent's.
+ onTap: chat == null
+ ? () => _openBuddyChat(key)
+ : board && onOpenAgentChat != null
+ ? () => onOpenAgentChat!(chat.id)
+ : null,
tappable: chat != null || !busy,
);
}
+ /// My agents (Swarm v3, task #4118): the person's Buddy first, then the agents they brought, each with its face and name,
+ /// a crown after a PM's, the name bold while its chat has unread, and + New agent in the heading.
+ List<Widget> _myAgents(
+ BuildContext context,
+ SuperTabSnapshot? snapshot,
+ _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'),
+ 'My agents',
+ titleStyle: _headingStyle,
+ endInset: 0,
+ ),
+ if (controller.oneBuddy)
+ ?_swarmBuddyRow()
+ else
+ ..._buddies([...snapshot.projects], reading),
+ for (final agent in mine) _agentRow(snapshot, agent),
+ // The last row opens the creation dialog, where Regular or PM is chosen.
+ if (controller.canWrite && onNewAgent != null)
+ _navigationRow(
+ key: 'super-new-agent-row',
+ label: 'New agent',
+ icon: AppIcons.plus,
+ onTap: onNewAgent,
+ ),
+ const SizedBox(height: 16),
+ ];
+ }
+
+ Widget _agentRow(SuperTabSnapshot snapshot, SuperTabAgent agent) {
+ final chat = superTabAgentChat(snapshot, agent);
+ final name = snapshot.agentName(agent.id, fallback: agent.name);
+ return SuperTabBuddyRow(
+ key: ValueKey('super-agent-${agent.id}'),
+ agentId: agent.id,
+ name: name,
+ tooltip: chat == null ? '$name · no chat yet' : name,
+ crownKey: superTabAgentIsPm(snapshot, agent)
+ ? ValueKey('super-agent-crown-${agent.id}')
+ : null,
+ status: _buddyMark(agent),
+ selected:
+ chat != null && !_paneCovered && controller.selectedId == chat.id,
+ unread: chat != null && controller.unreadShown(chat),
+ onTap: chat == null ? null : () => (onOpenAgentChat ?? onSelect)(chat.id),
+ );
+ }
+
/// The Buddy's activity mark, drawn as the Agents list draws an agent's.
Widget? _buddyMark(SuperTabAgent agent) {
final app = this.app;
@@ -695,6 +765,27 @@ class ProjectSidebar extends StatelessWidget {
final decisions = activity?.needsCount ?? snapshot?.decisionsWaiting ?? 0;
final mentions = activity?.mentionsCount ?? snapshot?.mentionsWaiting ?? 0;
final threads = activity?.threadsCount ?? 0;
+ final switcher = switch ((app, onNewSwarm)) {
+ (final app?, final onNewSwarm?) => SwarmSwitcher(
+ app: app,
+ controller: controller,
+ onNewSwarm: onNewSwarm,
+ row:
+ ({
+ required label,
+ required icon,
+ required onTap,
+ required trailing,
+ }) => _navigationRow(
+ key: 'super-swarm-switcher',
+ label: label,
+ icon: icon,
+ onTap: onTap,
+ trailing: trailing,
+ ),
+ ),
+ _ => null,
+ };
return Material(
// The page's color: the rule at its edge is what separates them. A
// theme may give the sidebar its own (Plum's plum).
@@ -707,26 +798,11 @@ class ProjectSidebar extends StatelessWidget {
child: LaidOutListView(
padding: const EdgeInsets.all(8),
children: [
+ // The Desktop's org switcher is the first thing in the pane (Swarm v3 spec); elsewhere it follows the
+ // back and forward arrows.
+ if (board) ?switcher,
if (places case final places?) _arrows(places),
- if ((app, onNewSwarm) case (final app?, final onNewSwarm?))
- SwarmSwitcher(
- app: app,
- controller: controller,
- onNewSwarm: onNewSwarm,
- row:
- ({
- required label,
- required icon,
- required onTap,
- required trailing,
- }) => _navigationRow(
- key: 'super-swarm-switcher',
- label: label,
- icon: icon,
- onTap: onTap,
- trailing: trailing,
- ),
- ),
+ if (!board) ?switcher,
// Three rows, each one thing, in anh Dee's order (11-05, task
// #2996): bold when something waits, grey when not, and no
// numbers (task #3128). The Swarm switcher stands apart from
@@ -742,14 +818,16 @@ class ProjectSidebar extends StatelessWidget {
icon: AppIcons.flag,
waiting: decisions,
),
- _pageRow(
- onPage,
- target: SwarmPage.mentions,
- key: 'super-mentions',
- label: 'Mentions',
- icon: AppIcons.atSign,
- waiting: mentions,
- ),
+ // Mentions goes from the Desktop's left pane (Swarm v3, anh Dee 11-07).
+ if (!board)
+ _pageRow(
+ onPage,
+ target: SwarmPage.mentions,
+ key: 'super-mentions',
+ label: 'Mentions',
+ icon: AppIcons.atSign,
+ waiting: mentions,
+ ),
if (!board)
_pageRow(
onPage,
@@ -761,6 +839,7 @@ class ProjectSidebar extends StatelessWidget {
),
],
const SizedBox(height: 20),
+ if (board) ..._myAgents(context, snapshot, reading),
SuperTabSectionHeading(
key: const ValueKey('project-sidebar-projects'),
'Projects',
@@ -780,12 +859,18 @@ class ProjectSidebar extends StatelessWidget {
onAdd: controller.canWrite ? onNewProject : null,
addTooltip: 'New project',
endInset: 0,
+ // The Desktop folds Projects: closed while the person has an agent (Swarm v3, #4118).
+ collapsed: board ? !controller.projectsOpen : null,
+ onToggleCollapsed: board
+ ? controller.toggleProjectsGroup
+ : null,
),
// The reader's one Buddy, the first item under Projects (anh
// Dee, 11-05).
if (controller.oneBuddy && !board) ?_swarmBuddyRow(),
- for (final (_, channel) in _channels(snapshot, reading))
- channel,
+ if (!board || controller.projectsOpen)
+ for (final (_, channel) in _channels(snapshot, reading))
+ channel,
const SizedBox(height: 16),
// Buddies replaced Chat with PM in every Swarm (Ken, 10-29); where the
// server gives one Buddy for the whole Swarm, it is # buddy above.
diff --git a/desktop/lib/super_tabs/task_card.dart b/desktop/lib/super_tabs/task_card.dart
index 587a11ad0..0324f61b7 100644
--- a/desktop/lib/super_tabs/task_card.dart
+++ b/desktop/lib/super_tabs/task_card.dart
@@ -1,7 +1,10 @@
import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import '../shared/theme/app_icons.dart';
import '../shared/theme/app_theme.dart' as grid;
import '../shared/theme/appearance_prefs_store.dart';
+import '../shared/theme/pull_request_icon.dart';
import '../state/harness_activity.dart';
import '../terminal/terminal_theme.dart';
import '../terminal/terminal_theme_store.dart';
@@ -9,6 +12,18 @@ import '../widgets/desktop_chrome.dart';
import '../widgets/harness_activity_mark.dart';
import 'backlog.dart';
import 'chip.dart';
+import 'identity.dart';
+import 'model.dart';
+import 'task_groups.dart';
+
+/// A Board card's pull request ("#3480") and acceptance checks done of all.
+/// None of a kind shows nothing (task #3869).
+class SuperTabCardFacts {
+ const SuperTabCardFacts({this.pullRequest, this.checks});
+ final String? pullRequest;
+ final ({int done, int total})? checks;
+ bool get isEmpty => pullRequest == null && checks == null;
+}
/// One card of a project's Tasks view, on the Board and as a List row alike:
/// its title (up to [titleLines]), its caption led by its [priority] (task
@@ -37,6 +52,10 @@ class SuperTabTaskCard extends StatefulWidget {
this.tile = false,
this.selected = false,
this.warn = false,
+ this.chips = const [],
+ this.facts = const SuperTabCardFacts(),
+ this.agent,
+ this.requester,
this.trailing,
this.note,
this.noteKey,
@@ -63,6 +82,13 @@ class SuperTabTaskCard extends StatefulWidget {
/// The caption is a warning (a merge that has waited too long).
final bool warn;
+
+ /// A tile's state chips, its pull request and checks, and the agent on it and who asked, which sit in its
+ /// footer, the avatars bottom right (task #3869). A List row shows none of them.
+ final List<SuperTabStateChip> chips;
+ final SuperTabCardFacts facts;
+ final SuperTabAgent? agent;
+ final SuperTabPerson? requester;
final Widget? trailing;
/// A tile's padding: the spacing scale's 12, between the control and the
@@ -114,6 +140,10 @@ class _SuperTabTaskCardState extends State<SuperTabTaskCard> {
_ => w.activity.label,
},
if (w.unread) 'New replies',
+ for (final chip in w.chips) chip.label,
+ ?w.facts.pullRequest,
+ if (w.facts.checks case final checks?)
+ '${checks.done} of ${checks.total} checks done',
].join(', '),
excludeSemantics: true,
child: _surface(
@@ -140,6 +170,21 @@ class _SuperTabTaskCardState extends State<SuperTabTaskCard> {
?w.trailing,
],
),
+ if (w.tile && w.chips.isNotEmpty) ...[
+ const SizedBox(height: grid.AppDesktop.controlGap),
+ Wrap(
+ spacing: grid.AppDesktop.menuInset,
+ runSpacing: grid.AppDesktop.menuInset,
+ children: [for (final chip in w.chips) _chip(chip)],
+ ),
+ ],
+ if (w.tile &&
+ (!w.facts.isEmpty ||
+ w.agent != null ||
+ w.requester != null)) ...[
+ const SizedBox(height: grid.AppDesktop.controlGap),
+ _footer(),
+ ],
],
),
),
@@ -222,6 +267,77 @@ class _SuperTabTaskCardState extends State<SuperTabTaskCard> {
);
}
+ Widget _chip(SuperTabStateChip chip) =>
+ superTabTintedChip(chip.label, switch (chip) {
+ SuperTabStateChip.readyToMerge => grid.AppPalette.online,
+ SuperTabStateChip.ciFailing => grid.AppPalette.usageCritical,
+ SuperTabStateChip.needsYou => grid.AppPalette.warn,
+ }, key: ValueKey('super-card-chip-${chip.name}'));
+
+ /// The pull request and checks on the left, and on the right the agent's avatar with the requester's
+ /// small beside it, bottom right, where a Trello card puts its members.
+ Widget _footer() {
+ final w = widget;
+ Widget fact(String key, Widget icon, String text) => Padding(
+ padding: const EdgeInsets.only(right: grid.AppDesktop.controlGap),
+ child: Row(
+ key: ValueKey(key),
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ icon,
+ const SizedBox(width: grid.AppDesktop.listRowGap * 2),
+ Text(text, style: DesktopChrome.metadata()),
+ ],
+ ),
+ );
+ const iconSize = 14.0;
+ return Row(
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ if (w.facts.pullRequest case final pr?)
+ fact(
+ 'super-card-pr',
+ SvgPicture.asset(
+ pullRequestIconAsset('Open'),
+ width: iconSize,
+ height: iconSize,
+ colorFilter: ColorFilter.mode(
+ DesktopChrome.muted,
+ BlendMode.srcIn,
+ ),
+ ),
+ pr,
+ ),
+ if (w.facts.checks case final checks?)
+ fact(
+ 'super-card-checks',
+ Icon(AppIcons.check, size: iconSize, color: DesktopChrome.muted),
+ '${checks.done}/${checks.total}',
+ ),
+ const Spacer(),
+ if (w.requester case final person?) ...[
+ SuperTabAvatar.person(
+ person,
+ key: const ValueKey('super-card-requester'),
+ size: _requesterSize,
+ ),
+ const SizedBox(width: grid.AppDesktop.listRowGap * 2),
+ ],
+ if (w.agent case final agent?)
+ SuperTabAvatar.agent(
+ agent,
+ key: const ValueKey('super-card-agent'),
+ size: _agentSize,
+ engineBadge: false,
+ ),
+ ],
+ );
+ }
+
+ /// The agent's avatar, the size of a roster row's, and the requester's a step smaller beside it.
+ static const _agentSize = SuperTabAvatar.rowSize;
+ static const _requesterSize = 18.0;
+
Widget _mark() => ListenableBuilder(
listenable: Listenable.merge([terminalThemeStore, appearancePrefsStore]),
builder: (context, _) => ActivityMark(
diff --git a/desktop/lib/super_tabs/task_groups.dart b/desktop/lib/super_tabs/task_groups.dart
index f6b4bc2a9..1f15a0adc 100644
--- a/desktop/lib/super_tabs/task_groups.dart
+++ b/desktop/lib/super_tabs/task_groups.dart
@@ -115,14 +115,51 @@ Duration? superTabMergeWait(SuperTabConversation task, DateTime now) {
/// Past this a merge waiting turns to a warning, so a merge bottleneck shows.
const superTabMergeWarnAfter = Duration(hours: 1);
-/// Whether [task] is done, not merged, and has waited past the warning.
-bool superTabMergeOverdue(SuperTabConversation task, DateTime now) =>
+/// Whether [task] is done and waits for its pull request to merge.
+bool _waitingToMerge(SuperTabConversation task) =>
task.assignment?['status'] == 'done' &&
!task.closed &&
!superTabTaskReleasing(task) &&
- !superTabTaskShipped(task) &&
+ !superTabTaskShipped(task);
+
+/// Whether [task] is done, not merged, and has waited past the warning.
+bool superTabMergeOverdue(SuperTabConversation task, DateTime now) =>
+ _waitingToMerge(task) &&
(superTabMergeWait(task, now) ?? Duration.zero) > superTabMergeWarnAfter;
+/// The state chips a Board card wears (task #3869), each a colour and its words: green Ready to merge, red CI failing,
+/// yellow Needs you. A chip says its state once: the card's quiet line leaves the same words out ([superTabQuietState]).
+enum SuperTabStateChip {
+ readyToMerge('Ready to merge'),
+ ciFailing('CI failing'),
+ needsYou('Needs you');
+
+ const SuperTabStateChip(this.label);
+ final String label;
+}
+
+/// The chips of [entry]'s card, in the order they read.
+List<SuperTabStateChip> superTabStateChips(SuperTabTaskEntry entry) {
+ final task = entry.task;
+ final checks = task == null ? null : _checksOf(task);
+ return [
+ if (checks == 'red') SuperTabStateChip.ciFailing,
+ if (task != null && checks == 'green' && _waitingToMerge(task))
+ SuperTabStateChip.readyToMerge,
+ if (entry.needsYou) SuperTabStateChip.needsYou,
+ ];
+}
+
+/// A card's quiet line with what its chips and footer already say left out: the red checks (a chip), the green that leads
+/// "green, waiting 12 min" and the pull request (the footer's); null when nothing is left.
+String? superTabQuietState(String? state) => switch (state) {
+ 'CI red' => null,
+ // The footer names the pull request.
+ final String text when RegExp(r'^PR #\d+$').hasMatch(text) => null,
+ final String text when text.startsWith('green, ') => text.substring(7),
+ _ => state,
+};
+
/// A task's checks as the server recorded them for the pull requests it still links, the worst first: `red`, then `running`,
/// then `green`; null when it recorded none (an older server, or the watch has not read one).
String? _checksOf(SuperTabConversation task) {
diff --git a/desktop/lib/super_tabs/tasks_view.dart b/desktop/lib/super_tabs/tasks_view.dart
index 6d46b97c2..d66eeeace 100644
--- a/desktop/lib/super_tabs/tasks_view.dart
+++ b/desktop/lib/super_tabs/tasks_view.dart
@@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:convert';
+import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -61,10 +62,12 @@ class SuperTabTasksView extends StatefulWidget {
final LocalKeyValueStore? storage;
final DateTime Function() now;
- /// A Board column's width: about a card and a half of title per line, so
- /// five fit a wide window and a narrow one scrolls sideways (task #2948).
+ /// A Members column's width: about a card and a half of title per line (task #2948).
static const columnWidth = 280.0;
+ /// The least a Board column takes (task #3869): the columns share the pane's width, and below this the Board scrolls.
+ static const minColumnWidth = 240.0;
+
static String storageKey(String accountId) =>
'super-tab-tasks-view/$accountId';
@@ -93,6 +96,19 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
bool _droppedOnNextUp = false;
final _nextUpKey = GlobalKey();
+ /// The Board's sideways scroll, shared with its scrollbar.
+ final _boardScroll = ScrollController();
+
+ /// The Search field's text, so Show all can empty it.
+ final _search = TextEditingController();
+
+ @override
+ void dispose() {
+ _boardScroll.dispose();
+ _search.dispose();
+ super.dispose();
+ }
+
@override
void initState() {
super.initState();
@@ -207,6 +223,7 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
key: value.where(_keeps).toList(),
};
final empty = board.values.every((entries) => entries.isEmpty);
+ final hidden = shown.values.every((entries) => entries.isEmpty);
final pulse = c.snapshot?.pulseOf(project.id);
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -243,6 +260,8 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
style: DesktopChrome.control(color: DesktopChrome.muted),
),
)
+ : hidden
+ ? _noMatch()
: _layout == _Layout.list
? _listView(shown, now)
: _boardView(shown, now),
@@ -251,6 +270,34 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
);
}
+ /// What Mine and Search hid, so a filtered board never reads as an empty
+ /// project (Dee, task #3869); Show all lifts both.
+ Widget _noMatch() {
+ final filters = [if (_mine) 'Mine', if (_query.isNotEmpty) '“$_query”'];
+ return Center(
+ key: const ValueKey('super-tasks-no-match'),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ 'No cards match ${filters.join(' and ')}',
+ style: DesktopChrome.control(color: DesktopChrome.muted),
+ ),
+ const SizedBox(height: grid.AppDesktop.controlGap),
+ DesktopPill(
+ key: const ValueKey('super-tasks-show-all'),
+ label: 'Show all',
+ onPressed: () {
+ _search.clear();
+ setState(() => _query = '');
+ _choose(mine: false);
+ },
+ ),
+ ],
+ ),
+ );
+ }
+
/// Over a switched project's Board (#3820): everything in it that waits on the reader, each opening its card's
/// chat; null when nothing does.
Widget? _needsYou(Map<SuperTabTaskColumn, List<SuperTabTaskEntry>> board) {
@@ -300,80 +347,100 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
/// The view's own bar: Board, List or Members, Mine and Search, nothing
/// else.
- Widget _bar(BuildContext context) => Padding(
- padding: const EdgeInsets.fromLTRB(
- grid.AppDesktop.groupGap,
- grid.AppDesktop.controlGap,
- grid.AppDesktop.groupGap,
- grid.AppDesktop.controlGap,
- ),
- child: Row(
- children: [
- Text('Tasks', style: DesktopChrome.text(medium: true)),
- if (_moveError case final error?) ...[
- const SizedBox(width: grid.AppDesktop.groupGap),
- Flexible(
- child: Text(
- error,
- key: const ValueKey('super-tasks-move-error'),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: DesktopChrome.metadata(),
- ),
- ),
- ],
- const Spacer(),
- DesktopPill(
- key: const ValueKey('super-tasks-layout-board'),
- label: 'Board',
- selected: _layout == _Layout.board,
- onPressed: () => _choose(layout: _Layout.board),
- ),
- const SizedBox(width: grid.AppDesktop.listRowGap),
- DesktopPill(
- key: const ValueKey('super-tasks-layout-list'),
- label: 'List',
- selected: _layout == _Layout.list,
- onPressed: () => _choose(layout: _Layout.list),
- ),
- const SizedBox(width: grid.AppDesktop.listRowGap),
- DesktopPill(
- key: const ValueKey('super-tasks-layout-members'),
- label: 'Members',
- selected: _layout == _Layout.members,
- tooltip: 'Tasks by crew member',
- onPressed: () => _choose(layout: _Layout.members),
+ Widget _bar(BuildContext context) {
+ final title = Text('Tasks', style: DesktopChrome.text(medium: true));
+ final error = _moveError == null
+ ? null
+ : Text(
+ _moveError!,
+ key: const ValueKey('super-tasks-move-error'),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: DesktopChrome.metadata(),
+ );
+ // Keep controls stable while a divider changes only their layout.
+ final controls = <Widget>[
+ // The Board is the project's Board tab above (or the view itself): List and Members are toggles back to it.
+ DesktopPill(
+ key: const ValueKey('super-tasks-layout-list'),
+ label: 'List',
+ selected: _layout == _Layout.list,
+ onPressed: () => _choose(
+ layout: _layout == _Layout.list ? _Layout.board : _Layout.list,
),
- const SizedBox(width: grid.AppDesktop.groupGap),
- DesktopPill(
- key: const ValueKey('super-tasks-mine'),
- label: 'Mine',
- selected: _mine,
- tooltip: 'Only the tasks you asked for',
- onPressed: () => _choose(mine: !_mine),
+ ),
+ const SizedBox(width: grid.AppDesktop.listRowGap),
+ DesktopPill(
+ key: const ValueKey('super-tasks-layout-members'),
+ label: 'Members',
+ selected: _layout == _Layout.members,
+ tooltip: 'Tasks by crew member',
+ onPressed: () => _choose(
+ layout: _layout == _Layout.members ? _Layout.board : _Layout.members,
),
- const SizedBox(width: grid.AppDesktop.controlGap),
- SizedBox(
- width: _searchWidth,
- child: TextField(
- key: const ValueKey('super-tasks-search'),
- onChanged: (query) => setState(() => _query = query.trim()),
- textInputAction: TextInputAction.search,
- style: grid.kFieldTextStyle,
- decoration: InputDecoration(
- hintText: 'Search',
- isDense: true,
- prefixIcon: Icon(
- AppIcons.search,
- size: grid.kFieldIconSize,
- color: grid.AppPalette.textFaint,
- ),
+ ),
+ const SizedBox(width: grid.AppDesktop.groupGap),
+ DesktopPill(
+ key: const ValueKey('super-tasks-mine'),
+ label: 'Mine',
+ selected: _mine,
+ tooltip: 'Only the tasks you asked for',
+ onPressed: () => _choose(mine: !_mine),
+ ),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ SizedBox(
+ width: _searchWidth,
+ child: TextField(
+ key: const ValueKey('super-tasks-search'),
+ controller: _search,
+ onChanged: (query) => setState(() => _query = query.trim()),
+ textInputAction: TextInputAction.search,
+ style: grid.kFieldTextStyle,
+ decoration: InputDecoration(
+ hintText: 'Search',
+ isDense: true,
+ prefixIcon: Icon(
+ AppIcons.search,
+ size: grid.kFieldIconSize,
+ color: grid.AppPalette.textFaint,
),
),
),
- ],
- ),
- );
+ ),
+ ];
+ return Padding(
+ padding: const EdgeInsets.fromLTRB(
+ grid.AppDesktop.groupGap,
+ grid.AppDesktop.controlGap,
+ grid.AppDesktop.groupGap,
+ grid.AppDesktop.controlGap,
+ ),
+ // These render objects reflow the controls without rebuilding them on
+ // every divider movement. Wide windows keep the title left and controls right.
+ child: OverflowBar(
+ alignment: MainAxisAlignment.spaceBetween,
+ overflowAlignment: OverflowBarAlignment.start,
+ overflowSpacing: grid.AppDesktop.controlGap,
+ children: [
+ Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ title,
+ if (error != null) ...[
+ const SizedBox(width: grid.AppDesktop.groupGap),
+ Flexible(child: error),
+ ],
+ ],
+ ),
+ Wrap(
+ crossAxisAlignment: WrapCrossAlignment.center,
+ runSpacing: grid.AppDesktop.controlGap,
+ children: controls,
+ ),
+ ],
+ ),
+ );
+ }
static const _searchWidth = 220.0;
static const _columnGap = grid.AppDesktop.groupGap;
@@ -425,7 +492,20 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
/// The caption under a card's title: who asked, the agent on it and its
/// state, joined by middle dots; a proposal's says who asked and how long
/// ago. No task numbers, machines or models.
- String _caption(SuperTabTaskEntry entry, DateTime now) {
+ String _caption(SuperTabTaskEntry entry, DateTime now, {bool tile = false}) {
+ // A tile names no one: its avatars do, and its chips say what its state says (task #3869).
+ if (tile) {
+ if (entry.proposal case final proposal?) {
+ return superTabAgoShort(now.difference(proposal.at));
+ }
+ // Who waits is the "Needs you" chip's to say, not the line's.
+ final waitingOnReader =
+ entry.needsYou &&
+ !superTabTaskShipped(entry.task!) &&
+ (entry.task!.assignment?['status'] == 'needs_human' ||
+ entry.task!.liveness?['why'] == 'person');
+ return waitingOnReader ? '' : superTabQuietState(entry.state) ?? '';
+ }
final snapshot = widget.controller.snapshot;
if (entry.proposal case final proposal?) {
return [
@@ -550,7 +630,14 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
}) {
final task = entry.task;
final id = task?.id ?? entry.proposal!.messageId;
- final caption = _caption(entry, now);
+ final caption = _caption(entry, now, tile: !list);
+ final snapshot = widget.controller.snapshot;
+ final agentId = task?.assignment?['agentId'];
+ // A proposal's card names who proposed it (#3817), here as its requester avatar.
+ final requesterId =
+ task?.requesterId ??
+ task?.proposal?.senderIds.firstOrNull ??
+ entry.proposal?.personId;
return SuperTabTaskCard(
key: ValueKey('super-task-card-$id'),
// A legacy marker is the badge now: the title drops it.
@@ -578,6 +665,12 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
? null
: 1,
tile: !list,
+ chips: list ? const [] : superTabStateChips(entry),
+ facts: list || task == null ? const SuperTabCardFacts() : _facts(task),
+ agent: list || agentId is! String ? null : snapshot?.agent(agentId),
+ requester: list
+ ? null
+ : snapshot?.people.where((p) => p.id == requesterId).firstOrNull,
note: _note(entry, now),
noteKey: ValueKey('super-task-card-note-$id'),
warn: task != null && superTabMergeOverdue(task, now),
@@ -587,33 +680,70 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {
);
}
- /// The Board: each column a neutral panel of a fixed width (Huy, task
- /// #2948), side by side in one row that scrolls sideways when the window is
- /// narrower than all five; each column scrolls its own cards.
+ /// The footer uses only facts the snapshot provides. A message sequence
+ /// includes the tab's baseline, so it cannot serve as a comment count.
+ SuperTabCardFacts _facts(SuperTabConversation task) {
+ final url =
+ task.cards.pullRequests.firstOrNull?.url ??
+ task.pullRequestUrls.firstOrNull;
+ final number = url == null
+ ? null
+ : int.tryParse(Uri.tryParse(url)?.pathSegments.last ?? '');
+ return SuperTabCardFacts(
+ pullRequest: number == null ? null : '#$number',
+ checks: task.checks.isEmpty
+ ? null
+ : (
+ done: task.checks.where((c) => c['passedBy'] != null).length,
+ total: task.checks.length,
+ ),
+ );
+ }
+
+ /// The Board: each column a neutral panel, all of one width that shares the
+ /// pane (task #3869), never under [SuperTabTasksView.minColumnWidth]. Below
+ /// it the row scrolls sideways under a scrollbar that stays in view, which a
+ /// mouse drags; a trackpad swipe and shift with the wheel scroll it too. Each
+ /// column scrolls its own cards.
Widget _boardView(
Map<SuperTabTaskColumn, List<SuperTabTaskEntry>> shown,
DateTime now,
- ) => SingleChildScrollView(
- key: const ValueKey('super-tasks-board'),
- scrollDirection: Axis.horizontal,
- padding: const EdgeInsets.only(
- left: grid.AppDesktop.groupGap,
- right: grid.AppDesktop.groupGap,
- bottom: grid.AppDesktop.groupGap,
- ),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- for (final column in SuperTabTaskColumn.values) ...[
- if (column != SuperTabTaskColumn.values.first)
- const SizedBox(width: _columnGap),
- SizedBox(
- width: SuperTabTasksView.columnWidth,
- child: _panel(column, shown[column]!, now),
+ ) => LayoutBuilder(
+ builder: (context, box) {
+ const edge = grid.AppDesktop.groupGap;
+ final count = SuperTabTaskColumn.values.length;
+ final share =
+ (box.maxWidth - 2 * edge - (count - 1) * _columnGap) / count;
+ final width = math.max(SuperTabTasksView.minColumnWidth, share);
+ return Scrollbar(
+ key: const ValueKey('super-tasks-board-scrollbar'),
+ controller: _boardScroll,
+ thumbVisibility: share < SuperTabTasksView.minColumnWidth,
+ child: SingleChildScrollView(
+ key: const ValueKey('super-tasks-board'),
+ controller: _boardScroll,
+ scrollDirection: Axis.horizontal,
+ padding: const EdgeInsets.only(
+ left: edge,
+ right: edge,
+ bottom: grid.AppDesktop.groupGap,
),
- ],
- ],
- ),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ for (final column in SuperTabTaskColumn.values) ...[
+ if (column != SuperTabTaskColumn.values.first)
+ const SizedBox(width: _columnGap),
+ SizedBox(
+ width: width,
+ child: _panel(column, shown[column]!, now),
+ ),
+ ],
+ ],
+ ),
+ ),
+ );
+ },
);
/// A lane's tint, as Trello's lists (anh Dee, task #3787): a step off the
diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dart
index bf64a6e7a..e1985b3fc 100644
--- a/desktop/lib/super_tabs/view.dart
+++ b/desktop/lib/super_tabs/view.dart
@@ -62,6 +62,7 @@ import 'crew_panel.dart';
import 'instructions_panel.dart';
import 'project_rules.dart';
import 'model.dart';
+import 'join/new_agent_dialog.dart';
import 'agent_details.dart';
import 'identity.dart' show superTabMachineName;
import 'identity_card.dart';
@@ -135,6 +136,7 @@ class SuperTabView extends StatefulWidget {
this.terminalsVisible = false,
this.app,
this.onNewProject,
+ this.rightPane,
this.onNewSwarm,
this.onChooseAgentTerminal,
this.linkSwarms,
@@ -144,7 +146,7 @@ class SuperTabView extends StatefulWidget {
});
final SuperTabController controller;
- /// Where the hidden left rail and Buddy pane are remembered (task #3787); the app's local store when null.
+ /// Where pane widths are remembered; the app's local store when null.
final LocalKeyValueStore? paneStore;
/// Desktop's layout of task #3787 (anh Dee): a project opens its Board with the person's Buddy beside it, the left
@@ -165,6 +167,11 @@ class SuperTabView extends StatefulWidget {
final AppNotifier? app;
final VoidCallback? onNewProject;
+ /// The Desktop's right pane (Swarm v3's Tasks, task #4119): always shown, never collapsing, in the pane layout's right
+ /// slot. Given, the chat of the selected agent or project is in the middle; without it the right pane keeps the Board's
+ /// chat as before.
+ final Widget Function(BuildContext context)? rightPane;
+
/// The existing New Swarm, for the Swarm dropdown atop the left bar; none
/// without it.
final VoidCallback? onNewSwarm;
@@ -218,47 +225,6 @@ class _SuperTabViewState extends State<SuperTabView>
/// the right (anh Dee, task #3787): opening a project shows its Board, not its chat.
String? _boardProjectId;
- /// The left rail and the Buddy pane, hidden by their icons; remembered ([_paneStore]).
- bool _leftHidden = false, _rightHidden = false;
- static const _leftHiddenKey = 'swarm_left_pane_hidden';
- static const _rightHiddenKey = 'swarm_right_pane_hidden';
- LocalKeyValueStore? get _paneStore =>
- widget.paneStore ?? widget.app?.localStore;
-
- Future<void> _loadPanes() async {
- final store = _paneStore;
- if (store == null) return;
- try {
- final left = await store.read(_leftHiddenKey) == '1';
- final right = await store.read(_rightHiddenKey) == '1';
- if (!mounted) return;
- setState(() {
- _leftHidden = left;
- _rightHidden = right;
- });
- } catch (_) {
- // Unreadable: both panes show.
- }
- }
-
- void _togglePane({required bool left}) {
- setState(() {
- if (left) {
- _leftHidden = !_leftHidden;
- } else {
- _rightHidden = !_rightHidden;
- }
- });
- final store = _paneStore;
- if (store == null) return;
- final hidden = left ? _leftHidden : _rightHidden;
- unawaited(
- store
- .write(left ? _leftHiddenKey : _rightHiddenKey, hidden ? '1' : '0')
- .catchError((Object _) {}),
- );
- }
-
/// Opens [project]'s Board in the middle, with the person's Buddy on the right.
void _openBoard(SuperTabProject project) {
c.leaveDevices();
@@ -267,11 +233,53 @@ class _SuperTabViewState extends State<SuperTabView>
_page = null;
_showManage = _showTasks = _showPullRequests = false;
_boardProjectId = project.id;
+ _agentChatId = null;
});
_showBuddy(project);
_closeSidebar();
}
+ /// A project's own chat is open and no Board is: its Chat view, with the
+ /// header's Members, Terminals and Tasks icons, as before the fixed
+ /// layout. Its Tasks icon opens the Board with projects and the Buddy.
+ /// The chat the reader chose in My agents (Swarm v3, task #4118), shown in the middle while it stays the selected one.
+ String? _agentChatId;
+
+ /// Opens the chat of an agent chosen in My agents in the middle: the Board closes and the chat takes its place.
+ void _openAgentChat(String id) {
+ c.leaveDevices();
+ widget.onCloseTerminal?.call();
+ setState(() {
+ _page = null;
+ _showManage = _showTasks = _showPullRequests = false;
+ _boardProjectId = null;
+ _agentChatId = id;
+ });
+ c.select(id);
+ _closeSidebar();
+ }
+
+ bool get _projectChatOnly {
+ final group = c.selected;
+ return _boardProjectId == null &&
+ group != null &&
+ !group.isBuddyChat &&
+ c.snapshot?.projectById(group.projectId) != null;
+ }
+
+ /// Keeps the Board of the project [group] belongs to in the middle, for a
+ /// task or project chat opened by a card, a link or a notice; the Buddy's
+ /// own chat names no project of its own.
+ void _showBoardOf(SuperTabConversation group) {
+ if (!widget.board || group.isBuddyChat) return;
+ final project = c.snapshot?.projectById(group.projectId);
+ if (project == null) return;
+ setState(() {
+ _boardProjectId = project.id;
+ if (group.id != project.leadConversationId) _tasksSelectedId = group.id;
+ });
+ }
+
/// The person's Buddy chat on the right: the Swarm's one Buddy, or this project's.
void _showBuddy(SuperTabProject project) {
final key = c.oneBuddy ? SuperTabController.kSwarmBuddyKey : project.id;
@@ -440,7 +448,6 @@ class _SuperTabViewState extends State<SuperTabView>
c.addListener(_changed);
c.addListener(_holdVoiceAway);
c.buddyChatOpener = _openBuddyChat;
- unawaited(_loadPanes());
SuperTabChatNotices.of(c).chatShown = _chatShown;
SuperTabPlaces.of(c).addListener(_takePlace);
_registerDial();
@@ -2092,6 +2099,8 @@ class _SuperTabViewState extends State<SuperTabView>
compact: _phone,
app: widget.app,
onNewProject: widget.onNewProject,
+ onNewAgent: widget.app == null ? null : _newAgent,
+ onOpenAgentChat: _openAgentChat,
onNewSwarm: widget.onNewSwarm,
page: _pageShown,
places: SuperTabPlaces.of(c),
@@ -2122,6 +2131,15 @@ class _SuperTabViewState extends State<SuperTabView>
onOpenBuddyChat: (projectId) => unawaited(_openBuddyChat(projectId)),
);
+ /// + New agent (Swarm v3, task #4118): the creation dialog, where Regular or PM is chosen and the agent starts on this
+ /// computer. It needs the app: a view without one has no +.
+ void _newAgent() {
+ final app = widget.app;
+ if (app != null) {
+ unawaited(showSwarmNewAgentDialog(context, controller: c, app: app));
+ }
+ }
+
/// Opens the reader's Buddy chat in [projectId] in front of Notifications,
/// pull requests and a terminal, opening it on the server when they have
/// none yet: the sidebar's way in and ⇧⌘K's
@@ -2283,9 +2301,8 @@ class _SuperTabViewState extends State<SuperTabView>
/// Opens chat [conversationId] from a row of a page; false when it is
/// gone or the reader's access is.
bool _openConversation(String conversationId) {
- if (c.accessRevoked || c.snapshot?.conversation(conversationId) == null) {
- return false;
- }
+ final group = c.snapshot?.conversation(conversationId);
+ if (c.accessRevoked || group == null) return false;
widget.onCloseTerminal?.call();
_closeSidebar();
setState(() {
@@ -2293,6 +2310,7 @@ class _SuperTabViewState extends State<SuperTabView>
_showManage = false;
_showPullRequests = _showTasks = false;
});
+ _showBoardOf(group);
c.select(conversationId);
return true;
}
@@ -2360,6 +2378,7 @@ class _SuperTabViewState extends State<SuperTabView>
widget.onCloseTerminal?.call();
_closeSidebar();
c.select(id);
+ _showBoardOf(c.snapshot!.conversation(id)!);
// A thread reply opens its thread; one shown only there has no row in the
// chat to scroll to.
if (message.threadReply) {
@@ -3501,6 +3520,18 @@ class _SuperTabViewState extends State<SuperTabView>
void _openTasks(SuperTabConversation group) {
final project = c.snapshot?.projectById(group.projectId);
if (project == null) return;
+ if (widget.board) {
+ // The fixed layout has one Board: projects, the Board and the chat on
+ // the right, the Buddy unless a task's chat is the one open.
+ if (group.id == project.leadConversationId || group.isBuddyChat) {
+ _openBoard(project);
+ } else {
+ _showBoardOf(group);
+ }
+ c.closeThread();
+ if (_rosterOpen) _closeRoster();
+ return;
+ }
widget.onCloseTerminal?.call();
if (c.selectedId != project.leadConversationId) {
unawaited(c.select(project.leadConversationId));
@@ -3529,18 +3560,11 @@ class _SuperTabViewState extends State<SuperTabView>
),
);
- /// Above the Board: the left rail's icon, the project's name, and the Buddy pane's icon while it is hidden.
+ /// Above the Board: the project's name and its Board / Chat navigation.
Widget _boardHeader(SuperTabProject project) => SizedBox(
height: 44,
child: Row(
children: [
- const SizedBox(width: 8),
- AppIconButton(
- key: const ValueKey('super-pane-left-toggle'),
- icon: _leftHidden ? AppIcons.panelLeftOpen : AppIcons.panelLeftClose,
- tooltip: _leftHidden ? 'Show sidebar' : 'Hide sidebar',
- onPressed: () => _togglePane(left: true),
- ),
const SizedBox(width: 8),
// The name and its tabs take the room left, so what follows sits at the right edge: a Flexible name beside a
// Spacer split the free space, and the name's unused half left the controls mid-bar (#3846).
@@ -3568,13 +3592,6 @@ class _SuperTabViewState extends State<SuperTabView>
icon: const Icon(AppIcons.plus, size: 16),
label: const Text('New proposal'),
),
- if (_rightHidden)
- AppIconButton(
- key: const ValueKey('super-pane-right-toggle'),
- icon: AppIcons.panelRightOpen,
- tooltip: 'Show your Buddy',
- onPressed: () => _togglePane(left: false),
- ),
const SizedBox(width: 8),
],
),
@@ -3606,6 +3623,8 @@ class _SuperTabViewState extends State<SuperTabView>
foregroundColor: selected
? DesktopChrome.foreground
: DesktopChrome.muted,
+ // The tab shown has no action, so a disabled button would grey it: it reads as selected instead.
+ disabledForegroundColor: DesktopChrome.foreground,
),
child: Text(label),
),
@@ -3613,12 +3632,49 @@ class _SuperTabViewState extends State<SuperTabView>
],
);
- /// The project's chat in the middle, as before the Board: the Chat tab.
+ /// The project's chat in the middle, as before the Board: the Chat tab. Its
+ /// Tasks icon brings the Board back with projects and the Buddy.
void _openProjectChat(SuperTabProject project) {
- setState(() => _boardProjectId = null);
+ setState(() {
+ _boardProjectId = null;
+ // Its chat is the one chosen, so the Board is not implied by the selection.
+ _agentChatId = project.leadConversationId;
+ });
unawaited(c.select(project.leadConversationId));
}
+ /// The chat of the selected agent in the middle (Swarm v3, task #4118), under its name.
+ Widget _middleChat(Widget chat) {
+ final group = c.selected;
+ return Column(
+ key: const ValueKey('super-middle-chat'),
+ children: [
+ SizedBox(
+ height: 44,
+ child: Row(
+ children: [
+ const SizedBox(width: 12),
+ Expanded(
+ child: Text(
+ group?.isBuddyChat == true
+ ? 'Your Buddy'
+ : group?.label ?? '',
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: DesktopChrome.control().copyWith(
+ fontWeight: grid.AppFont.semibold,
+ ),
+ ),
+ ),
+ const SizedBox(width: 8),
+ ],
+ ),
+ ),
+ Expanded(child: chat),
+ ],
+ );
+ }
+
/// The right pane beside the Board: the selected chat, flat, under a small header that goes back to the Buddy.
Widget _boardChat(Widget chat) {
final group = c.selected;
@@ -3670,12 +3726,6 @@ class _SuperTabViewState extends State<SuperTabView>
),
),
),
- AppIconButton(
- key: const ValueKey('super-pane-right-toggle'),
- icon: AppIcons.panelRightClose,
- tooltip: 'Hide your Buddy',
- onPressed: () => _togglePane(left: false),
- ),
const SizedBox(width: 8),
],
),
@@ -5084,7 +5134,9 @@ class _SuperTabViewState extends State<SuperTabView>
);
Widget _conversation(bool narrow) {
- if (c.snapshot?.projects.isEmpty == true && !c.accessRevoked) {
+ if (!widget.board &&
+ c.snapshot?.projects.isEmpty == true &&
+ !c.accessRevoked) {
return Center(
child: Padding(
padding: const EdgeInsets.all(24),
@@ -6096,16 +6148,37 @@ class _SuperTabViewState extends State<SuperTabView>
builder: (context, constraints) {
grid.AppTheme.watch(context);
final terminal = widget.terminal;
+ final thread = _threadPanel();
+ final viewer = _imageViewer();
+ // A thread opened since Members takes its side and closes it.
+ if (thread != null) _rosterOpen = false;
+ // Desktop reserves both side panes even before a project is selected.
+ // Other navigation surfaces keep their existing place in the middle.
+ 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 chatInMiddle = agentChat || widget.rightPane != null;
+ final boardLayout =
+ widget.board &&
+ (!_projectChatOnly || chatInMiddle) &&
+ thread == null &&
+ !_rosterOpen &&
+ !_manageVisible &&
+ !_notificationsVisible &&
+ !_devicesVisible &&
+ !_terminalsVisible &&
+ !_showPullRequests &&
+ _pageShown == null;
+ // The fixed layout never drops a side pane; every other surface keeps
+ // its own width rules.
final narrow =
+ !boardLayout &&
constraints.maxWidth < MediaQuery.textScalerOf(context).scale(720);
// Wide enough for a right column beside the chat; it shows only an
// open thread or Members, closed at rest (Quiet Swarm, 2026-11-02).
final wide =
+ boardLayout ||
constraints.maxWidth >= MediaQuery.textScalerOf(context).scale(1080);
- final thread = _threadPanel();
- final viewer = _imageViewer();
- // A thread opened since Members takes its side and closes it.
- if (thread != null) _rosterOpen = false;
final threadDrawer = thread != null && !wide;
// A terminal on screen keeps its chat beside it, in the right pane, as
// a thread sits; a thread or Members takes that side, and a narrow
@@ -6123,21 +6196,16 @@ class _SuperTabViewState extends State<SuperTabView>
images: () => _images(_shownMessages(c.selectedId)),
child: _conversation(narrow),
);
- // The project's Board in the middle, the selected chat on the right (task #3787), while nothing else holds the
- // middle pane.
- final boardProject =
- wide &&
- _boardProjectId != null &&
- thread == null &&
- !_rosterOpen &&
- !_manageVisible &&
- !_notificationsVisible &&
- !_devicesVisible &&
- !_terminalsVisible &&
- !_showPullRequests &&
- _pageShown == null &&
- c.snapshot?.projectById(_boardProjectId!) != null
- ? _boardProjectId
+ // 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 = widget.rightPane != null && !agentChat
+ ? c.snapshot?.projects
+ .where((p) => p.leadConversationId == c.selectedId)
+ .firstOrNull
+ ?.id
+ : null;
+ final boardProject = boardLayout
+ ? c.snapshot?.projectById(_boardProjectId ?? impliedBoard ?? '')?.id
: null;
final chatCovered =
(narrow && _sidebarOpen) || (!wide && _rosterOpen) || threadDrawer;
@@ -6186,146 +6254,163 @@ class _SuperTabViewState extends State<SuperTabView>
ExcludeFocus(
excluding: chatCovered,
child: SuperTabPaneLayout(
- storage: widget.app?.localStore,
+ storage: widget.paneStore ?? widget.app?.localStore,
onLeave: _leaveResize,
- left: narrow || (boardProject != null && _leftHidden)
- ? null
- : _sidebar(),
+ left: narrow ? null : _sidebar(),
// An open thread takes the roster's side, as in Slack.
right: !wide
? null
- : boardProject != null
- ? (_rightHidden ? null : _boardChat(chat))
+ : boardLayout
+ ? widget.rightPane?.call(context) ??
+ (agentChat
+ ? const SizedBox.expand()
+ : _boardChat(chat))
: thread ??
(_rosterOpen
? roster
: chatBeside
? chat
: null),
- rightDefault:
- boardProject == null && thread == null && !chatBeside
+ rightDefault: boardLayout
+ ? SuperTabPaneLayout.boardRightWidth
+ : !boardLayout && thread == null && !chatBeside
? SuperTabPaneLayout.rightWidth
: SuperTabPaneLayout.threadWidth,
+ // The Desktop's right pane is a fixed 340, the Tasks pane's: the middle takes the rest (River, Swarm v3).
+ rightMinimum: boardLayout
+ ? SuperTabPaneLayout.boardRightWidth
+ : SuperTabPaneLayout.rightWidth,
+ rightFixed: boardLayout,
// Over the chat, beside an open thread, as in Slack.
over: wide ? viewer : null,
- center: Column(
- children: [
- if (boardProject != null)
- _boardHeader(c.snapshot!.projectById(boardProject)!)
- else ...[
- if (widget.board &&
- !_manageVisible &&
- !_notificationsVisible &&
- _pageShown == null)
- if (c.snapshot?.projects
- .where(
- (p) => p.leadConversationId == c.selectedId,
- )
- .firstOrNull
- case final project?)
- Padding(
- padding: const EdgeInsetsDirectional.only(
- start: grid.AppDesktop.controlGap,
- top: grid.AppDesktop.listRowGap,
- ),
- child: Align(
- alignment: Alignment.centerLeft,
- child: _projectTabs(project, board: false),
- ),
- ),
- _header(c.selected, narrow),
- ],
- if (_manageOpen)
- Align(
- alignment: Alignment.centerLeft,
- child: SuperTabManageTabs(
- selected: _devicesVisible
- ? SuperTabManageTab.devices
- : _manageTab,
- devices: _hasDevices,
- onChoose: _chooseManageTab,
- ),
- ),
- Expanded(
- child: SuperTabPages(
- index: boardProject != null
- ? 5
- : _devicesVisible
- ? 1
- : _manageVisible
- ? 4
- : _notificationsVisible
- ? 3
- : c.snapshot?.projects.isEmpty == true
- ? 0
- : _terminalsVisible
- ? 1
- : _showPullRequests
- ? 2
- : _showTasks
- ? 5
- : 0,
+ // A project's own chat keeps its header and tabs (Project options, Tasks): the full chat view.
+ center:
+ boardLayout &&
+ boardProject == null &&
+ c.snapshot?.isProjectLead(c.selectedId) != true
+ ? (chatInMiddle
+ ? _middleChat(chat)
+ : const SizedBox.shrink())
+ : Column(
children: [
- chatBeside || boardProject != null
- ? const SizedBox.shrink()
- : chat,
- terminal ?? const SizedBox.shrink(),
- _showPullRequests
- ? SuperTabPullRequests(
- controller: c,
- app: widget.app,
- visible: !_terminalsVisible,
- )
- : const SizedBox.shrink(),
- switch (_pageShown) {
- SwarmPage.decisions => SuperTabDecisionsPage(
- activity: SuperTabActivity.of(c),
- highlight: _highlight,
- highlightTurn: _highlightTurn,
- onOpenConversation: _openConversation,
- onOpenReminder: (reminder) =>
- unawaited(_openReminder(reminder)),
- ),
- SwarmPage.mentions => SuperTabMentionsPage(
- activity: SuperTabActivity.of(c),
- onOpenMention: (mention) =>
- unawaited(_openMention(mention)),
- ),
- SwarmPage.threads => SuperTabThreadsPage(
- activity: SuperTabActivity.of(c),
- onOpenThread: _openThreadFromList,
- message: (message) => _message(
- message,
- false,
- const {},
- inThread: true,
+ if (boardProject != null)
+ _boardHeader(c.snapshot!.projectById(boardProject)!)
+ else ...[
+ if (widget.board &&
+ !_manageVisible &&
+ !_notificationsVisible &&
+ _pageShown == null)
+ if (c.snapshot?.projects
+ .where(
+ (p) =>
+ p.leadConversationId ==
+ c.selectedId,
+ )
+ .firstOrNull
+ case final project?)
+ Padding(
+ padding: const EdgeInsetsDirectional.only(
+ start: grid.AppDesktop.controlGap,
+ top: grid.AppDesktop.listRowGap,
+ ),
+ child: Align(
+ alignment: Alignment.centerLeft,
+ child: _projectTabs(project, board: false),
+ ),
+ ),
+ _header(c.selected, narrow),
+ ],
+ if (_manageOpen)
+ Align(
+ alignment: Alignment.centerLeft,
+ child: SuperTabManageTabs(
+ selected: _devicesVisible
+ ? SuperTabManageTab.devices
+ : _manageTab,
+ devices: _hasDevices,
+ onChoose: _chooseManageTab,
),
),
- null => const SizedBox.shrink(),
- },
- _manageVisible
- ? SuperTabManagePage(
- controller: c,
- app: widget.app,
- board: _board,
- tab: _manageTab,
- onAddAgent: widget.onAddAgent,
- onOpenAgent: (agent) {
- setState(() => _showManage = false);
- (widget.onChooseAgentTerminal ??
- widget.onOpenTerminal)
- .call(agent);
- },
- onOpenConversation: _openConversation,
- facts: _facts,
- )
- : const SizedBox.shrink(),
- _tasksPage(boardProject: boardProject),
+ Expanded(
+ child: SuperTabPages(
+ index: boardProject != null
+ ? 5
+ : _devicesVisible
+ ? 1
+ : _manageVisible
+ ? 4
+ : _notificationsVisible
+ ? 3
+ : c.snapshot?.projects.isEmpty == true
+ ? 0
+ : _terminalsVisible
+ ? 1
+ : _showPullRequests
+ ? 2
+ : _showTasks
+ ? 5
+ : 0,
+ children: [
+ chatBeside || boardProject != null
+ ? const SizedBox.shrink()
+ : chat,
+ terminal ?? const SizedBox.shrink(),
+ _showPullRequests
+ ? SuperTabPullRequests(
+ controller: c,
+ app: widget.app,
+ visible: !_terminalsVisible,
+ )
+ : const SizedBox.shrink(),
+ switch (_pageShown) {
+ SwarmPage.decisions => SuperTabDecisionsPage(
+ activity: SuperTabActivity.of(c),
+ highlight: _highlight,
+ highlightTurn: _highlightTurn,
+ onOpenConversation: _openConversation,
+ onOpenReminder: (reminder) =>
+ unawaited(_openReminder(reminder)),
+ ),
+ SwarmPage.mentions => SuperTabMentionsPage(
+ activity: SuperTabActivity.of(c),
+ onOpenMention: (mention) =>
+ unawaited(_openMention(mention)),
+ ),
+ SwarmPage.threads => SuperTabThreadsPage(
+ activity: SuperTabActivity.of(c),
+ onOpenThread: _openThreadFromList,
+ message: (message) => _message(
+ message,
+ false,
+ const {},
+ inThread: true,
+ ),
+ ),
+ null => const SizedBox.shrink(),
+ },
+ _manageVisible
+ ? SuperTabManagePage(
+ controller: c,
+ app: widget.app,
+ board: _board,
+ tab: _manageTab,
+ onAddAgent: widget.onAddAgent,
+ onOpenAgent: (agent) {
+ setState(() => _showManage = false);
+ (widget.onChooseAgentTerminal ??
+ widget.onOpenTerminal)
+ .call(agent);
+ },
+ onOpenConversation: _openConversation,
+ facts: _facts,
+ )
+ : const SizedBox.shrink(),
+ _tasksPage(boardProject: boardProject),
+ ],
+ ),
+ ),
],
),
- ),
- ],
- ),
),
),
if (threadDrawer)
diff --git a/desktop/test/super_tab_board_buddies_test.dart b/desktop/test/super_tab_board_buddies_test.dart
index 4a2aa8193..64379e83a 100644
--- a/desktop/test/super_tab_board_buddies_test.dart
+++ b/desktop/test/super_tab_board_buddies_test.dart
@@ -64,7 +64,12 @@ void main() {
]);
final c = server.controller(
account: 'owner',
- initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},
+ initial: {
+ 'tabId': 'tab',
+ 'projectsGroupOpen': true,
+ 'accountId': 'owner',
+ 'selectedId': 'lead',
+ },
);
await tester.runAsync(c.refresh);
await tester.pumpWidget(
diff --git a/desktop/test/super_tab_board_can_chat_test.dart b/desktop/test/super_tab_board_can_chat_test.dart
index 11ace32c5..219016c55 100644
--- a/desktop/test/super_tab_board_can_chat_test.dart
+++ b/desktop/test/super_tab_board_can_chat_test.dart
@@ -55,7 +55,12 @@ void main() {
}
final c = server.controller(
account: reader,
- initial: {'tabId': 'tab', 'accountId': reader, 'selectedId': 'lead'},
+ initial: {
+ 'tabId': 'tab',
+ 'projectsGroupOpen': true,
+ 'accountId': reader,
+ 'selectedId': 'lead',
+ },
);
await tester.runAsync(c.refresh);
await tester.pumpWidget(
diff --git a/desktop/test/super_tab_board_cards_test.dart b/desktop/test/super_tab_board_cards_test.dart
index 21ab3f23b..9cf51c400 100644
--- a/desktop/test/super_tab_board_cards_test.dart
+++ b/desktop/test/super_tab_board_cards_test.dart
@@ -2,6 +2,7 @@ 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/controller.dart';
+import 'package:harness/super_tabs/identity.dart';
import 'package:harness/super_tabs/view.dart';
import 'super_tab_activity_lists_test.dart' show swarm;
@@ -22,7 +23,11 @@ Future<void> _settle(WidgetTester tester) async {
Finder _key(String k) => find.byKey(ValueKey(k));
-final _deadline = DateTime(2026, 11, 6, 15, 0);
+// Today at 15:00, whatever today is: the card writes a deadline of another day with its date.
+final _deadline = () {
+ final today = DateTime.now();
+ return DateTime(today.year, today.month, today.day, 15);
+}();
Map<String, dynamic> _proposal({
Map<String, dynamic>? decision,
@@ -80,7 +85,12 @@ void main() {
}
final c = server.controller(
account: 'owner',
- initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},
+ initial: {
+ 'tabId': 'tab',
+ 'projectsGroupOpen': true,
+ 'accountId': 'owner',
+ 'selectedId': 'lead',
+ },
);
await tester.runAsync(c.refresh);
await tester.pumpWidget(
@@ -130,13 +140,13 @@ void main() {
],
);
expect(inColumn('proposals', 'pin'), findsOneWidget);
- expect(
- find.descendant(
- of: _key('super-task-card-pin'),
- matching: find.textContaining('tuan'),
- ),
- findsOneWidget,
+ // Who proposed it is the card's requester avatar, as a tile names no one in text (#3869).
+ final proposer = find.descendant(
+ of: _key('super-task-card-pin'),
+ matching: _key('super-card-requester'),
);
+ expect(proposer, findsOneWidget);
+ expect(tester.widget<SuperTabAvatar>(proposer).identity, 'person:tuan');
expect(note(tester, 'pin'), isNull);
await end(tester, c);
});
diff --git a/desktop/test/super_tab_board_layout_test.dart b/desktop/test/super_tab_board_layout_test.dart
index 0767b461e..1ba9a12c7 100644
--- a/desktop/test/super_tab_board_layout_test.dart
+++ b/desktop/test/super_tab_board_layout_test.dart
@@ -1,47 +1,51 @@
+import 'dart:convert';
+import 'dart:io';
+
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/core/local_key_value_store.dart';
import 'package:harness/shared/theme/app_theme.dart' as grid;
import 'package:harness/super_tabs/controller.dart';
+import 'package:harness/super_tabs/message_link.dart';
import 'package:harness/super_tabs/message_row.dart' show SuperTabReplyPreview;
+import 'package:harness/super_tabs/pane_layout.dart';
import 'package:harness/super_tabs/view.dart';
import 'super_tab_activity_lists_test.dart' show swarm;
+import 'support/capture.dart';
+import 'support/memory_key_value_store.dart';
import 'support/super_tab_fixture.dart';
/// Task #3787 (anh Dee, 11-06): the left rail, the project's Board in the middle and the person's Buddy on the right.
/// Opening a project shows its Board; a card's chat opens on the right, flat, with a way back to the Buddy; the
-/// left rail has no Buddy entry and no Threads; both side panes hide and show, remembered.
-
-class _Memory implements LocalKeyValueStore {
- final values = <String, String>{};
- @override
- Future<String?> read(String key) async => values[key];
- @override
- Future<void> write(String key, String value) async => values[key] = value;
- @override
- Future<void> delete(String key) async => values.remove(key);
-}
+/// left rail has no Buddy entry and no Threads. Task #3863 keeps both side panes visible.
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));
- }
+ await tester.pumpAndSettle();
}
Finder _key(String k) => find.byKey(ValueKey(k));
void main() {
+ final shots = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];
+ setUpAll(() => loadCaptureFonts(shots));
+
Future<(SuperTabController, ConversationServer)> show(
WidgetTester tester, {
LocalKeyValueStore? store,
+ Brightness brightness = Brightness.light,
+ double width = 1500,
+ bool projects = true,
+ String selected = 'lead',
+ double textScale = 1,
}) async {
- await tester.binding.setSurfaceSize(const Size(1500, 900));
+ await tester.binding.setSurfaceSize(Size(width, 900));
addTearDown(() => tester.binding.setSurfaceSize(null));
+ final previous = grid.AppTheme.brightness.value;
+ grid.AppTheme.brightness.value = brightness;
+ addTearDown(() => grid.AppTheme.brightness.value = previous);
final server = swarm();
+ if (!projects) server.state['projects'] = <dynamic>[];
server.append('The project chat line nobody should see');
final conversations = (server.state['conversations'] as List)
.cast<Map<String, dynamic>>();
@@ -60,14 +64,26 @@ void main() {
'status': 'working',
};
server.append('Working on the fix.', conversationId: 'offline');
+ server.append('What shall we work on?', conversationId: 'buddy-owner-lead');
final c = server.controller(
account: 'owner',
- initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},
+ initial: {
+ 'tabId': 'tab',
+ 'projectsGroupOpen': true,
+ 'accountId': 'owner',
+ 'selectedId': selected,
+ },
);
await tester.runAsync(c.refresh);
await tester.pumpWidget(
MaterialApp(
- theme: grid.buildAppTheme(brightness: Brightness.light),
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: brightness),
+ builder: (context, child) => MediaQuery(
+ data: MediaQuery.of(context)
+ .copyWith(textScaler: TextScaler.linear(textScale)),
+ child: child!,
+ ),
home: Scaffold(
body: SuperTabView(
controller: c,
@@ -75,7 +91,7 @@ void main() {
onAddAgent: (_) {},
onOpenTerminal: (_) {},
machineName: (_) => 'Mac Studio',
- paneStore: store,
+ paneStore: store ?? MemoryKeyValueStore(),
board: true,
),
),
@@ -108,6 +124,8 @@ void main() {
final (c, _) = await show(tester);
await tester.tap(_key('super-group-lead'));
await _settle(tester);
+ // The wider chat leaves the Board narrower: it scrolls sideways to the card.
+ await tester.ensureVisible(_key('super-task-card-offline'));
await tester.tap(_key('super-task-card-offline'));
await _settle(tester);
expect(c.selectedId, 'offline');
@@ -123,13 +141,16 @@ void main() {
testWidgets("a card's chat is flat: its thread replies show inline, in time "
'order, with no thread line', (tester) async {
final (c, server) = await show(tester);
- final root = server.messages
- .lastWhere((m) => m['conversationId'] == 'offline')['id'] as String;
+ final root =
+ server.messages.lastWhere((m) => m['conversationId'] == 'offline')['id']
+ as String;
server.append('A reply in its thread.', conversationId: 'offline');
server.messages.last['thread'] = root;
await tester.runAsync(c.refresh);
await tester.tap(_key('super-group-lead'));
await _settle(tester);
+ // The wider chat leaves the Board narrower: it scrolls sideways to the card.
+ await tester.ensureVisible(_key('super-task-card-offline'));
await tester.tap(_key('super-task-card-offline'));
await _settle(tester);
// The root, and its quote on the reply below.
@@ -147,8 +168,8 @@ void main() {
await end(tester, c);
});
- testWidgets('the project chat stays a tab away: Chat beside Board, Board '
- 'first (Ken)', (tester) async {
+ testWidgets('the project Chat tab opens its chat in the middle, with its '
+ 'header, and the Board tab brings back the three panes', (tester) async {
final (c, _) = await show(tester);
await tester.tap(_key('super-group-lead'));
await _settle(tester);
@@ -156,12 +177,19 @@ void main() {
await tester.tap(_key('super-board-tab-chat'));
await _settle(tester);
expect(c.selectedId, 'lead');
- expect(find.text('The project chat line nobody should see'), findsOneWidget);
+ expect(
+ find.text('The project chat line nobody should see'),
+ findsOneWidget,
+ );
+ // The Chat view keeps its header, Project options and Tasks icon.
expect(_key('super-tasks-lead'), findsNothing);
+ expect(_key('super-tasks'), findsOneWidget);
+ expect(_key('super-left-pane'), findsOneWidget);
await tester.tap(_key('super-board-tab-board'));
await _settle(tester);
expect(_key('super-tasks-lead'), findsOneWidget);
expect(c.selectedId, 'buddy-owner-lead');
+ expect(_key('super-right-pane'), findsOneWidget);
await end(tester, c);
});
@@ -176,32 +204,288 @@ void main() {
await end(tester, c);
});
- testWidgets('each side pane hides and shows, and a new view starts as it '
- 'was left', (tester) async {
- final store = _Memory();
- final (c, _) = await show(tester, store: store);
+ void expectFixedPanes(WidgetTester tester) {
+ expect(_key('super-left-pane'), findsOneWidget);
+ expect(_key('super-right-pane'), findsOneWidget);
+ expect(tester.getSize(_key('super-left-pane')).width, greaterThan(0));
+ expect(tester.getSize(_key('super-right-pane')).width, greaterThan(0));
+ for (final tooltip in [
+ 'Show sidebar',
+ 'Hide sidebar',
+ 'Show your Buddy',
+ 'Hide your Buddy',
+ ]) {
+ expect(find.byTooltip(tooltip), findsNothing);
+ }
+ }
+
+ void expectBlankMiddle() {
+ expect(
+ find.descendant(
+ of: _key('super-center-pane'),
+ matching: find.byWidgetPredicate(
+ (w) =>
+ w is Text ||
+ w is TextField ||
+ w is Icon ||
+ w is ButtonStyleButton,
+ ),
+ ),
+ findsNothing,
+ reason: 'no conversation, header, controls or placeholder in the middle',
+ );
+ }
+
+ for (final brightness in Brightness.values) {
+ for (final width in [1280.0, 1920.0, 2560.0]) {
+ testWidgets(
+ 'the right pane is a fixed 340 at $width wide (${brightness.name})',
+ (tester) async {
+ final (c, _) = await show(
+ tester,
+ width: width,
+ brightness: brightness,
+ );
+ await tester.tap(_key('super-group-lead'));
+ await _settle(tester);
+ expect(tester.getSize(_key('super-right-pane')).width, 340);
+ expectFixedPanes(tester);
+ expect(_key('super-tasks-lead'), findsOneWidget);
+ expect(tester.takeException(), isNull);
+ await captureWindow(
+ tester,
+ shots,
+ 'fixed-board-${width.toInt()}-${brightness.name}',
+ );
+ await end(tester, c);
+ },
+ );
+ }
+
+ testWidgets('both panes return from saved hidden state and stay visible '
+ 'after remount (${brightness.name})', (tester) async {
+ final store = MemoryKeyValueStore()
+ ..values['swarm_left_pane_hidden'] = '1'
+ ..values['swarm_right_pane_hidden'] = '1';
+ for (var mount = 0; mount < 2; mount++) {
+ final (c, _) = await show(tester, store: store, brightness: brightness);
+ await tester.tap(_key('super-group-lead'));
+ await _settle(tester);
+ expectFixedPanes(tester);
+ expect(_key('super-group-lead'), findsOneWidget);
+ expect(_key('super-tasks-lead'), findsOneWidget);
+ expect(find.text('What shall we work on?'), findsOneWidget);
+ if (mount == 0) {
+ await captureWindow(tester, shots, 'fixed-board-${brightness.name}');
+ }
+ expect(tester.takeException(), isNull);
+ await end(tester, c);
+ }
+ });
+
+ testWidgets('no project selected leaves a blank middle and Buddy on the '
+ 'right (${brightness.name})', (tester) async {
+ final (c, _) = await show(
+ tester,
+ selected: 'buddy-owner-lead',
+ brightness: brightness,
+ );
+ expectBlankMiddle();
+ expectFixedPanes(tester);
+ expect(
+ find.descendant(
+ of: _key('super-right-pane'),
+ matching: find.text('What shall we work on?'),
+ ),
+ findsOneWidget,
+ );
+ await captureWindow(tester, shots, 'fixed-empty-${brightness.name}');
+ await tester.tap(_key('super-group-lead'));
+ await _settle(tester);
+ expect(
+ find.descendant(
+ of: _key('super-center-pane'),
+ matching: _key('super-tasks-lead'),
+ ),
+ findsOneWidget,
+ );
+ expectFixedPanes(tester);
+ expect(tester.takeException(), isNull);
+ await end(tester, c);
+ });
+ }
+
+ testWidgets(
+ 'a Swarm with no projects has a blank middle and both side panes',
+ (tester) async {
+ final (c, _) = await show(
+ tester,
+ projects: false,
+ selected: 'buddy-owner-lead',
+ );
+ expectBlankMiddle();
+ expectFixedPanes(tester);
+ expect(tester.takeException(), isNull);
+ await end(tester, c);
+ },
+ );
+
+ testWidgets('removing the open project clears only the middle', (
+ tester,
+ ) async {
+ final (c, server) = await show(tester);
await tester.tap(_key('super-group-lead'));
await _settle(tester);
- expect(_key('super-group-lead'), findsOneWidget);
- await tester.tap(_key('super-pane-left-toggle'));
+ server.state['projects'] = <dynamic>[];
+ await tester.runAsync(c.refresh);
await _settle(tester);
- expect(_key('super-group-lead'), findsNothing, reason: 'left rail hidden');
- await tester.tap(_key('super-pane-right-toggle'));
+ expectBlankMiddle();
+ expectFixedPanes(tester);
+ expect(tester.takeException(), isNull);
+ await end(tester, c);
+ });
+
+ testWidgets(
+ 'the minimum Desktop window keeps projects, Board and chat visible',
+ (tester) async {
+ final (c, _) = await show(tester, width: 880);
+ await tester.tap(_key('super-group-lead'));
+ await _settle(tester);
+ expectFixedPanes(tester);
+ expect(_key('super-tasks-lead'), findsOneWidget);
+ expect(tester.getSize(_key('super-right-pane')).width, 340);
+ expect(tester.takeException(), isNull);
+ await end(tester, c);
+ },
+ );
+
+ testWidgets(
+ 'the right pane stays 340 whatever width was saved, and has no divider',
+ (tester) async {
+ final store = MemoryKeyValueStore()
+ ..values[SuperTabPaneLayout.storageKey] =
+ '{"left":300,"right":280,"rightChosen":true}';
+ final (c, _) = await show(tester, store: store);
+ await tester.tap(_key('super-group-lead'));
+ await _settle(tester);
+ expect(tester.getSize(_key('super-right-pane')).width, 340);
+ expect(_key('super-resize-right'), findsNothing);
+ await tester.binding.setSurfaceSize(const Size(880, 900));
+ await _settle(tester);
+ expect(tester.getSize(_key('super-right-pane')).width, 340);
+ expectFixedPanes(tester);
+ expect(tester.takeException(), isNull);
+ await end(tester, c);
+ },
+ );
+
+ // Every way into the Board shows the same three panes (Scholes, task #3863).
+ testWidgets('the Tasks icon of a project chat opens the Board with projects, '
+ 'the wide Buddy chat and the project kept', (tester) async {
+ final (c, _) = await show(tester, width: 1500);
+ // A person lands in the project's own chat, no Board open: that Chat
+ // view's header has the Tasks icon.
+ expect(c.selectedId, 'lead');
+ expect(_key('super-tasks-lead'), findsNothing);
+ await tester.tap(_key('super-tasks'));
await _settle(tester);
- expect(_key('super-board-chat'), findsNothing, reason: 'Buddy hidden');
expect(_key('super-tasks-lead'), findsOneWidget);
+ expect(c.selectedId, 'buddy-owner-lead');
+ expect(_key('super-board-chat'), findsOneWidget);
+ expect(find.text('Your Buddy'), findsOneWidget);
+ expectFixedPanes(tester);
+ expect(tester.getSize(_key('super-right-pane')).width, 340);
+ expect(tester.takeException(), isNull);
await end(tester, c);
+ });
- // A new view: the project's Board opens as the panes were left.
- final (again, _) = await show(tester, store: store);
- await tester.tap(_key('super-group-lead'));
+ testWidgets('a task chat opened from a notice shows its project Board '
+ 'beside it', (tester) async {
+ final (c, server) = await show(tester, width: 1500);
+ final message =
+ server.messages.lastWhere((m) => m['conversationId'] == 'offline')['id']
+ as String;
+ c.openMessageLink(
+ SwarmMessageLink(
+ tabId: 'tab',
+ conversationId: 'offline',
+ messageId: message,
+ ),
+ );
await _settle(tester);
+ expect(c.selectedId, 'offline');
expect(_key('super-tasks-lead'), findsOneWidget);
- expect(_key('super-group-lead'), findsNothing, reason: 'still hidden');
- expect(_key('super-board-chat'), findsNothing, reason: 'still hidden');
- await tester.tap(_key('super-pane-left-toggle'));
- await _settle(tester);
- expect(_key('super-group-lead'), findsOneWidget);
- await end(tester, again);
+ expectFixedPanes(tester);
+ expect(tester.takeException(), isNull);
+ await end(tester, c);
});
+
+ // At enlarged text the side panes widen only while the Board keeps room:
+ // the chat's scaled minimum shrinks back to 420 first, then projects to
+ // their own minimum (reviews of #3399). The Board never goes blank.
+ for (final (width, scale) in [
+ (880.0, 1.25),
+ (1024.0, 1.5),
+ (880.0, 1.6),
+ (1280.0, 2.0),
+ (1500.0, 1.0),
+ ]) {
+ testWidgets('the Board keeps room at $width wide, text ${scale * 100}%', (
+ tester,
+ ) async {
+ // From the Buddy: the fixed layout's own start, never the Chat view.
+ final (c, _) = await show(
+ tester,
+ width: width,
+ textScale: scale,
+ selected: 'buddy-owner-lead',
+ );
+ await tester.tap(_key('super-group-lead'));
+ await _settle(tester);
+ final left = tester.getSize(_key('super-left-pane')).width;
+ final right = tester.getSize(_key('super-right-pane')).width;
+ final center = tester.getSize(_key('super-center-pane')).width;
+ expect(left, greaterThanOrEqualTo(180));
+ expect(right, greaterThanOrEqualTo(340));
+ expect(center, greaterThanOrEqualTo(280));
+ expect(left + center + right, closeTo(width, 0.01));
+ // The Board itself is drawn, not an empty centre.
+ expect(_key('super-tasks-lead'), findsOneWidget);
+ expectFixedPanes(tester);
+ expect(tester.takeException(), isNull);
+ await end(tester, c);
+ });
+ }
+
+ if (Platform.environment['HARNESS_LAYOUT_BENCH'] == '1') {
+ testWidgets('Board divider drag benchmark', (tester) async {
+ final (c, _) = await show(tester);
+ await tester.tap(_key('super-group-lead'));
+ await _settle(tester);
+ final drag = await tester.startGesture(
+ tester.getCenter(_key('super-resize-right')),
+ );
+ await drag.moveBy(const Offset(-40, 0));
+ await tester.pump();
+ final samples = <int>[];
+ for (var i = 0; i < 1100; i++) {
+ final watch = Stopwatch()..start();
+ await drag.moveBy(Offset(i.isEven ? -8 : 8, 0));
+ await tester.pump();
+ if (i >= 100) samples.add(watch.elapsedMicroseconds);
+ }
+ samples.sort();
+ // ignore: avoid_print
+ print(
+ jsonEncode({
+ 'benchmark': 'board-divider-drag',
+ 'samples': samples.length,
+ 'p50_us': samples[500],
+ 'p95_us': samples[950],
+ }),
+ );
+ await drag.up();
+ await end(tester, c);
+ });
+ }
}
diff --git a/desktop/test/super_tab_board_needs_you_test.dart b/desktop/test/super_tab_board_needs_you_test.dart
index 9b1336895..26c939936 100644
--- a/desktop/test/super_tab_board_needs_you_test.dart
+++ b/desktop/test/super_tab_board_needs_you_test.dart
@@ -72,7 +72,12 @@ void main() {
(server.state['conversations'] as List).addAll(cards);
final c = server.controller(
account: 'owner',
- initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},
+ initial: {
+ 'tabId': 'tab',
+ 'projectsGroupOpen': true,
+ 'accountId': 'owner',
+ 'selectedId': 'lead',
+ },
);
await tester.runAsync(c.refresh);
await tester.pumpWidget(
diff --git a/desktop/test/super_tab_board_phase2_shots_test.dart b/desktop/test/super_tab_board_phase2_shots_test.dart
index fec6b91eb..fdf00614a 100644
--- a/desktop/test/super_tab_board_phase2_shots_test.dart
+++ b/desktop/test/super_tab_board_phase2_shots_test.dart
@@ -170,7 +170,12 @@ void main() {
]);
final c = server.controller(
account: 'owner',
- initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},
+ initial: {
+ 'tabId': 'tab',
+ 'projectsGroupOpen': true,
+ 'accountId': 'owner',
+ 'selectedId': 'lead',
+ },
);
await tester.runAsync(c.refresh);
await tester.pumpWidget(
diff --git a/desktop/test/super_tab_board_propose_test.dart b/desktop/test/super_tab_board_propose_test.dart
index c48ad0d8e..100d9d067 100644
--- a/desktop/test/super_tab_board_propose_test.dart
+++ b/desktop/test/super_tab_board_propose_test.dart
@@ -49,7 +49,12 @@ void main() {
if (boardMode) project['boardMode'] = true;
final c = server.controller(
account: reader,
- initial: {'tabId': 'tab', 'accountId': reader, 'selectedId': 'lead'},
+ initial: {
+ 'tabId': 'tab',
+ 'projectsGroupOpen': true,
+ 'accountId': reader,
+ 'selectedId': 'lead',
+ },
);
await tester.runAsync(c.refresh);
await tester.pumpWidget(
diff --git a/desktop/test/super_tab_board_steer_test.dart b/desktop/test/super_tab_board_steer_test.dart
index fa1acf9d7..61d92c0e2 100644
--- a/desktop/test/super_tab_board_steer_test.dart
+++ b/desktop/test/super_tab_board_steer_test.dart
@@ -67,7 +67,12 @@ void main() {
};
final c = server.controller(
account: reader,
- initial: {'tabId': 'tab', 'accountId': reader, 'selectedId': 'lead'},
+ initial: {
+ 'tabId': 'tab',
+ 'projectsGroupOpen': true,
+ 'accountId': reader,
+ 'selectedId': 'lead',
+ },
);
await tester.runAsync(c.refresh);
await tester.pumpWidget(
@@ -88,6 +93,8 @@ void main() {
await _settle(tester);
await tester.tap(_key('super-group-lead'));
await _settle(tester);
+ // The wider chat leaves the Board narrower: it scrolls sideways to the card.
+ await tester.ensureVisible(_key('super-task-card-offline'));
await tester.tap(_key('super-task-card-offline'));
await _settle(tester);
return (c, server);
diff --git a/desktop/test/super_tab_member_groups_test.dart b/desktop/test/super_tab_member_groups_test.dart
index f6f8c588c..c8d0f83eb 100644
--- a/desktop/test/super_tab_member_groups_test.dart
+++ b/desktop/test/super_tab_member_groups_test.dart
@@ -356,7 +356,7 @@ void main() {
expect(_member('finch'), findsNothing);
expect(_unassigned(), findsNothing);
final pills = [
- for (final key in ['board', 'list', 'members'])
+ for (final key in ['list', 'members'])
tester.getTopLeft(find.byKey(ValueKey('super-tasks-layout-$key'))).dx,
];
expect(pills, orderedEquals([...pills]..sort()));
@@ -566,7 +566,8 @@ void main() {
c = await _show(tester, _server(), storage: storage, members: false);
expect(_member('finch'), findsOneWidget);
expect(find.byKey(const ValueKey('super-tasks-board')), findsNothing);
- await tester.tap(find.byKey(const ValueKey('super-tasks-layout-board')));
+ // Members is a toggle back to the Board.
+ await tester.tap(find.byKey(const ValueKey('super-tasks-layout-members')));
await tester.pumpAndSettle();
expect(find.byKey(const ValueKey('super-tasks-board')), findsOneWidget);
await _close(tester, c);
diff --git a/desktop/test/super_tab_task_activity_test.dart b/desktop/test/super_tab_task_activity_test.dart
index e2d07e4da..f1f5f1df3 100644
--- a/desktop/test/super_tab_task_activity_test.dart
+++ b/desktop/test/super_tab_task_activity_test.dart
@@ -5,6 +5,7 @@ import 'package:harness/shared/theme/appearance_prefs_store.dart';
import 'package:harness/state/harness_activity.dart';
import 'package:harness/super_tabs/controller.dart';
import 'package:harness/super_tabs/task_card.dart';
+import 'package:harness/super_tabs/task_groups.dart';
import 'package:harness/super_tabs/tasks_view.dart';
import 'package:harness/terminal/terminal_theme.dart';
import 'package:harness/terminal/terminal_theme_store.dart';
@@ -175,10 +176,15 @@ void main() {
HarnessActivity.needsInput,
);
final card = tester.widget<SuperTabTaskCard>(_card('task'));
- expect(card.caption, contains('Needs you'));
+ // A List row says it in its caption; a Board tile wears it as a chip (task #3869).
+ if (list) {
+ expect(card.caption, contains('Needs you'));
+ } else {
+ expect(card.chips, contains(SuperTabStateChip.needsYou));
+ }
expect(
find.descendant(of: _card('task'), matching: find.text('Needs you')),
- findsNothing,
+ list ? findsNothing : findsOneWidget,
);
await tester.pumpWidget(const SizedBox());
});
@@ -262,10 +268,14 @@ void main() {
),
list: list,
);
- expect(
- tester.widget<SuperTabTaskCard>(_card('task')).caption,
- 'ken15 · Finch2 · Needs you',
- );
+ final card = tester.widget<SuperTabTaskCard>(_card('task'));
+ if (list) {
+ expect(card.caption, 'ken15 · Finch2 · Needs you');
+ } else {
+ // A tile names no one and does not repeat who waits: the chip says it.
+ expect(card.caption, '');
+ expect(card.chips, [SuperTabStateChip.needsYou]);
+ }
await tester.pumpWidget(const SizedBox());
});
@@ -297,10 +307,14 @@ void main() {
);
await _show(tester, server, list: list);
expect(find.textContaining('Agent unavailable'), findsNothing);
- expect(
- tester.widget<SuperTabTaskCard>(_card('known')).caption,
- contains('Finch2'),
- );
+ final known = tester.widget<SuperTabTaskCard>(_card('known'));
+ if (list) {
+ expect(known.caption, contains('Finch2'));
+ } else {
+ // The tile shows the agent as an avatar, and none for one that is gone.
+ expect(known.agent?.displayName, 'Finch2');
+ expect(tester.widget<SuperTabTaskCard>(_card('missing')).agent, isNull);
+ }
await tester.pumpWidget(const SizedBox());
});
}
diff --git a/desktop/test/super_tab_task_priority_test.dart b/desktop/test/super_tab_task_priority_test.dart
index c2bb79ae9..2a2dddd14 100644
--- a/desktop/test/super_tab_task_priority_test.dart
+++ b/desktop/test/super_tab_task_priority_test.dart
@@ -185,10 +185,19 @@ void main() {
'third',
]);
expect(_cardsIn(tester, 'working'), ['crash', 'test-copy', 'tag']);
- // The badge leads the caption, which keeps its words.
+ // The badge leads the quiet line, at the card's left; the agent's avatar is bottom right (task #3869).
expect(
tester.getTopLeft(_in(_card('crash'), 'P0')).dx,
- lessThan(tester.getTopLeft(_in(_card('crash'), 'Finch2')).dx),
+ lessThan(
+ tester
+ .getTopLeft(
+ find.descendant(
+ of: _card('crash'),
+ matching: find.byKey(const ValueKey('super-card-agent')),
+ ),
+ )
+ .dx,
+ ),
);
});
diff --git a/desktop/test/super_tab_tasks_shots_test.dart b/desktop/test/super_tab_tasks_shots_test.dart
index d04dcb56d..036e55d68 100644
--- a/desktop/test/super_tab_tasks_shots_test.dart
+++ b/desktop/test/super_tab_tasks_shots_test.dart
@@ -32,14 +32,17 @@ void main() {
});
for (final brightness in Brightness.values) {
- for (final layout in ['board', 'list']) {
+ // The Board at the three widths its columns must fill, and the List.
+ for (final (layout, size) in [
+ ('board-1280', const Size(1280, 900)),
+ ('board-1920', const Size(1920, 900)),
+ ('board-2560', const Size(2560, 900)),
+ ('list', const Size(1900, 1500)),
+ ]) {
testWidgets('screenshots for review ($layout, ${brightness.name})', (
tester,
) async {
- await tester.binding.setSurfaceSize(
- // Six columns of 280 beside the sidebar: the whole Board in one picture.
- layout == 'list' ? const Size(1900, 1500) : const Size(2300, 900),
- );
+ await tester.binding.setSurfaceSize(size);
addTearDown(() => tester.binding.setSurfaceSize(null));
final before = grid.AppTheme.brightness.value;
grid.AppTheme.brightness.value = brightness;
diff --git a/desktop/test/super_tab_tasks_view_test.dart b/desktop/test/super_tab_tasks_view_test.dart
index 2547a8a6b..8b7677345 100644
--- a/desktop/test/super_tab_tasks_view_test.dart
+++ b/desktop/test/super_tab_tasks_view_test.dart
@@ -4,7 +4,10 @@ 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/chip.dart';
import 'package:harness/super_tabs/controller.dart';
+import 'package:harness/super_tabs/identity.dart';
+import 'package:harness/super_tabs/task_card.dart';
import 'package:harness/super_tabs/tasks_view.dart';
import 'support/memory_key_value_store.dart';
@@ -28,6 +31,8 @@ Map<String, dynamic> taskFixture(
List<String>? releasing,
Map<String, dynamic>? released,
Map<String, String>? checks,
+ List<Map<String, dynamic>>? acceptance,
+ int? messages,
}) => {
...conversationFixture(id, title),
'projectId': 'lead',
@@ -58,6 +63,8 @@ Map<String, dynamic> taskFixture(
'releasing': ?releasing,
'released': ?released,
'pullRequestChecks': ?checks,
+ if (acceptance != null) 'checks': acceptance,
+ if (messages != null) 'lastMessageSequence': messages,
};
/// The project of the mockup Dee confirmed: a proposal, two tasks nobody is on
@@ -264,7 +271,7 @@ void main() {
await _close(tester, c);
});
- testWidgets('each column is a 280-wide tinted lane, rounded 12, with no rim '
+ testWidgets('each column is a tinted lane as wide as the board gives it, rounded 12, with no rim '
'or shadow (task #3787)', (tester) async {
final c = await _show(tester, tasksServer());
for (final name in [
@@ -275,7 +282,12 @@ void main() {
'merged',
'shipped',
]) {
- expect(tester.getSize(_column(name)).width, 280, reason: name);
+ // 1400 is under six minimums, so each takes the least a column does (task #3869).
+ expect(
+ tester.getSize(_column(name)).width,
+ SuperTabTasksView.minColumnWidth,
+ reason: name,
+ );
final panel = tester.widget<DecoratedBox>(_column(name));
final decoration = panel.decoration as BoxDecoration;
// A step off the page, as Trello's lists: darker under white cards in
@@ -305,6 +317,402 @@ void main() {
await _close(tester, c);
});
+ group('a Board card is Trello\'s (task #3869)', () {
+ String pr(int n) => 'https://github.com/autonomous-ai/openharness/pull/$n';
+ var checkCount = 0;
+ Map<String, dynamic> check(bool passed) => {
+ 'id': 'check-${checkCount++}',
+ 'description': 'A check',
+ 'independent': false,
+ 'evidence': null,
+ 'passedBy': passed ? 'agent:r' : null,
+ };
+ Future<SuperTabController> faces(
+ WidgetTester tester, {
+ Size size = const Size(1920, 900),
+ }) async {
+ final server = tasksServer();
+ (server.state['conversations'] as List).addAll(<Map<String, dynamic>>[
+ taskFixture(
+ 'ready',
+ 'Ready to merge',
+ 50,
+ requester: 'tony',
+ status: 'done',
+ pullRequest: 3700,
+ shippedAt: _now.subtract(const Duration(minutes: 12)),
+ checks: {pr(3700): 'green'},
+ acceptance: [
+ check(true),
+ check(true),
+ check(true),
+ check(false),
+ check(false),
+ ],
+ messages: 4,
+ ),
+ taskFixture(
+ 'failing',
+ 'Checks are red',
+ 51,
+ requester: 'tony',
+ status: 'working',
+ pullRequest: 3701,
+ checks: {pr(3701): 'red'},
+ ),
+ taskFixture(
+ 'bare',
+ 'Nothing linked yet',
+ 52,
+ requester: 'tony',
+ status: 'working',
+ ),
+ ]);
+ return _show(tester, server, size: size);
+ }
+
+ Finder inCard(String id, Key key) =>
+ find.descendant(of: _card(id), matching: find.byKey(key));
+ const agentKey = ValueKey('super-card-agent');
+ const requesterKey = ValueKey('super-card-requester');
+
+ testWidgets(
+ 'the agent\'s avatar sits bottom right with the requester\'s small beside it, and no name line',
+ (tester) async {
+ final c = await faces(tester);
+ final agent = inCard('ready', agentKey);
+ final requester = inCard('ready', requesterKey);
+ expect(agent, findsOneWidget);
+ expect(requester, findsOneWidget);
+ final card = tester.getRect(_card('ready'));
+ expect(
+ tester.getBottomRight(agent).dx,
+ moreOrLessEquals(
+ card.right - SuperTabTaskCard.tilePadding,
+ epsilon: 1,
+ ),
+ );
+ expect(
+ tester.getBottomRight(agent).dy,
+ moreOrLessEquals(
+ card.bottom - SuperTabTaskCard.tilePadding,
+ epsilon: 1,
+ ),
+ );
+ expect(
+ tester.getSize(requester).width,
+ lessThan(tester.getSize(agent).width),
+ );
+ expect(
+ tester.getTopRight(requester).dx,
+ lessThanOrEqualTo(tester.getTopLeft(agent).dx),
+ );
+ expect(
+ find.descendant(
+ of: _card('ready'),
+ matching: find.byType(SuperTabAvatar),
+ ),
+ findsNWidgets(2),
+ );
+ expect(
+ find.descendant(
+ of: _card('ready'),
+ matching: find.textContaining('Finch2'),
+ ),
+ findsNothing,
+ );
+ expect(
+ find.descendant(
+ of: _card('ready'),
+ matching: find.textContaining('tony'),
+ ),
+ findsNothing,
+ );
+ await _close(tester, c);
+ },
+ );
+
+ testWidgets(
+ 'a task nobody is on shows the requester alone, and a proposal too',
+ (tester) async {
+ final c = await faces(tester);
+ expect(inCard('shipped-means', agentKey), findsNothing);
+ expect(inCard('shipped-means', requesterKey), findsOneWidget);
+ expect(inCard('p-old', requesterKey), findsOneWidget);
+ await _close(tester, c);
+ },
+ );
+
+ testWidgets(
+ 'chips say the state once: Ready to merge green, CI failing red, Needs you yellow',
+ (tester) async {
+ final c = await faces(tester);
+ Color? ink(String id, String text) => tester
+ .widget<SuperTabChip>(
+ find.descendant(
+ of: _card(id),
+ matching: find.widgetWithText(SuperTabChip, text),
+ ),
+ )
+ .color;
+ expect(ink('ready', 'Ready to merge'), grid.AppPalette.online);
+ expect(ink('failing', 'CI failing'), grid.AppPalette.usageCritical);
+ expect(ink('test-copy', 'Needs you'), grid.AppPalette.warn);
+ // Said once: the quiet line leaves out what a chip says.
+ expect(
+ find.descendant(of: _card('failing'), matching: find.text('CI red')),
+ findsNothing,
+ );
+ expect(
+ find.descendant(
+ of: _card('ready'),
+ matching: find.textContaining('green,'),
+ ),
+ findsNothing,
+ );
+ expect(
+ find.descendant(
+ of: _card('ready'),
+ matching: find.textContaining('waiting 12 min'),
+ ),
+ findsOneWidget,
+ );
+ await _close(tester, c);
+ },
+ );
+
+ testWidgets(
+ 'the footer shows the pull request and checks without inventing a comment count',
+ (tester) async {
+ final c = await faces(tester);
+ Finder footer(String id, String key) => inCard(id, ValueKey(key));
+ expect(
+ find.descendant(
+ of: footer('ready', 'super-card-pr'),
+ matching: find.text('#3700'),
+ ),
+ findsOneWidget,
+ );
+ expect(
+ find.descendant(
+ of: footer('ready', 'super-card-checks'),
+ matching: find.text('3/5'),
+ ),
+ findsOneWidget,
+ );
+ expect(footer('ready', 'super-card-comments'), findsNothing);
+ // None of a kind, none shown.
+ expect(footer('bare', 'super-card-pr'), findsNothing);
+ expect(footer('bare', 'super-card-checks'), findsNothing);
+ expect(footer('bare', 'super-card-comments'), findsNothing);
+ await _close(tester, c);
+ },
+ );
+
+ testWidgets(
+ 'a live tab message sequence is never displayed as a comment count',
+ (tester) async {
+ final server = tasksServer();
+ (server.state['conversations'] as List).add(
+ taskFixture(
+ 'live-sequence',
+ 'A task on an established Swarm',
+ 53,
+ status: 'working',
+ messages: 241397,
+ ),
+ );
+ final c = await _show(tester, server);
+ expect(
+ inCard('live-sequence', const ValueKey('super-card-comments')),
+ findsNothing,
+ );
+ expect(
+ find.descendant(
+ of: _card('live-sequence'),
+ matching: find.text('241397'),
+ ),
+ findsNothing,
+ );
+ expect(tester.takeException(), isNull);
+ await _close(tester, c);
+ },
+ );
+
+ testWidgets(
+ 'List keeps its rows as they were: names in the caption, no footer',
+ (tester) async {
+ final c = await faces(tester);
+ await tester.tap(find.byKey(const ValueKey('super-tasks-layout-list')));
+ await tester.pumpAndSettle();
+ expect(inCard('ready', agentKey), findsNothing);
+ expect(
+ find.descendant(
+ of: _card('ready'),
+ matching: find.textContaining('Finch2'),
+ ),
+ findsOneWidget,
+ );
+ await _close(tester, c);
+ },
+ );
+ });
+
+ group('the Board\'s columns share the pane and every one is reachable (task #3869)', () {
+ const names = [
+ 'proposals',
+ 'nextUp',
+ 'working',
+ 'done',
+ 'merged',
+ 'shipped',
+ ];
+ final board = find.byKey(const ValueKey('super-tasks-board'));
+ List<double> widths(WidgetTester tester) => [
+ for (final name in names) tester.getSize(_column(name)).width,
+ ];
+ ScrollPosition position(WidgetTester tester) => tester
+ .state<ScrollableState>(
+ find.descendant(of: board, matching: find.byType(Scrollable)).first,
+ )
+ .position;
+
+ for (final width in [1920.0, 2560.0]) {
+ testWidgets(
+ 'at $width the six columns are equal and reach the pane\'s edge',
+ (tester) async {
+ final c = await _show(tester, tasksServer(), size: Size(width, 900));
+ final all = widths(tester);
+ expect(
+ all.every((w) => (w - all.first).abs() < .5),
+ isTrue,
+ reason: '$all',
+ );
+ expect(all.first, greaterThan(SuperTabTasksView.columnWidth));
+ // No empty band: the last column ends where the pane's padding does.
+ expect(
+ tester.getTopRight(_column('shipped')).dx,
+ moreOrLessEquals(
+ tester.getRect(board).right - grid.AppDesktop.groupGap,
+ epsilon: 1,
+ ),
+ );
+ expect(position(tester).maxScrollExtent, 0);
+ await _close(tester, c);
+ },
+ );
+ }
+
+ testWidgets(
+ 'at 1280 they keep their minimum and the Board scrolls sideways',
+ (tester) async {
+ final c = await _show(
+ tester,
+ tasksServer(),
+ size: const Size(1280, 900),
+ );
+ final all = widths(tester);
+ expect(all.every((w) => (w - 240).abs() < .5), isTrue, reason: '$all');
+ expect(position(tester).maxScrollExtent, greaterThan(0));
+ await _close(tester, c);
+ },
+ );
+
+ testWidgets(
+ 'a scrollbar shows while they do not fit, and not when they do',
+ (tester) async {
+ final c = await _show(
+ tester,
+ tasksServer(),
+ size: const Size(900, 900),
+ );
+ final bar = find.byWidgetPredicate(
+ (w) => w is RawScrollbar,
+ description: 'the Board\'s scrollbar',
+ );
+ expect(bar, findsOneWidget);
+ expect(tester.widget<RawScrollbar>(bar).thumbVisibility, isTrue);
+ await tester.binding.setSurfaceSize(const Size(2560, 900));
+ await tester.pumpAndSettle();
+ expect(position(tester).maxScrollExtent, 0);
+ await _close(tester, c);
+ },
+ );
+
+ Future<void> reachesTheLastColumnAndBack(
+ WidgetTester tester,
+ Future<void> Function() there,
+ Future<void> Function() back,
+ ) async {
+ final start = position(tester).pixels;
+ await there();
+ await tester.pumpAndSettle();
+ expect(
+ position(tester).pixels,
+ position(tester).maxScrollExtent,
+ reason: 'the last column is in view',
+ );
+ expect(tester.getTopRight(_column('shipped')).dx, lessThanOrEqualTo(900));
+ await back();
+ await tester.pumpAndSettle();
+ expect(position(tester).pixels, start, reason: 'and back to the first');
+ }
+
+ testWidgets('a trackpad swipe reaches every column and back', (
+ tester,
+ ) async {
+ final c = await _show(tester, tasksServer(), size: const Size(900, 900));
+ await reachesTheLastColumnAndBack(
+ tester,
+ () => tester.trackpadFling(board, const Offset(-2000, 0), 3000),
+ () => tester.trackpadFling(board, const Offset(2000, 0), 3000),
+ );
+ await _close(tester, c);
+ });
+
+ testWidgets('shift plus the mouse wheel reaches every column and back', (
+ tester,
+ ) async {
+ final c = await _show(tester, tasksServer(), size: const Size(900, 900));
+ final mouse = TestPointer(1, PointerDeviceKind.mouse);
+ Future<void> wheel(double dy) async {
+ await tester.sendKeyDownEvent(LogicalKeyboardKey.shiftLeft);
+ tester.binding.handlePointerEvent(mouse.hover(tester.getCenter(board)));
+ tester.binding.handlePointerEvent(mouse.scroll(Offset(0, dy)));
+ await tester.sendKeyUpEvent(LogicalKeyboardKey.shiftLeft);
+ }
+
+ await reachesTheLastColumnAndBack(
+ tester,
+ () => wheel(3000),
+ () => wheel(-3000),
+ );
+ await _close(tester, c);
+ });
+
+ testWidgets(
+ 'dragging the scrollbar\'s thumb reaches every column and back',
+ (tester) async {
+ final c = await _show(
+ tester,
+ tasksServer(),
+ size: const Size(900, 900),
+ );
+ final rect = tester.getRect(board);
+ final thumb = Offset(rect.left + 60, rect.bottom - 4);
+ await reachesTheLastColumnAndBack(
+ tester,
+ () => tester.dragFrom(thumb, const Offset(2000, 0)),
+ () => tester.dragFrom(
+ Offset(rect.right - 60, rect.bottom - 4),
+ const Offset(-2000, 0),
+ ),
+ );
+ await _close(tester, c);
+ },
+ );
+ });
+
testWidgets('columns that do not fit scroll sideways', (tester) async {
final c = await _show(tester, tasksServer(), size: const Size(900, 800));
expect(tester.getTopLeft(_column('shipped')).dx, greaterThan(900));
@@ -417,13 +825,17 @@ void main() {
matching: find.text('One tag per ask'),
);
expect(tester.getTopLeft(label).dy, lessThan(tester.getTopLeft(title).dy));
- // The caption keeps its words.
+ // The footer names the pull request; the card has no name line (task #3869).
+ expect(
+ find.descendant(of: _card('tag'), matching: find.text('#2867')),
+ findsOneWidget,
+ );
expect(
find.descendant(
of: _card('tag'),
- matching: find.text('dee · Finch2 · PR #2867'),
+ matching: find.textContaining('Finch2'),
),
- findsOneWidget,
+ findsNothing,
);
expect(
find.descendant(
@@ -523,23 +935,26 @@ void main() {
await _close(tester, c);
});
- testWidgets('cards read the title, then requester · agent · state', (
- tester,
- ) async {
- final c = await _show(tester, tasksServer());
- Finder inCard(String id, String text) =>
- find.descendant(of: _card(id), matching: find.text(text));
- expect(inCard('tag', 'One tag per ask'), findsOneWidget);
- expect(inCard('tag', 'dee · Finch2 · PR #2867'), findsOneWidget);
- expect(inCard('shipped-means', 'scholes'), findsOneWidget);
- expect(inCard('sender', 'scholes · Finch2 · PR #2870'), findsOneWidget);
- expect(inCard('test-copy', 'ken15 · Finch2 · Needs you'), findsOneWidget);
- // No task numbers, machines or models.
- expect(find.textContaining('#12'), findsNothing);
- expect(find.textContaining('studio'), findsNothing);
- expect(find.textContaining('claude'), findsNothing);
- await _close(tester, c);
- });
+ testWidgets(
+ 'cards read the title, then the state, the footer and the avatars (task #3869)',
+ (tester) async {
+ final c = await _show(tester, tasksServer());
+ Finder inCard(String id, String text) =>
+ find.descendant(of: _card(id), matching: find.text(text));
+ expect(inCard('tag', 'One tag per ask'), findsOneWidget);
+ expect(inCard('tag', '#2867'), findsOneWidget);
+ expect(inCard('sender', '#2870'), findsOneWidget);
+ expect(inCard('test-copy', 'Needs you'), findsOneWidget);
+ // Who asked and who works on it are avatars, not a line of names.
+ expect(find.textContaining('scholes'), findsNothing);
+ expect(find.textContaining('Finch2'), findsNothing);
+ // No task numbers, machines or models.
+ expect(find.textContaining('#12'), findsNothing);
+ expect(find.textContaining('studio'), findsNothing);
+ expect(find.textContaining('claude'), findsNothing);
+ await _close(tester, c);
+ },
+ );
testWidgets('a task that needs the reader says so, first in its column', (
tester,
@@ -580,7 +995,7 @@ void main() {
final c = await _show(tester, tasksServer(), openedProposals: opened);
expect(_cardsIn(tester, 'proposals'), ['p-old', 'p-new']);
expect(
- find.descendant(of: _card('p-new'), matching: find.text('tony · 23m')),
+ find.descendant(of: _card('p-new'), matching: find.text('23m')),
findsOneWidget,
);
await tester.tap(_card('p-old'));
@@ -645,6 +1060,101 @@ void main() {
await _close(tester, c);
});
+ group('a filter that hides every card says so (task #3869)', () {
+ final noCards = find.byKey(const ValueKey('super-tasks-no-match'));
+ final showAll = find.byKey(const ValueKey('super-tasks-show-all'));
+
+ for (final layout in ['board', 'list']) {
+ testWidgets('Mine and Search name themselves in the $layout, '
+ 'and Show all brings the cards back', (tester) async {
+ final c = await _show(tester, tasksServer());
+ // The Board is the view itself; List is one tap away.
+ if (layout == 'list') {
+ await tester.tap(
+ find.byKey(const ValueKey('super-tasks-layout-list')),
+ );
+ await tester.pumpAndSettle();
+ }
+ expect(noCards, findsNothing);
+
+ // Mine alone hides every card the reader did not ask for: the
+ // search for "preview" leaves only another person's task.
+ await tester.tap(find.byKey(const ValueKey('super-tasks-mine')));
+ await tester.enterText(
+ find.byKey(const ValueKey('super-tasks-search')),
+ 'preview',
+ );
+ await tester.pumpAndSettle();
+ expect(_card('preview'), findsNothing);
+ expect(
+ find.descendant(
+ of: noCards,
+ matching: find.text('No cards match Mine and “preview”'),
+ ),
+ findsOneWidget,
+ );
+ expect(find.text('No tasks yet'), findsNothing);
+
+ await tester.tap(showAll);
+ await tester.pumpAndSettle();
+ expect(noCards, findsNothing);
+ expect(_card('preview'), findsOneWidget);
+ expect(_card('tag'), findsOneWidget);
+ expect(
+ tester
+ .widget<TextField>(
+ find.byKey(const ValueKey('super-tasks-search')),
+ )
+ .controller
+ ?.text,
+ isNot('preview'),
+ );
+ await _close(tester, c);
+ });
+ }
+
+ testWidgets('a search alone, and Mine alone, are named alone', (
+ tester,
+ ) async {
+ final c = await _show(tester, tasksServer());
+ await tester.enterText(
+ find.byKey(const ValueKey('super-tasks-search')),
+ 'zzz',
+ );
+ await tester.pumpAndSettle();
+ expect(find.text('No cards match “zzz”'), findsOneWidget);
+ await tester.tap(showAll);
+ await tester.pumpAndSettle();
+ expect(noCards, findsNothing);
+ expect(_card('tag'), findsOneWidget);
+
+ // Mine alone: the reader asked for nothing in this project.
+ final server = tasksServer();
+ for (final g
+ in (server.state['conversations'] as List)
+ .cast<Map<String, dynamic>>()) {
+ g.remove('requesterId');
+ }
+ await _close(tester, c);
+ final lonely = await _show(tester, server);
+ await tester.tap(find.byKey(const ValueKey('super-tasks-mine')));
+ await tester.pumpAndSettle();
+ expect(find.text('No cards match Mine'), findsOneWidget);
+ await tester.tap(showAll);
+ await tester.pumpAndSettle();
+ expect(_card('tag'), findsOneWidget);
+ await _close(tester, lonely);
+ });
+
+ testWidgets('a project with no tasks still says so, with no filter to '
+ 'clear', (tester) async {
+ final c = await _show(tester, tasksServer(empty: true));
+ expect(find.text('No tasks yet'), findsOneWidget);
+ expect(noCards, findsNothing);
+ await _close(tester, c);
+ });
+ });
+
testWidgets('List and Mine are remembered for the reader on this Mac', (
tester,
) async {
@@ -1095,20 +1605,30 @@ void main() {
_cardsIn(tester, 'done'),
containsAll(['green-done', 'stale-green']),
);
- expect(line('green-done', 'green, waiting 12 min'), findsOneWidget);
+ expect(line('green-done', 'waiting 12 min'), findsOneWidget);
expect(
- tester
- .widget<Text>(line('green-done', 'green, waiting 12 min'))
- .style
- ?.color,
+ find.descendant(
+ of: _card('green-done'),
+ matching: find.text('Ready to merge'),
+ ),
+ findsOneWidget,
+ );
+ expect(
+ tester.widget<Text>(line('green-done', 'waiting 12 min')).style?.color,
isNot(grid.AppPalette.warn),
);
- final stale = line('stale-green', 'green, waiting 1 h 30 min');
+ final stale = line('stale-green', 'waiting 1 h 30 min');
expect(stale, findsOneWidget);
expect(tester.widget<Text>(stale).style?.color, grid.AppPalette.warn);
expect(_cardsIn(tester, 'working'), contains('red-done'));
expect(_cardsIn(tester, 'done'), isNot(contains('red-done')));
- expect(line('red-done', 'CI red'), findsOneWidget);
+ expect(
+ find.descendant(
+ of: _card('red-done'),
+ matching: find.text('CI failing'),
+ ),
+ findsOneWidget,
+ );
expect(_cardsIn(tester, 'merged'), contains('merged-soon'));
expect(
line('merged-soon', 'waiting for Desktop · next release about 15:30'),
diff --git a/desktop/test/super_tab_v3_left_shots_test.dart b/desktop/test/super_tab_v3_left_shots_test.dart
new file mode 100644
index 000000000..1fea3db18
--- /dev/null
+++ b/desktop/test/super_tab_v3_left_shots_test.dart
@@ -0,0 +1,167 @@
+import 'dart:io';
+
+import 'package:flutter/material.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/state/app_state.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_V3_LEFT_SHOTS'];
+
+Map<String, dynamic> _agent(String id, String name) => {
+ 'id': id,
+ 'projectId': 'lead',
+ 'name': name,
+ 'displayName': name,
+ 'machineId': 'host',
+ 'harnessId': 'session',
+ 'contributorId': 'owner',
+ 'configuration': {'engine': 'codex'},
+};
+
+/// Swarm v3's left pane and middle (task #4118), in both appearances: My agents with the Buddy first, a PM's crown and an
+/// unread name in bold; the chat of a selected agent in the middle; a project's Board with Projects open.
+void main() {
+ setUpAll(() async {
+ await loadCaptureFonts(shots);
+ if (shots != null && Platform.isMacOS) {
+ final bytes = ByteData.sublistView(
+ await File('/System/Library/Fonts/Apple Symbols.ttf').readAsBytes(),
+ );
+ await (FontLoader('Apple Symbols')..addFont(Future.value(bytes))).load();
+ }
+ });
+
+ for (final brightness in Brightness.values) {
+ for (final scene in ['agent-chat', 'no-agents', 'board']) {
+ testWidgets('$scene (${brightness.name})', (tester) 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>>();
+ if (scene == 'no-agents') {
+ server.state['agents'] = <dynamic>[];
+ } else {
+ server.state['swarmBuddy'] = true;
+ server.state['agents'] = [
+ {
+ ..._agent('buddy', 'Buddy'),
+ 'buddyScope': 'swarm',
+ 'buddyOf': {'personId': 'owner'},
+ 'kind': 'buddy',
+ 'chatId': 'swarm-buddy-owner',
+ },
+ {
+ ..._agent('kestrel', 'Kestrel'),
+ 'kind': 'regular',
+ 'chatId': 'agent-chat-kestrel',
+ },
+ {..._agent('orion', 'Orion'), 'kind': 'pm', 'chatId': 'lead'},
+ ];
+ groups.add({
+ ...conversationFixture('swarm-buddy-owner', 'Buddy'),
+ 'kind': 'swarm-buddy',
+ 'buddyOwnerId': 'owner',
+ 'agentIds': ['buddy'],
+ });
+ groups.firstWhere((g) => g['id'] == 'lead')['leadId'] = 'orion';
+ // A Regular agent's own chat with its person (backend #4116): it needs no Lead.
+ groups.add({
+ ...conversationFixture('agent-chat-kestrel', 'Kestrel'),
+ 'kind': 'agent-chat',
+ 'agentIds': ['kestrel'],
+ });
+ server.append(
+ 'Please look at the build.',
+ conversationId: 'agent-chat-kestrel',
+ );
+ server.messages.last['author'] = {
+ 'kind': 'person',
+ 'id': 'owner',
+ 'name': '[email protected]',
+ };
+ server.append(
+ 'On it: the build fails on the lint step, fixing now.',
+ conversationId: 'agent-chat-kestrel',
+ );
+ server.messages.last['author'] = {
+ 'kind': 'agent',
+ 'id': 'kestrel',
+ 'name': 'Kestrel',
+ };
+ }
+ server.append('Working on the fix.', conversationId: 'offline');
+ final c = server.controller(
+ account: 'owner',
+ initial: {
+ 'tabId': 'tab',
+ 'accountId': 'owner',
+ 'selectedId': 'lead',
+ if (scene == 'board') 'projectsGroupOpen': true,
+ },
+ );
+ await tester.runAsync(c.refresh);
+ // With an app the left pane has the org switcher and + New agent, as it does in the real window.
+ 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 (v3)',
+ style: TextStyle(color: grid.AppPalette.textFaint),
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ Future<void> settle() 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));
+ }
+ }
+
+ await settle();
+ if (scene == 'agent-chat') {
+ await tester.tap(find.byKey(const ValueKey('super-agent-kestrel')));
+ await settle();
+ } else if (scene == 'board') {
+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));
+ await settle();
+ }
+ await captureWindow(tester, shots, '$scene-${brightness.name}');
+ await tester.pumpWidget(const SizedBox());
+ await tester.runAsync(c.flush);
+ c.dispose();
+ await tester.pump(const Duration(seconds: 5));
+ });
+ }
+ }
+}
diff --git a/desktop/test/super_tab_v3_left_test.dart b/desktop/test/super_tab_v3_left_test.dart
new file mode 100644
index 000000000..07e457725
--- /dev/null
+++ b/desktop/test/super_tab_v3_left_test.dart
@@ -0,0 +1,753 @@
+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/widgets/desktop_chrome.dart';
+import 'package:harness/state/app_state.dart';
+import 'package:harness/super_tabs/buddy_rows.dart' show SuperTabCountBadge;
+import 'package:harness/super_tabs/controller.dart';
+import 'package:harness/super_tabs/model.dart' show SuperTabAgent;
+import 'package:harness/super_tabs/places.dart';
+import 'package:harness/super_tabs/project_sidebar.dart';
+import 'package:harness/super_tabs/view.dart';
+
+import 'super_tab_activity_lists_test.dart' show load, swarm;
+import 'support/super_tab_fixture.dart';
+import 'swarm_state_test.dart' show createApp;
+
+/// Swarm v3's left pane (task #4118, anh Dee 2026-11-07): org switching, Decisions, My agents, then collapsible Projects,
+/// closed unless the person has no agents. Mentions goes.
+Map<String, dynamic> _agent(
+ String id,
+ String name, {
+ String contributor = 'owner',
+}) => {
+ 'id': id,
+ 'projectId': 'lead',
+ 'name': name,
+ 'displayName': name,
+ 'machineId': 'host',
+ 'harnessId': 'session',
+ 'contributorId': contributor,
+ 'configuration': {'engine': 'codex'},
+};
+
+void main() {
+ Finder key(String k) => find.byKey(ValueKey(k));
+
+ 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));
+ }
+ }
+
+ Future<SuperTabController> show(
+ WidgetTester tester, {
+ List<Map<String, dynamic>>? agents,
+ bool board = true,
+ void Function(ConversationServer server)? setup,
+ List<String>? selected,
+ List<String>? created,
+ }) async {
+ final server = swarm();
+ if (agents != null) server.state['agents'] = agents;
+ setup?.call(server);
+ final activity = (await tester.runAsync(() => load(server)))!;
+ final c = activity.controller;
+ final AppNotifier app = createApp();
+ addTearDown(app.dispose);
+ await tester.binding.setSurfaceSize(const Size(300, 900));
+ addTearDown(() => tester.binding.setSurfaceSize(null));
+ await tester.pumpWidget(
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: Brightness.light),
+ home: Scaffold(
+ // The view rebuilds the sidebar as the controller changes.
+ body: ListenableBuilder(
+ listenable: c,
+ builder: (context, _) => ProjectSidebar(
+ controller: c,
+ app: app,
+ onSelect: (id) {
+ selected?.add(id);
+ c.select(id);
+ },
+ onNewAgent: () => created?.add('new'),
+ places: SuperTabPlaces.of(c),
+ onNewSwarm: () {},
+ onNewProject: () {},
+ onPage: (_) {},
+ activity: activity,
+ attention: activity.attention,
+ onManage: () {},
+ board: board,
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.pump();
+ addTearDown(() => tester.pumpWidget(const SizedBox()));
+ return c;
+ }
+
+ group('the org switcher is the first thing in the left pane', () {
+ testWidgets('on the Desktop it sits above the back and forward arrows '
+ 'and Decisions', (tester) async {
+ await show(tester);
+ double top(String k) => tester.getTopLeft(key(k)).dy;
+ expect(top('super-swarm-switcher'), lessThan(top('super-back')));
+ expect(top('super-swarm-switcher'), lessThan(top('super-decisions')));
+ });
+
+ testWidgets('a layout that is not the Desktop\'s keeps its order', (
+ tester,
+ ) async {
+ await show(tester, board: false);
+ double top(String k) => tester.getTopLeft(key(k)).dy;
+ expect(top('super-back'), lessThan(top('super-swarm-switcher')));
+ });
+ });
+
+ group('Mentions goes', () {
+ testWidgets('the Desktop\'s left pane has Decisions and no Mentions', (
+ tester,
+ ) async {
+ await show(tester);
+ expect(key('super-decisions'), findsOneWidget);
+ expect(key('super-mentions'), findsNothing);
+ });
+
+ testWidgets('a layout that is not the Desktop\'s keeps its rows', (
+ tester,
+ ) async {
+ await show(tester, board: false);
+ expect(key('super-mentions'), findsOneWidget);
+ });
+ });
+
+ group('Projects folds', () {
+ testWidgets('closed while the person has an agent', (tester) async {
+ await show(tester);
+ expect(key('project-sidebar-projects'), findsOneWidget);
+ expect(key('super-project-lead'), findsNothing);
+ expect(find.byTooltip('Expand Projects'), findsOneWidget);
+ });
+
+ testWidgets('open when the person has no agents, or only another\'s', (
+ tester,
+ ) async {
+ await show(tester, agents: []);
+ expect(key('super-project-lead'), findsOneWidget);
+ await tester.pumpWidget(const SizedBox());
+ await show(
+ tester,
+ agents: [_agent('tuan-agent', 'Tuan agent', contributor: 'tuan')],
+ );
+ expect(key('super-project-lead'), findsOneWidget);
+ });
+
+ testWidgets('its heading opens and closes it', (tester) async {
+ final c = await show(tester);
+ await tester.tap(find.byTooltip('Expand Projects'));
+ await tester.pump();
+ expect(key('super-project-lead'), findsOneWidget);
+ await tester.tap(find.byTooltip('Collapse Projects'));
+ await tester.pump();
+ expect(key('super-project-lead'), findsNothing);
+ // The choice is saved with the view.
+ expect(c.projectsGroupOpen, isFalse);
+ await tester.runAsync(c.flush);
+ });
+
+ testWidgets('a layout that is not the Desktop\'s keeps Projects open', (
+ tester,
+ ) async {
+ await show(tester, board: false);
+ expect(key('super-project-lead'), findsOneWidget);
+ expect(find.byTooltip('Collapse Projects'), findsNothing);
+ });
+ });
+
+ group('My agents', () {
+ final buddy = {
+ ..._agent('buddy', 'Buddy'),
+ 'buddyScope': 'swarm',
+ 'buddyOf': {'personId': 'owner'},
+ };
+
+ /// The person's Buddy, an agent of theirs at work on a task (Kestrel), a
+ /// PM of theirs (Orion, the project's), and another person's agent.
+ void agents(ConversationServer server) {
+ server.state['swarmBuddy'] = true;
+ final groups = (server.state['conversations'] as List)
+ .cast<Map<String, dynamic>>();
+ groups.firstWhere((g) => g['id'] == 'lead')['leadId'] = 'orion';
+ groups.firstWhere((g) => g['id'] == 'offline')['assignment'] = {
+ 'id': 'a1',
+ 'agentId': 'kestrel',
+ 'status': 'working',
+ };
+ }
+
+ final mine = [
+ buddy,
+ _agent('kestrel', 'Kestrel'),
+ _agent('orion', 'Orion'),
+ _agent('tuan-agent', 'Tuan agent', contributor: 'tuan'),
+ ];
+
+ double top(WidgetTester tester, String k) => tester.getTopLeft(key(k)).dy;
+
+ testWidgets('lists the Buddy first, then the person\'s own agents and '
+ 'no one else\'s', (tester) async {
+ await show(tester, agents: mine, setup: agents);
+ expect(key('project-sidebar-agents'), findsOneWidget);
+ expect(
+ find.descendant(
+ of: key('project-sidebar-agents'),
+ matching: find.text('My agents'),
+ ),
+ findsOneWidget,
+ );
+ expect(key('super-swarm-buddy'), findsOneWidget);
+ expect(
+ top(tester, 'super-swarm-buddy'),
+ lessThan(top(tester, 'super-agent-kestrel')),
+ );
+ expect(
+ top(tester, 'super-agent-kestrel'),
+ lessThan(top(tester, 'super-agent-orion')),
+ );
+ expect(key('super-agent-tuan-agent'), findsNothing);
+ // My agents comes before Projects.
+ expect(
+ top(tester, 'project-sidebar-agents'),
+ lessThan(top(tester, 'project-sidebar-projects')),
+ );
+ });
+
+ testWidgets('a PM has a crown right after its name, a Regular agent '
+ 'none', (tester) async {
+ await show(tester, agents: mine, setup: agents);
+ expect(key('super-agent-crown-orion'), findsOneWidget);
+ expect(key('super-agent-crown-kestrel'), findsNothing);
+ final name = find.descendant(
+ of: key('super-agent-orion'),
+ matching: find.text('Orion'),
+ );
+ final crown = tester.getRect(key('super-agent-crown-orion'));
+ expect(crown.left - tester.getRect(name).right, inInclusiveRange(0, 12));
+ expect(
+ (crown.center.dy - tester.getRect(name).center.dy).abs(),
+ lessThan(4),
+ );
+ });
+
+ testWidgets('unread is a bold name, with no dot and no number', (
+ tester,
+ ) async {
+ await show(
+ tester,
+ agents: mine,
+ setup: (server) {
+ agents(server);
+ server.append('Done with the change.', conversationId: 'offline');
+ },
+ );
+ FontWeight? weight(String agent, String name) => tester
+ .widget<Text>(
+ find.descendant(of: key(agent), matching: find.text(name)),
+ )
+ .style
+ ?.fontWeight;
+ expect(weight('super-agent-kestrel', 'Kestrel'), FontWeight.w600);
+ expect(weight('super-agent-orion', 'Orion'), isNot(FontWeight.w600));
+ expect(
+ find.descendant(
+ of: key('super-agent-kestrel'),
+ matching: find.byType(SuperTabCountBadge),
+ ),
+ findsNothing,
+ );
+ });
+
+ testWidgets('opening an agent opens its chat: a PM\'s project chat, a '
+ 'Regular agent\'s task', (tester) async {
+ final selected = <String>[];
+ final c = await show(
+ tester,
+ agents: mine,
+ setup: agents,
+ selected: selected,
+ );
+ await tester.tap(key('super-agent-orion'));
+ await tester.pump();
+ await tester.tap(key('super-agent-kestrel'));
+ await tester.pump();
+ expect(selected, ['lead', 'offline']);
+ await tester.runAsync(c.flush);
+ });
+
+ testWidgets('an agent with no chat yet opens nothing and says why', (
+ tester,
+ ) async {
+ final selected = <String>[];
+ await show(
+ tester,
+ agents: mine,
+ setup: (server) {
+ agents(server);
+ (server.state['conversations'] as List<Map<String, dynamic>>)
+ .firstWhere((g) => g['id'] == 'offline')
+ .remove('assignment');
+ },
+ selected: selected,
+ );
+ await tester.tap(key('super-agent-kestrel'));
+ await tester.pump();
+ expect(selected, isEmpty);
+ expect(find.byTooltip('Kestrel · no chat yet'), findsOneWidget);
+ });
+
+ testWidgets('+ New agent is the last row, below the agents, and hands on '
+ 'to the creation dialog', (tester) async {
+ final created = <String>[];
+ await show(tester, agents: mine, setup: agents, created: created);
+ expect(find.byTooltip('New agent'), findsNothing);
+ expect(
+ top(tester, 'super-new-agent-row'),
+ greaterThan(top(tester, 'super-agent-orion')),
+ );
+ expect(
+ top(tester, 'super-new-agent-row'),
+ lessThan(top(tester, 'project-sidebar-projects')),
+ );
+ expect(
+ find.descendant(
+ of: key('super-new-agent-row'),
+ matching: find.text('New agent'),
+ ),
+ findsOneWidget,
+ );
+ await tester.tap(key('super-new-agent-row'));
+ await tester.pumpAndSettle();
+ expect(created, ['new']);
+ });
+
+ testWidgets('a layout that is not the Desktop\'s has no My agents', (
+ tester,
+ ) async {
+ await show(tester, agents: mine, setup: agents, board: false);
+ expect(key('project-sidebar-agents'), findsNothing);
+ });
+ });
+
+ group('the view offers + New agent only with an app', () {
+ Future<SuperTabController> view(
+ WidgetTester tester, {
+ required bool withApp,
+ }) async {
+ final server = swarm()..state['agents'] = [_agent('kestrel', 'Kestrel')];
+ final c = server.controller(
+ account: 'owner',
+ initial: {
+ 'tabId': 'tab',
+ 'accountId': 'owner',
+ 'selectedId': 'lead',
+ 'projectsGroupOpen': true,
+ },
+ );
+ await tester.runAsync(c.refresh);
+ final AppNotifier? app = withApp ? createApp() : null;
+ if (app != null) addTearDown(app.dispose);
+ await tester.binding.setSurfaceSize(const Size(1500, 900));
+ addTearDown(() => tester.binding.setSurfaceSize(null));
+ await tester.pumpWidget(
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: Brightness.light),
+ home: Scaffold(
+ body: SuperTabView(
+ controller: c,
+ app: app,
+ onInvite: () {},
+ onAddAgent: (_) {},
+ onOpenTerminal: (_) {},
+ machineName: (_) => 'Mac Studio',
+ board: true,
+ ),
+ ),
+ ),
+ );
+ await settle(tester);
+ return c;
+ }
+
+ testWidgets('with an app the last row of My agents is + New agent', (
+ tester,
+ ) async {
+ final c = await view(tester, withApp: true);
+ expect(key('super-new-agent-row'), findsOneWidget);
+ await tester.pumpWidget(const SizedBox());
+ c.dispose();
+ });
+
+ testWidgets('without one it has none', (tester) async {
+ final c = await view(tester, withApp: false);
+ expect(key('super-new-agent-row'), findsNothing);
+ await tester.pumpWidget(const SizedBox());
+ c.dispose();
+ });
+ });
+
+ group('the middle follows the selected agent', () {
+ Future<SuperTabController> view(
+ WidgetTester tester, {
+ Widget Function(BuildContext)? rightPane,
+ void Function(ConversationServer server)? setup,
+ }) async {
+ final server = swarm()
+ ..state['agents'] = [
+ _agent('kestrel', 'Kestrel'),
+ _agent('orion', 'Orion'),
+ ];
+ final groups = (server.state['conversations'] as List)
+ .cast<Map<String, dynamic>>();
+ groups.firstWhere((g) => g['id'] == 'lead')['leadId'] = 'orion';
+ groups.firstWhere((g) => g['id'] == 'offline')['assignment'] = {
+ 'id': 'a1',
+ 'agentId': 'kestrel',
+ 'status': 'working',
+ };
+ server.append('Working on the fix.', conversationId: 'offline');
+ server.append('The project chat line.');
+ setup?.call(server);
+ final c = server.controller(
+ account: 'owner',
+ initial: {
+ 'tabId': 'tab',
+ 'accountId': 'owner',
+ 'selectedId': 'lead',
+ 'projectsGroupOpen': true,
+ },
+ );
+ await tester.runAsync(c.refresh);
+ await tester.binding.setSurfaceSize(const Size(1600, 900));
+ addTearDown(() => tester.binding.setSurfaceSize(null));
+ await tester.pumpWidget(
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: Brightness.light),
+ home: Scaffold(
+ body: SuperTabView(
+ controller: c,
+ onInvite: () {},
+ onAddAgent: (_) {},
+ onOpenTerminal: (_) {},
+ machineName: (_) => 'Mac Studio',
+ board: true,
+ rightPane: rightPane,
+ ),
+ ),
+ ),
+ );
+ await settle(tester);
+ return c;
+ }
+
+ Future<void> end(WidgetTester tester, SuperTabController c) async {
+ await tester.pumpWidget(const SizedBox());
+ c.dispose();
+ await tester.pump(const Duration(seconds: 5));
+ }
+
+ testWidgets('a Regular agent opens its task\'s chat in the middle', (
+ tester,
+ ) async {
+ final c = await view(tester);
+ await tester.tap(key('super-agent-kestrel'));
+ await settle(tester);
+ expect(c.selectedId, 'offline');
+ expect(
+ find.descendant(
+ of: key('super-center-pane'),
+ matching: find.text('Working on the fix.'),
+ ),
+ findsOneWidget,
+ );
+ expect(key('super-middle-chat'), findsOneWidget);
+ // No Board, and the chat is not in the right pane any more.
+ expect(key('super-tasks-lead'), findsNothing);
+ expect(key('super-board-chat'), findsNothing);
+ expect(key('super-right-pane'), findsOneWidget);
+ await end(tester, c);
+ });
+
+ testWidgets('the Buddy opens its chat in the middle', (tester) async {
+ final c = await view(
+ tester,
+ setup: (server) {
+ server.state['swarmBuddy'] = true;
+ (server.state['agents'] as List).add({
+ ..._agent('buddy', 'Buddy'),
+ 'buddyScope': 'swarm',
+ 'buddyOf': {'personId': 'owner'},
+ });
+ (server.state['conversations'] as List).add({
+ ...conversationFixture('swarm-buddy-owner', 'Buddy'),
+ 'kind': 'swarm-buddy',
+ 'buddyOwnerId': 'owner',
+ 'agentIds': ['buddy'],
+ });
+ server.append(
+ 'What shall we work on?',
+ conversationId: 'swarm-buddy-owner',
+ );
+ },
+ );
+ await tester.tap(key('super-swarm-buddy'));
+ await settle(tester);
+ expect(c.selectedId, 'swarm-buddy-owner');
+ expect(
+ find.descendant(
+ of: key('super-center-pane'),
+ matching: find.text('What shall we work on?'),
+ ),
+ findsOneWidget,
+ );
+ expect(key('super-board-chat'), findsNothing);
+ await end(tester, c);
+ });
+
+ testWidgets('a PM opens its project\'s chat in the middle', (tester) async {
+ final c = await view(tester);
+ await tester.tap(key('super-agent-orion'));
+ await settle(tester);
+ expect(c.selectedId, 'lead');
+ expect(
+ find.descendant(
+ of: key('super-center-pane'),
+ matching: find.text('The project chat line.'),
+ ),
+ findsOneWidget,
+ );
+ expect(key('super-tasks-lead'), findsNothing);
+ await end(tester, c);
+ });
+
+ testWidgets('a project still opens its Board, Board first', (tester) async {
+ final c = await view(tester);
+ await tester.tap(key('super-agent-kestrel'));
+ await settle(tester);
+ await tester.tap(key('super-group-lead'));
+ await settle(tester);
+ expect(key('super-tasks-lead'), findsOneWidget);
+ expect(key('super-middle-chat'), findsNothing);
+ expect(
+ tester.widget<TextButton>(key('super-board-tab-board')).onPressed,
+ isNull,
+ reason: 'Board is the tab shown',
+ );
+ await end(tester, c);
+ });
+
+ testWidgets('a project that is selected shows its Board first, and its '
+ 'Chat tab shows the chat', (tester) async {
+ final c = await view(tester, rightPane: (_) => const SizedBox.expand());
+ // The project's chat is the selected one at start: the Board is shown.
+ expect(c.selectedId, 'lead');
+ expect(key('super-tasks-lead'), findsOneWidget);
+ await tester.tap(key('super-board-tab-chat'));
+ await settle(tester);
+ expect(key('super-tasks-lead'), findsNothing);
+ expect(
+ find.descendant(
+ of: key('super-center-pane'),
+ matching: find.text('The project chat line.'),
+ ),
+ findsOneWidget,
+ );
+ await tester.tap(key('super-board-tab-board'));
+ await settle(tester);
+ expect(key('super-tasks-lead'), findsOneWidget);
+ await end(tester, c);
+ });
+
+ testWidgets('the right pane is a fixed 340 and the middle has the rest', (
+ tester,
+ ) async {
+ final c = await view(tester, rightPane: (_) => const SizedBox.expand());
+ await tester.tap(key('super-group-lead'));
+ await settle(tester);
+ double w(String k) => tester.getSize(key(k)).width;
+ expect(w('super-right-pane'), 340);
+ expect(
+ w('super-center-pane'),
+ closeTo(1600 - w('super-left-pane') - 340, 1),
+ );
+ // Fixed: no divider to drag.
+ expect(key('super-resize-right'), findsNothing);
+ await end(tester, c);
+ });
+
+ testWidgets('Board and Chat are the one view switch: Board is not '
+ 'repeated, and the selected tab reads as selected', (tester) async {
+ final c = await view(tester, rightPane: (_) => const SizedBox.expand());
+ await tester.tap(key('super-group-lead'));
+ await settle(tester);
+ expect(key('super-tasks-layout-board'), findsNothing);
+ expect(find.text('Board'), findsOneWidget);
+ final style = tester
+ .widget<TextButton>(key('super-board-tab-board'))
+ .style!;
+ expect(
+ style.foregroundColor!.resolve({WidgetState.disabled}),
+ DesktopChrome.foreground,
+ reason: 'the tab shown is not greyed as a disabled button',
+ );
+ await end(tester, c);
+ });
+
+ testWidgets('List and Members are toggles back to the Board', (
+ tester,
+ ) async {
+ final c = await view(tester, rightPane: (_) => const SizedBox.expand());
+ await tester.tap(key('super-group-lead'));
+ await settle(tester);
+ for (final layout in ['list', 'members']) {
+ expect(key('super-tasks-board'), findsOneWidget);
+ await tester.tap(key('super-tasks-layout-$layout'));
+ await settle(tester);
+ expect(key('super-tasks-board'), findsNothing, reason: layout);
+ await tester.tap(key('super-tasks-layout-$layout'));
+ await settle(tester);
+ expect(key('super-tasks-board'), findsOneWidget, reason: layout);
+ }
+ await end(tester, c);
+ });
+
+ testWidgets('a person\'s own agent chat sends without a Lead', (
+ tester,
+ ) async {
+ final c = await view(
+ tester,
+ setup: (server) {
+ (server.state['agents'] as List<Map<String, dynamic>>)
+ .firstWhere((a) => a['id'] == 'kestrel')
+ .addAll({'kind': 'regular', 'chatId': 'agent-chat-kestrel'});
+ (server.state['conversations'] as List).add({
+ ...conversationFixture('agent-chat-kestrel', 'Kestrel'),
+ 'kind': 'agent-chat',
+ 'agentIds': ['kestrel'],
+ });
+ server.append(
+ 'Please look at the build.',
+ conversationId: 'agent-chat-kestrel',
+ );
+ server.messages.last['author'] = {
+ 'kind': 'person',
+ 'id': 'owner',
+ 'name': '[email protected]',
+ };
+ },
+ );
+ await tester.tap(key('super-agent-kestrel'));
+ await settle(tester);
+ expect(c.selectedId, 'agent-chat-kestrel');
+ expect(find.text('Please look at the build.'), findsOneWidget);
+ expect(find.text('Not sent · this chat has no Lead'), findsNothing);
+ expect(find.text('Add a Lead'), findsNothing);
+ await end(tester, c);
+ });
+
+ testWidgets('the right pane is the Tasks slot: always there, with the '
+ 'chat in the middle', (tester) async {
+ final c = await view(
+ tester,
+ rightPane: (_) => const Text('Tasks pane', key: ValueKey('tasks-pane')),
+ );
+ // Even on a project's Board the right pane is the slot, not a chat.
+ await tester.tap(key('super-group-lead'));
+ await settle(tester);
+ expect(
+ find.descendant(
+ of: key('super-right-pane'),
+ matching: key('tasks-pane'),
+ ),
+ findsOneWidget,
+ );
+ expect(key('super-board-chat'), findsNothing);
+ await tester.tap(key('super-agent-kestrel'));
+ await settle(tester);
+ expect(
+ find.descendant(
+ of: key('super-right-pane'),
+ matching: key('tasks-pane'),
+ ),
+ findsOneWidget,
+ );
+ expect(key('super-middle-chat'), findsOneWidget);
+ await end(tester, c);
+ });
+ });
+
+ group(
+ 'an agent says what it is and where its person talks to it (#4116)',
+ () {
+ Map<String, dynamic> row(Map<String, dynamic> extra) => {
+ 'id': 'a',
+ 'name': 'A',
+ 'machineId': 'host',
+ 'harnessId': 'session',
+ 'contributorId': 'owner',
+ 'configuration': <String, dynamic>{},
+ ...extra,
+ };
+
+ test('the model reads its kind and its chat; an older backend sends '
+ 'neither', () {
+ final pm = SuperTabAgent.fromJson(
+ row({'kind': 'pm', 'chatId': 'lead'}),
+ );
+ expect((pm.kind, pm.chatId), ('pm', 'lead'));
+ final older = SuperTabAgent.fromJson(row({}));
+ expect((older.kind, older.chatId), (null, null));
+ });
+
+ testWidgets('a PM by kind has the crown and opens the chat it names', (
+ tester,
+ ) async {
+ final selected = <String>[];
+ final c = await show(
+ tester,
+ agents: [
+ {..._agent('zed', 'Zed'), 'kind': 'pm', 'chatId': 'offline'},
+ {..._agent('amy', 'Amy'), 'kind': 'regular', 'chatId': null},
+ ],
+ selected: selected,
+ );
+ expect(key('super-agent-crown-zed'), findsOneWidget);
+ expect(key('super-agent-crown-amy'), findsNothing);
+ await tester.tap(key('super-agent-zed'));
+ await tester.pump();
+ expect(selected, ['offline']);
+ await tester.runAsync(c.flush);
+ });
+
+ testWidgets('its kind wins over the project it once led', (tester) async {
+ await show(
+ tester,
+ agents: [
+ {..._agent('orion', 'Orion'), 'kind': 'regular', 'chatId': null},
+ ],
+ setup: (server) =>
+ (server.state['conversations'] as List<Map<String, dynamic>>)
+ .firstWhere((g) => g['id'] == 'lead')['leadId'] =
+ 'orion',
+ );
+ expect(key('super-agent-crown-orion'), findsNothing);
+ });
+ },
+ );
+}
diff --git a/docs/plans/2026-11-06-board-trello-cards-plan.md b/docs/plans/2026-11-06-board-trello-cards-plan.md
new file mode 100644
index 000000000..18d8d918a
--- /dev/null
+++ b/docs/plans/2026-11-06-board-trello-cards-plan.md
@@ -0,0 +1,102 @@
+# The board's cards as Trello's, columns that fill the pane: implementation plan
+
+> Written by the project's Engineer way of working (project instructions, Engineer): plan first, then each task test first,
+> the failing test committed before its code. No Execution Handoff.
+
+**Goal:** The Desktop Board feels like Trello, which anh Dee finds delightful: a card shows the agent's avatar with the
+requester's small beside it, colour chips for its state and a small row for its pull request, checks and comments; the columns
+share the pane's full width with a sensible minimum, and when they do not fit a trackpad swipe, shift and the mouse wheel and a
+visible scrollbar each reach every column and back (task #3869, requested by Dee through Harness, with Scholes's report that the
+other columns cannot be reached).
+
+**Architecture:** Delta to the board that exists (`task_card.dart`, `tasks_view.dart`), no other redesign.
+- Card face (a tile on the Board): lane chip, title, one quiet line (priority and state words), the state chips, and a footer
+ row: PR, checks done and comments on the left; the agent's avatar (`SuperTabAvatar.agent`, the app's one generated avatar,
+ stable from its id) at the right with the requester's small beside it. This replaces the "dee · Agent" name line.
+- State chips come from what the board already knows of a task (`superTabTaskPlaceOf`): green "Ready to merge" (done, checks
+ green), red "CI failing" (the red state #3827 records), yellow "Needs you"; the lane chip stays. The chips' words leave the
+ quiet line so nothing is said twice.
+- Columns: each takes an equal share of the pane (`LayoutBuilder`), never below a minimum of 240; below it the row scrolls
+ sideways with a permanent scrollbar. One spacing scale (`grid.AppDesktop`) for every padding, gap and heading.
+- Scrolling: Flutter reads a trackpad's horizontal swipe and shift plus the mouse wheel on a horizontal scrollable already; the
+ board gets the scrollbar, whose thumb a mouse drags, so each of the three reaches every column on macOS and Windows.
+
+**Tech Stack:** Dart and Flutter widget tests with the fake Swarm of `test/support/super_tab_fixture.dart`.
+
+**Spec:** Task #3869's brief and its scroll addition; anh Dee's option 2 (his Buddy's); #3787's Trello look; #3812's six columns
+and #3827's check state, which this branch is stacked on.
+
+## Mockup (for anh Dee; his look follows after merge)
+
+```
+ Proposal 1 Next up 3 Working 7 Done 2 Merged 2 Shipped 3 <- six equal columns, full pane
++------------+ +------------+ +------------+ +------------+ +------------+ +------------+
+|[Desktop] | |[CLI] | |[Desktop] | |[Backend] | |[Desktop] | | |
+| Chat limits| | Remove old | | Tasks board| | Waiting on | | Dial recap | | |
+| out in a.. | | preview .. | | six columns| | the merge | | on main | | |
+| P2 12 min | | P2 | | P1 in revw | | P2 1 h 30m | | P2 next .. | | |
+| [Ready to | | | | [CI failing| | [Ready to | | | | |
+| merge] | | | | ][Needs | | merge] | | | | |
+| PR#3480 3/5| | PR#3470 0/2| | you] | | PR#3501 5/5| | PR#3498 5/5| | |
+| 4 (A)d| | 1 (A)d| | PR#3502 2/4| | 2 (A)d| | 0 (A)d| | |
++------------+ +------------+ +------------+ +------------+ +------------+ +------------+
+ (A) the agent's generated avatar, d the requester's, smaller, beside it.
+ Below 6 x 240 plus gaps the row scrolls sideways under a visible scrollbar.
+```
+
+## Global Constraints
+
+- PR body first line: "Requested by dee through Harness." Stacked on #3827 (and #3812): merge them first; #3863 and #3864 also
+ touch the board page, so main is merged once when either lands.
+- Owns `desktop/lib/super_tabs/` and `desktop/test/`. Desktop only, the Board's widgets only.
+- Harness design language (`scripts/check-ui-style.py`): tokens, never frozen colours, light and dark. Trello's look and feel,
+ not its logo, name or images. docs/windows-rules.md: no process, no window.
+- Desktop tests use a memory store and a fake sign-in. No fixed sleeps.
+
+## Design
+
+N/A because nothing is stored, synced or exposed: the same snapshot is drawn differently. The comment count is the task's
+message counter the snapshot already holds (`lastMessageSequence`), so no read is added. platforms: Desktop and web, one Dart
+path; the scrollbar and the wheel and trackpad paths are tested for macOS and Windows behaviour.
+
+## Review Focus
+
+- Every card, chip, row and heading lines up on one grid; the avatars sit bottom right on every tile.
+- No empty band at the right of the pane at 1280, 1920 and 2560; below the minimum, every column is reachable by trackpad,
+ shift plus wheel and the scrollbar, and back.
+- The chips say each state once.
+
+## Task 1: columns fill the pane, and every column is reachable
+
+**Files:** `desktop/lib/super_tabs/tasks_view.dart`, `desktop/test/super_tab_tasks_view_test.dart`.
+
+- [ ] Failing tests: at 1920 and 2560 the six columns are equal width and the last ends at the pane's inner edge (no empty
+ band); at 1280 they keep the minimum and the board scrolls; a scrollbar shows when they do not fit; a trackpad swipe, shift plus
+ the wheel and a drag of the scrollbar's thumb each bring the last column into view and back.
+- [ ] `LayoutBuilder` widths, a `Scrollbar` with a permanent thumb on the board's controller. Commit.
+
+## Task 2: the card face
+
+**Files:** `desktop/lib/super_tabs/task_card.dart`, `tasks_view.dart`, tests.
+
+- [ ] Failing tests: a tile shows the agent's avatar and the requester's small beside it at the bottom right and no name line; the
+ chips (Ready to merge, CI failing, Needs you) and the lane chip; the footer's PR, checks done (3/5) and comment count; a
+ list row and a Member card keep their line.
+- [ ] Footer, chips and avatars on `SuperTabTaskCard`; the board passes the agent, requester, chips and counts. Commit.
+
+## Task 3: one grid, screenshots
+
+- [ ] Light and dark screenshots of the board at 1280, 1920 and 2560, written when the capture directory is set; spacing from the
+ scale only (`check-ui-style.py` clean). Red/green evidence and the PNGs in the pull request and the task thread.
+
+## Review correction: comment counts
+
+Hazel found that `lastMessageSequence` begins at the tab's sequence baseline, so it is not a count of comments.
+The snapshot provides no real comment count. Omit that fact from the footer and its semantics; keep PR/checks/avatars.
+The reviewer accepted this bounded fix, and the PM has been informed of the omitted count.
+
+- [x] Commit a regression test with `lastMessageSequence: 241397`; watch it fail on the original footer.
+- [x] Remove the invented count and the unused comment fact from the card.
+- [x] Run affected widget tests (128 passed) and regenerate light/dark Board screenshots at all three widths (8 capture tests passed).
+
+Six columns retain a 240 px minimum and scroll below about 1530 px of pane width, including a 1280 px window.
diff --git a/docs/plans/2026-11-06-fixed-desktop-layout-plan.md b/docs/plans/2026-11-06-fixed-desktop-layout-plan.md
new file mode 100644
index 000000000..10103bb77
--- /dev/null
+++ b/docs/plans/2026-11-06-fixed-desktop-layout-plan.md
@@ -0,0 +1,71 @@
+# Fixed Desktop layout implementation plan
+
+> Implement task by task in this Engineer session, test first, with one independent PR review.
+
+**Goal:** Keep projects on the left and chat on the right; show the selected project's Board in the middle, otherwise blank.
+
+**Architecture:** Remove the side-pane visibility preferences and their controls from `SuperTabView`. Desktop's Board layout reserves both side panes independently of project selection. Reuse the existing pane sizing, Board, conversation and navigation widgets.
+
+**Tech Stack:** Dart, Flutter, flutter_test; no new dependencies.
+
+**Spec:** Harness task #3863: Dee's fixed projects / Board / chat layout, replacing #3846. No other layout change. Both appearances; memory stores and fake sign-in in tests.
+
+Dee's follow-up: the right chat is the main interface, approximately one-third of the window with a 420 px minimum. Smaller windows give space to chat before the Board. Task #3869 owns sideways Board scrolling. Capture light/dark at 1280, 1920 and 2560 px.
+
+## Global Constraints
+
+- No hide/show controls or remembered hidden state for either side pane.
+- An update restores panes hidden in Desktop 1.3.83.
+- No project selected: blank middle, with no placeholder content.
+- Keep the project's Chat tab accessible, and task chat / return-to-Buddy navigation working.
+- Keep existing Manage, Devices, terminal and web navigation intact.
+- Use existing theme and sizing tokens; read `docs/windows-rules.md`.
+- Scope: Desktop macOS, Linux and Windows; no backend or phone changes.
+
+## Design
+
+- Growth, concurrency, read cost, scale: no added data; remove two local preference reads and all visibility writes. Pane width preferences remain bounded to one existing record.
+- Compatibility: old visibility values are ignored. No server contract changes or backend deployment required.
+- Migration / rollback: no destructive migration; existing obsolete local keys can remain unread. Reverting restores old behavior.
+- Audience / identity: existing server access and account identity are unchanged.
+- Failure: existing loading and error states stay in the chat; an absent project cannot remove the side panes.
+- Platforms: shared Desktop Flutter view on macOS, Linux, Windows; web keeps its current layout.
+
+## Review Focus
+
+1. Old hidden preferences must not conceal either pane after update or remount.
+2. No project selected (including a Swarm with no projects) must leave the middle truly blank.
+3. Selecting a project, opening a task and returning to Buddy must preserve the Board and both side panes.
+4. Desktop's minimum 880-point window must keep both panes visible; existing web compact behavior must remain unchanged.
+5. A project removed while open must not leave stale Board content in the middle.
+
+## Task 1: Fixed panes and empty middle
+
+**Files:**
+- Modify: `desktop/lib/super_tabs/view.dart`
+- Modify: `desktop/lib/super_tabs/tasks_view.dart` (wrap the toolbar only when both panes leave it too narrow).
+- Modify / test: `desktop/test/super_tab_board_layout_test.dart`
+- Test: existing `super_tab_pane_layout_test.dart`, `super_tab_tasks_view_test.dart`, `super_tab_navigation_test.dart`, `super_tab_sidebar_test.dart`, `super_tab_workspace_test.dart`.
+
+**Interfaces:**
+- Consumes `SuperTabView(board: true)`, `SuperTabPaneLayout`, fake `ConversationServer` and `MemoryKeyValueStore`.
+- Produces the same public view interface; `paneStore` supplies pane sizing only. No visibility persistence remains.
+
+- [x] Replace the old hide/show regression with tests seeded with both old hidden preferences; assert visible project rows and right chat, no hide/show controls, including after remount.
+- [x] Add blank-center tests with a Buddy selected and with no projects; assert no center text, editor or controls. Select a project and assert the Board appears in the center, then remove it and assert blank again.
+- [x] Cover the minimum Desktop window and light/dark screenshot capture using synthetic state. Keep existing task / Buddy navigation tests and update the project Chat test to keep the Board beside its chat.
+- [x] Commit tests first; run the layout file and record behavioral failures on the unchanged implementation. Measure the same Board divider-drag workload before and after.
+- [x] Remove visibility flags, reads, writes and buttons. Reserve side panes for the Desktop Board workspace at supported window widths, and leave the center blank without an open project. Keep other navigation surfaces intact.
+- [x] Run the layout regression, named affected tests, changed-file analysis, icon and style audits. Capture and inspect both appearances, with and without a project. Record evidence and platform limitations in the PR.
+- [ ] Commit implementation, push, mark ready and hand the stable revision to the Integrator for independent review and test. Full Desktop suite evidence comes from automatic PR CI.
+
+## Task 2: Comfortable chat width (Dee's follow-up)
+
+**Files:** `desktop/lib/super_tabs/view.dart`, `desktop/lib/super_tabs/pane_layout.dart`, `desktop/test/super_tab_board_layout_test.dart`.
+
+**Interfaces:** Keep the existing resizable layout and stored widths. Add a `rightMinimum` size to `SuperTabPaneLayout` for the Board chat; other callers retain their current minimum. Desktop Board chat defaults to one-third of available width, at least 420 px. The center yields space before either side's minimum.
+
+- [ ] Commit tests asserting chat widths 426.67 / 640 / 853.33 at windows 1280 / 1920 / 2560, in both appearances, and capture each. At 880 px and after restoring an old 280 px width, assert at least 420 px of chat and a visible Board.
+- [ ] Watch these fail before adding the width rule; record the red revision.
+- [ ] Implement the size contract and retain existing user resizing above the minimum. Preserve non-Board navigation's responsive behavior.
+- [ ] Run layout and pane sizing regressions plus the changed Tasks toolbar tests, analyze the changed Dart, and inspect six screenshots. Record the rendering comparison and remaining platform limits.
diff --git a/docs/plans/2026-11-07-swarm-v3-desktop-left-plan.md b/docs/plans/2026-11-07-swarm-v3-desktop-left-plan.md
new file mode 100644
index 000000000..267a86d4e
--- /dev/null
+++ b/docs/plans/2026-11-07-swarm-v3-desktop-left-plan.md
@@ -0,0 +1,105 @@
+# Swarm v3 Desktop: My agents on the left, chat or Board/Chat in the middle: implementation plan
+
+> Written by the project's Engineer way of working (project instructions, Engineer): plan first, then each task test first,
+> the failing test committed before its code. No Execution Handoff.
+
+**Goal:** The Desktop's left pane and middle follow anh Dee's Swarm v3 spec (task #4118, requested by Dee through Harness; the
+spec is shared by all v3 tasks and written to `docs/specs/2026-11-07-swarm-v3.md` by #V3-backend's first PR): left is org
+switching, Decisions, My agents (the person's Buddy first, then the agents on their own account, a crown right next to a PM's
+name, bold for unread with no dots or counts, and + New agent), then collapsible Projects, closed unless the person has no
+agents; Mentions goes. The middle is the chat with the selected agent, or the selected project's Board and Chat tabs, Board
+first. The right pane (Tasks) is task #4119's.
+
+**Architecture:** Delta to what the app shows today (`project_sidebar.dart`, `view.dart`), nothing else redesigned.
+- Rows: the Mentions row leaves. Projects becomes a heading with a chevron (the Buddies group already folds this way:
+ `buddiesGroupOpen`); it starts closed when the person has an agent, open when they have none.
+- My agents: a heading with + New agent, then the person's Buddy first (the existing Buddy row), then each agent they brought
+ (`contributorId` is the reader, a Buddy of another person excluded). A row is the agent's face and name, a crown right after
+ the name of a PM (`snapshot.isLead`), the name bold while its chat has unread, no dot and no count (the existing unread rule).
+- Opening an agent: its chat in the middle. A PM's is its project's chat; a Regular agent's is the task it works on now; the
+ Buddy's is the Buddy chat. An agent with no chat yet opens nothing and says so on its row's tooltip.
+- + New agent: a two-choice menu, Regular or PM, which hands the choice to the creation flow (`onNewAgent(kind)`), where #4116
+ shapes the rest (the engine, the computer you are on).
+- Middle: unchanged where it already is the spec: a project shows Board and Chat tabs, Board first (main's #3787 and #3820); an
+ agent's chat fills the middle.
+
+**Tech Stack:** Dart and Flutter widget tests with the fake Swarm of `test/support/super_tab_fixture.dart`.
+
+**Spec:** Task #4118's brief (anh Dee 2026-11-07 00:05 VN); the Quiet Swarm sidebar (#2996); #3787's Board.
+
+## Assumptions to confirm (no backend contract is published yet)
+
+- An agent's role: `snapshot.isLead(agentId)` for a PM (today's rule), Regular otherwise; a v3 server's own field is read when
+ it appears. Own agents are found by `contributorId == accountId` (the person the agent was brought by).
+- A Regular agent has no chat of its own today: its task chat stands for it.
+
+## Mockup (for anh Dee; his look follows after merge)
+
+```
+ +------------------------+
+ | < > |
+ | [ Company v ] |
+ | Decisions | Mentions is gone
+ | |
+ | My agents [+] | + opens: Regular | PM
+ | (B) Buddy | the Buddy first
+ | (A) Kestrel | an agent: face and name
+ | (A) Orion [crown] | a PM: crown right after the name
+ | (A) **Finch** | bold = unread, no dot, no count
+ | |
+ | > Projects | closed while you have agents
+ | |
+ | Manage |
+ +------------------------+
+```
+
+## Global Constraints
+
+- PR body first line: "Requested by dee through Harness." Draft early, ready as soon as tested; release window 09:00 VN.
+- Owns `desktop/lib/super_tabs/` and `desktop/test/`. Right pane is #4119's; Team accounts' removal is #4120's.
+- Harness design language (`scripts/check-ui-style.py`), light and dark. docs/windows-rules.md: no process, no window.
+- Desktop tests use a memory store and a fake sign-in. No fixed sleeps. No login or credential is read or shown.
+
+## Design
+
+N/A for stored data: Desktop stores one local preference (whether Projects is open), as `buddiesGroupOpen` is kept today, and
+nothing is sent. Compatibility: an older server has no role field and the same agents; the list reads what it reads today.
+Audience: only the person's own agents are listed (the server's read decides what they see); identity is the person's own
+account, never the machine owner's. Failure: an agent with no chat opens nothing and says why. Platforms: one Dart path for
+Desktop macOS, Linux, Windows.
+
+## Review Focus
+
+- The left pane matches the spec: no Mentions, My agents with the Buddy first, crown beside a PM's name, bold unread with no
+ dot or count, Projects collapsed by default only while the person has an agent.
+- Only the person's own agents are listed; nobody else's agent, and no login or credential, is read.
+- Selecting an agent shows its chat in the middle; a project still shows Board and Chat, Board first.
+
+## Task 1: Mentions goes, Projects folds
+
+**Files:** `desktop/lib/super_tabs/project_sidebar.dart`, `controller.dart`, tests.
+
+- [ ] Failing tests: no Mentions row; Projects is closed when the person has an agent and open when they have none; its heading
+ toggles it and the choice is kept.
+- [ ] Remove the row, fold Projects. Commit.
+
+## Task 2: My agents
+
+**Files:** `desktop/lib/super_tabs/project_sidebar.dart`, new `desktop/lib/super_tabs/my_agents.dart`, tests.
+
+- [ ] Failing tests: the section lists the Buddy first, then the person's own agents and no one else's; a PM has a crown right
+ after its name, a Regular agent has none; a name is bold with unread and plain without, with no dot and no number; + New
+ agent offers Regular and PM and hands the choice to the creation flow.
+- [ ] The section and its rows. Commit.
+
+## Task 3: the middle follows the selected agent
+
+**Files:** `desktop/lib/super_tabs/view.dart`, `controller.dart`, tests.
+
+- [ ] Failing tests: selecting a PM opens its project's chat in the middle; a Regular agent opens its task's chat; the Buddy its
+ chat; a project still opens Board and Chat, Board first.
+- [ ] Selection to chat. Commit.
+
+## Task 4: screenshots
+
+- [ ] Light and dark screenshots of the left pane (agents present, none, a PM with a crown, unread) and of the middle.
diff --git a/mobile/lib/swarm/model.dart b/mobile/lib/swarm/model.dart
index 54793532a..3a9c9a511 100644
--- a/mobile/lib/swarm/model.dart
+++ b/mobile/lib/swarm/model.dart
@@ -172,6 +172,8 @@ class SuperTabAgent {
machineOwnerId =
row['machineOwnerId'] as String? ?? _text(row, 'contributorId'),
role = row['role'] as String?,
+ kind = row['kind'] as String?,
+ chatId = row['chatId'] as String?,
roleId = row['roleId'] as String?,
roleName = row['roleName'] as String?,
buddyOf = switch (row['buddyOf']) {
@@ -231,6 +233,9 @@ class SuperTabAgent {
final String id, projectId, name, machineId, harnessId, contributorId;
+ /// What it is and where its person talks to it (Swarm v3, backend #4116), read as the desktop's model reads them.
+ final String? kind, chatId;
+
/// Set by its contributor or its project's Lead; null draws its pattern.
final SuperTabAvatarPicture? avatar;