The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
Desktop: Swarm left pane in one quiet row style, and a Projects grid (#4466) (#3539)
0xken15e25ab17f2315
diff --git a/desktop/design/desktop-design-system.md b/desktop/design/desktop-design-system.mdindex a442f645a..20fd5f377 100644--- a/desktop/design/desktop-design-system.md+++ b/desktop/design/desktop-design-system.md@@ -292,9 +292,10 @@ sized for the widest expected value; names take the remaining width andtruncate first. Row anatomy is the list rule above: rank, identity, name withits metadata, then trend and the emphasized number at the right.-The left pane's People and Agents have no rank number (Dee, 2026-10-29):-people sort by name with their points at the right, and the crown sits after-the week's top person's name.+The Desktop left pane's Humans has no rank number and no crown: it is the+Leaderboard in short, its people most points first with their points at the+right ([Swarm left pane](#swarm-left-pane)). There, as the one exception to the+table, points are the row's quiet detail: 12, tertiary, tabular.A place is its numeral; a celebration mark sits beside it and never replacesit, as [Team and celebration](#team-and-celebration) describes. Color never@@ -394,8 +395,8 @@ quarter of its box, and nothing else outside the words more than 38 pixels.mouth shift sideways by `[-3,0,3][(hash>>9)%3]` units and tilt around thecentre by `[-9,-4,0,5,10][(hash>>5)%5]` degrees. The face is artwork: thesame in light and dark, and always a disc. A chosen picture still wins.-- **Person avatar.** A person keeps their photo, preset or initial; a person- never wears an agent face.+- **Person avatar.** A person keeps their photo or preset, else an initial on+ a neutral grey disc (task #4466); a person never wears an agent face.- **Lead ring.** A Lead (a PM) wears a thin gold ring, hsl(42 92% 58%)(`SwarmPalette.leadRing`), around its avatar: stroke 5% of the face'sdiameter, gap 7%, drawn outside the avatar's box so no row moves. Its@@ -407,11 +408,46 @@ quarter of its box, and nothing else outside the words more than 38 pixels.vocabulary. No status in Flutter draws an X: an X means close. Terminal textand native tab marks may keep `✗`.- **Task card and row.** The Tasks pane card (`SuperTabPersonalTaskCard`) and- the sidebar row (`SuperTabBuddyRow`) carry the elements above at their+ the left pane's row (`SuperTabQuietRow`, [Swarm left pane](#swarm-left-pane))+ carry the elements above at theirshipped sizes; their size and layout do not change when an element does.- **Adding or changing one.** A new or changed element updates this sectionand the gallery, with its images, in the same pull request.+## Swarm left pane++The Desktop's Swarm left pane (anh Dee, 2026-11-07, task #4466) follows the+Swarm's six rules: grey everywhere, colour only on agent faces; blue only for+the main action, red only for failed; 14 chat, 13 names, 12 details, and in a+list bold means unread; every row a face, a name and one quiet detail on the+right; dropdowns plain text until hovered; nothing that does not help you+decide. Top to bottom:++```text+ autonomous.ai ⌄ org name, semibold 13 primary; ⌄ only on hover+ ⊡ Decisions 3 inbox icon; the waiting count is the detail+ ▦ Projects 1 grid icon; opens the grid; the detail counts tags of you+ My agents ⌄ quiet heading; ⌄ only on hover; folds, remembered+ ◉ Buddy ⠋ the Buddy first, by its own name and face+ ◎ River harness ? a Lead's detail is the project it leads+ ◉ Leftquiet offline a down agent's detail is "offline"+ + New agent the last row, opens Cmd-N+ Humans quiet heading; opens the Leaderboard+ D dee 120 the board's top 8 by points; a tap opens it+ ⚙ Manage at the foot+```++| Element | Implementation | Rule |+| --- | --- | --- |+| Quiet row | `SuperTabQuietRow` (`super_tabs/buddy_rows.dart`) | 30 high, 2 under it. A 20 face (`SuperTabQuietRow.faceSize`) or a 16 icon centred in the 32 column, so every name starts on one line. Name 13 (`DesktopChrome.control`): read `textSecondary` regular, unread `textPrimary` semibold, the open row `SidebarInk.selected` with a primary name. One detail, 12 (`DesktopChrome.metadata`) in the tertiary grey (`SidebarInk.faint`, `textFaint`), right-aligned, tabular figures, no brackets; it keeps up to 40% of a row whose name is long, and is cut first. |+| Status mark | `SuperTabQuietRow.mark`, `superTabAgentMark` | My agents only, in one 20 column at the right edge after the detail, kept on every agent row so details line up. A mark only while the agent works (the spinner), needs you (`?`) or failed: grey, failed in the error ink. Idle and finished show nothing; a finished agent's unread reply is its semibold name. |+| Quiet heading | `SuperTabQuietHeading` | 12 `textSecondary`, its text level with the faces' left edge. A group that folds shows `chevronDown` (`chevronRight` folded) only while hovered or focused. |+| Org name | `SuperTabQuietHeading.org` | Semibold 13 primary, no icon; its chevron only on hover; opens the Swarm menu. |+| Person | `SuperTabAvatar.person` at 20 | A photo, or an initial on the neutral grey disc. |+| Projects grid | `SuperTabProjectsPage` (`super_tabs/projects_page.dart`) | Every project as a card, as repositories under a GitHub org, most recent first (the latest message in its chat or tasks). Cards at least 260 wide with 12 between them, transparent with a hairline (`DesktopChrome.rim`) and the hover fill; the name semibold 13 primary, one line 12 tertiary: its repository's `owner/name`, or Private. New project is the page's one blue button. A card opens its project's Board, which lights Projects in the left pane. |++The phone and web layouts keep their own rows.+## PhoneThe phone app speaks the same language at a thumb's scale. It uses the samediff --git a/desktop/lib/shared/theme/app_icons.dart b/desktop/lib/shared/theme/app_icons.dartindex 1e2210fdf..fb16c670b 100644--- a/desktop/lib/shared/theme/app_icons.dart+++ b/desktop/lib/shared/theme/app_icons.dart@@ -127,6 +127,7 @@ abstract final class AppIcons {static const hourglass = LucideIcons.hourglass400;static const house = LucideIcons.house400;static const imagePlus = LucideIcons.imagePlus400;+ static const inbox = LucideIcons.inbox400;static const info = LucideIcons.info400;static const keyboard = LucideIcons.keyboard400;static const laptop = LucideIcons.laptop400;diff --git a/desktop/lib/super_tabs/avatar_art.dart b/desktop/lib/super_tabs/avatar_art.dartindex e22408238..46a411210 100644--- a/desktop/lib/super_tabs/avatar_art.dart+++ b/desktop/lib/super_tabs/avatar_art.dart@@ -2,8 +2,8 @@ import 'dart:math' as math;import 'package:flutter/material.dart';+import '../shared/theme/app_theme.dart' as grid;import '../shared/theme/swarm_palette.dart';-import '../widgets/desktop_chrome.dart';import 'profile_model.dart';@@ -115,7 +115,10 @@ class SuperTabAvatarFace extends StatelessWidget {);Widget _initial(BuildContext context) {- final color = _tone(context, _hue(identity));+ // People are grey: colour is only on agent faces (task #4466).+ final color = identity.startsWith('person:')+ ? grid.AppPalette.textSecondary+ : _tone(context, _hue(identity));final words = name.trim().split(RegExp(r'[\s@._-]+'))diff --git a/desktop/lib/super_tabs/buddy_rows.dart b/desktop/lib/super_tabs/buddy_rows.dartindex c555f1719..ffbe3d7ed 100644--- a/desktop/lib/super_tabs/buddy_rows.dart+++ b/desktop/lib/super_tabs/buddy_rows.dart@@ -2,11 +2,13 @@ import 'dart:math' as math;import 'package:flutter/material.dart';+import '../shared/theme/app_icons.dart';import '../shared/theme/app_theme.dart' as grid;+import '../state/harness_activity.dart';import '../widgets/desktop_chrome.dart';+import '../widgets/harness_activity_mark.dart';import 'buddy_chat.dart';import 'identity.dart';-import 'model.dart';import 'section_heading.dart';import 'swarm_type.dart';@@ -41,6 +43,269 @@ class SuperTabCountBadge extends StatelessWidget {}}+/// One line of the Desktop's left pane (task #4466, anh Dee 11-07): a face or an icon in a fixed column, so every name+/// starts on one line, the name, and at most one quiet detail on the right. 13 names, 12 details; a read name is+/// secondary, an unread one semibold primary, the open row a neutral fill. No marks, badges or colour of its own.+class SuperTabQuietRow extends StatelessWidget {+ const SuperTabQuietRow({+ super.key,+ required this.leading,+ required this.name,+ required this.onTap,+ this.detail,+ this.selected = false,+ this.unread = false,+ this.tooltip,+ this.mark,+ this.markColumn = false,+ });++ static const double height = 30;+ static const double faceSize = 20;++ /// Where the face's left edge, and so the headings' text, starts.+ static double get faceInset =>+ _leadingStart + SuperTabSectionHeading.actionWidth / 2 - faceSize / 2;+ static double get _leadingStart => SuperTabSectionHeading.indentFor(0);++ /// The least of the row a name keeps when its detail is long.+ static const _nameShare = .6;++ static double _width(BuildContext context, String text, TextStyle style) {+ final painter = TextPainter(+ text: TextSpan(text: text, style: style),+ textDirection: Directionality.of(context),+ textScaler: MediaQuery.textScalerOf(context),+ maxLines: 1,+ )..layout();+ final width = painter.width;+ painter.dispose();+ return width;+ }++ /// The face (20) or the icon, centred in its column.+ final Widget leading;+ final String name;++ /// The one quiet word on the right: the project a Lead leads, "offline", a person's points, a count.+ final String? detail;+ final bool selected, unread;+ final String? tooltip;+ final VoidCallback? onTap;++ /// An agent's status mark, after the detail (anh Dee 11-07): only while it works, needs you or failed.+ final Widget? mark;++ /// Whether the row keeps the marks' column at its right edge, so a list's marks and details line up.+ final bool markColumn;++ /// The marks' column.+ static const double markWidth = AppIcons.controlSize;++ @override+ Widget build(BuildContext context) {+ grid.AppTheme.watch(context);+ final strong = unread || selected;+ final markColumn = this.markColumn || mark != null;+ final nameStyle = DesktopChrome.control(+ color: strong+ ? grid.SidebarInk.foreground(context)+ : grid.SidebarInk.muted(context),+ ).copyWith(fontWeight: unread ? grid.AppFont.semibold : null);+ final detailStyle = DesktopChrome.metadata(+ color: grid.SidebarInk.faint(context),+ ).copyWith(fontFeatures: const [FontFeature.tabularFigures()]);+ final nameText = Text(+ name,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: nameStyle,+ );+ final row = LayoutBuilder(+ builder: (context, box) {+ const gap = grid.AppDesktop.controlGap;+ final detail = this.detail;+ // What the name and the detail share: the row less its face column and the gaps.+ final room = math.max(+ 0.0,+ box.maxWidth -+ _leadingStart -+ SuperTabSectionHeading.actionWidth -+ gap -+ (detail == null ? 0 : gap) -+ (markColumn ? markWidth : 0),+ );+ return ConstrainedBox(+ constraints: const BoxConstraints(minHeight: height),+ child: Row(+ children: [+ SizedBox(width: _leadingStart),+ SizedBox(+ width: SuperTabSectionHeading.actionWidth,+ child: Center(child: leading),+ ),+ if (detail == null)+ Expanded(child: nameText)+ else ...[+ // The name first: a long detail is cut before it, but always keeps the rest of the row.+ ConstrainedBox(+ constraints: BoxConstraints(+ maxWidth: math.max(+ room - _width(context, detail, detailStyle),+ room * _nameShare,+ ),+ ),+ child: nameText,+ ),+ const SizedBox(width: gap),+ Expanded(+ child: Text(+ detail,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ textAlign: TextAlign.right,+ style: detailStyle,+ ),+ ),+ ],+ if (markColumn)+ SizedBox(+ width: markWidth,+ child: Center(child: mark),+ ),+ // Unread is a semibold name, and heard in words: the row says what its face, name and detail say.+ if (unread) Semantics(label: 'unread'),+ const SizedBox(width: gap),+ ],+ ),+ );+ },+ );+ return Padding(+ padding: const EdgeInsets.only(bottom: grid.AppDesktop.listRowGap),+ // Focus is a ring, not a second fill (#4445, audit finding 21).+ child: SuperTabRowGround(+ color: selected+ ? grid.SidebarInk.selectedFill(context)+ : Colors.transparent,+ child: Semantics(+ button: true,+ selected: selected,+ child: InkWell(+ onTap: onTap,+ hoverColor: grid.SidebarInk.hoverFill(context),+ focusColor: Colors.transparent,+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ child: tooltip == null+ ? row+ : Tooltip(message: tooltip!, child: row),+ ),+ ),+ ),+ );+ }+}++/// An agent's status mark in the Desktop's My agents (anh Dee 11-07): the shared activity mark, grey, but failed in the+/// error ink. Only working, needs you and failed are ever drawn (`superTabAgentMark`).+class SuperTabAgentMark extends StatelessWidget {+ const SuperTabAgentMark(this.activity, {super.key});+ final HarnessActivity activity;++ @override+ Widget build(BuildContext context) {+ grid.AppTheme.watch(context);+ return ActivityMark(+ activity: activity,+ color: activity == HarnessActivity.failed+ ? Theme.of(context).colorScheme.error+ : grid.SidebarInk.muted(context),+ );+ }+}++/// A heading of the Desktop's left pane (task #4466): 12 and secondary, its text level with the faces' left edge. A+/// group that folds ([collapsed] given) shows its chevron only while hovered or focused, as every dropdown does;+/// [SuperTabQuietHeading.org] is the org name, semibold 13 primary, whose chevron opens the Swarm menu.+class SuperTabQuietHeading extends StatefulWidget {+ const SuperTabQuietHeading(+ this.title, {+ super.key,+ required this.onTap,+ this.collapsed,+ }) : _org = false;++ const SuperTabQuietHeading.org(this.title, {super.key, required this.onTap})+ : collapsed = false,+ _org = true;++ final String title;+ final VoidCallback? onTap;++ /// Whether a group that folds is folded; null for a heading that only opens a page, which has no chevron.+ final bool? collapsed;+ final bool _org;++ @override+ State<SuperTabQuietHeading> createState() => _SuperTabQuietHeadingState();+}++class _SuperTabQuietHeadingState extends State<SuperTabQuietHeading> {+ bool _hovered = false, _focused = false;++ @override+ Widget build(BuildContext context) {+ grid.AppTheme.watch(context);+ final org = widget._org;+ final style = org+ ? DesktopChrome.control(color: grid.SidebarInk.foreground(context))+ .copyWith(fontWeight: grid.AppFont.semibold)+ : DesktopChrome.metadata(color: grid.SidebarInk.muted(context));+ final collapsed = widget.collapsed;+ return MouseRegion(+ onEnter: (_) => setState(() => _hovered = true),+ onExit: (_) => setState(() => _hovered = false),+ child: Semantics(+ button: widget.onTap != null,+ expanded: org || collapsed == null ? null : !collapsed,+ child: InkWell(+ onTap: widget.onTap,+ onFocusChange: (focused) => setState(() => _focused = focused),+ hoverColor: Colors.transparent,+ focusColor: grid.SidebarInk.hoverFill(context),+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ child: ConstrainedBox(+ constraints: const BoxConstraints(+ minHeight: SuperTabQuietRow.height,+ ),+ child: Row(+ children: [+ SizedBox(width: SuperTabQuietRow.faceInset),+ Flexible(+ child: Text(+ widget.title,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: style,+ ),+ ),+ if (collapsed != null && (_hovered || _focused)) ...[+ const SizedBox(width: grid.AppDesktop.listRowGap * 2),+ Icon(+ collapsed ? AppIcons.chevronRight : AppIcons.chevronDown,+ size: AppIcons.closeSize,+ color: grid.SidebarInk.muted(context),+ ),+ ],+ ],+ ),+ ),+ ),+ ),+ );+ }+}+/// A sidebar row's ground: its fill and, while a key's focus is in the row, a/// 2 px ring over it, the fill left as it is. Focus once wore the hover fill/// and read as a second selection (Desktop 1.3.89 audit, finding 21).@@ -97,7 +362,6 @@ class SuperTabBuddyRow extends StatelessWidget {required this.name,required this.tooltip,required this.onTap,- this.agent,this.project,this.selected = false,this.unread = false,@@ -106,7 +370,6 @@ class SuperTabBuddyRow extends StatelessWidget {this.note,this.detail,this.status,- this.lead = false,this.compact = false,});@@ -114,10 +377,6 @@ class SuperTabBuddyRow extends StatelessWidget {final String? agentId;final String name;- /// An agent in My agents: the row wears its picture or face, as- /// its chat, cards and Tasks pane draw it (audit finding 6 of task #4211).- final SuperTabAgent? agent;-/// The project's name, shown when the Swarm has several.final String? project;final bool selected, unread;@@ -130,15 +389,11 @@ class SuperTabBuddyRow extends StatelessWidget {/// What hovering says: "Your Buddy · openharness".final String tooltip;- /// A quiet word after the name, such as a Buddy's "offline" or the project- /// a PM leads.+ /// A quiet word after the name, such as a Buddy's "offline".final String? note;- /// A PM: the Lead ring around its avatar (anh Dee 11-07, task #4461).- final bool lead;-/// A line under the name, such as where a Buddy runs, with [status], its- /// activity mark, before it. Without one the mark sits at the row's right.+ /// activity mark, before it; [status] shows only with it.final String? detail;final Widget? status;@@ -175,22 +430,13 @@ class SuperTabBuddyRow extends StatelessWidget {SizedBox(width: _column,child: Center(- child: switch (agent) {- final agent? => SuperTabAvatar.agent(- agent,- name: name,- size: 20,- engineBadge: false,- lead: lead,- ),- null => SuperTabAvatar(- identity: agentId == null- ? 'buddy:$name'- : 'agent:$agentId',- name: name,- size: 20,- ),- },+ child: SuperTabAvatar(+ identity: agentId == null+ ? 'buddy:$name'+ : 'agent:$agentId',+ name: name,+ size: 20,+ ),),),Expanded(@@ -303,17 +549,7 @@ class SuperTabBuddyRow extends StatelessWidget {),// Unread is drawn as a bold name and heard in words.Semantics(label: unread ? 'Unread messages' : null),- // With no second line the activity mark is at the right, where two empty columns cut names- // early (audit finding 9 of #4436).- if (detail == null && status != null)- Padding(- padding: const EdgeInsets.symmetric(- horizontal: grid.AppDesktop.controlGap,- ),- child: status,- )- else- const SizedBox(width: 12),+ const SizedBox(width: 12),],),),diff --git a/desktop/lib/super_tabs/controller.dart b/desktop/lib/super_tabs/controller.dartindex 7e1402f6c..0e25f9b96 100644--- a/desktop/lib/super_tabs/controller.dart+++ b/desktop/lib/super_tabs/controller.dart@@ -18,7 +18,6 @@ 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';@@ -250,7 +249,6 @@ 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?;agentsGroupOpen = initial['agentsGroupOpen'] as bool? ?? true;modelsGroupOpen = initial['modelsGroupOpen'] as bool? ?? true;offlineMachinesOpen = initial['offlineMachinesOpen'] as bool? ?? false;@@ -1136,15 +1134,8 @@ 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;-- /// Whether the left pane's My agents is open (task #4192): it folds like Projects, open until the reader closes it.+ /// Whether the left pane's My agents is open (task #4192): open until the reader closes it.bool agentsGroupOpen = true;- bool get projectsOpen =>- projectsGroupOpen ??- (snapshot == null || superTabMyAgents(snapshot!, accountId).isEmpty);bool isMachineExpanded(String id) => expandedMachines.contains(id);@@ -1216,12 +1207,6 @@ class SuperTabController extends ChangeNotifier {_changed();}- void toggleProjectsGroup() {- projectsGroupOpen = !projectsOpen;- _saveSoon();- _changed();- }-void toggleAgentsGroup() {agentsGroupOpen = !agentsGroupOpen;_saveSoon();@@ -2870,7 +2855,6 @@ class SuperTabController extends ChangeNotifier {'unreadOnly': unreadOnly,'machinesGroupOpen': machinesGroupOpen,'buddiesGroupOpen': buddiesGroupOpen,- if (projectsGroupOpen != null) 'projectsGroupOpen': projectsGroupOpen,'agentsGroupOpen': agentsGroupOpen,'modelsGroupOpen': modelsGroupOpen,'offlineMachinesOpen': offlineMachinesOpen,diff --git a/desktop/lib/super_tabs/places.dart b/desktop/lib/super_tabs/places.dartindex 2d0a0d7a0..94e3c00ac 100644--- a/desktop/lib/super_tabs/places.dart+++ b/desktop/lib/super_tabs/places.dart@@ -3,8 +3,8 @@ import 'package:flutter/foundation.dart';import 'controller.dart';/// The Swarm's sidebar pages: answers, the weekly Desktop leaderboard,-/// tags and followed threads.-enum SwarmPage { decisions, leaderboard, mentions, threads }+/// tags, followed threads, and the Desktop's grid of projects (task #4466).+enum SwarmPage { decisions, leaderboard, mentions, threads, projects }/// A place the reader was in a Swarm: one of its pages, or a chat with the/// thread open beside it ([root]) or none.diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dartindex 6da75dfbb..278104413 100644--- a/desktop/lib/super_tabs/project_sidebar.dart+++ b/desktop/lib/super_tabs/project_sidebar.dart@@ -20,7 +20,10 @@ import 'model.dart';import 'my_agents.dart';import 'personal_projects.dart' show PersonalProjects;import 'places.dart';+import 'buddy_chat.dart' show countText;import 'buddy_rows.dart';+import 'identity.dart';+import 'leaderboard/reader.dart';import 'section_heading.dart';import 'swarm_switcher.dart';import 'project_github.dart';@@ -67,9 +70,17 @@ class ProjectSidebar extends StatelessWidget {this.onOpenAgentChat,this.boardProjectId,this.onOpenAgentTerminal,+ this.leaderboard,});final SuperTabController controller;+ /// The board Humans lists on the Desktop (task #4466): the view's, which the right pane reads too. Without it, or+ /// before it is read, Humans is its heading alone.+ final SuperTabLeaderboardReader? leaderboard;++ /// How many people Humans lists, most points first; the heading opens the whole board.+ static const humansShown = 8;+/// A phone's layout: its rows keep the app's sizes, not Slack desktop's ([SwarmType]).final bool compact;@@ -128,13 +139,6 @@ class ProjectSidebar extends StatelessWidget {/// the main pane.bool get _paneCovered => manageSelected || devicesSelected || page != null;- /// Whether an open My agents lists an agent whose chat is [chat], so that agent's row is the lit one.- bool _litInMyAgents(SuperTabConversation chat, _SidebarReading? reading) =>- board &&- controller.agentsGroupOpen &&- reading != null &&- reading.myAgents.any((row) => row.$2?.id == chat.id);-/// A project's Board holds the Desktop's middle: no chat's row is lit.bool get _boardOpen => board && boardProjectId != null;@@ -149,9 +153,6 @@ class ProjectSidebar extends StatelessWidget {/// controller's [SuperTabController.openBuddyChat] when not given.final ValueChanged<String>? onOpenBuddyChat;- /// Forwarded to the embedded [SuperTabMachines]; a test gives it to pin- /// the clock its readings' ages are counted against.- @visibleForTesting/// Projects and workgroups share a text column. Only projects use its icon.static const _iconColumn = SuperTabSectionHeading.actionWidth;static const _rowEnd = 10.0;@@ -311,11 +312,7 @@ class ProjectSidebar extends StatelessWidget {String? key,}) {final project = reading?.project;- // On the Desktop the lit project is the one whose Board is in the middle (task #4220), and never the one whose chat- // a My agents row has lit: a PM's chat is its project's (#4441).- final selected = _boardOpen- ? !_paneCovered && project?.id == boardProjectId- : _chatLit(group) && !_litInMyAgents(group, reading?.sidebar);+ final selected = _chatLit(group);// A project's row is bold for its own chat (Huy, 11-04, task #2638): a// person's message or a tag of the reader there, never agents' progress// alone (#2427). A task's unread is on its card and in Activity.@@ -362,11 +359,9 @@ class ProjectSidebar extends StatelessWidget {}) {// A project shows as selected while one of its tasks is open; the// reader's Buddy chat has a row of its own.- // The Desktop lights one row, the middle's: never a project for a chat of its in the middle (task #4220).final highlighted =selected ||- (!board &&- project != null &&+ (project != null &&!_paneCovered &&selectedProjectId == project.id &&controller.selectedId != buddyChat?.id);@@ -554,11 +549,193 @@ class ProjectSidebar extends StatelessWidget {for (final project in projects)if (reading.of(project) case final readwhen (read.buddyChat != null || controller.canWrite) &&- (!controller.unreadOnly ||+ // The Desktop has no unread filter to turn off: one saved on hides nothing there.+ (board ||+ !controller.unreadOnly ||(read.buddyChat != null && _keptByFilter(read.buddyChat!))))read,];- return [for (final read in listed) _buddy(read, named: listed.length > 1)];+ return [+ for (final read in listed)+ board+ ? _quietBuddy(read, named: listed.length > 1)+ : _buddy(read, named: listed.length > 1),+ ];+ }++ /// A project's Buddy in the Desktop's My agents, from a server before one Buddy per Swarm: the project its one detail+ /// when there are several, or why it is not running.+ Widget _quietBuddy(_ProjectReading reading, {required bool named}) {+ final project = reading.project;+ final chat = reading.buddyChat;+ final agent = controller.buddy(project.id);+ final name = agent == null+ ? chat?.buddyName ?? 'Buddy'+ : controller.snapshot!.agentName(agent.id, fallback: agent.name);+ return SuperTabQuietRow(+ key: ValueKey('super-buddy-${project.id}'),+ leading: _face(agent, name),+ name: name,+ tooltip: 'Your Buddy · ${project.name}',+ mark: _quietMark(agent),+ markColumn: true,+ detail:+ _detail(agent) ??+ switch ((agent, controller.buddyStart(project.id))) {+ (null, {'harnessId': null, 'error': null}) => 'starting',+ (null, _) => 'not started',+ _ => named ? project.name : null,+ },+ selected: _chatLit(chat),+ unread: chat != null && controller.unreadShown(chat),+ onTap: chat != null+ ? () => onSelect(chat.id)+ : controller.saving || controller.hasPendingAction+ ? null+ : () => _openBuddyChat(project.id),+ );+ }++ /// An agent's 20 face in a quiet row; a Buddy not running yet has its name's.+ Widget _face(SuperTabAgent? agent, String name, {bool lead = false}) =>+ agent == null+ ? SuperTabAvatar(+ identity: 'buddy:$name',+ name: name,+ size: SuperTabQuietRow.faceSize,+ )+ : SuperTabAvatar.agent(+ agent,+ name: name,+ size: SuperTabQuietRow.faceSize,+ engineBadge: false,+ lead: lead,+ );++ /// What [agent] is doing, as the Agents list reads it; null with no app to ask, or none running.+ HarnessActivity? _activity(SuperTabAgent? agent) => agent == null+ ? null+ : agent.downSince != null+ ? HarnessActivity.offline+ : switch (app) {+ final app? => harnessActivity(app, agent.machineId, agent.harnessId),+ null => null,+ };++ /// An agent's one quiet detail in My agents ([superTabAgentDetail]).+ String? _detail(SuperTabAgent? agent, {String? leads}) =>+ superTabAgentDetail(_activity(agent), leads: leads);++ /// An agent's mark in My agents ([superTabAgentMark]).+ Widget? _quietMark(SuperTabAgent? agent) =>+ switch (superTabAgentMark(_activity(agent))) {+ final activity? => SuperTabAgentMark(activity),+ null => null,+ };++ Widget _iconRow({+ required String key,+ required IconData icon,+ required String name,+ required VoidCallback? onTap,+ String? detail,+ bool selected = false,+ bool unread = false,+ }) => SuperTabQuietRow(+ key: ValueKey(key),+ leading: Icon(+ icon,+ size: AppIcons.inlineSize,+ color: grid.SidebarInk.inkMuted,+ ),+ name: name,+ detail: detail,+ selected: selected,+ unread: unread,+ onTap: onTap,+ );++ /// The Desktop's left pane, top to bottom (task #4466, anh Dee 11-07): the org name, Decisions with its count,+ /// Projects (one link to the grid in the middle), My agents, then Humans; Manage stays at the foot.+ List<Widget> _desktop(+ SuperTabSnapshot? snapshot,+ _SidebarReading reading, {+ required Widget? switcher,+ required int decisions,+ }) {+ // The projects with something new in their chat, a tag of you or a person's new lines: with no project rows and no+ // Mentions row, they show here (tasks #4220, #4445).+ final waiting = [+ for (final read in _listed(snapshot, reading))+ if ((read.unread.contains(read.lead!.id) &&+ controller.notifyOf(read.lead!.id) != SuperTabNotify.muted) ||+ (attention?.chatTagsIn(read.lead!.id) ?? 0) > 0)+ read,+ ].length;+ return [+ ?switcher,+ if (onPage case final onPage?) ...[+ _iconRow(+ key: 'super-decisions',+ icon: AppIcons.inbox,+ name: 'Decisions',+ detail: decisions > 0 ? countText(decisions) : null,+ unread: decisions > 0,+ selected: page == SwarmPage.decisions,+ onTap: () => onPage(SwarmPage.decisions),+ ),+ _iconRow(+ key: 'super-projects',+ icon: AppIcons.layoutGrid,+ name: 'Projects',+ detail: waiting > 0 ? countText(waiting) : null,+ unread: waiting > 0,+ // A project's Board is one of the grid's: it lights Projects.+ selected: page == SwarmPage.projects || (!_paneCovered && _boardOpen),+ onTap: () => onPage(SwarmPage.projects),+ ),+ ],+ const SizedBox(height: grid.AppDesktop.groupGap),+ ..._myAgents(snapshot, reading),+ ..._humans(snapshot),+ ];+ }++ /// Humans (task #4466): the Leaderboard in short, its people most points first with their points on the right. The+ /// heading and every person open the whole board.+ List<Widget> _humans(SuperTabSnapshot? snapshot) {+ final onPage = this.onPage;+ if (snapshot == null || onPage == null) return const [];+ void open() => onPage(SwarmPage.leaderboard);+ final people = {for (final person in snapshot.people) person.id: person};+ return [+ SuperTabQuietHeading(+ 'Humans',+ key: const ValueKey('project-sidebar-humans'),+ onTap: open,+ ),+ for (final score in [...?leaderboard?.board?.people].take(humansShown))+ if (people[score.personId] case final person)+ SuperTabQuietRow(+ key: ValueKey('super-human-${score.personId}'),+ leading: person == null+ ? SuperTabAvatar(+ identity: 'person:${score.personId}',+ name: score.displayName ?? '',+ size: SuperTabQuietRow.faceSize,+ )+ : SuperTabAvatar.person(+ person,+ size: SuperTabQuietRow.faceSize,+ ),+ name: person?.shownName ?? score.displayName ?? 'Someone',+ detail: '${score.points}',+ selected:+ page == SwarmPage.leaderboard &&+ score.personId == controller.accountId,+ onTap: open,+ ),+ ];}Widget _buddy(_ProjectReading reading, {required bool named}) {@@ -626,17 +803,17 @@ class ProjectSidebar extends StatelessWidget {final muted =chat != null && controller.notifyOf(chat.id) == SuperTabNotify.muted;// Its own name and face, as the header draws it (audit finding 8 of #4436).- return SuperTabBuddyRow(+ final name = agent == null+ ? chat?.buddyName ?? 'Buddy'+ : controller.snapshot!.agentName(agent.id, fallback: agent.name);+ return SuperTabQuietRow(key: const ValueKey('super-swarm-buddy'),- agentId: agent?.id,- agent: agent,- name: agent == null- ? chat?.buddyName ?? 'Buddy'- : controller.snapshot!.agentName(agent.id, fallback: agent.name),+ leading: _face(agent, name),+ name: name,tooltip: 'Your Buddy',- compact: compact,- note: agent?.downSince != null ? 'offline' : null,- status: agent == null ? null : _buddyMark(agent),+ detail: _detail(agent),+ mark: _quietMark(agent),+ markColumn: true,selected: _chatLit(chat),unread: chat != null && !muted && controller.unreadShown(chat),onTap: switch (chat) {@@ -659,23 +836,18 @@ class ProjectSidebar extends StatelessWidget {);}- /// My agents (Swarm v3, task #4118): the person's Buddy first, then the agents they brought, each with its face and name,- /// a PM's in its Lead ring and followed by the project it leads (tasks #4421, #4461), the name bold while its chat has unread, and + New agent in the heading.- List<Widget> _myAgents(- BuildContext context,- SuperTabSnapshot? snapshot,- _SidebarReading reading,- ) {+ /// My agents (Swarm v3, task #4118): the person's Buddy first, then the agents they brought, each with its face and+ /// name, a Lead's naming the project it leads (task #4421), the name bold while its chat has unread, and + New agent+ /// as the last row.+ List<Widget> _myAgents(SuperTabSnapshot? snapshot, _SidebarReading reading) {if (snapshot == null) return const [];return [- SuperTabSectionHeading(- key: const ValueKey('project-sidebar-agents'),+ SuperTabQuietHeading('My agents',- titleStyle: _headingStyle,- endInset: 0,- // It folds as Projects does, remembered (task #4192).+ key: const ValueKey('project-sidebar-agents'),+ // It folds, remembered (task #4192); its chevron shows on hover.collapsed: !controller.agentsGroupOpen,- onToggleCollapsed: controller.toggleAgentsGroup,+ onTap: controller.toggleAgentsGroup,),if (controller.agentsGroupOpen) ...[if (controller.oneBuddy)@@ -686,14 +858,14 @@ class ProjectSidebar extends StatelessWidget {_agentRow(snapshot, agent, chat),// The last row opens the creation dialog, where Regular or PM is chosen.if (controller.canWrite && onNewAgent != null)- _navigationRow(+ _iconRow(key: 'super-new-agent-row',- label: 'New agent',icon: AppIcons.plus,+ name: 'New agent',onTap: onNewAgent,),],- const SizedBox(height: 16),+ const SizedBox(height: grid.AppDesktop.groupGap),];}@@ -704,26 +876,20 @@ class ProjectSidebar extends StatelessWidget {) {final name = snapshot.agentName(agent.id, fallback: agent.name);final pm = superTabAgentIsPm(snapshot, agent);- return SuperTabBuddyRow(+ return SuperTabQuietRow(key: ValueKey('super-agent-${agent.id}'),- agentId: agent.id,- agent: agent,+ leading: _face(agent, name, lead: pm),name: name,- tooltip: chat != null- ? name- : onOpenAgentTerminal != null- ? '$name · opens its terminal'- : '$name · no chat yet',- lead: pm,- compact: compact,- // A PM's project after a separator, so it never reads as part of the name.- note: agent.downSince != null- ? 'offline'- : switch (pm ? snapshot.leadProjectForAgent(agent.id) : null) {- final project? => '· ${project.name}',- null => null,- },- status: _buddyMark(agent),+ // Only what the row does not say itself.+ tooltip: chat == null && onOpenAgentTerminal != null+ ? 'Opens its terminal'+ : null,+ detail: _detail(+ agent,+ leads: pm ? snapshot.leadProjectForAgent(agent.id)?.name : null,+ ),+ mark: _quietMark(agent),+ markColumn: true,selected: _chatLit(chat),unread: chat != null && controller.unreadShown(chat),onTap: switch ((chat, onOpenAgentTerminal)) {@@ -810,13 +976,11 @@ class ProjectSidebar extends StatelessWidget {/// swipes projects in this order (cli superTabs/cards.ts `leadsOf`); a/// Personal project whose panes are all closed leaves this list but stays/// on the dial (task #3042: the brief is the project list).- /// [taggedOnly]: only the projects whose chat tags the reader, as folded Projects lists them.List<(String, Widget)> _channels(SuperTabSnapshot? snapshot,- _SidebarReading reading, {- bool taggedOnly = false,- }) => [- for (final read in _listed(snapshot, reading, taggedOnly: taggedOnly))+ _SidebarReading reading,+ ) => [+ for (final read in _listed(snapshot, reading))(read.project.name,Column(@@ -827,40 +991,27 @@ class ProjectSidebar extends StatelessWidget {),];- /// The projects Projects lists, each with a chat, in its order; [taggedOnly] as [_channels].+ /// The projects Projects lists, each with a chat, in its order.Iterable<_ProjectReading> _listed(SuperTabSnapshot? snapshot,- _SidebarReading reading, {- bool taggedOnly = false,- }) {+ _SidebarReading reading,+ ) {final hidden = superTabHiddenProjects(controller, app: app);return [for (final project in ([...?snapshot?.projects]..sort(_compareProjects)))if (reading.of(project) case final readwhen read.lead != null &&- (!taggedOnly ||- (attention?.chatTagsIn(read.lead!.id) ?? 0) > 0) &&(!controller.unreadOnly || _hasUnread(read)) &&!_paneless(project, read.lead!, hidden))read,];}- /// The listed projects whose rows would be bold or carry a red number- /// ([_drawRow]): what a folded Projects counts.- int _waitingProjects(SuperTabSnapshot? snapshot, _SidebarReading reading) =>- _listed(snapshot, reading).where((read) {- final chat = read.lead!.id;- final muted = controller.notifyOf(chat) == SuperTabNotify.muted;- return (read.unread.contains(chat) && !muted) ||- (attention?.chatTagsIn(chat) ?? 0) > 0;- }).length;-// The sidebar's ink scope (#3006): a theme's own sidebar ink reaches the// shared rows drawn in it.@overrideWidget build(BuildContext context) => grid.SidebarInk.scope(- child: switch ([?attention, ?activity, ?places]) {+ child: switch ([?attention, ?activity, ?places, ?leaderboard]) {final List<Listenable> sources when sources.isNotEmpty =>ListenableBuilder(listenable: Listenable.merge(sources),@@ -894,13 +1045,20 @@ class ProjectSidebar extends StatelessWidget {excludeFromSemantics: true,positionDelegate: _besideTheRow,constraints: const BoxConstraints(maxWidth: 260),- child: _navigationRow(- key: 'super-swarm-switcher',- label: label,- icon: icon,- onTap: onTap,- trailing: trailing,- ),+ child: board+ // Plain text, its chevron only on hover (task #4466).+ ? SuperTabQuietHeading.org(+ label,+ key: const ValueKey('super-swarm-switcher'),+ onTap: onTap,+ )+ : _navigationRow(+ key: 'super-swarm-switcher',+ label: label,+ icon: icon,+ onTap: onTap,+ trailing: trailing,+ ),),),_ => null,@@ -916,130 +1074,103 @@ class ProjectSidebar extends StatelessWidget {Expanded(child: LaidOutListView(padding: const EdgeInsets.all(8),- children: [- // The Desktop's org switcher is the first thing in the pane (Swarm v3 spec), with no arrows under it- // (task #4192); elsewhere it follows the back and forward arrows.- if (board)- ?switcher- else ...[- if (places case final places?) _arrows(places),- ?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- // them by a control gap.- if (onPage case final onPage?) ...[- if (app != null && onNewSwarm != null)- const SizedBox(height: DesktopChrome.controlGap),- _pageRow(- onPage,- target: SwarmPage.decisions,- key: 'super-decisions',- label: 'Decisions',- icon: AppIcons.flag,- waiting: decisions,- ),- if (board)- _pageRow(- onPage,- target: SwarmPage.leaderboard,- key: 'super-leaderboard',- label: 'Leaderboard',- icon: AppIcons.trophy,- waiting: 0,- ),- // 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,- target: SwarmPage.threads,- key: 'super-threads',- label: 'Threads',- icon: AppIcons.messagesSquare,- waiting: threads,- ),- ],- const SizedBox(height: 20),- if (board) ..._myAgents(context, snapshot, reading),- SuperTabSectionHeading(- key: const ValueKey('project-sidebar-projects'),- 'Projects',- titleStyle: _headingStyle,- // Slack's unread filter: only chats with something unread.- actions: [- AppIconButton(- key: const ValueKey('super-unread-only'),- icon: AppIcons.listFilter,- selected: controller.unreadOnly,- tooltip: controller.unreadOnly- ? 'Show all chats'- : 'Show unread chats only',- onPressed: controller.toggleUnreadOnly,- ),- ],- 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,- waiting: board && !controller.projectsOpen- ? _waitingProjects(snapshot, reading)- : 0,- onToggleCollapsed: board- ? controller.toggleProjectsGroup- : null,- ),- // The reader's one Buddy, the first item under Projects (anh- // Dee, 11-05).- if (controller.oneBuddy && !board) ?_swarmBuddyRow(),- // Folded, it keeps the projects whose chat tags the reader: the Desktop has no Mentions row (task #4220).- if (snapshot != null &&- projects.isEmpty &&- (!board || controller.projectsOpen))- _noProjects()- else- for (final (_, channel) in _channels(- snapshot,- reading,- taggedOnly: board && !controller.projectsOpen,- ))- 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.- if (!controller.oneBuddy && !board) ...[- SuperTabSectionHeading(- 'Buddies',- titleStyle: _headingStyle,- onAdd:- controller.canWrite &&- !controller.saving &&- !controller.hasPendingAction &&- buddyProjects(controller).isNotEmpty- ? () => unawaited(- showAddBuddy(context, controller, app: app),- )- : null,- addTooltip: 'Add a Buddy',- endInset: 0,- collapsed: !controller.buddiesGroupOpen,- onToggleCollapsed: controller.toggleBuddiesGroup,- ),- if (controller.buddiesGroupOpen)- ..._buddies(projects, reading),- const SizedBox(height: 16),- ],- ],+ children: board+ ? _desktop(+ snapshot,+ reading,+ switcher: switcher,+ decisions: decisions,+ )+ : [+ if (places case final places?) _arrows(places),+ ?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+ // them by a control gap.+ if (onPage case final onPage?) ...[+ if (app != null && onNewSwarm != null)+ const SizedBox(height: DesktopChrome.controlGap),+ _pageRow(+ onPage,+ target: SwarmPage.decisions,+ key: 'super-decisions',+ label: 'Decisions',+ icon: AppIcons.flag,+ waiting: decisions,+ ),+ _pageRow(+ onPage,+ target: SwarmPage.mentions,+ key: 'super-mentions',+ label: 'Mentions',+ icon: AppIcons.atSign,+ waiting: mentions,+ ),+ _pageRow(+ onPage,+ target: SwarmPage.threads,+ key: 'super-threads',+ label: 'Threads',+ icon: AppIcons.messagesSquare,+ waiting: threads,+ ),+ ],+ const SizedBox(height: 20),+ SuperTabSectionHeading(+ key: const ValueKey('project-sidebar-projects'),+ 'Projects',+ titleStyle: _headingStyle,+ // Slack's unread filter: only chats with something unread.+ actions: [+ AppIconButton(+ key: const ValueKey('super-unread-only'),+ icon: AppIcons.listFilter,+ selected: controller.unreadOnly,+ tooltip: controller.unreadOnly+ ? 'Show all chats'+ : 'Show unread chats only',+ onPressed: controller.toggleUnreadOnly,+ ),+ ],+ onAdd: controller.canWrite ? onNewProject : null,+ addTooltip: 'New project',+ endInset: 0,+ ),+ // The reader's one Buddy, the first item under Projects (anh+ // Dee, 11-05).+ if (controller.oneBuddy) ?_swarmBuddyRow(),+ if (snapshot != null && projects.isEmpty)+ _noProjects()+ else+ 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.+ if (!controller.oneBuddy) ...[+ SuperTabSectionHeading(+ 'Buddies',+ titleStyle: _headingStyle,+ onAdd:+ controller.canWrite &&+ !controller.saving &&+ !controller.hasPendingAction &&+ buddyProjects(controller).isNotEmpty+ ? () => unawaited(+ showAddBuddy(context, controller, app: app),+ )+ : null,+ addTooltip: 'Add a Buddy',+ endInset: 0,+ collapsed: !controller.buddiesGroupOpen,+ onToggleCollapsed: controller.toggleBuddiesGroup,+ ),+ if (controller.buddiesGroupOpen)+ ..._buddies(projects, reading),+ const SizedBox(height: 16),+ ],+ ],),),// At the foot, however long the list (Quiet Swarm, screen 1).@@ -1053,13 +1184,21 @@ class ProjectSidebar extends StatelessWidget {grid.AppDesktop.controlGap,(compact ? grid.AppDesktop.controlGap : footGap) - 2,),- child: _navigationRow(- key: 'super-manage',- label: 'Manage',- icon: AppIcons.settings,- onTap: onManage,- selected: manageSelected,- ),+ child: board+ ? _iconRow(+ key: 'super-manage',+ icon: AppIcons.settings,+ name: 'Manage',+ onTap: onManage,+ selected: manageSelected,+ )+ : _navigationRow(+ key: 'super-manage',+ label: 'Manage',+ icon: AppIcons.settings,+ onTap: onManage,+ selected: manageSelected,+ ),),],),@@ -1231,3 +1370,17 @@ Set<String> superTabHiddenProjects(SuperTabController controller, {AppNotifier? app,}) => app == null ? const {} : PersonalProjects.of(app).hiddenIn(controller);++/// An agent's one quiet detail in the Desktop's My agents (task #4466): "offline", else the project a Lead [leads].+String? superTabAgentDetail(HarnessActivity? activity, {String? leads}) =>+ activity == HarnessActivity.offline ? 'offline' : leads;++/// The status a My agents row marks (anh Dee 11-07): only while its agent works, needs the person or failed. Idle,+/// finished and the rest show nothing; a finished agent's unread reply is its name in semibold.+HarnessActivity? superTabAgentMark(HarnessActivity? activity) =>+ switch (activity) {+ HarnessActivity.working ||+ HarnessActivity.needsInput ||+ HarnessActivity.failed => activity,+ _ => null,+ };diff --git a/desktop/lib/super_tabs/projects_page.dart b/desktop/lib/super_tabs/projects_page.dartnew file mode 100644index 000000000..19ca91e01--- /dev/null+++ b/desktop/lib/super_tabs/projects_page.dart@@ -0,0 +1,176 @@+import 'dart:math' as math;++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 '../widgets/laid_out_list.dart';+import 'controller.dart';+import 'model.dart';+import 'project_github.dart';++/// The Desktop's Projects in the middle (task #4466, anh Dee 11-07): every project as a card, like repositories under+/// a GitHub org, most recent first. A card opens its project's Board; New project is the page's one blue button.+class SuperTabProjectsPage extends StatelessWidget {+ const SuperTabProjectsPage({+ super.key,+ required this.controller,+ required this.onOpen,+ this.onNewProject,+ });++ final SuperTabController controller;+ final ValueChanged<SuperTabProject> onOpen;++ /// Opens the New project form; without it the page offers none.+ final VoidCallback? onNewProject;++ /// A card's least width: two across at 880, more as the window grows.+ static const _cardWidth = 260.0;+ static const _gap = grid.AppDesktop.composerRowGap;++ @override+ Widget build(BuildContext context) => ListenableBuilder(+ listenable: controller,+ builder: (context, _) {+ grid.AppTheme.watch(context);+ final projects = superTabProjectsByRecent(controller);+ return LaidOutListView(+ padding: const EdgeInsets.all(grid.AppDesktop.panelPadding),+ children: [+ if (onNewProject case final onNewProject?)+ Align(+ alignment: Alignment.centerRight,+ child: FilledButton.icon(+ onPressed: onNewProject,+ icon: const Icon(AppIcons.plus, size: AppIcons.inlineSize),+ label: const Text('New project'),+ ),+ ),+ const SizedBox(height: grid.AppDesktop.groupGap),+ // Empty means empty: New project above is what fills it (anh Dee 11-07).+ if (projects.isNotEmpty)+ LayoutBuilder(+ builder: (context, box) {+ final across = math.max(+ 1,+ ((box.maxWidth + _gap) / (_cardWidth + _gap)).floor(),+ );+ final width = (box.maxWidth - _gap * (across - 1)) / across;+ return Wrap(+ spacing: _gap,+ runSpacing: _gap,+ children: [+ for (final project in projects)+ SizedBox(+ width: width,+ child: _ProjectCard(+ controller: controller,+ project: project,+ onTap: () => onOpen(project),+ ),+ ),+ ],+ );+ },+ ),+ ],+ );+ },+ );+}++/// The Swarm's projects, the one with the latest message in its chat or its tasks first, then by name.+List<SuperTabProject> superTabProjectsByRecent(SuperTabController controller) {+ final projects = [...?controller.snapshot?.projects];+ int latest(SuperTabProject project) => controller+ .projectConversations(project.id)+ .fold(0, (at, g) => math.max(at, g.lastMessageSequence));+ final at = {for (final project in projects) project.id: latest(project)};+ return projects..sort(+ (a, b) => switch (at[b.id]!.compareTo(at[a.id]!)) {+ 0 => a.name.toLowerCase().compareTo(b.name.toLowerCase()),+ final order => order,+ },+ );+}++/// `owner/name` of a GitHub address, as GitHub lists a repository; null for none.+String? _repositoryName(SuperTabProject project) {+ final url = project.repository?['repositoryUrl'];+ if (url is! String) return null;+ final path = (Uri.tryParse(url)?.pathSegments ?? const <String>[])+ .where((part) => part.isNotEmpty)+ .toList();+ if (path.length < 2) return null;+ final name = path.last.endsWith('.git')+ ? path.last.substring(0, path.last.length - 4)+ : path.last;+ return '${path[path.length - 2]}/$name';+}++/// One project: its name (13 semibold primary) and one quiet line, its repository or Private, on a hairline card.+class _ProjectCard extends StatelessWidget {+ const _ProjectCard({+ required this.controller,+ required this.project,+ required this.onTap,+ });++ final SuperTabController controller;+ final SuperTabProject project;+ final VoidCallback onTap;++ @override+ Widget build(BuildContext context) {+ final detail =+ _repositoryName(project) ?? (project.isPrivate ? 'Private' : null);+ final shape = RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ side: BorderSide(color: DesktopChrome.rim),+ );+ return Material(+ key: ValueKey('super-group-${project.leadConversationId}'),+ color: Colors.transparent,+ shape: shape,+ clipBehavior: Clip.antiAlias,+ child: Semantics(+ button: true,+ label: [project.name, ?detail].join(', '),+ child: InkWell(+ onTap: onTap,+ hoverColor: grid.AppSurface.hoverFill,+ child: Padding(+ padding: const EdgeInsets.all(grid.AppDesktop.composerRowGap),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ mainAxisSize: MainAxisSize.min,+ children: [+ Text(+ project.name,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: DesktopChrome.control(+ color: grid.AppPalette.textPrimary,+ ).copyWith(fontWeight: grid.AppFont.semibold),+ ),+ if (detail != null)+ Text(+ detail,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: DesktopChrome.metadata(+ color: grid.AppPalette.textFaint,+ ),+ ),+ // Teammates' agents cannot push to its repository yet: the one thing here to act on.+ ProjectGitHubLine(controller: controller, project: project),+ ],+ ),+ ),+ ),+ ),+ );+ }+}diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex 46545158a..51415563a 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -98,6 +98,7 @@ import 'thread_panel.dart';import 'work_details.dart';import 'manage_page.dart';import 'project_sidebar.dart';+import 'projects_page.dart';import 'buddy_sessions.dart';import 'swarm_switcher.dart' show fallBackToPersonal;import 'project_options.dart';@@ -2124,6 +2125,7 @@ class _SuperTabViewState extends State<SuperTabView>/// [boardProjectId]: the project whose Board holds the middle, whose row is then lit.Widget _sidebar({String? boardProjectId}) => ProjectSidebar(board: widget.board,+ leaderboard: _board,boardProjectId: boardProjectId,controller: c,compact: _phone,@@ -3070,6 +3072,7 @@ class _SuperTabViewState extends State<SuperTabView>SwarmPage.leaderboard => 'Leaderboard',SwarmPage.mentions => 'Mentions',SwarmPage.threads => 'Threads',+ SwarmPage.projects => 'Projects',}: group == null? c.snapshot?.projects.isEmpty == true@@ -6622,6 +6625,13 @@ class _SuperTabViewState extends State<SuperTabView>inThread: true,),),+ SwarmPage.projects => SuperTabProjectsPage(+ controller: c,+ onOpen: _openBoard,+ onNewProject: c.canWrite+ ? widget.onNewProject+ : null,+ ),null => const SizedBox.shrink(),},_manageVisiblediff --git a/desktop/test/benchmarks/swarm_left_pane_benchmark.dart b/desktop/test/benchmarks/swarm_left_pane_benchmark.dartnew file mode 100644index 000000000..706122a34--- /dev/null+++ b/desktop/test/benchmarks/swarm_left_pane_benchmark.dart@@ -0,0 +1,103 @@+// Run explicitly: flutter test test/benchmarks/swarm_left_pane_benchmark.dart --reporter expanded+// Headless CPU measurements of the Desktop's Swarm left pane (task #4466), not display latency claims. It uses only+// what main's pane had before the redraw, so the same file runs on both sides.+import 'dart:convert';++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/project_sidebar.dart';++import '../super_tab_activity_lists_test.dart' show load, swarm;+import '../swarm_state_test.dart' show createApp;++Map<String, num> _distribution(List<int> microseconds) {+ microseconds.sort();+ return {+ 'samples': microseconds.length,+ 'medianMs': microseconds[microseconds.length ~/ 2] / 1000,+ 'p95Ms': microseconds[(microseconds.length * .95).ceil() - 1] / 1000,+ };+}++void main() {+ testWidgets('the Desktop left pane with 40 agents: rebuild and relayout', (+ tester,+ ) async {+ final server = swarm()+ ..state['swarmBuddy'] = true+ ..state['agents'] = [+ for (var i = 0; i < 40; i++)+ {+ 'id': 'agent-$i',+ 'projectId': 'lead',+ 'name': 'Agent number $i',+ 'displayName': 'Agent number $i',+ 'machineId': 'host',+ 'harnessId': 'session-$i',+ 'contributorId': 'owner',+ 'configuration': {'engine': 'codex'},+ 'kind': i < 8 ? 'pm' : 'regular',+ 'myAgent': true,+ },+ ];+ final activity = (await tester.runAsync(() => load(server)))!;+ final c = activity.controller;+ final app = createApp();+ addTearDown(app.dispose);+ await tester.binding.setSurfaceSize(const Size(300, 2400));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ var width = 300.0;+ late StateSetter resize;+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: Brightness.light),+ home: Scaffold(+ body: StatefulBuilder(+ builder: (context, setState) {+ resize = setState;+ return Align(+ alignment: Alignment.topLeft,+ child: SizedBox(+ width: width,+ child: ProjectSidebar(+ controller: c,+ app: app,+ onSelect: (_) {},+ onNewAgent: () {},+ onNewSwarm: () {},+ onPage: (_) {},+ activity: activity,+ attention: activity.attention,+ onManage: () {},+ board: true,+ ),+ ),+ );+ },+ ),+ ),+ ),+ );+ await tester.pump();+ final rebuild = <int>[], relayout = <int>[];+ for (var i = 0; i < 120; i++) {+ final watch = Stopwatch()..start();+ tester.element(find.byType(ProjectSidebar)).markNeedsBuild();+ await tester.pump();+ if (i >= 20) rebuild.add(watch.elapsedMicroseconds);+ watch+ ..reset()+ ..start();+ resize(() => width = i.isEven ? 280 : 300);+ await tester.pump();+ if (i >= 20) relayout.add(watch.elapsedMicroseconds);+ }+ // ignore: avoid_print+ print(+ 'SWARM_LEFT_PANE ${jsonEncode({'rebuild': _distribution(rebuild), 'relayout': _distribution(relayout)})}',+ );+ await tester.pumpWidget(const SizedBox());+ await tester.runAsync(c.flush);+ });+}diff --git a/desktop/test/goldens/swarm-elements-dark.png b/desktop/test/goldens/swarm-elements-dark.pngindex 5778f6923..b92ea1f00 100644Binary files a/desktop/test/goldens/swarm-elements-dark.png and b/desktop/test/goldens/swarm-elements-dark.png differdiff --git a/desktop/test/goldens/swarm-elements-light.png b/desktop/test/goldens/swarm-elements-light.pngindex a815ab3f6..22333a508 100644Binary files a/desktop/test/goldens/swarm-elements-light.png and b/desktop/test/goldens/swarm-elements-light.png differdiff --git a/desktop/test/super_tab_agent_chat_not_task_test.dart b/desktop/test/super_tab_agent_chat_not_task_test.dartindex d1309a50a..bb003a698 100644--- a/desktop/test/super_tab_agent_chat_not_task_test.dart+++ b/desktop/test/super_tab_agent_chat_not_task_test.dart@@ -67,12 +67,7 @@ void main() {});final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': 'owner',- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -93,6 +88,9 @@ void main() {),);await tester.pumpAndSettle();+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();expect(find.byKey(const ValueKey('super-tasks-lead')), findsOneWidget);diff --git a/desktop/test/super_tab_avatar_test.dart b/desktop/test/super_tab_avatar_test.dartindex 50b15a08c..bd20f516a 100644--- a/desktop/test/super_tab_avatar_test.dart+++ b/desktop/test/super_tab_avatar_test.dart@@ -2,6 +2,7 @@ import 'dart:math' as math;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/avatar_art.dart';import 'package:harness/super_tabs/identity.dart';import 'package:harness/super_tabs/model.dart';@@ -71,6 +72,41 @@ void main() {}});+ // Task #4466 (anh Dee 11-07): grey everywhere, colour only on agent faces.+ testWidgets('a person without a photo is an initial on a neutral grey disc', (+ tester,+ ) async {+ (Color, Color) drawn(String identity, String name) {+ final face = find.byWidgetPredicate(+ (w) => w is SuperTabAvatarFace && w.identity == identity,+ );+ final disc = tester.widget<Container>(+ find.descendant(of: face, matching: find.byType(Container)).first,+ );+ final ink = tester+ .widget<Text>(find.descendant(of: face, matching: find.byType(Text)))+ .style!+ .color!;+ return ((disc.decoration! as BoxDecoration).color!, ink);+ }++ await tester.pumpWidget(+ host(+ const Column(+ children: [+ SuperTabAvatarFace(identity: 'person:mai', name: 'mai', size: 20),+ SuperTabAvatarFace(identity: 'person:ken', name: 'ken', size: 20),+ SuperTabAvatarFace(identity: 'agent:kai', name: 'kai', size: 20),+ ],+ ),+ ),+ );+ final mai = drawn('person:mai', 'mai'), ken = drawn('person:ken', 'ken');+ expect(mai, ken);+ expect(mai.$2, grid.AppPalette.textSecondary);+ expect(drawn('agent:kai', 'kai').$2, isNot(grid.AppPalette.textSecondary));+ });+testWidgets('a face draws the numbers of the design: disc, eyes and smile ''in ink #221F29, tilted and shifted', (tester) async {const ink = Color(0xFF221F29);diff --git a/desktop/test/super_tab_board_buddies_test.dart b/desktop/test/super_tab_board_buddies_test.dartindex 64379e83a..82a7e19d7 100644--- a/desktop/test/super_tab_board_buddies_test.dart+++ b/desktop/test/super_tab_board_buddies_test.dart@@ -64,12 +64,7 @@ void main() {]);final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': 'owner',- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -88,6 +83,9 @@ void main() {),);await _settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);return (c, server);diff --git a/desktop/test/super_tab_board_buddy_card_test.dart b/desktop/test/super_tab_board_buddy_card_test.dartindex 261979c4b..351169e8d 100644--- a/desktop/test/super_tab_board_buddy_card_test.dart+++ b/desktop/test/super_tab_board_buddy_card_test.dart@@ -87,7 +87,6 @@ void main() {'accountId': 'owner','selectedId': 'lead',// v3 folds Projects while the person has an agent.- 'projectsGroupOpen': true,},);await tester.runAsync(c.refresh);@@ -109,6 +108,9 @@ void main() {),);await settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(key('super-group-lead'));await settle(tester);return c;diff --git a/desktop/test/super_tab_board_can_chat_test.dart b/desktop/test/super_tab_board_can_chat_test.dartindex 219016c55..4400e7556 100644--- a/desktop/test/super_tab_board_can_chat_test.dart+++ b/desktop/test/super_tab_board_can_chat_test.dart@@ -55,12 +55,7 @@ void main() {}final c = server.controller(account: reader,- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': reader,- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': reader, 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -79,6 +74,9 @@ void main() {),);await _settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);await tester.tap(_key('super-board-tab-chat'));diff --git a/desktop/test/super_tab_board_cards_test.dart b/desktop/test/super_tab_board_cards_test.dartindex 9cf51c400..471315cd5 100644--- a/desktop/test/super_tab_board_cards_test.dart+++ b/desktop/test/super_tab_board_cards_test.dart@@ -85,12 +85,7 @@ void main() {}final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': 'owner',- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -109,6 +104,9 @@ void main() {),);await _settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);return c;diff --git a/desktop/test/super_tab_board_fit_shots_test.dart b/desktop/test/super_tab_board_fit_shots_test.dartindex cf3df8f5e..9fbb88f47 100644--- a/desktop/test/super_tab_board_fit_shots_test.dart+++ b/desktop/test/super_tab_board_fit_shots_test.dart@@ -96,12 +96,7 @@ void main() {conversations.addAll(_tasks());final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': 'owner',- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -126,6 +121,9 @@ void main() {),);await tester.pumpAndSettle();+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();expect(diff --git a/desktop/test/super_tab_board_fit_test.dart b/desktop/test/super_tab_board_fit_test.dartindex e2d2df99a..8c3cf112e 100644--- a/desktop/test/super_tab_board_fit_test.dart+++ b/desktop/test/super_tab_board_fit_test.dart@@ -204,6 +204,9 @@ Future<SuperTabController> showWindow(),);await tester.pumpAndSettle();+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(_key('super-projects'));+ await tester.pumpAndSettle();await tester.tap(_key('super-group-lead'));await tester.pumpAndSettle();expect(_key('super-tasks-lead'), findsOneWidget);@@ -408,16 +411,16 @@ void main() {expect(tester.getCenter(_key('super-tasks-mine')).dy, closeTo(bar, 1));await tester.tap(menu);await tester.pumpAndSettle();- expect(_key('super-group-lead'), findsOneWidget);+ expect(_key('super-projects'), findsOneWidget);await tester.sendKeyEvent(LogicalKeyboardKey.escape);await tester.pumpAndSettle();- expect(_key('super-group-lead'), findsNothing);+ expect(_key('super-projects'), findsNothing);expect(_key('super-tasks-lead'), findsOneWidget, reason: 'the Board stays');await tester.tap(menu);await tester.pumpAndSettle();await tester.tapAt(const Offset(860, 430));await tester.pumpAndSettle();- expect(_key('super-group-lead'), findsNothing);+ expect(_key('super-projects'), findsNothing);expect(tester.takeException(), isNull);await closeWindow(tester, c);});diff --git a/desktop/test/super_tab_board_layout_test.dart b/desktop/test/super_tab_board_layout_test.dartindex b1ce18d9d..174bdfeaf 100644--- a/desktop/test/super_tab_board_layout_test.dart+++ b/desktop/test/super_tab_board_layout_test.dart@@ -67,12 +67,7 @@ void main() {server.append('What shall we work on?', conversationId: 'buddy-owner-lead');final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': 'owner',- 'selectedId': selected,- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': selected},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -110,6 +105,9 @@ void main() {testWidgets('opening a project shows its Board, and the right pane is the '"person's Buddy, not the project chat", (tester) async {final (c, _) = await show(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);expect(_key('super-tasks-lead'), findsOneWidget);@@ -122,6 +120,9 @@ void main() {testWidgets("a card's chat opens on the right beside the Board, and its "'header goes back to the Buddy', (tester) async {final (c, _) = await show(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);// The wider chat leaves the Board narrower: it scrolls sideways to the card.@@ -147,6 +148,9 @@ void main() {server.append('A reply in its thread.', conversationId: 'offline');server.messages.last['thread'] = root;await tester.runAsync(c.refresh);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);// The wider chat leaves the Board narrower: it scrolls sideways to the card.@@ -171,6 +175,9 @@ void main() {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);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);expect(_key('super-tasks-lead'), findsOneWidget);@@ -247,6 +254,9 @@ void main() {width: width,brightness: brightness,);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);expect(tester.getSize(_key('super-right-pane')).width, 340);@@ -270,10 +280,14 @@ void main() {..values['swarm_right_pane_hidden'] = '1';for (var mount = 0; mount < 2; mount++) {final (c, _) = await show(tester, store: store, brightness: brightness);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);expectFixedPanes(tester);- expect(_key('super-group-lead'), findsOneWidget);+ // The left pane is back: its Projects row, lit for the Board.+ expect(_key('super-projects'), findsOneWidget);expect(_key('super-tasks-lead'), findsOneWidget);expect(find.text('What shall we work on?'), findsOneWidget);if (mount == 0) {@@ -301,6 +315,9 @@ void main() {findsOneWidget,);await captureWindow(tester, shots, 'fixed-empty-${brightness.name}');+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);expect(@@ -335,6 +352,9 @@ void main() {tester,) async {final (c, server) = await show(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);server.state['projects'] = <dynamic>[];@@ -356,6 +376,9 @@ void main() {testWidgets('the minimum Desktop window keeps the Board and chat, projects in their ''drawer', (tester) async {final (c, _) = await show(tester, width: 880);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);expectFoldedLeft(tester);@@ -377,6 +400,9 @@ void main() {..values[SuperTabPaneLayout.storageKey] ='{"left":300,"right":280,"rightChosen":true}';final (c, _) = await show(tester, store: store);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);expect(tester.getSize(_key('super-right-pane')).width, 340);@@ -455,6 +481,9 @@ void main() {textScale: scale,selected: 'buddy-owner-lead',);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);// Under 1000 scaled, projects fold into their drawer.@@ -477,6 +506,9 @@ void main() {if (Platform.environment['HARNESS_LAYOUT_BENCH'] == '1') {testWidgets('Board divider drag benchmark', (tester) async {final (c, _) = await show(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);final drag = await tester.startGesture(diff --git a/desktop/test/super_tab_board_navigation_test.dart b/desktop/test/super_tab_board_navigation_test.dartindex 398debaa7..4c58f4e2a 100644--- a/desktop/test/super_tab_board_navigation_test.dart+++ b/desktop/test/super_tab_board_navigation_test.dart@@ -68,7 +68,6 @@ Future<SuperTabController> _open('tabId': 'tab','accountId': 'owner','selectedId': 'swarm-buddy-owner',- 'projectsGroupOpen': true,},);await tester.runAsync(c.refresh);@@ -133,23 +132,16 @@ Future<void> _settle(WidgetTester tester) async {}}-/// Whether the left pane's row [key] is lit: an agent's row says so itself; a project's row by its selected fill.-bool _lit(WidgetTester tester, String key) {- final row = find.byKey(ValueKey(key));- final widget = tester.widget(row);- if (widget is SuperTabBuddyRow) return widget.selected;- final ground = tester.widget<Material>(- find.ancestor(of: row, matching: find.byType(Material)).first,- );- return ground.color == grid.SidebarInk.selected;-}+/// Whether the left pane's row [key] is lit: every Desktop row says so itself (task #4466).+bool _lit(WidgetTester tester, String key) =>+ tester.widget<SuperTabQuietRow>(find.byKey(ValueKey(key))).selected;-/// The rows the left pane lights, of Buddy, the PM Orion and the project `# web-project`.+/// The rows the left pane lights, of Buddy, the PM Orion and Projects, whose grid the Board is from.List<String> _litRows(WidgetTester tester) => [for (final key in ['super-swarm-buddy','super-agent-orion',- 'super-group-lead',+ 'super-projects',])if (_lit(tester, key)) key,];@@ -161,6 +153,9 @@ void main() {tester,c,) async {+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(find.byKey(const ValueKey('super-group-lead')));await _settle(tester);await tester.tap(find.byKey(const ValueKey('super-task-card-offline')));@@ -177,22 +172,28 @@ void main() {);});- _scene('a Board lights its project row, not Buddy', 'board-lights-project', (+ _scene('a Board lights Projects, not Buddy', 'board-lights-project', (tester,c,) async {+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(find.byKey(const ValueKey('super-group-lead')));await _settle(tester);expect(find.byKey(const ValueKey('super-board-tab-board')), findsOneWidget);- expect(_litRows(tester), ['super-group-lead']);+ expect(_litRows(tester), ['super-projects']);});// Below 1000 the Board folds the left pane into its drawer (#4445): the drawer lights the same row (Test of #4445)._scene(- 'a narrow Board\'s drawer lights its project row, not Buddy',+ 'a narrow Board\'s drawer lights Projects, not Buddy','board-drawer-lights-project',(tester, c) async {+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(find.byKey(const ValueKey('super-group-lead')));await _settle(tester);await tester.binding.setSurfaceSize(const Size(880, 800));@@ -206,7 +207,7 @@ void main() {);await _settle(tester);- expect(_litRows(tester), ['super-group-lead']);+ expect(_litRows(tester), ['super-projects']);},);diff --git a/desktop/test/super_tab_board_needs_you_test.dart b/desktop/test/super_tab_board_needs_you_test.dartindex 26c939936..05d2295c5 100644--- a/desktop/test/super_tab_board_needs_you_test.dart+++ b/desktop/test/super_tab_board_needs_you_test.dart@@ -72,12 +72,7 @@ void main() {(server.state['conversations'] as List).addAll(cards);final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': 'owner',- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -96,6 +91,9 @@ void main() {),);await _settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);return (c, server);diff --git a/desktop/test/super_tab_board_phase2_shots_test.dart b/desktop/test/super_tab_board_phase2_shots_test.dartindex fdf00614a..076a7d11d 100644--- a/desktop/test/super_tab_board_phase2_shots_test.dart+++ b/desktop/test/super_tab_board_phase2_shots_test.dart@@ -170,12 +170,7 @@ void main() {]);final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': 'owner',- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -199,6 +194,9 @@ void main() {),);await _settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);expect(tester.takeException(), isNull);diff --git a/desktop/test/super_tab_board_propose_test.dart b/desktop/test/super_tab_board_propose_test.dartindex 100d9d067..8c1b9f898 100644--- a/desktop/test/super_tab_board_propose_test.dart+++ b/desktop/test/super_tab_board_propose_test.dart@@ -49,12 +49,7 @@ void main() {if (boardMode) project['boardMode'] = true;final c = server.controller(account: reader,- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': reader,- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': reader, 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -73,6 +68,9 @@ void main() {),);await _settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);return (c, server);diff --git a/desktop/test/super_tab_board_steer_test.dart b/desktop/test/super_tab_board_steer_test.dartindex 61d92c0e2..210f646c4 100644--- a/desktop/test/super_tab_board_steer_test.dart+++ b/desktop/test/super_tab_board_steer_test.dart@@ -67,12 +67,7 @@ void main() {};final c = server.controller(account: reader,- initial: {- 'tabId': 'tab',- 'projectsGroupOpen': true,- 'accountId': reader,- 'selectedId': 'lead',- },+ initial: {'tabId': 'tab', 'accountId': reader, 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.pumpWidget(@@ -91,6 +86,9 @@ void main() {),);await _settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await _settle(tester);// The wider chat leaves the Board narrower: it scrolls sideways to the card.diff --git a/desktop/test/super_tab_devices_test.dart b/desktop/test/super_tab_devices_test.dartindex 29de8d803..c3afadbf5 100644--- a/desktop/test/super_tab_devices_test.dart+++ b/desktop/test/super_tab_devices_test.dart@@ -144,6 +144,9 @@ void main() {await tester.tap(find.byKey(const ValueKey('super-manage-tab-devices')));await tester.pumpAndSettle();expect(tab.panes.single, same(viewer));+ // A project opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();expect(c.devicesSelected, isFalse);diff --git a/desktop/test/super_tab_offline_line_test.dart b/desktop/test/super_tab_offline_line_test.dartindex ca33a7ecf..02f08d38e 100644--- a/desktop/test/super_tab_offline_line_test.dart+++ b/desktop/test/super_tab_offline_line_test.dart@@ -59,7 +59,8 @@ void main() {}for (final brightness in Brightness.values) {- for (final page in ['super-decisions', 'super-leaderboard']) {+ // Humans opens the Leaderboard on the Desktop (task #4466).+ for (final page in ['super-decisions', 'project-sidebar-humans']) {testWidgets('${brightness.name}: $page says it is reconnecting, once, ''and Retry reads again', (tester) async {final f = await mount(tester, brightness);diff --git a/desktop/test/super_tab_pages_test.dart b/desktop/test/super_tab_pages_test.dartindex 2e56f3ba3..00888c411 100644--- a/desktop/test/super_tab_pages_test.dart+++ b/desktop/test/super_tab_pages_test.dart@@ -75,6 +75,9 @@ Future<Opened> show(SwarmPage.leaderboard => throw UnimplementedError('leaderboard has its own tests',),+ SwarmPage.projects => throw UnimplementedError(+ 'super_tab_projects_page_test.dart',+ ),},),),diff --git a/desktop/test/super_tab_pane_minimums_shots_test.dart b/desktop/test/super_tab_pane_minimums_shots_test.dartindex b57e48ddd..ee1f48275 100644--- a/desktop/test/super_tab_pane_minimums_shots_test.dart+++ b/desktop/test/super_tab_pane_minimums_shots_test.dart@@ -50,7 +50,6 @@ void main() {account: 'owner',initial: {'tabId': 'tab',- 'projectsGroupOpen': true,'accountId': 'owner','selectedId': 'buddy-owner-lead',},@@ -74,6 +73,9 @@ void main() {),);await tester.pumpAndSettle();+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();expect(tester.takeException(), isNull);diff --git a/desktop/test/super_tab_places_view_test.dart b/desktop/test/super_tab_places_view_test.dartindex 5ddd04a7a..58638c422 100644--- a/desktop/test/super_tab_places_view_test.dart+++ b/desktop/test/super_tab_places_view_test.dart@@ -116,13 +116,14 @@ void main() {};},);- expect(key('super-leaderboard'), findsOneWidget);+ // Humans is the Leaderboard's way in (task #4466).+ expect(key('project-sidebar-humans'), findsOneWidget);expect(- tester.getTopLeft(key('super-leaderboard')).dy,+ tester.getTopLeft(key('project-sidebar-humans')).dy,greaterThanOrEqualTo(tester.getBottomLeft(key('super-decisions')).dy),);await tap(tester, 'super-decisions');- await tap(tester, 'super-leaderboard');+ await tap(tester, 'project-sidebar-humans');expect(find.text('This week'), findsOneWidget);expect(key('weekly-person-owner'), findsOneWidget);expect(diff --git a/desktop/test/super_tab_projects_folded_test.dart b/desktop/test/super_tab_projects_folded_test.dartdeleted file mode 100644index 36bed1a20..000000000--- a/desktop/test/super_tab_projects_folded_test.dart+++ /dev/null@@ -1,72 +0,0 @@-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/buddy_rows.dart' show SuperTabCountBadge;--import 'support/super_tab_fixture.dart';-import 'support/super_tab_left_pane.dart';--/// Audit finding 19 (Desktop 1.3.89, task #4445): the Desktop folds Projects while the person has an agent, so a tag-/// in a project went unseen. Folded, the heading is bold and counts the projects whose rows are waiting.-void main() {- Finder heading(Finder matching) => find.descendant(- of: find.byKey(const ValueKey('project-sidebar-projects')),- matching: matching,- );- FontWeight? weight(WidgetTester tester) =>- tester.widget<Text>(heading(find.text('Projects'))).style?.fontWeight;-- /// A second project, `second-project`, beside the fixture's web-project.- void twoProjects(ConversationServer server) {- (server.state['projects'] as List).add(- projectFixture('second', 'second-project', 'second'),- );- (server.state['conversations'] as List).add({- ...conversationFixture('second', 'second-project'),- 'projectId': 'second',- });- }-- testWidgets('folded with nothing waiting, it is the ordinary heading', (- tester,- ) async {- await showLeftPane(tester, setup: twoProjects);- expect(find.byTooltip('Expand Projects'), findsOneWidget);- expect(weight(tester), isNot(grid.AppFont.semibold));- expect(heading(find.byType(SuperTabCountBadge)), findsNothing);- });-- testWidgets('folded with a tag in one project and new lines in another, it '- 'is bold and counts the two', (tester) async {- final c = await showLeftPane(- tester,- setup: (server) {- twoProjects(server);- server.followedThreads = null;- server.tag('message-1');- server.append('Can someone look?', conversationId: 'second');- server.messages.last['author'] = {- 'kind': 'person',- 'id': 'tuan',- 'name': '[email protected]',- };- },- );- expect(find.byTooltip('Expand Projects'), findsOneWidget);- expect(weight(tester), grid.AppFont.semibold);- expect(- find.descendant(- of: heading(find.byType(SuperTabCountBadge)),- matching: find.text('2'),- ),- findsOneWidget,- );- // Open, the rows say it themselves: the heading goes back to ordinary.- await tester.tap(find.byTooltip('Expand Projects'));- await tester.pump();- expect(find.byKey(const ValueKey('super-mentions-lead')), findsOneWidget);- expect(weight(tester), isNot(grid.AppFont.semibold));- expect(heading(find.byType(SuperTabCountBadge)), findsNothing);- await tester.runAsync(c.flush);- });-}diff --git a/desktop/test/super_tab_projects_page_test.dart b/desktop/test/super_tab_projects_page_test.dartnew file mode 100644index 000000000..534276c25--- /dev/null+++ b/desktop/test/super_tab_projects_page_test.dart@@ -0,0 +1,193 @@+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/model.dart' show SuperTabProject;+import 'package:harness/super_tabs/projects_page.dart';++import 'super_tab_activity_lists_test.dart' show swarm;+import 'support/super_tab_fixture.dart';++/// The Desktop's Projects grid (task #4466, anh Dee 11-07): the left pane's Projects opens every project in the middle,+/// as repositories under a GitHub org, most recent first.+void main() {+ Finder key(String k) => find.byKey(ValueKey(k));++ /// web-project (lead `lead`, quiet), api (busiest) and docs (private, in between).+ void projects(ConversationServer server) {+ final groups = (server.state['conversations'] as List)+ .cast<Map<String, dynamic>>();+ groups.firstWhere((g) => g['id'] == 'lead')['lastMessageSequence'] = 3;+ (server.state['projects'] as List)+ ..first['repository'] = {+ 'repositoryUrl': 'https://github.com/autonomous-ai/openharness.git',+ }+ ..addAll(<Map<String, dynamic>>[+ projectFixture('api', 'api', 'api-lead'),+ projectFixture('docs', 'docs', 'docs-lead', visibility: 'private'),+ ]);+ groups.addAll(<Map<String, dynamic>>[+ {+ ...conversationFixture('api-lead', 'api'),+ 'projectId': 'api',+ 'lastMessageSequence': 1,+ },+ {+ ...conversationFixture('api-task', 'A task'),+ 'projectId': 'api',+ 'lastMessageSequence': 90,+ },+ {+ ...conversationFixture('docs-lead', 'docs'),+ 'projectId': 'docs',+ 'lastMessageSequence': 40,+ },+ ]);+ }++ Future<SuperTabController> show(+ WidgetTester tester, {+ void Function(ConversationServer server)? setup,+ List<SuperTabProject>? opened,+ VoidCallback? onNewProject,+ Brightness brightness = Brightness.light,+ }) async {+ final server = swarm();+ setup?.call(server);+ final c = server.controller(account: 'owner');+ addTearDown(c.dispose);+ await tester.runAsync(c.refresh);+ final previous = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = previous);+ await tester.binding.setSurfaceSize(const Size(1000, 700));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: brightness),+ home: Scaffold(+ body: SuperTabProjectsPage(+ controller: c,+ onOpen: (project) => opened?.add(project),+ onNewProject: onNewProject,+ ),+ ),+ ),+ );+ await tester.pump();+ addTearDown(() => tester.pumpWidget(const SizedBox()));+ return c;+ }++ testWidgets('every project is a card, most recent first', (tester) async {+ await show(tester, setup: projects);+ final cards = [+ 'super-group-api-lead',+ 'super-group-docs-lead',+ 'super-group-lead',+ ];+ for (final card in cards) {+ expect(key(card), findsOneWidget, reason: card);+ }+ // Reading order: left to right, then down.+ Offset at(String k) => tester.getTopLeft(key(k));+ for (var i = 1; i < cards.length; i++) {+ final before = at(cards[i - 1]), after = at(cards[i]);+ expect(+ before.dy < after.dy || (before.dy == after.dy && before.dx < after.dx),+ isTrue,+ reason: cards[i],+ );+ }+ });++ testWidgets('a card has its name and one quiet line: the repository, or '+ 'Private', (tester) async {+ await show(tester, setup: projects);+ final name = tester+ .widget<Text>(+ find.descendant(+ of: key('super-group-lead'),+ matching: find.text('web-project'),+ ),+ )+ .style!;+ expect(name.fontSize, 13);+ expect(name.fontWeight, grid.AppFont.semibold);+ expect(name.color, grid.AppPalette.textPrimary);+ final repository = tester+ .widget<Text>(+ find.descendant(+ of: key('super-group-lead'),+ matching: find.text('autonomous-ai/openharness'),+ ),+ )+ .style!;+ expect(repository.fontSize, 12);+ expect(repository.color, grid.AppPalette.textFaint);+ expect(+ find.descendant(+ of: key('super-group-docs-lead'),+ matching: find.text('Private'),+ ),+ findsOneWidget,+ );+ expect(+ find.descendant(+ of: key('super-group-api-lead'),+ matching: find.byType(Text),+ ),+ findsOneWidget,+ );+ });++ testWidgets('a card opens its project\'s Board', (tester) async {+ final opened = <SuperTabProject>[];+ await show(tester, setup: projects, opened: opened);+ await tester.tap(key('super-group-docs-lead'));+ expect([for (final p in opened) p.id], ['docs']);+ });++ testWidgets('New project is the one blue button, and opens its form', (+ tester,+ ) async {+ var created = 0;+ await show(tester, setup: projects, onNewProject: () => created++);+ expect(find.byType(FilledButton), findsOneWidget);+ await tester.tap(find.widgetWithText(FilledButton, 'New project'));+ expect(created, 1);+ });++ testWidgets('a reader who may not make one has no New project', (+ tester,+ ) async {+ await show(tester, setup: projects);+ expect(find.text('New project'), findsNothing);+ });++ // anh Dee 11-07, rule 7: empty means empty; only the action that fills it.+ testWidgets('a Swarm with no projects shows only New project', (+ tester,+ ) async {+ await show(+ tester,+ setup: (server) => server.state['projects'] = <Map<String, dynamic>>[],+ onNewProject: () {},+ );+ expect(find.byType(Text), findsOneWidget);+ expect(find.text('New project'), findsOneWidget);+ });++ testWidgets('it fills 880 and wide windows, light and dark, without '+ 'overflow', (tester) async {+ for (final brightness in Brightness.values) {+ for (final width in [880.0 - 300, 1440.0 - 300]) {+ await show(tester, setup: projects, brightness: brightness);+ await tester.binding.setSurfaceSize(Size(width, 700));+ await tester.pump();+ expect(tester.takeException(), isNull);+ await tester.pumpWidget(const SizedBox());+ }+ }+ });+}diff --git a/desktop/test/super_tab_quiet_rows_test.dart b/desktop/test/super_tab_quiet_rows_test.dartnew file mode 100644index 000000000..5ebfb27c1--- /dev/null+++ b/desktop/test/super_tab_quiet_rows_test.dart@@ -0,0 +1,274 @@+import 'package:flutter/gestures.dart';+import 'package:flutter/material.dart';+import 'package:flutter/rendering.dart' show RenderParagraph;+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_icons.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/buddy_rows.dart';++/// The Desktop left pane's one row style and its heading (task #4466, anh Dee 11-07): face, name, one quiet detail on+/// the right; 30 high; 13 names, 12 details; bold only for unread; chevrons only on hover.+void main() {+ Future<void> pump(WidgetTester tester, List<Widget> children) async {+ await tester.binding.setSurfaceSize(const Size(300, 400));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: Brightness.light),+ home: Scaffold(+ body: Column(+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: children,+ ),+ ),+ ),+ );+ }++ TextStyle styleOf(WidgetTester tester, String text) =>+ tester.widget<Text>(find.text(text)).style!;++ const face = SizedBox.square(+ key: ValueKey('face'),+ dimension: SuperTabQuietRow.faceSize,+ );++ group('a quiet row', () {+ testWidgets('is 30 high, and a face and an icon start every name on one '+ 'line', (tester) async {+ await pump(tester, [+ SuperTabQuietRow(+ key: const ValueKey('a'),+ leading: face,+ name: 'River',+ onTap: () {},+ ),+ SuperTabQuietRow(+ key: const ValueKey('b'),+ leading: const Icon(AppIcons.plus, size: AppIcons.inlineSize),+ name: 'New agent',+ onTap: () {},+ ),+ ]);+ expect(SuperTabQuietRow.height, 30);+ // The fill is 30; the 2 under it keeps two lit rows apart.+ expect(+ tester+ .getSize(+ find.descendant(+ of: find.byKey(const ValueKey('a')),+ matching: find.byType(InkWell),+ ),+ )+ .height,+ 30,+ );+ expect(+ tester.getTopLeft(find.text('River')).dx,+ tester.getTopLeft(find.text('New agent')).dx,+ );+ expect(tester.getSize(find.byKey(const ValueKey('face'))).width, 20);+ });++ testWidgets('its detail is 12 and tertiary, right-aligned at the row\'s '+ 'end, with no brackets', (tester) async {+ await pump(tester, [+ SuperTabQuietRow(+ key: const ValueKey('lead'),+ leading: face,+ name: 'River',+ detail: 'harness',+ onTap: () {},+ ),+ SuperTabQuietRow(+ key: const ValueKey('person'),+ leading: face,+ name: 'dee',+ detail: '120',+ onTap: () {},+ ),+ ]);+ final detail = styleOf(tester, 'harness');+ expect(detail.fontSize, 12);+ expect(detail.color, grid.AppPalette.textFaint);+ expect(find.text('(harness)'), findsNothing);+ // One right edge for every detail, whatever its length.+ expect(+ tester.getTopRight(find.text('harness')).dx,+ tester.getTopRight(find.text('120')).dx,+ );+ expect(+ styleOf(tester, '120').fontFeatures,+ contains(const FontFeature.tabularFigures()),+ );+ });++ testWidgets('a read name is secondary and regular, an unread one primary '+ 'and semibold, and only unread is heard', (tester) async {+ final semantics = tester.ensureSemantics();+ await pump(tester, [+ SuperTabQuietRow(leading: face, name: 'Read', onTap: () {}),+ SuperTabQuietRow(+ leading: face,+ name: 'Unread',+ unread: true,+ onTap: () {},+ ),+ ]);+ final read = styleOf(tester, 'Read'), unread = styleOf(tester, 'Unread');+ expect(read.fontSize, 13);+ expect(read.color, grid.AppPalette.textSecondary);+ expect(read.fontWeight, FontWeight.w400);+ expect(unread.fontSize, 13);+ expect(unread.color, grid.AppPalette.textPrimary);+ expect(unread.fontWeight, grid.AppFont.semibold);+ expect(+ find.bySemanticsLabel(RegExp('^Unread\nunread\$')),+ findsOneWidget,+ );+ expect(find.bySemanticsLabel(RegExp('^Read\$')), findsOneWidget);+ semantics.dispose();+ });++ testWidgets('the selected row has the neutral fill and a primary name', (+ tester,+ ) async {+ await pump(tester, [+ SuperTabQuietRow(+ key: const ValueKey('open'),+ leading: face,+ name: 'Open',+ selected: true,+ onTap: () {},+ ),+ ]);+ final fill = tester.widget<Material>(+ find+ .descendant(+ of: find.byKey(const ValueKey('open')),+ matching: find.byType(Material),+ )+ .first,+ );+ expect(fill.color, grid.SidebarInk.selected);+ expect(styleOf(tester, 'Open').color, grid.AppPalette.textPrimary);+ expect(styleOf(tester, 'Open').fontWeight, FontWeight.w400);+ });++ testWidgets('marks sit in one column at the right edge, after the detail, '+ 'and a row without one keeps the column', (tester) async {+ const mark = SizedBox.square(key: ValueKey('mark'), dimension: 12);+ await pump(tester, [+ SuperTabQuietRow(+ key: const ValueKey('working'),+ leading: face,+ name: 'River',+ detail: 'harness',+ mark: mark,+ onTap: () {},+ ),+ SuperTabQuietRow(+ key: const ValueKey('idle'),+ leading: face,+ name: 'Kestrel',+ detail: 'web',+ markColumn: true,+ onTap: () {},+ ),+ ]);+ final markRect = tester.getRect(find.byKey(const ValueKey('mark')));+ expect(+ markRect.left,+ greaterThan(tester.getRect(find.text('harness')).right),+ );+ expect(+ tester.getRect(find.byKey(const ValueKey('working'))).right -+ markRect.right,+ lessThan(SuperTabQuietRow.markWidth),+ );+ // Details end on one line whether the row has a mark or not.+ expect(+ tester.getTopRight(find.text('harness')).dx,+ tester.getTopRight(find.text('web')).dx,+ );+ });++ testWidgets('a long name is cut before the detail, which keeps its whole '+ 'word', (tester) async {+ await pump(tester, [+ SuperTabQuietRow(+ leading: face,+ name: 'An agent with a very long name indeed that never fits',+ detail: 'harness',+ onTap: () {},+ ),+ ]);+ final detail = tester.renderObject<RenderParagraph>(find.text('harness'));+ expect(detail.didExceedMaxLines, isFalse);+ expect(tester.takeException(), isNull);+ });+ });++ group('a quiet heading', () {+ Future<TestGesture> hover(WidgetTester tester, Finder target) async {+ final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);+ await mouse.addPointer(location: Offset.zero);+ addTearDown(mouse.removePointer);+ await mouse.moveTo(tester.getCenter(target));+ await tester.pump();+ return mouse;+ }++ testWidgets('is 12 and secondary, with its chevron only while hovered', (+ tester,+ ) async {+ var toggled = 0;+ await pump(tester, [+ SuperTabQuietHeading(+ 'My agents',+ collapsed: false,+ onTap: () => toggled++,+ ),+ ]);+ final style = styleOf(tester, 'My agents');+ expect(style.fontSize, 12);+ expect(style.color, grid.AppPalette.textSecondary);+ expect(find.byIcon(AppIcons.chevronDown), findsNothing);+ await hover(tester, find.text('My agents'));+ expect(find.byIcon(AppIcons.chevronDown), findsOneWidget);+ await tester.tap(find.text('My agents'));+ expect(toggled, 1);+ });++ testWidgets('folded, its hover chevron points right', (tester) async {+ await pump(tester, [+ SuperTabQuietHeading('My agents', collapsed: true, onTap: () {}),+ ]);+ await hover(tester, find.text('My agents'));+ expect(find.byIcon(AppIcons.chevronRight), findsOneWidget);+ });++ testWidgets('the org name is semibold, 13 and primary, a dropdown that '+ 'shows its chevron only on hover', (tester) async {+ await pump(tester, [+ SuperTabQuietHeading.org('autonomous.ai', onTap: () {}),+ ]);+ final style = styleOf(tester, 'autonomous.ai');+ expect(style.fontSize, 13);+ expect(style.fontWeight, grid.AppFont.semibold);+ expect(style.color, grid.AppPalette.textPrimary);+ expect(find.byIcon(AppIcons.chevronDown), findsNothing);+ await hover(tester, find.text('autonomous.ai'));+ expect(find.byIcon(AppIcons.chevronDown), findsOneWidget);+ });++ testWidgets('a heading that only opens a page has no chevron', (+ tester,+ ) async {+ await pump(tester, [SuperTabQuietHeading('Humans', onTap: () {})]);+ await hover(tester, find.text('Humans'));+ expect(find.byIcon(AppIcons.chevronDown), findsNothing);+ expect(find.byIcon(AppIcons.chevronRight), findsNothing);+ });+ });+}diff --git a/desktop/test/super_tab_sidebar_focus_test.dart b/desktop/test/super_tab_sidebar_focus_test.dartindex 001f86284..e267ee706 100644--- a/desktop/test/super_tab_sidebar_focus_test.dart+++ b/desktop/test/super_tab_sidebar_focus_test.dart@@ -66,7 +66,8 @@ void main() {for (final (row, label) in [('super-agent-orion', 'an agent row'),- ('super-project-lead', 'a project row'),+ // The Desktop's Projects is one link (task #4466).+ ('super-projects', 'the Projects row'),('super-decisions', 'a page row'),]) {testWidgets('Tab to $label that is not selected: a ring, and its fill '@@ -74,13 +75,8 @@ void main() {final c = await showLeftPane(tester, setup: agents);c.select('offline');await tester.pump();- await tester.tap(find.byTooltip('Expand Projects'));- await tester.pump();await tabTo(tester, key(row));- // A page row's key is on its click, inside the ground that draws it.- final drawn = row == 'super-decisions'- ? find.ancestor(of: key(row), matching: find.byType(Padding)).first- : key(row);+ final drawn = key(row);expect(drawn, isNot(fill(grid.SidebarInk.hover)));expect(drawn, ring());// The selected row keeps its fill and wears no ring.diff --git a/desktop/test/super_tab_sidebar_polish_test.dart b/desktop/test/super_tab_sidebar_polish_test.dartindex da97310eb..96d2698b7 100644--- a/desktop/test/super_tab_sidebar_polish_test.dart+++ b/desktop/test/super_tab_sidebar_polish_test.dart@@ -1,34 +1,13 @@import 'package:flutter/material.dart';import 'package:flutter_test/flutter_test.dart';-import 'package:harness/shared/theme/app_theme.dart' as grid;import 'support/super_tab_fixture.dart';import 'support/super_tab_left_pane.dart';-/// The left pane's smaller polish and finding 20's "No projects yet" (Desktop 1.3.89 audit, task #4445).+/// The left pane's smaller polish (Desktop 1.3.89 audit, task #4445). A Lead's project and Projects' counts are the+/// quiet rows' details (super_tab_v3_left_test.dart, task #4466).void main() {Finder key(String k) => find.byKey(ValueKey(k));- Finder inRow(String agent, Finder matching) =>- find.descendant(of: key('super-agent-$agent'), matching: matching);-- /// Kestrel, whose chat is [kestrelChat] (none while null), and Orion, the PM of web-project.- void Function(ConversationServer) agents({String? kestrelChat = 'offline'}) =>- (server) {- server.state['agents'] = [- leftPaneAgent('kestrel', 'Kestrel'),- leftPaneAgent('orion', 'Orion'),- ];- final groups = (server.state['conversations'] as List)- .cast<Map<String, dynamic>>();- groups.firstWhere((g) => g['id'] == 'lead')['leadId'] = 'orion';- if (kestrelChat != null) {- groups.firstWhere((g) => g['id'] == kestrelChat)['assignment'] = {- 'id': 'a1',- 'agentId': 'kestrel',- 'status': 'working',- };- }- };testWidgets('a long Swarm name says all of itself on hover', (tester) async {const name = 'Autonomous Robotics Collective of Saigon';@@ -46,28 +25,4 @@ void main() {);expect(find.byTooltip(name), findsOneWidget);});-- testWidgets('a PM\'s project reads after a separator, muted', (tester) async {- await showLeftPane(tester, setup: agents());- final note = inRow('orion', find.text('· web-project'));- expect(note, findsOneWidget);- expect(- tester.widget<Text>(note).style?.color,- grid.SidebarInk.muted(tester.element(key('super-agent-orion'))),- );- });-- testWidgets('open Projects with none says so', (tester) async {- await showLeftPane(- tester,- setup: (server) {- server.state['projects'] = <dynamic>[];- server.state['agents'] = <dynamic>[];- },- );- expect(find.byTooltip('Collapse Projects'), findsOneWidget);- final empty = find.text('No projects yet.');- expect(empty, findsOneWidget);- expect(tester.widget<Text>(empty).style?.color, grid.SidebarInk.inkMuted);- });}diff --git a/desktop/test/super_tab_v3_left_shots_test.dart b/desktop/test/super_tab_v3_left_shots_test.dartindex 6522e953a..bc9cb6c80 100644--- a/desktop/test/super_tab_v3_left_shots_test.dart+++ b/desktop/test/super_tab_v3_left_shots_test.dart@@ -29,7 +29,7 @@ Map<String, dynamic> _agent(String id, String name) => {/// Swarm v3's left pane and middle (task #4118), in both appearances: My agents with the Buddy first, a PM's Lead ring and an/// unread name in bold; the chat of a selected agent in the middle; a project's Board with Projects open. Task #4192: no/// arrows under the org switcher, the Buddy's own avatar, only the server's My agents, and My agents folded. Task #4220:-/// folded Projects keeps a project that tags you, and Decisions in the middle keeps Tasks on the right.+/// Decisions in the middle keeps Tasks on the right.void main() {setUpAll(() async {await loadCaptureFonts(shots);@@ -41,17 +41,20 @@ void main() {}});+ // Task #4466: the quiet left pane and the Projects grid, at 880 and wide.for (final brightness in Brightness.values) {- for (final scene in [- 'agent-chat',- 'no-agents',- 'board',- 'folded',- 'tagged',- 'decisions',+ for (final (scene, width) in [+ ('agent-chat', 1440.0),+ ('no-agents', 1440.0),+ ('board', 1440.0),+ ('board-880', 880.0),+ ('folded', 1440.0),+ ('projects', 1440.0),+ ('projects-880', 880.0),+ ('decisions', 1440.0),]) {testWidgets('$scene (${brightness.name})', (tester) async {- await tester.binding.setSurfaceSize(const Size(1500, 800));+ await tester.binding.setSurfaceSize(Size(width, 800));addTearDown(() => tester.binding.setSurfaceSize(null));final before = grid.AppTheme.brightness.value;grid.AppTheme.brightness.value = brightness;@@ -126,15 +129,49 @@ void main() {};}server.append('Working on the fix.', conversationId: 'offline');- if (scene == 'tagged') server.tag('message-1', conversationId: 'lead');+ // Humans: the board's people with their points.+ (server.state['people'] as List).addAll([+ for (final id in ['dee', 'ken15'])+ {'id': id, 'email': '[email protected]', 'role': 'collaborator'},+ ]);+ server.leaderboard = {+ 'projectId': 'lead',+ 'week': 0,+ 'people': [+ for (final (i, (id, points)) in [+ ('dee', 120),+ ('ken15', 80),+ ('owner', 12),+ ].indexed)+ {'personId': id, 'points': points, 'rank': i + 1},+ ],+ };+ (server.state['projects'] as List)+ ..first['repository'] = {+ 'repositoryUrl': 'https://github.com/autonomous-ai/openharness',+ }+ ..addAll(<Map<String, dynamic>>[+ projectFixture('site', 'website', 'site-lead'),+ projectFixture('docs', 'docs', 'docs-lead', visibility: 'private'),+ ]);+ groups.addAll(<Map<String, dynamic>>[+ {+ ...conversationFixture('site-lead', 'website'),+ 'projectId': 'site',+ 'lastMessageSequence': 1,+ },+ {+ ...conversationFixture('docs-lead', 'docs'),+ 'projectId': 'docs',+ 'lastMessageSequence': 0,+ },+ ]);final c = server.controller(account: 'owner',initial: {'tabId': 'tab','accountId': 'owner','selectedId': 'lead',- if (scene == 'board' || scene == 'folded')- 'projectsGroupOpen': true,if (scene == 'folded') 'agentsGroupOpen': false,},);@@ -176,10 +213,24 @@ void main() {}await settle();+ // Under 1000 the Board folds the left pane into its drawer (#4445): its header opens it.+ Future<void> openProjects() async {+ if (find.byKey(const ValueKey('super-projects')).evaluate().isEmpty) {+ await tester.tap(find.byTooltip('Conversations').first);+ await settle();+ }+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await settle();+ }+if (scene == 'agent-chat') {await tester.tap(find.byKey(const ValueKey('super-agent-kestrel')));await settle();- } else if (scene == 'board') {+ } else if (scene.startsWith('projects')) {+ await openProjects();+ } else if (scene.startsWith('board')) {+ // A project's Board opens from the Projects grid (task #4466).+ await openProjects();await tester.tap(find.byKey(const ValueKey('super-group-lead')));await settle();} else if (scene == 'decisions') {diff --git a/desktop/test/super_tab_v3_left_test.dart b/desktop/test/super_tab_v3_left_test.dartindex 1f67e539f..445f3ebaa 100644--- a/desktop/test/super_tab_v3_left_test.dart+++ b/desktop/test/super_tab_v3_left_test.dart@@ -5,19 +5,22 @@ import 'package:flutter/rendering.dart' show RenderParagraph;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/harness_activity.dart' show HarnessActivity;import 'package:harness/state/app_state.dart';import 'package:harness/shared/theme/app_icons.dart';import 'package:harness/super_tabs/buddy_rows.dart' show SuperTabCountBadge;import 'package:harness/super_tabs/identity.dart' show SuperTabAvatar;import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/leaderboard/reader.dart';import 'package:harness/super_tabs/model.dart' show SuperTabAgent;import 'package:harness/super_tabs/places.dart';+import 'package:harness/state/harness_activity.dart' show HarnessActivity;import 'package:harness/super_tabs/project_sidebar.dart';import 'package:harness/super_tabs/view.dart';import 'package:harness/widgets/harness_activity_mark.dart' show ActivityMark;-import 'super_tab_activity_lists_test.dart' show load, swarm;+import 'package:flutter/gestures.dart' show PointerDeviceKind;++import 'super_tab_activity_lists_test.dart' show load, swarm, wait;import 'support/capture.dart';import 'support/super_tab_fixture.dart';import 'swarm_state_test.dart' show createApp;@@ -69,6 +72,10 @@ void main() {List<String>? terminals,double width = 300,Brightness brightness = Brightness.light,+ List<SwarmPage>? pages,+ SwarmPage? page,+ String? boardProjectId,+ SuperTabLeaderboardReader? leaderboard,}) async {final server = swarm();if (agents != null) server.state['agents'] = agents;@@ -103,7 +110,10 @@ void main() {places: SuperTabPlaces.of(c),onNewSwarm: () {},onNewProject: () {},- onPage: (_) {},+ onPage: (page) => pages?.add(page),+ page: page,+ boardProjectId: boardProjectId,+ leaderboard: leaderboard,activity: activity,attention: activity.attention,onManage: () {},@@ -155,64 +165,263 @@ void main() {});});- group('Projects folds', () {- testWidgets('closed while the person has an agent', (tester) async {+ // Task #4466 (anh Dee 11-07): top to bottom, the org name, Decisions, Projects, My agents, Humans; Manage at the foot.+ group('the Desktop left pane, top to bottom', () {+ testWidgets('org, Decisions, Projects, My agents, Humans, then Manage', (+ tester,+ ) async {await show(tester);- expect(key('project-sidebar-projects'), findsOneWidget);- expect(key('super-project-lead'), findsNothing);- expect(find.byTooltip('Expand Projects'), findsOneWidget);+ double top(String k) => tester.getTopLeft(key(k)).dy;+ final order = [+ 'super-swarm-switcher',+ 'super-decisions',+ 'super-projects',+ 'project-sidebar-agents',+ 'project-sidebar-humans',+ 'super-manage',+ ];+ for (var i = 1; i < order.length; i++) {+ expect(top(order[i - 1]), lessThan(top(order[i])), reason: order[i]);+ }});- testWidgets('open when the person has no agents, or only another\'s', (+ testWidgets('the org name is plain text, its chevron only on hover', (tester,) async {- await show(tester, agents: []);- expect(key('super-project-lead'), findsOneWidget);- await tester.pumpWidget(const SizedBox());+ await show(tester);+ final org = key('super-swarm-switcher');+ Finder chevron() =>+ find.descendant(of: org, matching: find.byIcon(AppIcons.chevronDown));+ expect(chevron(), findsNothing);+ expect(+ find.descendant(of: org, matching: find.byIcon(AppIcons.users)),+ findsNothing,+ );+ final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse);+ await mouse.addPointer(location: Offset.zero);+ addTearDown(mouse.removePointer);+ await mouse.moveTo(tester.getCenter(org));+ await tester.pump();+ expect(chevron(), findsOneWidget);+ });++ testWidgets('Decisions has the inbox icon and its count on the right', (+ tester,+ ) async {+ await show(tester, setup: wait);+ final row = key('super-decisions');+ expect(+ find.descendant(of: row, matching: find.byIcon(AppIcons.inbox)),+ findsOneWidget,+ );+ final count = find.descendant(of: row, matching: find.text('1'));+ expect(count, findsOneWidget);+ expect(+ tester.getRect(count).right,+ greaterThan(tester.getRect(row).right - 16),+ );+ });++ testWidgets('no Leaderboard row, no project rows and no unread filter: '+ 'Projects is one link to the grid', (tester) async {+ final pages = <SwarmPage>[];+ await show(tester, pages: pages);+ for (final gone in [+ 'super-leaderboard',+ 'project-sidebar-projects',+ 'super-project-lead',+ 'super-unread-only',+ ]) {+ expect(key(gone), findsNothing, reason: gone);+ }+ expect(+ find.descendant(+ of: key('super-projects'),+ matching: find.byIcon(AppIcons.layoutGrid),+ ),+ findsOneWidget,+ );+ await tester.tap(key('super-projects'));+ expect(pages, [SwarmPage.projects]);+ });++ // Task #4220 kept a project that tags you in folded Projects, the Desktop having no Mentions row; with no project+ // rows (task #4466) the tags are Projects' own detail, and it is bold while any waits.+ testWidgets('a tag of you in a project\'s chat shows on Projects, with its '+ 'count', (tester) async {await show(tester,- agents: [_agent('tuan-agent', 'Tuan agent', contributor: 'tuan')],+ setup: (server) => server.tag('message-1', conversationId: 'lead'),);- expect(key('super-project-lead'), findsOneWidget);+ final row = key('super-projects');+ expect(+ find.descendant(of: row, matching: find.text('1')),+ findsOneWidget,+ );+ expect(+ tester+ .widget<Text>(+ find.descendant(of: row, matching: find.text('Projects')),+ )+ .style+ ?.fontWeight,+ grid.AppFont.semibold,+ );+ await tester.pumpWidget(const SizedBox());+ await show(tester);+ expect(find.descendant(of: row, matching: find.text('1')), findsNothing);});- // Task #4220: the Desktop has no Mentions row, so a tag in a folded project's chat showed nowhere.- testWidgets('folded, it still lists a project whose chat tags you, with '- 'its number', (tester) async {+ // Audit finding 19 (task #4445), carried to the Projects row: new lines from a person count as a tag does.+ testWidgets('a tag in one project and new lines in another: Projects is '+ 'bold and counts the two', (tester) async {await show(tester,- setup: (server) => server.tag('message-1', conversationId: 'lead'),+ setup: (server) {+ (server.state['projects'] as List).add(+ projectFixture('second', 'second-project', 'second'),+ );+ (server.state['conversations'] as List).add({+ ...conversationFixture('second', 'second-project'),+ 'projectId': 'second',+ });+ server.tag('message-1', conversationId: 'lead');+ server.append('Can someone look?', conversationId: 'second');+ server.messages.last['author'] = {+ 'kind': 'person',+ 'id': 'tuan',+ 'name': '[email protected]',+ };+ },);- expect(find.byTooltip('Expand Projects'), findsOneWidget);- expect(key('super-project-lead'), findsOneWidget);expect(- find.descendant(- of: key('super-project-lead'),- matching: key('super-mentions-lead'),- ),+ find.descendant(of: key('super-projects'), matching: find.text('2')),findsOneWidget,);});- testWidgets('its heading opens and closes it', (tester) async {+ // Review of #3539: the Desktop has no unread filter to turn off, so one saved on must hide nothing there.+ testWidgets('a saved unread filter hides no Buddy row on the Desktop', (+ 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'));+ expect(key('super-buddy-lead'), findsOneWidget);+ c.toggleUnreadOnly();await tester.pump();- expect(key('super-project-lead'), findsNothing);- // The choice is saved with the view.- expect(c.projectsGroupOpen, isFalse);+ expect(c.unreadOnly, isTrue);+ expect(key('super-buddy-lead'), findsOneWidget);await tester.runAsync(c.flush);});+ testWidgets('Projects is the lit row while the grid or a Board is open', (+ tester,+ ) async {+ bool lit() => tester+ .widget<Semantics>(+ find+ .descendant(+ of: key('super-projects'),+ matching: find.byWidgetPredicate(+ (w) => w is Semantics && w.properties.selected != null,+ ),+ )+ .first,+ )+ .properties+ .selected!;+ await show(tester);+ expect(lit(), isFalse);+ await tester.pumpWidget(const SizedBox());+ await show(tester, page: SwarmPage.projects);+ expect(lit(), isTrue);+ await tester.pumpWidget(const SizedBox());+ await show(tester, boardProjectId: 'lead');+ expect(lit(), isTrue);+ });+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);+ expect(key('super-projects'), findsNothing);+ });+ });++ group('Humans is the Leaderboard', () {+ SuperTabLeaderboardReader board(List<(String, int)> people) {+ final reader = SuperTabLeaderboardReader(+ tabId: 'tab',+ request: (method, path, {body}) async => {+ 'projectId': 'lead',+ 'week': 0,+ 'people': [+ for (final (i, (id, points)) in people.indexed)+ {'personId': id, 'points': points, 'rank': i + 1},+ ],+ },+ );+ addTearDown(reader.dispose);+ return reader;+ }++ void people(ConversationServer server) =>+ (server.state['people'] as List).addAll([+ for (final id in ['dee', 'ken', 'tuan'])+ {'id': id, 'email': '[email protected]', 'role': 'collaborator'},+ ]);++ testWidgets('lists people most points first, their points on the right', (+ tester,+ ) async {+ final reader = board([('dee', 120), ('ken', 80), ('owner', 0)]);+ await tester.runAsync(() => reader.show('lead'));+ await show(tester, setup: people, leaderboard: reader);+ expect(+ find.descendant(+ of: key('project-sidebar-humans'),+ matching: find.text('Humans'),+ ),+ findsOneWidget,+ );+ double top(String k) => tester.getTopLeft(key(k)).dy;+ expect(top('super-human-dee'), lessThan(top('super-human-ken')));+ expect(top('super-human-ken'), lessThan(top('super-human-owner')));+ final points = find.descendant(+ of: key('super-human-dee'),+ matching: find.text('120'),+ );+ expect(points, findsOneWidget);+ // Zero still shows, so the column holds.+ expect(+ find.descendant(of: key('super-human-owner'), matching: find.text('0')),+ findsOneWidget,+ );+ expect(+ tester.getRect(points).right,+ greaterThan(tester.getRect(key('super-human-dee')).right - 16),+ );+ expect(top('super-human-owner'), lessThan(top('super-manage')));+ });++ testWidgets('at most 8 people; the heading and every person open the '+ 'whole board', (tester) async {+ final reader = board([for (var i = 0; i < 12; i++) ('p$i', 12 - i)]);+ await tester.runAsync(() => reader.show('lead'));+ final pages = <SwarmPage>[];+ await show(tester, leaderboard: reader, pages: pages, setup: people);+ expect(key('super-human-p7'), findsOneWidget);+ expect(key('super-human-p8'), findsNothing);+ await tester.tap(key('project-sidebar-humans'));+ await tester.tap(key('super-human-p0'));+ expect(pages, [SwarmPage.leaderboard, SwarmPage.leaderboard]);+ });++ testWidgets('before the board is read, the heading alone', (tester) async {+ await show(tester, leaderboard: board([('dee', 1)]));+ expect(key('project-sidebar-humans'), findsOneWidget);+ expect(key('super-human-dee'), findsNothing);+ expect(find.byType(CircularProgressIndicator), findsNothing);});});@@ -267,10 +476,10 @@ void main() {lessThan(top(tester, 'super-agent-orion')),);expect(key('super-agent-tuan-agent'), findsNothing);- // My agents comes before Projects.+ // Under the Projects link.expect(- top(tester, 'project-sidebar-agents'),- lessThan(top(tester, 'project-sidebar-projects')),+ top(tester, 'super-projects'),+ lessThan(top(tester, 'project-sidebar-agents')),);});@@ -295,32 +504,25 @@ void main() {expect(key('super-agent-fir'), findsNothing);});- // Task #4220: the row drew its status only beside a detail line, and My agents rows have none.- testWidgets('each row shows its status, quietly, at its end', (- tester,- ) async {- // The person's one running Buddy, of no project.+ // Task #4466: grey everywhere, colour only on faces; an agent that is down says so in its one detail.+ testWidgets('no coloured marks in the rows; an offline agent says '+ '"offline" on the right', (tester) async {await show(tester,agents: [{...buddy}..remove('projectId'),- ...mine.skip(1),+ {...mine[1], 'downSince': '2026-11-07T08:00:00Z'},+ ...mine.skip(2),],setup: agents,);- for (final row in ['super-swarm-buddy', 'super-agent-kestrel']) {- final mark = find.descendant(- of: key(row),- matching: find.byType(ActivityMark),- );- expect(mark, findsOneWidget, reason: row);- // At the row's end, in the column the unread state is heard in.- expect(- tester.getRect(mark).left,- greaterThan(tester.getRect(key(row)).right - 64),- reason: row,- );- }+ expect(find.byType(ActivityMark), findsNothing);+ final offline = text('kestrel', 'offline');+ expect(offline, findsOneWidget);+ expect(+ tester.getRect(offline).right,+ greaterThan(tester.getRect(key('super-agent-kestrel')).right - 40),+ );});// Task #4421 (anh Dee 11-07): "let's put the project name next to the one that it leads". Task #4461 (anh Dee@@ -362,15 +564,20 @@ void main() {expect(said('kestrel').split('\n'), isNot(contains('Lead')));final name = tester.getRect(text('orion', 'Orion'));expect(tester.getRect(ring('orion')).right, lessThan(name.left));- final project = tester.getRect(text('orion', '· web-project'));+ final project = tester.getRect(text('orion', 'web-project'));expect(project.left, greaterThan(name.right));expect((project.center.dy - name.center.dy).abs(), lessThan(4));+ // The one quiet detail, right-aligned at the row's end.expect(- tester.widget<Text>(text('orion', '· web-project')).style?.color,- grid.SidebarInk.muted(tester.element(key('super-agent-orion'))),+ project.right,+ greaterThan(tester.getRect(key('super-agent-orion')).right - 40),+ );+ expect(+ tester.widget<Text>(text('orion', 'web-project')).style?.color,+ grid.AppPalette.textFaint,);expect(ring('kestrel'), findsNothing);- expect(text('kestrel', '· web-project'), findsNothing);+ expect(text('kestrel', 'web-project'), findsNothing);semantics.dispose();});@@ -382,13 +589,18 @@ void main() {buddy,{..._agent('orion', 'Orion Lead'), 'kind': 'pm'},],- setup: agents,- width: 280,+ setup: (server) {+ agents(server);+ (server.state['projects'] as List).first['name'] =+ 'a-project-with-a-long-name';+ },+ // The test font draws every letter as a square: 320 here is about 200 in the app's.+ width: 320,);bool cut(String shown) => tester.renderObject<RenderParagraph>(text('orion', shown)).didExceedMaxLines;- expect(cut('· web-project'), isTrue);+ expect(cut('a-project-with-a-long-name'), isTrue);expect(cut('Orion Lead'), isFalse);});@@ -433,9 +645,34 @@ void main() {expect(avatar.face, isTrue);});- // Audit finding 9 of task #4436 (task #4444): working, waiting, offline and starting all looked the same.- testWidgets('each row shows its activity mark beside its name, and '- '"offline" when its agent is down', (tester) async {+ test('the detail is "offline", else the project a Lead leads', () {+ for (final (activity, lead, word) in [+ (HarnessActivity.offline, 'web', 'offline'),+ (HarnessActivity.working, 'web', 'web'),+ (HarnessActivity.needsInput, null, null),+ (null, 'web', 'web'),+ ]) {+ expect(superTabAgentDetail(activity, leads: lead), word);+ }+ });++ // anh Dee 11-07 (1.3.90): idle showed a hollow circle and finished a check on every row.+ test('a mark only while an agent works, needs you or failed', () {+ for (final activity in HarnessActivity.values) {+ expect(superTabAgentMark(activity), switch (activity) {+ HarnessActivity.working ||+ HarnessActivity.needsInput ||+ HarnessActivity.failed => activity,+ _ => null,+ }, reason: '$activity');+ }+ expect(superTabAgentMark(null), isNull);+ });++ // Audit finding 9 of task #4436 (task #4444): working, waiting, offline and starting all looked the same. Since+ // task #4466 a state is the row's one quiet word on the right, grey, with no coloured mark.+ testWidgets('a row says "offline" on the right when its agent is down, '+ 'with no coloured mark', (tester) async {await show(tester,agents: [@@ -448,41 +685,19 @@ void main() {],setup: buddyChat,);- ActivityMark mark(String row) => tester.widget<ActivityMark>(- find.descendant(of: key(row), matching: find.byType(ActivityMark)),- );- for (final (row, name) in [- ('super-swarm-buddy', 'Buddy'),- ('super-agent-kestrel', 'Kestrel'),- ('super-agent-orion', 'Orion'),- ]) {- final shown = tester.getRect(- find.descendant(of: key(row), matching: find.text(name)),- );- final at = tester.getRect(- find.descendant(of: key(row), matching: find.byType(ActivityMark)),+ expect(find.byType(ActivityMark), findsNothing);+ for (final row in ['super-swarm-buddy', 'super-agent-orion']) {+ final word = find.descendant(+ of: key(row),+ matching: find.text('offline'),);+ expect(word, findsOne, reason: row);expect(- (at.center.dy - shown.center.dy).abs(),- lessThan(4),+ tester.getRect(word).right,+ greaterThan(tester.getRect(key(row)).right - 40),reason: row,);- expect(at.left, greaterThan(shown.right), reason: row);}- expect(mark('super-swarm-buddy').activity, HarnessActivity.offline);- expect(mark('super-agent-orion').activity, HarnessActivity.offline);- expect(- mark('super-agent-kestrel').activity,- isNot(HarnessActivity.offline),- );- expect(text('orion', 'offline'), findsOne);- expect(- find.descendant(- of: key('super-swarm-buddy'),- matching: find.text('offline'),- ),- findsOne,- );expect(text('kestrel', 'offline'), findsNothing);});@@ -618,7 +833,9 @@ void main() {await tester.pump();expect(selected, isEmpty);expect(terminals, ['kestrel']);- expect(find.byTooltip('Kestrel · opens its terminal'), findsOneWidget);+ // Copy says it once: no name repeated, no filler (anh Dee 11-07).+ expect(find.byTooltip('Opens its terminal'), findsOneWidget);+ expect(find.byTooltip('Kestrel'), findsNothing);});testWidgets('+ New agent is the last row, below the agents, and hands on '@@ -632,7 +849,7 @@ void main() {);expect(top(tester, 'super-new-agent-row'),- lessThan(top(tester, 'project-sidebar-projects')),+ lessThan(top(tester, 'project-sidebar-humans')),);expect(find.descendant(@@ -660,7 +877,7 @@ void main() {},);expect(key('super-agent-kestrel'), findsOneWidget);- await tester.tap(find.byTooltip('Collapse My agents'));+ await tester.tap(key('project-sidebar-agents'));await tester.pump();for (final row in ['super-swarm-buddy',@@ -675,7 +892,7 @@ void main() {final again = server.controller(initial: server.saved);addTearDown(again.dispose);expect(again.agentsGroupOpen, isFalse);- await tester.tap(find.byTooltip('Expand My agents'));+ await tester.tap(key('project-sidebar-agents'));await tester.pump();expect(key('super-agent-kestrel'), findsOneWidget);expect(c.agentsGroupOpen, isTrue);@@ -737,12 +954,7 @@ void main() {final server = swarm()..state['agents'] = [_agent('kestrel', 'Kestrel')];final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'accountId': 'owner',- 'selectedId': 'lead',- 'projectsGroupOpen': true,- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},);await tester.runAsync(c.refresh);final AppNotifier? app = withApp ? createApp() : null;@@ -816,12 +1028,7 @@ void main() {setup?.call(server);final c = server.controller(account: 'owner',- initial: {- 'tabId': 'tab',- 'accountId': 'owner',- 'selectedId': 'lead',- 'projectsGroupOpen': true,- },+ initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},);await tester.runAsync(c.refresh);await tester.binding.setSurfaceSize(const Size(1600, 900));@@ -930,6 +1137,9 @@ void main() {final c = await view(tester);await tester.tap(key('super-agent-kestrel'));await settle(tester);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(key('super-group-lead'));await settle(tester);expect(key('super-tasks-lead'), findsOneWidget);@@ -968,6 +1178,9 @@ void main() {tester,) async {final c = await view(tester, rightPane: (_) => const SizedBox.expand());+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(key('super-group-lead'));await settle(tester);double w(String k) => tester.getSize(key(k)).width;@@ -984,6 +1197,9 @@ void main() {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());+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(key('super-group-lead'));await settle(tester);expect(key('super-tasks-layout-board'), findsNothing);@@ -1003,6 +1219,9 @@ void main() {tester,) async {final c = await view(tester, rightPane: (_) => const SizedBox.expand());+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(key('super-group-lead'));await settle(tester);for (final layout in ['list', 'members']) {@@ -1058,6 +1277,9 @@ void main() {rightPane: (_) => const Text('Tasks pane', key: ValueKey('tasks-pane')),);// Even on a project's Board the right pane is the slot, not a chat.+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(key('super-group-lead'));await settle(tester);expect(diff --git a/desktop/test/super_tab_v3_ux_fixes_test.dart b/desktop/test/super_tab_v3_ux_fixes_test.dartindex afff47c32..9835e4b3a 100644--- a/desktop/test/super_tab_v3_ux_fixes_test.dart+++ b/desktop/test/super_tab_v3_ux_fixes_test.dart@@ -49,7 +49,6 @@ void main() {account: 'owner',initial: {'tabId': 'tab',- 'projectsGroupOpen': true,'accountId': 'owner','selectedId': 'swarm-buddy-owner',},@@ -87,16 +86,20 @@ void main() {'the Buddy\'s', (tester) async {final (c, _) = await showDesktop(tester);expect(_lit('super-swarm-buddy'), isTrue);+ // A project's Board opens from the Projects grid (task #4466).+ await tester.tap(find.byKey(const ValueKey('super-projects')));+ await tester.pump();await tester.tap(_key('super-group-lead'));await tester.pumpAndSettle();expect(c.selectedId, 'swarm-buddy-owner');- expect(_lit('super-group-lead'), isTrue);+ // The Board is one of the Projects grid's: Projects is lit (task #4466).+ expect(_lit('super-projects'), isTrue);expect(_lit('super-swarm-buddy'), isFalse);// Choosing the Buddy again puts its chat in the middle, and its row is the lit one.await tester.tap(_key('super-swarm-buddy'));await tester.pumpAndSettle();expect(_lit('super-swarm-buddy'), isTrue);- expect(_lit('super-group-lead'), isFalse);+ expect(_lit('super-projects'), isFalse);});// Finding 3: a page or Manage in the middle turned the board layout off, and the Tasks pane with it.@@ -113,7 +116,8 @@ void main() {expect(tasks, findsOneWidget);for (final row in ['super-decisions',- 'super-leaderboard',+ // Humans opens the Leaderboard (task #4466).+ 'project-sidebar-humans','super-manage',]) {await tester.tap(_key(row));diff --git a/desktop/test/super_tab_weekly_leaderboard_test.dart b/desktop/test/super_tab_weekly_leaderboard_test.dartindex e922af1f1..37494bd61 100644--- a/desktop/test/super_tab_weekly_leaderboard_test.dart+++ b/desktop/test/super_tab_weekly_leaderboard_test.dart@@ -179,7 +179,8 @@ void main() {shots,'weekly-board-tasks-${brightness.name}',);- await tester.tap(find.byKey(const ValueKey('super-leaderboard')));+ // Humans opens the whole board (task #4466).+ await tester.tap(find.byKey(const ValueKey('project-sidebar-humans')));await tester.pumpAndSettle();expect(find.text('This week'), findsOneWidget);expect(find.byKey(const ValueKey('weekly-person-peer')), findsOneWidget);diff --git a/desktop/test/swarm_elements_gallery_test.dart b/desktop/test/swarm_elements_gallery_test.dartindex e51a598e3..575ae45cc 100644--- a/desktop/test/swarm_elements_gallery_test.dart+++ b/desktop/test/swarm_elements_gallery_test.dart@@ -7,6 +7,8 @@ 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/state/harness_activity.dart';+import 'package:harness/shared/theme/app_icons.dart';import 'package:harness/shared/theme/app_type.dart';import 'package:harness/super_tabs/buddy_rows.dart';import 'package:harness/super_tabs/avatar_art.dart';@@ -109,7 +111,7 @@ Future<void> _show(grid.AppTheme.brightness.value = brightness;addTearDown(() => grid.AppTheme.brightness.value = old);tester.view.devicePixelRatio = 1;- tester.view.physicalSize = const Size(760, 500);+ tester.view.physicalSize = const Size(760, 720);addTearDown(tester.view.reset);await tester.pumpWidget(MaterialApp(@@ -164,6 +166,7 @@ List<GalleryRegion> _regions(WidgetTester tester) {of: find.byType(SuperTabTaskStatusMark),matching: find.byType(Icon),);+ final agentMarks = find.byType(SuperTabAgentMark);return [for (var i = 0; i < faces.evaluate().length; i++)if (tester.widget<SuperTabAvatarFace>(faces.at(i)) case final face)@@ -193,6 +196,13 @@ List<GalleryRegion> _regions(WidgetTester tester) {rect: tester.getRect(marks.at(i)),limit: _glyph,),+ for (var i = 0; i < agentMarks.evaluate().length; i++)+ (+ name:+ 'agent mark ${tester.widget<SuperTabAgentMark>(agentMarks.at(i)).activity.name}',+ rect: tester.getRect(agentMarks.at(i)),+ limit: _glyph,+ ),];}@@ -392,7 +402,7 @@ class _Gallery extends StatelessWidget {),],),- title('Row and task card'),+ title('Left pane rows and task card'),Row(crossAxisAlignment: CrossAxisAlignment.start,children: [@@ -400,21 +410,58 @@ class _Gallery extends StatelessWidget {width: 280,child: Column(children: [- SuperTabBuddyRow(- agentId: 'id-River',- agent: _agent('River', kind: 'pm'),- name: 'River',- note: 'harness',- tooltip: 'River',- lead: true,+ // The Desktop left pane (task #4466).+ SuperTabQuietHeading.org('autonomous.ai', onTap: () {}),+ SuperTabQuietRow(+ leading: const Icon(+ AppIcons.inbox,+ size: AppIcons.inlineSize,+ ),+ name: 'Decisions',+ detail: '3',+ unread: true,onTap: () {},),- SuperTabBuddyRow(- agentId: 'id-Quinn',- agent: _agent('Quinn'),- name: 'Quinn',- tooltip: 'Quinn',- selected: true,+ SuperTabQuietHeading(+ 'My agents',+ collapsed: false,+ onTap: () {},+ ),+ for (final (name, lead, detail, mark, selected) in [+ ('River', true, 'harness', null, false),+ ('Quinn', false, null, null, true),+ ('Kai', false, null, HarnessActivity.working, false),+ (+ 'Sage',+ false,+ 'offline',+ HarnessActivity.needsInput,+ false,+ ),+ ('Lark', false, null, HarnessActivity.failed, false),+ ])+ SuperTabQuietRow(+ leading: SuperTabAvatar.agent(+ _agent(name, kind: lead ? 'pm' : null),+ size: SuperTabQuietRow.faceSize,+ engineBadge: false,+ lead: lead,+ ),+ name: name,+ detail: detail,+ selected: selected,+ mark: mark == null ? null : SuperTabAgentMark(mark),+ markColumn: true,+ onTap: () {},+ ),+ SuperTabQuietHeading('Humans', onTap: () {}),+ SuperTabQuietRow(+ leading: SuperTabAvatar.person(+ _person,+ size: SuperTabQuietRow.faceSize,+ ),+ name: 'dee',+ detail: '120',onTap: () {},),],diff --git a/docs/plans/2026-11-07-swarm-left-pane-plan.md b/docs/plans/2026-11-07-swarm-left-pane-plan.mdnew file mode 100644index 000000000..477829d1f--- /dev/null+++ b/docs/plans/2026-11-07-swarm-left-pane-plan.md@@ -0,0 +1,149 @@+# Swarm left pane: one quiet row style (task #4466) Implementation Plan++Way of working: the project's Engineer flow (plan first; each task's failing test committed before its code; one pull+request; one independent review). No subagent-driven development and no execution handoff.++**Goal:** Redraw the Desktop's Swarm left pane as anh Dee agreed (11-07 15:35): the org name, Decisions with its count,+one Projects link that opens a grid of projects in the middle, My agents, then Humans with their points, all in one+quiet row style.++**Architecture:** One new row widget, `SuperTabQuietRow`, and one heading, `SuperTabQuietHeading`, in `buddy_rows.dart`+draw every Desktop left-pane line (face or icon, name, one detail on the right). `ProjectSidebar` lays them out top to+bottom when `board` is true; the phone and web layout (`board: false`) keeps today's rows. A new `SwarmPage.projects`+shows `SuperTabProjectsPage` (`projects_page.dart`) in the middle, a grid of project cards, most recent first.++**Tech Stack:** Flutter (Desktop), flutter_test widget tests with captured screenshots, light and dark.++**Spec:** task #4466 brief (anh Dee, 11-07 15:35 'sure'), quoted in Global Constraints.++```text+ autonomous.ai ⌄ <- semibold 13 primary; ⌄ only on hover+ ⊡ Decisions 3 <- inbox icon; count 12 tertiary, right+ ▦ Projects <- grid icon; opens the grid in the middle++ My agents ⌄ <- 12 quiet heading; ⌄ only on hover+ ◉ Buddy+ ◎ River harness <- a Lead: the project it leads+ ◉ Leftquiet offline+ + New agent++ Humans <- 12 quiet heading; opens the Leaderboard+ D dee 120 <- photo or initial on a grey disc; points+ K ken15 80++ ⚙ Manage <- at the foot, as today++ middle, Projects: ┌ harness ────────────┐ ┌ website ───────────┐+ │ autonomous-ai/open… │ │ Private │+ └─────────────────────┘ └────────────────────┘+```++## Global Constraints++- Six rules: 1. Grey everywhere; colour only on agent faces. 2. Blue only for the main action; red only for failed.+ 3. Three text sizes: 14 chat, 13 names, 12 details; in lists, bold means unread. 4. Every row: face, name, one quiet+ detail on the right. 5. Dropdowns stay plain text until you hover. 6. If it doesn't help you decide, it's gone.+- Rows are 30 high with a 20 face in a fixed column, so all names start on one line. The right detail is 12 tertiary+ (`AppPalette.textFaint`, the third of the three greys), right-aligned in one column, with no brackets.+- Read names are secondary text, unread semibold primary, the selected row a neutral fill (`SidebarInk.selected`).+- People keep a photo or an initial on a neutral grey disc.+- Desktop only (`ProjectSidebar.board`); phone and web rows unchanged. Named roles only; `check-ui-style.py` allowlist+ never grows. Light and dark, at 880 and wide. Out of scope: dropping Buddy as a kind; the top bar (#4465); the+ faces, Lead ring and task marks themselves (#4461), which this builds on after main has them.+- Every element changed goes into the design doc's Swarm elements section and the gallery test in this PR.++## Review Focus++- A Swarm with many people: Humans lists at most 8, most points first; the heading opens the whole board.+- No board yet (loading, an older server, a read that failed): Humans shows the heading and no rows, never a spinner.+- A Board open in the middle lights Projects, and nothing else; Decisions or the grid open light their own row.+- A long org, agent or project name truncates before the right detail, which never wraps or moves its column.+- 200% text: rows grow rather than clip (min height 30, not a fixed height).++---++### Task 1: the quiet row and heading++**Files:**+- Modify: `desktop/lib/super_tabs/buddy_rows.dart`+- Test: `desktop/test/super_tab_quiet_rows_test.dart` (new)++**Interfaces:**+- Produces: `SuperTabQuietRow({Key? key, required Widget leading, required String name, String? detail, bool selected,+ bool unread, String? tooltip, VoidCallback? onTap, bool strong = false})`; `SuperTabQuietRow.height = 30`,+ `SuperTabQuietRow.faceSize = 20`. `strong` draws the name semibold primary whatever its unread (the org name).+ `SuperTabQuietHeading(String title, {Key? key, VoidCallback? onTap, bool? collapsed})`: 12, secondary; with+ [collapsed] given, a chevron after the title only while hovered. `SuperTabHoverChevron` is internal.+- [ ] Test: a row is at least 30 high; its leading column is the same width for a face and an icon, so two rows' names+ start at one x; the detail is 12, `textFaint`, right-aligned at the row's end; a read name is `textSecondary`+ regular, an unread one `textPrimary` semibold; selected fills `SidebarInk.selected`; Semantics says "Unread" when+ unread. A heading draws no chevron until hovered, then `chevronDown` (or `chevronRight` when collapsed).+- [ ] Run, watch it fail (no such widgets).+- [ ] Implement both in `buddy_rows.dart`.+- [ ] Run, pass. Commit.++### Task 2: the Desktop left pane, top to bottom++**Files:**+- Modify: `desktop/lib/super_tabs/project_sidebar.dart`, `desktop/lib/super_tabs/places.dart` (`SwarmPage.projects`),+ `desktop/lib/super_tabs/controller.dart` (remove the Projects fold: `projectsGroupOpen`, `projectsOpen`,+ `toggleProjectsGroup`, which only the Desktop's Projects section used)+- Modify: `desktop/lib/super_tabs/buddy_rows.dart` (drop `SuperTabBuddyRow.agent`, `crown` and the status-at-end+ branch, used only by the Desktop's rows)+- Test: `desktop/test/super_tab_v3_left_test.dart` (rewrite the Projects-folding, status and crown cases)++**Interfaces:**+- Consumes: Task 1.+- Produces: `ProjectSidebar.leaderboard` (`SuperTabLeaderboardReader?`); keys `super-swarm-switcher`,+ `super-decisions`, `super-projects`, `project-sidebar-agents`, `super-agent-<id>`, `super-swarm-buddy`,+ `super-new-agent-row`, `project-sidebar-humans`, `super-human-<personId>`, `super-manage`.+- [ ] Test: on the Desktop the order is org, Decisions, Projects, My agents, Humans, Manage; the org row shows no+ chevron until hovered; Decisions shows its waiting count on the right; there is no project row, Leaderboard row or+ unread filter; Projects calls `onPage(SwarmPage.projects)` and is lit while the projects page or a Board is open; a+ Lead's detail is its project's name and an offline agent's is "offline"; no `ActivityMark` and no brackets in the+ pane; Humans lists the board's people, most points first, at most 8, with points on the right, and a tap on the+ heading or a person calls `onPage(SwarmPage.leaderboard)`; `board: false` keeps today's rows.+- [ ] Run, watch it fail.+- [ ] Implement; remove what the Desktop no longer draws.+- [ ] Run the test and the other left-pane tests (`super_tab_sidebar_test.dart`, `super_tab_v3_left_shots_test.dart`).+ Commit.++### Task 3: the Projects grid in the middle++**Files:**+- Create: `desktop/lib/super_tabs/projects_page.dart`+- Modify: `desktop/lib/super_tabs/view.dart` (show it for `SwarmPage.projects`, title "Projects", pass `_board` to the+ sidebar as `leaderboard`)+- Test: `desktop/test/super_tab_projects_page_test.dart` (new); every Desktop test that opened a Board by tapping its+ project row now taps `super-projects` first (the card keeps the key `super-group-<leadConversationId>`).++**Interfaces:**+- Produces: `SuperTabProjectsPage({required SuperTabController controller, required ValueChanged<SuperTabProject>+ onOpen, VoidCallback? onNewProject})`; `superTabProjectsByRecent(SuperTabController) → List<SuperTabProject>`, most+ recent first by the greatest `lastMessageSequence` of the project's conversations, then by name.+- [ ] Test: the page lists every project as a card, most recent first; a card shows the name (13 semibold primary)+ and one 12 tertiary line (the repository's `owner/name`, or "Private" for a private project without one); a tap+ opens that project's Board; New project is the one blue button and opens the New project form; an empty Swarm+ says "No projects yet".+- [ ] Run, watch it fail.+- [ ] Implement; `GridView` with a max card width so the grid fills 880 and wide windows.+- [ ] Run; move the Board-opening tests. Commit.++### Task 4: people on a grey disc++**Files:**+- Modify: `desktop/lib/super_tabs/avatar_art.dart` (a `person:` identity's initial disc is neutral)+- Test: `desktop/test/super_tab_avatar_test.dart`+- [ ] Test: a person without a photo draws its initial on `AppSurface` neutral grey with `textSecondary` ink, the same+ for every name; an agent's initial (no face) keeps its hue.+- [ ] Run, fail; implement; pass. Commit.++### Task 5: the design doc and the gallery++**Files:**+- Modify: `desktop/design/desktop-design-system.md` (Swarm elements: the quiet row, the quiet heading, the org row,+ the Projects grid card; replace the left pane's People lines in Numbers and rankings)+- Modify: the Swarm elements gallery test from #4461, once main has it (`desktop/test/swarm_elements_gallery_test.dart`+ and its light and dark images)+- [ ] Gallery entries for each element, light and dark; regenerate the images, inspect, commit.+- [ ] Screenshots of the whole pane and the grid, light and dark, 880 and 1440, for the PR.diff --git a/docs/plans/assets/swarm-left-pane/board-880-dark.png b/docs/plans/assets/swarm-left-pane/board-880-dark.pngnew file mode 100644index 000000000..b993b0a69Binary files /dev/null and b/docs/plans/assets/swarm-left-pane/board-880-dark.png differdiff --git a/docs/plans/assets/swarm-left-pane/board-880-light.png b/docs/plans/assets/swarm-left-pane/board-880-light.pngnew file mode 100644index 000000000..7115e2d7cBinary files /dev/null and b/docs/plans/assets/swarm-left-pane/board-880-light.png differdiff --git a/docs/plans/assets/swarm-left-pane/board-dark.png b/docs/plans/assets/swarm-left-pane/board-dark.pngnew file mode 100644index 000000000..7a9f28e36Binary files /dev/null and b/docs/plans/assets/swarm-left-pane/board-dark.png differdiff --git a/docs/plans/assets/swarm-left-pane/board-light.png b/docs/plans/assets/swarm-left-pane/board-light.pngnew file mode 100644index 000000000..78953dba9Binary files /dev/null and b/docs/plans/assets/swarm-left-pane/board-light.png differdiff --git a/docs/plans/assets/swarm-left-pane/folded-dark.png b/docs/plans/assets/swarm-left-pane/folded-dark.pngnew file mode 100644index 000000000..7b7dc787bBinary files /dev/null and b/docs/plans/assets/swarm-left-pane/folded-dark.png differdiff --git a/docs/plans/assets/swarm-left-pane/folded-light.png b/docs/plans/assets/swarm-left-pane/folded-light.pngnew file mode 100644index 000000000..9cc9099d5Binary files /dev/null and b/docs/plans/assets/swarm-left-pane/folded-light.png differdiff --git a/docs/plans/assets/swarm-left-pane/no-agents-dark.png b/docs/plans/assets/swarm-left-pane/no-agents-dark.pngnew file mode 100644index 000000000..3988551c7Binary files /dev/null and b/docs/plans/assets/swarm-left-pane/no-agents-dark.png differdiff --git a/docs/plans/assets/swarm-left-pane/no-agents-light.png b/docs/plans/assets/swarm-left-pane/no-agents-light.pngnew file mode 100644index 000000000..1e823fbeeBinary files /dev/null and b/docs/plans/assets/swarm-left-pane/no-agents-light.png differdiff --git a/docs/plans/assets/swarm-left-pane/projects-880-dark.png b/docs/plans/assets/swarm-left-pane/projects-880-dark.pngnew file mode 100644index 000000000..429645cecBinary files /dev/null and b/docs/plans/assets/swarm-left-pane/projects-880-dark.png differdiff --git a/docs/plans/assets/swarm-left-pane/projects-880-light.png b/docs/plans/assets/swarm-left-pane/projects-880-light.pngnew file mode 100644index 000000000..d703eb35fBinary files /dev/null and b/docs/plans/assets/swarm-left-pane/projects-880-light.png differdiff --git a/docs/plans/assets/swarm-left-pane/projects-dark.png b/docs/plans/assets/swarm-left-pane/projects-dark.pngnew file mode 100644index 000000000..ad0fa6966Binary files /dev/null and b/docs/plans/assets/swarm-left-pane/projects-dark.png differdiff --git a/docs/plans/assets/swarm-left-pane/projects-light.png b/docs/plans/assets/swarm-left-pane/projects-light.pngnew file mode 100644index 000000000..fa013e361Binary files /dev/null and b/docs/plans/assets/swarm-left-pane/projects-light.png differ