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: Product Manager role words, Board at laptop size, new-project visibility, left pane and audit polish (#4445) (#3532)
0xken156fa2bb7be98d
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dartindex c9fd449c2..f6f3b2167 100644--- a/desktop/lib/screens/swarm_screen.dart+++ b/desktop/lib/screens/swarm_screen.dart@@ -85,7 +85,6 @@ import '../state/new_harness.dart';import '../state/harness_launch_integration.dart';import '../super_tabs/launch.dart';import '../super_tabs/message_link.dart' show swarmMessageLinkInbox;-import '../super_tabs/buddy_chat.dart' show countText;import '../super_tabs/buddy_chat_shortcut.dart';import '../super_tabs/workspace.dart';import '../super_tabs/quick_switcher.dart';@@ -122,7 +121,6 @@ import '../widgets/session_work_dialog.dart';import '../widgets/web_download_button.dart';import '../widgets/workspace_share_button.dart';import '../widgets/workspace_account_button.dart';-import '../widgets/workspace_store_button.dart';import '../widgets/grid_model_picker.dart';import '../widgets/workspace_subscription_usage.dart';import '../store/store_mark.dart';@@ -2520,8 +2518,9 @@ class _SwarmScreenState extends State<SwarmScreen> {Future<void> _actOnNative(MethodCall call) async {if (mounted && call.method == 'keymapCommand') {final command = (call.arguments as Map?)?['command'];- if (command is String && dispatchSwarmQuickSwitcherCommand(command))+ if (command is String && dispatchSwarmQuickSwitcherCommand(command)) {return;+ }}if (mounted && call.method == 'keymapPending') {@@ -3865,6 +3864,17 @@ class _SwarmScreenState extends State<SwarmScreen> {return;}final search = source == _NewHarnessSource.workspace ? _search : null;+ // Nothing but "a new agent here": Cmd-N, File ▸ New Agent, search.+ final plain =+ source == _NewHarnessSource.workspace &&+ !newSwarmProject &&+ superTabConversationId == null &&+ (split ?? search?.split) == null &&+ (placement ?? search?.placement) == null &&+ engine == null &&+ folder == null &&+ projectName == null &&+ (search == null || _superTabAddTarget == null);// A pane never lands in the store tab: New Harness from there goes to// the empty starter tab (or a fresh one), the way New Tab does.placement ??= search?.placement;@@ -3876,6 +3886,15 @@ class _SwarmScreenState extends State<SwarmScreen> {final superTab = app.swarms.where((s) => s.id == target && s.isSuperTab).firstOrNull;+ // Where the left pane offers + New agent, a plain new agent is that one+ // (audit 1.3.89 finding 11), and a reader it is hidden from gets nothing.+ final board = superTab?.superTabId == null || kIsWeb+ ? null+ : app.superTabs.peek(superTab!.superTabId!);+ if (plain && board != null) {+ if (!board.canWrite) return;+ newSwarmAgent = true;+ }final conversation =superTabConversationId ??(superTab?.superTabId == nulldiff --git a/desktop/lib/state/new_harness.dart b/desktop/lib/state/new_harness.dartindex 0535e59eb..c9e089985 100644--- a/desktop/lib/state/new_harness.dart+++ b/desktop/lib/state/new_harness.dart@@ -2355,7 +2355,8 @@ class NewHarnessController extends ChangeNotifier {/// lost has still to be checked on.bool get locked => busy || checking || linkingProfile;- /// + New agent's Member or Lead (task #4196), or null outside one.+ /// + New agent's Agent (`member`) or Product Manager (`lead`) (task #4196),+ /// or null outside one.String? get agentKind => integration?.agentKind;void setAgentKind(String kind) {diff --git a/desktop/lib/super_tabs/buddies.dart b/desktop/lib/super_tabs/buddies.dartindex d72081d24..bd7836ed8 100644--- a/desktop/lib/super_tabs/buddies.dart+++ b/desktop/lib/super_tabs/buddies.dart@@ -589,7 +589,13 @@ class _RenameBuddyDialogState extends State<_RenameBuddyDialog> {),if (_error case final error?) ...[const SizedBox(height: 12),- Text(error, style: DesktopChrome.control()),+ Text(+ error,+ // The Buddy card's error colour.+ style: DesktopChrome.control(+ color: grid.AppPalette.dangerFill,+ ),+ ),],],),diff --git a/desktop/lib/super_tabs/buddy_machines.dart b/desktop/lib/super_tabs/buddy_machines.dartindex 4719d3473..5c142f001 100644--- a/desktop/lib/super_tabs/buddy_machines.dart+++ b/desktop/lib/super_tabs/buddy_machines.dart@@ -204,7 +204,8 @@ class _BuddyMachineFieldState extends State<BuddyMachineField> {final fitted = widget.fitNames? AppSelectField.fitWidth(context,- labels: [for (final m in widget.machines) m.name],+ // The prompt too, shown when no machine can be picked.+ labels: [label, for (final m in widget.machines) m.name],textStyle: style,) +grid.AppControl.iconSizediff --git a/desktop/lib/super_tabs/buddy_model.dart b/desktop/lib/super_tabs/buddy_model.dartindex 8b1eb31dd..5b99285c8 100644--- a/desktop/lib/super_tabs/buddy_model.dart+++ b/desktop/lib/super_tabs/buddy_model.dart@@ -2,6 +2,7 @@ import 'dart:async';import 'package:flutter/material.dart';+import '../core/runtime_model_name.dart';import '../shared/theme/app_icons.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/widgets/app_menu.dart';@@ -140,7 +141,9 @@ class _BuddyModelLineState extends State<BuddyModelLine> {style: DesktopChrome.metadata(),): _anchor(- label: current == null ? 'Your subscription' : nameOf(current),+ label: current == null+ ? _subscriptionModel(agent)+ : nameOf(current),offers: offers,phone: phone,busy: busy,@@ -204,6 +207,14 @@ class _BuddyModelLineState extends State<BuddyModelLine> {required bool busy,}) {final current = widget.agent.gridModel;+ // Only Claude switches to a shared model: on its subscription, any other engine's menu would hold the one row+ // already chosen.+ if (current == null && widget.agent.engine != 'claude') {+ return Text(+ label,+ style: DesktopChrome.metadata(color: DesktopChrome.foreground),+ );+ }final pool = c.snapshot!.pool(widget.agent.machineId);Widget row(AppMenuItem item) => fingerTarget(enabled: phone, item);Widget words(String text) => Padding(@@ -285,3 +296,13 @@ class _BuddyModelLineState extends State<BuddyModelLine> {);}}++/// The model a Buddy on its own subscription runs, as people know it ("Opus 5.5"); while its configuration names none+/// but the engine's default, the subscription it runs on.+String _subscriptionModel(SuperTabAgent agent) =>+ switch (agent.configuration['model']) {+ final String id when id.isNotEmpty && id != 'default' => modelDisplayName(+ id,+ ),+ _ => 'Your subscription',+ };diff --git a/desktop/lib/super_tabs/buddy_restart.dart b/desktop/lib/super_tabs/buddy_restart.dartindex 0c69329bc..4d90982c7 100644--- a/desktop/lib/super_tabs/buddy_restart.dart+++ b/desktop/lib/super_tabs/buddy_restart.dart@@ -257,6 +257,9 @@ class _RestartBuddyDialogState extends State<_RestartBuddyDialog> {bool _busy = false;String? _error;+ /// Flags an older Harness ignored: a warning, as the Buddy card colours it.+ bool _warning = false;+@overridevoid dispose() {_flags.dispose();@@ -267,7 +270,10 @@ class _RestartBuddyDialogState extends State<_RestartBuddyDialog> {final app = this.app;if (_busy) return;if (app == null) {- setState(() => _error = 'Restart is not available here.');+ setState(() {+ _error = 'Restart is not available here.';+ _warning = false;+ });return;}setState(() {@@ -289,6 +295,7 @@ class _RestartBuddyDialogState extends State<_RestartBuddyDialog> {setState(() {_busy = false;_error = result.message;+ _warning = result.outcome == BuddyRestartOutcome.ignored;});}@@ -336,7 +343,12 @@ class _RestartBuddyDialogState extends State<_RestartBuddyDialog> {Text(error,key: const ValueKey('super-buddy-launch-args-error'),- style: DesktopChrome.control(),+ // The Buddy card's colours for the same results.+ style: DesktopChrome.control(+ color: _warning+ ? grid.AppPalette.warn+ : grid.AppPalette.dangerFill,+ ),),],],diff --git a/desktop/lib/super_tabs/buddy_rows.dart b/desktop/lib/super_tabs/buddy_rows.dartindex 57ba02c63..c555f1719 100644--- a/desktop/lib/super_tabs/buddy_rows.dart+++ b/desktop/lib/super_tabs/buddy_rows.dart@@ -41,6 +41,50 @@ class SuperTabCountBadge extends StatelessWidget {}}+/// 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).+class SuperTabRowGround extends StatefulWidget {+ const SuperTabRowGround({+ super.key,+ required this.color,+ required this.child,+ });+ final Color color;+ final Widget child;++ @override+ State<SuperTabRowGround> createState() => _SuperTabRowGroundState();+}++class _SuperTabRowGroundState extends State<SuperTabRowGround> {+ var _focused = false;++ @override+ Widget build(BuildContext context) => Focus(+ canRequestFocus: false,+ skipTraversal: true,+ onFocusChange: (focused) {+ if (focused != _focused) setState(() => _focused = focused);+ },+ child: Material(+ color: widget.color,+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ clipBehavior: Clip.antiAlias,+ child: DecoratedBox(+ position: DecorationPosition.foreground,+ decoration: _focused+ ? BoxDecoration(+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ border: Border.all(color: DesktopChrome.focusRing, width: 2),+ )+ : const BoxDecoration(),+ child: widget.child,+ ),+ ),+ );+}+/// A person's Buddy chat in a project, in the sidebar's Buddies: its Buddy's/// avatar and name ("Buddy" while none runs), with the project in brackets/// after it when the Swarm has several: "Wren (web-2)". New lines, the PM's@@ -111,19 +155,17 @@ class SuperTabBuddyRow extends StatelessWidget {: grid.SidebarInk.muted(context);return Padding(padding: const EdgeInsets.only(bottom: grid.AppDesktop.listRowGap),- child: Material(+ child: SuperTabRowGround(color: selected? grid.SidebarInk.selectedFill(context): Colors.transparent,- borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),- clipBehavior: Clip.antiAlias,child: Semantics(button: true,selected: selected,child: InkWell(onTap: onTap,hoverColor: grid.SidebarInk.hoverFill(context),- focusColor: grid.SidebarInk.hoverFill(context),+ focusColor: Colors.transparent,borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),child: Tooltip(message: tooltip,diff --git a/desktop/lib/super_tabs/join_dialog.dart b/desktop/lib/super_tabs/join_dialog.dartindex ffc58f581..2d0cb48df 100644--- a/desktop/lib/super_tabs/join_dialog.dart+++ b/desktop/lib/super_tabs/join_dialog.dart@@ -2,6 +2,7 @@ import 'dart:async';import 'package:flutter/material.dart';+import '../shared/theme/app_theme.dart' as grid;import '../shared/widgets/app_dialog.dart';import '../state/app_state.dart';import '../widgets/desktop_chrome.dart';@@ -307,10 +308,16 @@ class _SwarmJoinDialogState extends State<SwarmJoinDialog> {),],const SizedBox(height: 12),- Text(widget.accountEmail, style: DesktopChrome.metadata()),+ Text(+ 'Signed in as ${widget.accountEmail}',+ style: DesktopChrome.metadata(),+ ),if (_error != null) ...[const SizedBox(height: 12),- Text(_error!, style: DesktopChrome.text()),+ Text(+ _error!,+ style: DesktopChrome.text(color: grid.AppPalette.dangerFill),+ ),],],),diff --git a/desktop/lib/super_tabs/launch.dart b/desktop/lib/super_tabs/launch.dartindex 2a87fad8b..849603b89 100644--- a/desktop/lib/super_tabs/launch.dart+++ b/desktop/lib/super_tabs/launch.dart@@ -224,10 +224,11 @@ class SuperTabLaunch {? saved['agentKind'] as String?: null,ownMachinesOnly: saved['newAgent'] == true,+ // + New agent's Product Manager makes a project too (audit+ // finding 14); the form shows the choice only while it is chosen.projectVisibility:- saved['newAgent'] != true &&- saved['lead'] == true &&- saved['coordinator'] != true+ saved['newAgent'] == true ||+ saved['lead'] == true && saved['coordinator'] != true? saved['visibility'] as String? ?? 'public': null,projectVisibilityLocked:@@ -1181,17 +1182,37 @@ class SuperTabLaunch {return;}final base = engine ?? saved['engine'] as String? ?? 'claude';- saved['chatRequest'] ??= {- 'operationId': '${saved['operationId']}-chat',- 'command': {- 'type': 'agent.new',- 'kind': 'regular',- 'machineId': machine,- 'engine': base,- 'name': base == 'codex' ? 'Codex' : 'Claude Code',- 'local': true,- },- };+ if (saved['chatRequest'] == null) {+ // The first free of Claude Code, Claude Code 2, …: two agents of one+ // engine read apart in the left pane.+ final tab = saved['tabId'] as String;+ final snapshot =+ app.superTabs.peek(tab)?.snapshot ??+ await app.superTabs.readSnapshot(tab);+ checkAccount();+ final taken = {+ for (final agent in snapshot.agents) ...[+ agent.name,+ ?agent.displayName,+ ],+ };+ final label = base == 'codex' ? 'Codex' : 'Claude Code';+ var name = label;+ for (var n = 2; taken.contains(name); n++) {+ name = '$label $n';+ }+ saved['chatRequest'] = {+ 'operationId': '${saved['operationId']}-chat',+ 'command': {+ 'type': 'agent.new',+ 'kind': 'regular',+ 'machineId': machine,+ 'engine': base,+ 'name': name,+ 'local': true,+ },+ };+ }await persist();final Map<String, dynamic> created;try {diff --git a/desktop/lib/super_tabs/project_add_people.dart b/desktop/lib/super_tabs/project_add_people.dartindex 4e3ec009e..838e0b7ef 100644--- a/desktop/lib/super_tabs/project_add_people.dart+++ b/desktop/lib/super_tabs/project_add_people.dart@@ -165,7 +165,7 @@ Future<void> showProjectAddPeople(if (c.hasPendingAction)TextButton(onPressed: c.saving ? null : c.retry,- child: const Text('Check pending action'),+ child: const Text('Check again'),),],),diff --git a/desktop/lib/super_tabs/project_options.dart b/desktop/lib/super_tabs/project_options.dartindex 25f43a80e..a954f5392 100644--- a/desktop/lib/super_tabs/project_options.dart+++ b/desktop/lib/super_tabs/project_options.dart@@ -304,7 +304,7 @@ Future<void> showProjectAction(if (c.hasPendingAction)TextButton(onPressed: c.saving ? null : c.retry,- child: const Text('Check pending action'),+ child: const Text('Check again'),),],),diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dartindex b9bd7b320..6da75dfbb 100644--- a/desktop/lib/super_tabs/project_sidebar.dart+++ b/desktop/lib/super_tabs/project_sidebar.dart@@ -179,10 +179,8 @@ class ProjectSidebar extends StatelessWidget {bool? unread,}) => Padding(padding: const EdgeInsets.only(bottom: 2),- child: Material(+ child: SuperTabRowGround(color: selected ? grid.SidebarInk.selected : Colors.transparent,- borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),- clipBehavior: Clip.antiAlias,child: Semantics(button: true,selected: selected,@@ -190,7 +188,7 @@ class ProjectSidebar extends StatelessWidget {key: ValueKey(key),onTap: onTap,hoverColor: grid.SidebarInk.hover,- focusColor: grid.SidebarInk.hover,+ focusColor: Colors.transparent,borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),child: Row(children: [@@ -401,7 +399,7 @@ class ProjectSidebar extends StatelessWidget {key: ValueKey(key ?? 'super-group-${group.id}'),onTap: !tappable ? null : onTap ?? () => onSelect(group.id),hoverColor: Colors.transparent,- focusColor: grid.SidebarInk.hover,+ focusColor: Colors.transparent,borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),child: Row(children: [@@ -718,11 +716,13 @@ class ProjectSidebar extends StatelessWidget {: '$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'- : pm- ? snapshot.leadProjectForAgent(agent.id)?.name- : null,+ : switch (pm ? snapshot.leadProjectForAgent(agent.id) : null) {+ final project? => '· ${project.name}',+ null => null,+ },status: _buddyMark(agent),selected: _chatLit(chat),unread: chat != null && controller.unreadShown(chat),@@ -734,6 +734,24 @@ class ProjectSidebar extends StatelessWidget {);}+ /// Open Projects over a Swarm with none, in the names' column.+ Widget _noProjects() => Padding(+ key: const ValueKey('super-projects-empty'),+ padding: EdgeInsets.fromLTRB(+ SuperTabSectionHeading.indentFor(0) + _iconColumn,+ SwarmType.sidebarRowPadding(compact: compact),+ grid.AppDesktop.controlGap,+ SwarmType.sidebarRowPadding(compact: compact),+ ),+ child: Text(+ 'No projects yet.',+ style: SwarmType.sidebar(+ compact: compact,+ color: grid.SidebarInk.inkMuted,+ ),+ ),+ );+/// The Buddy's activity mark, drawn as the Agents list draws an agent's.Widget? _buddyMark(SuperTabAgent agent) {final app = this.app;@@ -797,6 +815,23 @@ class ProjectSidebar extends StatelessWidget {SuperTabSnapshot? snapshot,_SidebarReading reading, {bool taggedOnly = false,+ }) => [+ for (final read in _listed(snapshot, reading, taggedOnly: taggedOnly))+ (+ read.project.name,+ Column(+ key: ValueKey('super-project-${read.project.id}'),+ mainAxisSize: MainAxisSize.min,+ children: [_row(read.lead!, reading: read)],+ ),+ ),+ ];++ /// The projects Projects lists, each with a chat, in its order; [taggedOnly] as [_channels].+ Iterable<_ProjectReading> _listed(+ SuperTabSnapshot? snapshot,+ _SidebarReading reading, {+ bool taggedOnly = false,}) {final hidden = superTabHiddenProjects(controller, app: app);return [@@ -807,17 +842,20 @@ class ProjectSidebar extends StatelessWidget {(attention?.chatTagsIn(read.lead!.id) ?? 0) > 0) &&(!controller.unreadOnly || _hasUnread(read)) &&!_paneless(project, read.lead!, hidden))- (- project.name,- Column(- key: ValueKey('super-project-${project.id}'),- mainAxisSize: MainAxisSize.min,- children: [_row(read.lead!, reading: read)],- ),- ),+ 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.@override@@ -850,12 +888,19 @@ class ProjectSidebar extends StatelessWidget {required icon,required onTap,required trailing,- }) => _navigationRow(- key: 'super-swarm-switcher',- label: label,- icon: icon,- onTap: onTap,- trailing: trailing,+ }) => Tooltip(+ // A long Swarm name is cut in the row; hovering reads all of it.+ message: label,+ excludeFromSemantics: true,+ positionDelegate: _besideTheRow,+ constraints: const BoxConstraints(maxWidth: 260),+ child: _navigationRow(+ key: 'super-swarm-switcher',+ label: label,+ icon: icon,+ onTap: onTap,+ trailing: trailing,+ ),),),_ => null,@@ -947,6 +992,9 @@ class ProjectSidebar extends StatelessWidget {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,@@ -955,12 +1003,17 @@ class ProjectSidebar extends StatelessWidget {// 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).- for (final (_, channel) in _channels(- snapshot,- reading,- taggedOnly: board && !controller.projectsOpen,- ))- channel,+ 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.@@ -1014,8 +1067,9 @@ class ProjectSidebar extends StatelessWidget {}}-/// A sidebar row's ground: the selected fill, or the hover fill while the-/// pointer is anywhere over it, one shape across the row's whole width.+/// A project row's ground: the selected fill, or the hover fill while the+/// pointer is anywhere over it, one shape across the row's whole width, and+/// the focus ring ([SuperTabRowGround]).class _RowSurface extends StatefulWidget {const _RowSurface({required this.selected, required this.child});final bool selected;@@ -1032,14 +1086,12 @@ class _RowSurfaceState extends State<_RowSurface> {Widget build(BuildContext context) => MouseRegion(onEnter: (_) => setState(() => _hovered = true),onExit: (_) => setState(() => _hovered = false),- child: Material(+ child: SuperTabRowGround(color: widget.selected? grid.SidebarInk.selected: _hovered? grid.SidebarInk.hover: Colors.transparent,- borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),- clipBehavior: Clip.antiAlias,child: widget.child,),);diff --git a/desktop/lib/super_tabs/section_heading.dart b/desktop/lib/super_tabs/section_heading.dartindex 228dde29d..a1d8678d8 100644--- a/desktop/lib/super_tabs/section_heading.dart+++ b/desktop/lib/super_tabs/section_heading.dart@@ -6,6 +6,7 @@ import '../shared/theme/app_icons.dart';import '../shared/widgets/app_icon_button.dart';import '../widgets/desktop_chrome.dart';import '../widgets/finger_target.dart';+import 'buddy_rows.dart' show SuperTabCountBadge;/// Keeps resource headings aligned whether their add action is available or not.class SuperTabSectionHeading extends StatelessWidget {@@ -22,6 +23,7 @@ class SuperTabSectionHeading extends StatelessWidget {this.onToggleCollapsed,this.titleTooltip,this.titleStyle,+ this.waiting = 0,});final String title;@@ -61,6 +63,11 @@ class SuperTabSectionHeading extends StatelessWidget {/// name.final String? titleTooltip;+ /// What waits inside a folded group: shown only while [collapsed], as a+ /// bold title and this count in a row's red number, so a folded Projects+ /// still says a tag is in it (audit finding 19).+ final int waiting;+/// The chevron and every action are a fixed 32 px square; the gap/// before the actions is 4 px; the title always keeps at least this/// much room, even when the trailing pill is at its widest.@@ -95,9 +102,17 @@ class SuperTabSectionHeading extends StatelessWidget {constraints: const BoxConstraints(minHeight: 32),child: LayoutBuilder(builder: (context, constraints) {- final titleStyle =+ final shownWaiting = collapsed == true && collapsible ? waiting : 0;+ final ordinaryStyle =this.titleStyle ??DesktopChrome.metadata().copyWith(fontWeight: FontWeight.w600);+ // Bold at full strength, as a row with something unread.+ final titleStyle = shownWaiting > 0+ ? ordinaryStyle.copyWith(+ fontWeight: grid.AppFont.semibold,+ color: grid.SidebarInk.foreground(context),+ )+ : ordinaryStyle;final titleMeasure = TextPainter(text: TextSpan(text: title, style: titleStyle),textDirection: Directionality.of(context),@@ -158,6 +173,16 @@ class SuperTabSectionHeading extends StatelessWidget {child: titleLabel,),),+ if (shownWaiting > 0) ...[+ const SizedBox(width: _trailingGap),+ Semantics(+ label: '$shownWaiting waiting',+ excludeSemantics: true,+ child: SuperTabCountBadge(+ shownWaiting,+ ),+ ),+ ],const SizedBox(width: _trailingGap),Icon(collapsed == truediff --git a/desktop/lib/super_tabs/switch_pm.dart b/desktop/lib/super_tabs/switch_pm.dartindex 5027084e2..5de269943 100644--- a/desktop/lib/super_tabs/switch_pm.dart+++ b/desktop/lib/super_tabs/switch_pm.dart@@ -394,7 +394,7 @@ Future<void> showSwitchPm(Navigator.pop(context);}},- child: const Text('Check pending action'),+ child: const Text('Check again'),),],),diff --git a/desktop/lib/super_tabs/tasks/personal_task_card.dart b/desktop/lib/super_tabs/tasks/personal_task_card.dartindex f6a70d27e..a4421b60e 100644--- a/desktop/lib/super_tabs/tasks/personal_task_card.dart+++ b/desktop/lib/super_tabs/tasks/personal_task_card.dart@@ -34,6 +34,8 @@ class SuperTabPersonalTaskCard extends StatefulWidget {this.waiting = false,this.onApprove,this.onReject,+ this.pending,+ this.disabledReason,});final SuperTabPersonalTask task;@@ -48,6 +50,12 @@ class SuperTabPersonalTaskCard extends StatefulWidget {final bool waiting;final VoidCallback? onApprove, onReject;+ /// The decision sent for this task and not yet confirmed, `approve` or `reject`: its button spins.+ final String? pending;++ /// Why Approve and Reject are disabled, as their tooltip; null when they are not, or nothing to say.+ final String? disabledReason;+@overrideState<SuperTabPersonalTaskCard> createState() => _CardState();}@@ -149,7 +157,11 @@ class _CardState extends State<SuperTabPersonalTaskCard> {padding: _buttonPadding,minimumSize: Size.zero,),- child: const Text('Reject'),+ child: _label(+ 'Reject',+ w.pending == 'reject',+ w.onReject,+ ),),const SizedBox(width: grid.AppDesktop.listRowGap * 2),FilledButton(@@ -160,7 +172,11 @@ class _CardState extends State<SuperTabPersonalTaskCard> {padding: _buttonPadding,minimumSize: Size.zero,),- child: const Text('Approve'),+ child: _label(+ 'Approve',+ w.pending == 'approve',+ w.onApprove,+ ),),],],@@ -174,6 +190,27 @@ class _CardState extends State<SuperTabPersonalTaskCard> {),);}++ /// The button's word; while its decision is sent, the app's small spinner in its place (the word kept invisible so+ /// the button keeps its width); while disabled, a tooltip that says what it waits on.+ Widget _label(String text, bool sending, VoidCallback? onPressed) {+ final label = sending+ ? Stack(+ alignment: Alignment.center,+ children: [+ Opacity(opacity: 0, child: Text(text)),+ const SizedBox.square(+ dimension: AppIcons.inlineSize,+ child: CircularProgressIndicator(strokeWidth: 2),+ ),+ ],+ )+ : Text(text);+ final why = widget.disabledReason;+ return onPressed == null && why != null+ ? Tooltip(message: why, child: label)+ : label;+ }}/// The project's name in a capsule of its colour, white on it, as a Board tile labels its lane.diff --git a/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart b/desktop/lib/super_tabs/tasks/personal_tasks_pane.dartindex c2566a10c..54d43125c 100644--- a/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart+++ b/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart@@ -3,10 +3,14 @@ import 'dart:async';import 'package:flutter/material.dart';import '../../shared/theme/app_theme.dart';+import '../../shared/widgets/app_select_field.dart';+import '../../shared/widgets/skeleton.dart';+import '../../widgets/desktop_chrome.dart';import '../../widgets/laid_out_list.dart';import '../controller.dart';import '../identity.dart';import '../model.dart';+import '../task_card.dart';import 'personal_task_card.dart';import 'personal_tasks.dart';@@ -30,6 +34,9 @@ class SuperTabPersonalTasksPane extends StatefulWidget {/// Who asked, a step smaller than the agent beside it, as on a Board tile.const _requesterSize = 18.0;+/// Why Approve, Reject and the approval mode are disabled while a change is unconfirmed.+const _waitingWhy = 'Waiting for the last change to be confirmed';+class _TasksPaneState extends State<SuperTabPersonalTasksPane> {String? _error, _operationId;Map<String, dynamic>? _action;@@ -182,6 +189,15 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {!c.saving &&!c.hasPendingAction &&_action == null;+ final waitingOnChange =+ _sending || c.saving || c.hasPendingAction || _action != null;+ // The decision being sent, by its task: its button spins.+ final sendingOn = _sending ? _action!['conversationId'] as String? : null;+ final sendingKind = switch (_action?['type']) {+ 'task.approve' => 'approve',+ 'task.reject' => 'reject',+ _ => null,+ };final snapshot = c.snapshot;final agents = {for (final a in snapshot?.agents ?? <SuperTabAgent>[]) a.id: a,@@ -217,33 +233,48 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {),),if (supported)- DropdownButtonHideUnderline(- child: DropdownButton<String>(- key: const ValueKey('tasks-approval-mode'),- value: tasks!.mode,- style: Theme.of(context).textTheme.bodySmall,- items: const [- DropdownMenuItem(- value: 'autoApprove',- child: Text('Auto approve'),+ // Disabled as the decisions are; the shared select has no disabled state of its own.+ ExcludeFocus(+ excluding: !enabled,+ child: IgnorePointer(+ ignoring: !enabled,+ child: AppSelectField<String>(+ key: const ValueKey('tasks-approval-mode'),+ value: tasks!.mode,+ semanticLabel: 'Approval',+ textStyle: DesktopChrome.metadata(+ color: DesktopChrome.foreground,),- DropdownMenuItem(- value: 'review',- child: Text('Review'),+ width: AppSelectField.fitWidth(+ context,+ labels: const ['Auto approve', 'Review'],+ textStyle: DesktopChrome.metadata(),),- ],- onChanged: enabled- ? (value) {- if (value != null) {- unawaited(- _send({- 'type': 'member.approvalMode',- 'mode': value,- }),- );- }- }- : null,+ menuWidth: 300,+ menuAlignedToEnd: true,+ options: const [+ SelectOption(+ value: 'autoApprove',+ label: 'Auto approve',+ detail: 'Tasks you ask for start right away.',+ ),+ SelectOption(+ value: 'review',+ label: 'Review',+ detail: 'Tasks you ask for wait until you approve them.',+ ),+ ],+ onChanged: (value) {+ if (value != tasks.mode) {+ unawaited(+ _send({+ 'type': 'member.approvalMode',+ 'mode': value,+ }),+ );+ }+ },+ ),),),],@@ -274,21 +305,29 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {],),),- if (!supported)+ if (!supported && !c.accessRevoked && c.snapshot == null)+ const Expanded(child: _SkeletonCards())+ else if (!supported)Padding(padding: const EdgeInsets.all(AppDesktop.groupGap),child: Text(c.accessRevoked? 'Tasks are unavailable.'- : c.snapshot == null- ? 'Loading Tasks…': 'Update Harness to use Tasks.',),)elseExpanded(child: tasks!.rows.isEmpty- ? const Center(child: Text('No tasks yet'))+ ? const Center(+ child: Padding(+ padding: EdgeInsets.all(AppDesktop.groupGap),+ child: Text(+ 'No tasks yet. Tasks your agents start or propose show here.',+ textAlign: TextAlign.center,+ ),+ ),+ ): NotificationListener<ScrollNotification>(onNotification: _onScroll,child: LaidOutListView.builder(@@ -365,6 +404,12 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {onReject: waiting && enabled? () => _reject(task): null,+ pending: sendingOn == task.id+ ? sendingKind+ : null,+ disabledReason: waitingOnChange+ ? _waitingWhy+ : null,),);},@@ -398,3 +443,58 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {},);}++/// Cards on their way: the shape of a task card (its tag, two lines of title, then who asked and its agent), on the+/// card's own surface so nothing jumps when the rows land.+class _SkeletonCards extends StatelessWidget {+ const _SkeletonCards();++ @override+ Widget build(BuildContext context) {+ AppTheme.watch(context);+ final title = DesktopChrome.control().copyWith(height: 1.35);+ return SkeletonList(+ rows: 5,+ semanticsLabel: 'Loading Tasks',+ itemBuilder: (context, i) => Padding(+ padding: const EdgeInsets.fromLTRB(+ AppDesktop.groupGap,+ 0,+ AppDesktop.groupGap,+ AppDesktop.controlGap,+ ),+ child: DecoratedBox(+ decoration: BoxDecoration(+ color: AppCard.base,+ borderRadius: BorderRadius.circular(AppCard.insetRadius),+ border: Border.all(color: AppCard.insetHair),+ ),+ child: Padding(+ padding: const EdgeInsets.all(SuperTabTaskCard.tilePadding),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Skeleton(+ width: 64 + 16.0 * (i % 3),+ height: 16,+ radius: AppDesktop.paneCloseInset,+ ),+ const SizedBox(height: AppDesktop.controlGap),+ SkeletonText(style: title, widthFactor: .9 - .1 * (i % 2)),+ SkeletonText(style: title, widthFactor: .55 + .1 * (i % 3)),+ const SizedBox(height: AppDesktop.controlGap),+ const Row(+ children: [+ Skeleton.circle(size: _requesterSize),+ SizedBox(width: AppDesktop.listRowGap * 2),+ Skeleton.circle(size: SuperTabAvatar.rowSize),+ ],+ ),+ ],+ ),+ ),+ ),+ ),+ );+ }+}diff --git a/desktop/lib/super_tabs/tasks/task_header.dart b/desktop/lib/super_tabs/tasks/task_header.dartindex 79feb9517..d3de5da22 100644--- a/desktop/lib/super_tabs/tasks/task_header.dart+++ b/desktop/lib/super_tabs/tasks/task_header.dart@@ -34,6 +34,14 @@ class SuperTabTaskHeader extends StatelessWidget {.firstOrNull;final agent = snapshot?.agent(task.agentId ?? '');final pr = task.pullRequestUrl;+ // Merged once the task's own card of that pull request says so (as the Board's Merged lane reads it).+ final merged =+ snapshot+ ?.conversation(task.id)+ ?.cards+ .pullRequests+ .any((card) => card.url == pr && card.merged) ??+ false;final rejection = task.status == 'rejected'? superTabTaskRejection(task.reason): null;@@ -127,7 +135,7 @@ class SuperTabTaskHeader extends StatelessWidget {onTap: () => unawaited(openInBrowser(Uri.parse(pr))),child: fact([SvgPicture.asset(- pullRequestIconAsset('Open'),+ pullRequestIconAsset(merged ? 'Merged' : 'Open'),width: 14,height: 14,colorFilter: ColorFilter.mode(diff --git a/desktop/lib/super_tabs/tasks_view.dart b/desktop/lib/super_tabs/tasks_view.dartindex 88f2ce57b..9c12af350 100644--- a/desktop/lib/super_tabs/tasks_view.dart+++ b/desktop/lib/super_tabs/tasks_view.dart@@ -37,6 +37,7 @@ class SuperTabTasksView extends StatefulWidget {required this.onOpenMessage,this.selectedId,this.storage,+ this.layout,this.now = DateTime.now,});@@ -59,6 +60,10 @@ class SuperTabTasksView extends StatefulWidget {/// Where Board, List or Members, and Mine, are kept for this reader on this Mac.final LocalKeyValueStore? storage;++ /// Board, List or Members, held by the page around the view for its life: that page's Board tab is on only while+ /// the Board is, and names the view, so the view draws no title of its own (audit polish, #4445).+ final ValueNotifier<SuperTabTasksLayout>? layout;final DateTime Function() now;/// A Members column's width: about a card and a half of title per line (task #2948).@@ -81,10 +86,11 @@ class SuperTabTasksView extends StatefulWidget {typedef _Span = ({SuperTabTaskColumn column, double left, double right});/// How the Tasks view lays its cards out, kept by its name.-enum _Layout { board, list, members }+enum SuperTabTasksLayout { board, list, members }class _SuperTabTasksViewState extends State<SuperTabTasksView> {- var _layout = _Layout.board;+ late final _shown = widget.layout ?? ValueNotifier(SuperTabTasksLayout.board);+ SuperTabTasksLayout get _layout => _shown.value;bool _mine = false;String _query = '';@@ -109,6 +115,8 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {@overridevoid dispose() {+ _shown.removeListener(_choose);+ if (widget.layout == null) _shown.dispose();_boardScroll.dispose();_search.dispose();super.dispose();@@ -117,6 +125,8 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {@overridevoid initState() {super.initState();+ // A layout chosen here or by the page's Board tab is drawn and kept.+ _shown.addListener(_choose);unawaited(_restore());// The lanes read each task's not-before day in its project's zone.if (!superTabZonesLoaded) {@@ -149,25 +159,25 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {try {final saved = jsonDecode(raw);if (saved is! Map) return;- setState(() {- _layout =- _Layout.values- .where((l) => l.name == saved['layout'])- .firstOrNull ??- _Layout.board;- _mine = saved['mine'] == true;- });+ setState(() => _mine = saved['mine'] == true);+ _shown.value =+ SuperTabTasksLayout.values+ .where((l) => l.name == saved['layout'])+ .firstOrNull ??+ SuperTabTasksLayout.board;} on FormatException {// A copy this build cannot read: the defaults stand, and the next// choice replaces it.}}- void _choose({_Layout? layout, bool? mine}) {- setState(() {- _layout = layout ?? _layout;- _mine = mine ?? _mine;- });+ void _choose({SuperTabTasksLayout? layout, bool? mine}) {+ if (layout != null && layout != _layout) {+ // Its listener comes back here to draw and keep it.+ _shown.value = layout;+ return;+ }+ setState(() => _mine = mine ?? _mine);unawaited(widget.storage?.write(_key,@@ -256,7 +266,7 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {),Expanded(// Members draws the crew, free or not, though no task is open.- child: _layout == _Layout.members+ child: _layout == SuperTabTasksLayout.members? _membersView(project, board, now): empty? Center(@@ -267,7 +277,7 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {): hidden? _noMatch()- : _layout == _Layout.list+ : _layout == SuperTabTasksLayout.list? _listView(shown, now): _boardView(shown, now),),@@ -353,7 +363,9 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {/// The view's own bar: Board, List or Members, Mine and Search, nothing/// else.Widget _bar(BuildContext context) {- final title = Text('Tasks', style: DesktopChrome.text(medium: true));+ final title = widget.layout != null+ ? null+ : Text('Tasks', style: DesktopChrome.text(medium: true));final error = _moveError == null? null: Text(@@ -369,19 +381,23 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {DesktopPill(key: const ValueKey('super-tasks-layout-list'),label: 'List',- selected: _layout == _Layout.list,+ selected: _layout == SuperTabTasksLayout.list,onPressed: () => _choose(- layout: _layout == _Layout.list ? _Layout.board : _Layout.list,+ layout: _layout == SuperTabTasksLayout.list+ ? SuperTabTasksLayout.board+ : SuperTabTasksLayout.list,),),const SizedBox(width: grid.AppDesktop.listRowGap),DesktopPill(key: const ValueKey('super-tasks-layout-members'),label: 'Members',- selected: _layout == _Layout.members,+ selected: _layout == SuperTabTasksLayout.members,tooltip: 'Tasks by crew member',onPressed: () => _choose(- layout: _layout == _Layout.members ? _Layout.board : _Layout.members,+ layout: _layout == SuperTabTasksLayout.members+ ? SuperTabTasksLayout.board+ : SuperTabTasksLayout.members,),),const SizedBox(width: grid.AppDesktop.groupGap),@@ -430,9 +446,10 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {Row(mainAxisSize: MainAxisSize.min,children: [- title,+ ?title,if (error != null) ...[- const SizedBox(width: grid.AppDesktop.groupGap),+ if (title != null)+ const SizedBox(width: grid.AppDesktop.groupGap),Flexible(child: error),],],@@ -791,15 +808,17 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {/// The width the Board's columns with cards share in a [view] that wide,/// [empty] saying which are slim lanes: all of it when they fit at/// [SuperTabTasksView.minColumnWidth] or more; else as many whole columns- /// as fit at rest, the lanes after the last of them included, so none is- /// cut mid-word until the reader scrolls (finding 5 of #4211).+ /// as fit at rest with the lanes between them, so none is cut mid-word+ /// until the reader scrolls (finding 5 of #4211). The lanes after the last+ /// are included while they fit; the rest start at the view's edge, as the+ /// columns then fill it exactly: lanes after Working once hid it (#4445).static double _fullWidth(double view, List<bool> empty) {const edge = grid.AppDesktop.groupGap;var width = SuperTabTasksView.minColumnWidth;var full = 0, slim = 0;- for (final (i, isEmpty) in empty.indexed) {+ for (final isEmpty in empty) {isEmpty ? slim++ : full++;- if (full == 0 || i + 1 < empty.length && empty[i + 1]) continue;+ if (full == 0) continue;final share =(view -2 * edge -@@ -813,8 +832,9 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {}/// The pills over the Board's bottom corners: each names, with its count,- /// every column with cards out of view at its edge, and pressed scrolls- /// the nearest of them into view.+ /// every column with cards wholly out of view at its edge, never one partly+ /// on screen (#4445), and pressed scrolls the nearest column cut or out+ /// there into view.Widget _offView(List<_Span> spans,Map<SuperTabTaskColumn, List<SuperTabTaskEntry>> shown,@@ -841,7 +861,8 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {Widget? pill(String side, List<_Span> off, VoidCallback onPressed) {final named = [for (final span in off)- if (shown[span.column]!.isNotEmpty)+ if (shown[span.column]!.isNotEmpty &&+ (span.right <= at + .5 || span.left >= at + view - .5))'${span.column.label} ${shown[span.column]!.length}',];if (named.isEmpty) return null;diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex 4c285869d..40f059c51 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -319,6 +319,9 @@ class _SuperTabViewState extends State<SuperTabView>/// last opened from it, or the task whose chat the board was opened from.String? _tasksSelectedId;+ /// The Board page's Board, List or Members: its Board tab is on only while the Board is, and turns it back on.+ final _tasksLayout = ValueNotifier(SuperTabTasksLayout.board);+/// Why the last priority change was refused, and for which task: said/// beside that task's title (task #3117).({String taskId, String error})? _priorityRefusal;@@ -1223,6 +1226,7 @@ class _SuperTabViewState extends State<SuperTabView>_answer.dispose();_board.dispose();_facts.dispose();+ _tasksLayout.dispose();c.removeListener(_changed);c.removeListener(_holdVoiceAway);_voice?.dispose();@@ -3591,13 +3595,26 @@ class _SuperTabViewState extends State<SuperTabView>/// so it opens in the middle as a Tasks card's does (audit of 1.3.89, #4441: the card only turned grey).Future<void> _openTask(String id) async {if (_hasTasksPane) return _openPersonalTask(id);- if (!await c.loadGroup(id) || !mounted) return;+ if (!await _readTask(id)) return;_openConversation(id);}+ /// Whether task [id]'s chat is held, read first if need be: a card whose chat can't be read says so rather than+ /// doing nothing (audit polish, #4445).+ Future<bool> _readTask(String id) async {+ final read = await c.loadGroup(id);+ if (!mounted) return false;+ if (!read && !c.accessRevoked) {+ ScaffoldMessenger.maybeOf(context)?.showSnackBar(+ const SnackBar(content: Text("You can't open this task's chat.")),+ );+ }+ return read;+ }+/// A Tasks card opens its task's chat in the middle under the task's header, never the Board (#4204).Future<void> _openPersonalTask(String id) async {- if (!await c.loadGroup(id) || !mounted) return;+ if (!await _readTask(id)) return;_openAgentChat(id);setState(() => _taskInMiddle = id);}@@ -3621,11 +3638,19 @@ class _SuperTabViewState extends State<SuperTabView>);/// Above the Board: the project's name and its Board / Chat navigation.- Widget _boardHeader(SuperTabProject project) => SizedBox(+ Widget _boardHeader(SuperTabProject project, bool narrow) => SizedBox(+ key: const ValueKey('super-board-header'),height: 44,child: Row(children: [const SizedBox(width: 8),+ // The left pane folded into its drawer: the chat header's button opens it.+ if (narrow)+ AppIconButton(+ icon: AppIcons.menu,+ tooltip: 'Conversations',+ onPressed: () => setState(() => _sidebarOpen = !_sidebarOpen),+ ),// The name and its tabs take the room left, so what follows sits at the right edge: a Flexible name beside a// Spacer split the free space, and the name's unused half left the controls mid-bar (#3846).Expanded(@@ -3640,7 +3665,10 @@ class _SuperTabViewState extends State<SuperTabView>),),const SizedBox(width: 12),- _projectTabs(project, board: true),+ ListenableBuilder(+ listenable: _tasksLayout,+ builder: (context, _) => _projectTabs(project, board: true),+ ),],),),@@ -3663,7 +3691,16 @@ class _SuperTabViewState extends State<SuperTabView>mainAxisSize: MainAxisSize.min,children: [for (final (key, label, selected, open) in [- ('super-board-tab-board', 'Board', board, () => _openBoard(project)),+ // On the Board page with List or Members on, the Board tab is the way back to the Board.+ (+ 'super-board-tab-board',+ 'Board',+ board && _tasksLayout.value == SuperTabTasksLayout.board,+ () {+ if (!board) return _openBoard(project);+ _tasksLayout.value = SuperTabTasksLayout.board;+ },+ ),('super-board-tab-chat','Chat',@@ -3993,6 +4030,8 @@ class _SuperTabViewState extends State<SuperTabView>controller: c,project: project,storage: widget.app?.localStore,+ // Under the Board page's tabs, which show it.+ layout: boardProject != null ? _tasksLayout : null,needsHuman: (g) => _needsHuman(g).length,selectedId: _tasksSelectedId,onOpenTask: (id) {@@ -5284,33 +5323,49 @@ class _SuperTabViewState extends State<SuperTabView>!c.accessRevoked) {// The same + New agent as the left pane's: the Cmd-N form (task #4196).final newAgent = widget.board ? widget.onNewAgent : null;+ final newProject =+ widget.board || WorkspaceChrome.of(context).superTabRecovers+ ? widget.onNewProject+ : null;return Center(child: Padding(padding: const EdgeInsets.all(24),child: Column(mainAxisSize: MainAxisSize.min,children: [+ // One sentence for both ways to start (audit finding 20, #4445).Text(- 'Create a project to get started.',+ newAgent != null+ ? 'Start a project, or bring an agent to work with you.'+ : 'Create a project to get started.',style: DesktopChrome.text(color: DesktopChrome.muted),),- if ((widget.board ||- WorkspaceChrome.of(context).superTabRecovers) &&- widget.onNewProject != null) ...[+ if (newProject != null || newAgent != null) ...[const SizedBox(height: 12),- FilledButton(- style: _thumb,- onPressed: c.canWrite ? widget.onNewProject : null,- child: const Text('New project'),- ),- ],- if (newAgent != null) ...[- const SizedBox(height: 8),- TextButton.icon(- key: const ValueKey('super-empty-new-agent'),- onPressed: c.canWrite ? newAgent : null,- icon: const Icon(AppIcons.plus, size: 16),- label: const Text('New agent'),+ // Both in one style and one width, so neither reads as the lesser choice.+ IntrinsicWidth(+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: [+ if (newProject != null)+ TextButton.icon(+ style: _thumb,+ onPressed: c.canWrite ? newProject : null,+ icon: const Icon(AppIcons.plus, size: 16),+ label: const Text('New project'),+ ),+ if (newProject != null && newAgent != null)+ const SizedBox(height: 8),+ if (newAgent != null)+ TextButton.icon(+ key: const ValueKey('super-empty-new-agent'),+ style: _thumb,+ onPressed: c.canWrite ? newAgent : null,+ icon: const Icon(AppIcons.plus, size: 16),+ label: const Text('New agent'),+ ),+ ],+ ),),],if (c.operationError != null) ...[@@ -5320,7 +5375,7 @@ class _SuperTabViewState extends State<SuperTabView>if (c.hasPendingAction)TextButton(onPressed: c.saving ? null : c.retry,- child: const Text('Check pending action'),+ child: const Text('Check again'),),],),@@ -6340,11 +6395,6 @@ class _SuperTabViewState extends State<SuperTabView>!_rosterOpen &&!_terminalsVisible;final fixedSides = boardLayout || tasksStay;- // The fixed layout never drops a side pane; every other surface keeps- // its own width rules.- final narrow =- !fixedSides &&- constraints.maxWidth < MediaQuery.textScalerOf(context).scale(720);// Wide enough for a right column beside the chat; it shows only an// open thread or Members, closed at rest (Quiet Swarm, 2026-11-02).final wide =@@ -6374,6 +6424,16 @@ class _SuperTabViewState extends State<SuperTabView>final boardProject = boardLayout? c.snapshot?.projectById(_boardProjectId ?? impliedBoard ?? '')?.id: null;+ // The left pane folds into its drawer in a small window. With the Board in the middle that is under 1000, its+ // header then opening the drawer, so the Board keeps two columns (audit finding 12, #4445); the fixed layout's+ // other middles have no menu button and keep both side panes.+ final narrow = boardLayout+ ? boardProject != null &&+ constraints.maxWidth <+ MediaQuery.textScalerOf(context).scale(1000)+ : !fixedSides &&+ constraints.maxWidth <+ MediaQuery.textScalerOf(context).scale(720);// The chat alone in the middle, under its one-row header (#4204); a project's own chat keeps the full view.final fullView =!boardLayout ||@@ -6473,7 +6533,10 @@ class _SuperTabViewState extends State<SuperTabView>: Column(children: [if (boardProject != null)- _boardHeader(c.snapshot!.projectById(boardProject)!)+ _boardHeader(+ c.snapshot!.projectById(boardProject)!,+ narrow,+ )else_header(c.selected, narrow),if (_manageOpen)@@ -6659,7 +6722,8 @@ class _SuperTabViewState extends State<SuperTabView>child: Material(color: grid.AppPalette.swarmSidebar,elevation: 8,- child: _sidebar(),+ // The same lit row as the left pane it stands in for.+ child: _sidebar(boardProjectId: boardProject),),),),diff --git a/desktop/lib/super_tabs/work_details.dart b/desktop/lib/super_tabs/work_details.dartindex a88bfd02f..91fa63b1a 100644--- a/desktop/lib/super_tabs/work_details.dart+++ b/desktop/lib/super_tabs/work_details.dart@@ -95,7 +95,7 @@ Future<void> _showWork(if (c.hasPendingAction)TextButton(onPressed: c.saving ? null : c.retry,- child: const Text('Check pending action'),+ child: const Text('Check again'),),],),diff --git a/desktop/lib/widgets/new_harness_form.dart b/desktop/lib/widgets/new_harness_form.dartindex 69f24f84c..d238cc768 100644--- a/desktop/lib/widgets/new_harness_form.dart+++ b/desktop/lib/widgets/new_harness_form.dart@@ -91,8 +91,7 @@ class NewHarnessFormState extends State<NewHarnessForm> {final _headerMachineMenu = MenuController();final _headerMachineFocus = FocusNode(debugLabel: 'New harness computer');final _kindMenu = MenuController();- final _kindFocus = FocusNode(debugLabel: 'New agent Member or Lead');- final _kindAnchor = GlobalKey();+ final _kindFocus = FocusNode(debugLabel: 'New agent role');final _leadRowFocus = <String, FocusNode>{};final _headerMachineAnchor = GlobalKey();bool get _desktopStartEnabled =>@@ -1905,6 +1904,8 @@ class NewHarnessFormState extends State<NewHarnessForm> {.lastOrNull;// A guest starts in its workspace or a folder the owner shares (NewHarnessController.asGuest).if (box.project.newRepository case final ask?) return '${ask.slug} · new';+ // Not its generated name (claude-2026-11-07-13-54): Start creates it.+ if (box.project.generated != null) return 'New folder';return box.asGuest? lastPart ?? 'My workspace': box.project.name ??@@ -2049,33 +2050,6 @@ class NewHarnessFormState extends State<NewHarnessForm> {),),),- if (box.agentKind case final kind?)- _desktopField(- order: 3.5,- finger: phone,- anchor: _kindAnchor,- child: _desktopKindMenu(- child: DesktopPill(- key: const ValueKey('new-harness-field-agent-kind'),- focusNode: _kindFocus,- label: kind == 'lead' ? 'Lead' : 'Member',- semanticLabel:- 'Starts as, ${kind == 'lead' ? 'Lead' : 'Member'}',- icon: kind == 'lead' ? AppIcons.circleUser : AppIcons.user,- menu: true,- capsule: true,- tooltip: 'Start as Lead or Member',- textSize: 13,- surfaceColor: DesktopChrome.surface,- onPressed:- box.locked || box.integration?.agentKindLocked == true- ? null- : () => _kindMenu.isOpen- ? _kindMenu.close()- : _kindMenu.open(),- ),- ),- ),]),),if (!widget.embedded) ...[@@ -2140,7 +2114,7 @@ class NewHarnessFormState extends State<NewHarnessForm> {if (attachments == null) {return Align(alignment: Alignment.centerRight,- child: _desktopLaunchActions(includeProjectVisibility: true),+ child: _desktopLaunchActions(includeChoices: true),);}return LayoutBuilder(@@ -2179,7 +2153,7 @@ class NewHarnessFormState extends State<NewHarnessForm> {constraints.maxWidth - grid.AppControl.height - 6 - 12,),),- child: _desktopLaunchActions(includeProjectVisibility: true),+ child: _desktopLaunchActions(includeChoices: true),),],),@@ -2644,7 +2618,9 @@ class NewHarnessFormState extends State<NewHarnessForm> {child: const Text('Use the existing folder'),);- Widget _desktopLaunchActions({bool includeProjectVisibility = false}) => Wrap(+ /// [includeChoices]: the project's visibility and the agent's role, which+ /// the box under the task shows and the starting view does not.+ Widget _desktopLaunchActions({bool includeChoices = false}) => Wrap(spacing: 8,runSpacing: 8,alignment: WrapAlignment.end,@@ -2664,8 +2640,10 @@ class NewHarnessFormState extends State<NewHarnessForm> {box.integration!.roleName = name.isEmpty ? null : name;},),- if (includeProjectVisibility &&- box.integration?.projectVisibility != null)+ // In + New agent, only a Product Manager makes a project.+ if (includeChoices &&+ box.integration?.projectVisibility != null &&+ (box.agentKind ?? 'lead') == 'lead')_desktopProjectVisibility(9.95),// A Buddy is an offer: saying no is as plain as saying yes (#4442).if (box.bringsBuddy && !widget.embedded)@@ -2676,10 +2654,36 @@ class NewHarnessFormState extends State<NewHarnessForm> {},child: const Text('Not now'),),+ // Chosen where the agent is started, directly left of Start (product owner, task #4445).+ if (includeChoices)+ if (box.agentKind case final kind?) _desktopKindChip(kind),_desktopStartButton(),],);+ Widget _desktopKindChip(String kind) => FocusTraversalOrder(+ // Just before Start.+ order: const NumericFocusOrder(9.97),+ child: _desktopKindMenu(+ child: DesktopPill(+ key: const ValueKey('new-harness-field-agent-kind'),+ focusNode: _kindFocus,+ label: kind == 'lead' ? 'Product Manager' : 'Agent',+ semanticLabel:+ 'Starts as, ${kind == 'lead' ? 'Product Manager' : 'Agent'}',+ icon: kind == 'lead' ? AppIcons.circleUser : AppIcons.user,+ menu: true,+ capsule: true,+ tooltip: 'Start as an agent or a Product Manager',+ textSize: 13,+ surfaceColor: DesktopChrome.surface,+ onPressed: box.locked || box.integration?.agentKindLocked == true+ ? null+ : () => _kindMenu.isOpen ? _kindMenu.close() : _kindMenu.open(),+ ),+ ),+ );+Widget _desktopProjectVisibility(double order) => FocusTraversalOrder(order: NumericFocusOrder(order),child: ProjectVisibility(@@ -3870,13 +3874,38 @@ class NewHarnessFormState extends State<NewHarnessForm> {}// Computer selection belongs to the header, independently of repo search.- /// Member or Lead (task #4196): the one choice + New agent adds to Cmd-N.+ /// Agent or Product Manager (task #4196): the one choice + New agent adds+ /// to Cmd-N. Wire values stay `member` and `lead`.Widget _desktopKindMenu({required Widget child}) {final locked = box.locked || box.integration?.agentKindLocked == true;+ final rows = [+ for (final (kind, label, detail, icon) in [+ ('member', 'Agent', 'Works with you in its own chat', AppIcons.user),+ (+ 'lead',+ 'Product Manager',+ 'Leads a project and its crew',+ AppIcons.circleUser,+ ),+ ])+ AppMenuItem(+ key: ValueKey('new-harness-agent-kind-$kind'),+ autofocus: kind == box.agentKind,+ selected: kind == box.agentKind,+ icon: icon,+ label: label,+ detail: detail,+ onPressed: locked ? null : () => box.setAgentKind(kind),+ ),+ ];return AppDropdown(controller: _kindMenu,childFocusNode: _kindFocus,- width: _machineMenuWidth,+ // As wide as its lines need at any text size, so a detail is never cut.+ width: math.max(+ _machineMenuWidth,+ AppMenuItem.fitWidth(context, rows) ?? 0,+ ),onOpen: () => setState(() {}),onClose: () {if (!mounted) return;@@ -3886,21 +3915,7 @@ class NewHarnessFormState extends State<NewHarnessForm> {_chooserTraversal = null;_focusEditor();},- children: [- for (final (kind, label, detail, icon) in [- ('member', 'Member', 'Works with you in its own chat', AppIcons.user),- ('lead', 'Lead', 'Names and starts a project', AppIcons.circleUser),- ])- AppMenuItem(- key: ValueKey('new-harness-agent-kind-$kind'),- autofocus: kind == box.agentKind,- selected: kind == box.agentKind,- icon: icon,- label: label,- detail: detail,- onPressed: locked ? null : () => box.setAgentKind(kind),- ),- ],+ children: rows,child: child,);}diff --git a/desktop/test/new_harness_agent_kind_test.dart b/desktop/test/new_harness_agent_kind_test.dartindex 3fbe47efd..07ce345ab 100644--- a/desktop/test/new_harness_agent_kind_test.dart+++ b/desktop/test/new_harness_agent_kind_test.dart@@ -21,7 +21,11 @@ import 'box_render_preview_test.dart' show loadPreviewFonts;/// one another account shares with them, and a Harness Team account.class _App extends AppNotifier {_App()- : super(config: AppConfig.dev, authSession: AuthSession(), configStore: null) {+ : super(+ config: AppConfig.dev,+ authSession: AuthSession(),+ configStore: null,+ ) {MachineState add(Machine machine, {bool local = false}) =>machineStates[machine.machineId] = MachineState(machine)..localOnly = local@@ -176,16 +180,15 @@ void main() {final image = await boundary.toImage(pixelRatio: 1.5);final data = await image.toByteData(format: ui.ImageByteFormat.png);final directory = Directory(renderDir)..createSync(recursive: true);- await File(- '${directory.path}/$name.png',- ).writeAsBytes(data!.buffer.asUint8List());+ await File('${directory.path}/$name.png')+ .writeAsBytes(data!.buffer.asUint8List());image.dispose();});}// Task #4196 (anh Dee, 11-07): + New agent is Cmd-N with one more choice.for (final brightness in Brightness.values) {- testWidgets('New agent adds a Member or Lead choice, ${brightness.name}', (+ testWidgets('New agent: Agent or Product Manager, ${brightness.name}', (tester,) async {final integration = _newAgent();@@ -198,8 +201,10 @@ void main() {find.byKey(const ValueKey('new-harness-field-project')),);expect(_kind, findsOneWidget);- expect(find.descendant(of: _kind, matching: find.text('Member')),- findsOneWidget);+ expect(+ find.descendant(of: _kind, matching: find.text('Agent')),+ findsOneWidget,+ );final kind = tester.getRect(_kind);expect(kind.top >= project.bottom ||@@ -208,18 +213,24 @@ void main() {isTrue,reason: 'The choice comes after the project, in reading order',);- await capture(tester, mounted.image, 'new-agent-member-${brightness.name}');+ await capture(+ tester,+ mounted.image,+ 'new-agent-member-${brightness.name}',+ );await tester.tap(_kind);await tester.pumpAndSettle();- expect(find.text('Names and starts a project'), findsOneWidget);+ expect(find.text('Leads a project and its crew'), findsOneWidget);await tester.tap(find.byKey(const ValueKey('new-harness-agent-kind-lead')),);await tester.pumpAndSettle();expect(integration.agentKind, 'lead');- expect(find.descendant(of: _kind, matching: find.text('Lead')),- findsOneWidget);+ expect(+ find.descendant(of: _kind, matching: find.text('Product Manager')),+ findsOneWidget,+ );// The crown is only the leaderboard's number one's (task #4461).expect(find.descendant(of: _kind, matching: find.byIcon(AppIcons.circleUser)),@@ -234,10 +245,7 @@ void main() {tester,) async {final mounted = await _mount(tester, integration: _newAgent());- expect(- mounted.box.machineChoices.map((m) => m.id),- ['here', 'studio'],- );+ expect(mounted.box.machineChoices.map((m) => m.id), ['here', 'studio']);await tester.tap(_machine);await tester.pumpAndSettle();expect(_machineOption('here'), findsOneWidget);diff --git a/desktop/test/super_tab_board_fit_test.dart b/desktop/test/super_tab_board_fit_test.dartindex 637fafc0f..e2d2df99a 100644--- a/desktop/test/super_tab_board_fit_test.dart+++ b/desktop/test/super_tab_board_fit_test.dart@@ -1,9 +1,12 @@import 'package:flutter/material.dart';+import 'package:flutter/services.dart';import 'package:flutter_test/flutter_test.dart';import 'package:harness/shared/theme/app_theme.dart' as grid;import 'package:harness/super_tabs/controller.dart';import 'package:harness/super_tabs/tasks_view.dart';+import 'package:harness/super_tabs/view.dart';+import 'super_tab_activity_lists_test.dart' show swarm;import 'super_tab_tasks_view_test.dart' show taskFixture, tasksServer;import 'support/memory_key_value_store.dart';import 'support/super_tab_fixture.dart';@@ -107,6 +110,112 @@ Future<void> _close(WidgetTester tester, SuperTabController c) async {c.dispose();}+/// Audit finding 12 (task #4445): two proposals, two Next up, two Working, empty Done and Merged, one Shipped.+ConversationServer crewServer() {+ final server = swarm();+ final now = DateTime.now();+ server.proposals['lead'] = [+ for (final (i, title) in [+ 'Rename a Swarm from the phone',+ 'Backlog shows nothing in Mine',+ ].indexed)+ {+ 'messageId': 'p-$i',+ 'title': title,+ 'personId': 'owner',+ 'at': now.subtract(Duration(hours: i + 1)).millisecondsSinceEpoch,+ },+ ];+ final conversations = (server.state['conversations'] as List)+ .cast<Map<String, dynamic>>();+ conversations.removeWhere((g) => g['id'] == 'offline');+ conversations.addAll([+ taskFixture('hotfix', 'Sign-in loops forever after a token refresh', 30),+ taskFixture('lanes', 'Document the crew lanes', 31),+ taskFixture(+ 'composer',+ 'Composer keeps its draft across tabs',+ 32,+ status: 'working',+ agent: 'kestrel',+ ),+ taskFixture(+ 'machines',+ 'Machines list sorts by load',+ 33,+ status: 'working',+ agent: 'kestrel',+ ),+ taskFixture(+ 'invite',+ 'Invite link expires in a week',+ 34,+ status: 'done',+ agent: 'kestrel',+ pullRequest: 3700,+ merged: true,+ shippedAt: now.subtract(const Duration(hours: 1)),+ ),+ ]);+ return server;+}++/// The whole Desktop Swarm view in a [width] × 860 window, [server]'s project's Board open.+Future<SuperTabController> showWindow(+ WidgetTester tester,+ ConversationServer server, {+ double width = 1500,+ Brightness brightness = Brightness.light,+}) async {+ await tester.binding.setSurfaceSize(Size(width, 860));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final previous = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = previous);+ final c = server.controller(+ account: 'owner',+ initial: {+ 'tabId': 'tab',+ 'projectsGroupOpen': true,+ 'accountId': 'owner',+ 'selectedId': 'lead',+ },+ );+ await tester.runAsync(c.refresh);+ await tester.pumpWidget(+ MaterialApp(+ debugShowCheckedModeBanner: false,+ theme: grid.buildAppTheme(brightness: brightness),+ builder: (context, child) => MediaQuery(+ data: MediaQuery.of(context).copyWith(disableAnimations: true),+ child: child!,+ ),+ home: Scaffold(+ body: SuperTabView(+ controller: c,+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Mac Studio',+ paneStore: MemoryKeyValueStore(),+ board: true,+ ),+ ),+ ),+ );+ await tester.pumpAndSettle();+ await tester.tap(_key('super-group-lead'));+ await tester.pumpAndSettle();+ expect(_key('super-tasks-lead'), findsOneWidget);+ return c;+}++Future<void> closeWindow(WidgetTester tester, SuperTabController c) async {+ await tester.pumpWidget(const SizedBox());+ c.dispose();+ await tester.pump(const Duration(seconds: 5));+}+const _names = ['proposals', 'nextUp', 'working', 'done', 'merged', 'shipped'];/// Whether every column that starts inside the Board's view ends inside it.@@ -258,4 +367,67 @@ void main() {}await _close(tester, c);});++ testWidgets('a 1500 window shows Proposal, Next up and Working whole, the '+ 'empty lanes after Working at the edge, never cut', (tester) async {+ final c = await showWindow(tester, crewServer());+ final view = tester.getRect(_board);+ for (final name in ['proposals', 'nextUp', 'working']) {+ final rect = tester.getRect(_column(name));+ expect(rect.left, greaterThanOrEqualTo(view.left - .5), reason: name);+ expect(rect.right, lessThanOrEqualTo(view.right + .5), reason: name);+ expect(+ rect.width,+ greaterThanOrEqualTo(SuperTabTasksView.minColumnWidth),+ reason: name,+ );+ }+ _expectWhole(tester);+ expect(+ find.descendant(+ of: _key('super-tasks-board-more-right'),+ matching: find.text('Shipped 1'),+ ),+ findsOneWidget,+ );+ await closeWindow(tester, c);+ });++ testWidgets('at 880 the Board folds the left pane into its drawer, which '+ 'the header opens and Esc or a click outside closes', (tester) async {+ final c = await showWindow(tester, crewServer(), width: 880);+ expect(_key('super-left-pane'), findsNothing);+ final menu = find.descendant(+ of: _key('super-board-header'),+ matching: find.byTooltip('Conversations'),+ );+ expect(menu, findsOneWidget);+ // The Board's own bar is one row in the wider middle.+ final bar = tester.getCenter(_key('super-tasks-layout-list')).dy;+ expect(tester.getCenter(_key('super-tasks-search')).dy, closeTo(bar, 1));+ expect(tester.getCenter(_key('super-tasks-mine')).dy, closeTo(bar, 1));+ await tester.tap(menu);+ await tester.pumpAndSettle();+ expect(_key('super-group-lead'), findsOneWidget);+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);+ await tester.pumpAndSettle();+ expect(_key('super-group-lead'), 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(tester.takeException(), isNull);+ await closeWindow(tester, c);+ });++ testWidgets('at 1100 the Board keeps the left pane, with no menu button', (+ tester,+ ) async {+ final c = await showWindow(tester, crewServer(), width: 1100);+ expect(_key('super-left-pane'), findsOneWidget);+ expect(find.byTooltip('Conversations'), findsNothing);+ await closeWindow(tester, c);+ });}diff --git a/desktop/test/super_tab_board_layout_test.dart b/desktop/test/super_tab_board_layout_test.dartindex 7ca84cb5a..b1ce18d9d 100644--- a/desktop/test/super_tab_board_layout_test.dart+++ b/desktop/test/super_tab_board_layout_test.dart@@ -346,20 +346,28 @@ void main() {await end(tester, c);});- testWidgets(- 'the minimum Desktop window keeps projects, Board and chat visible',- (tester) async {- final (c, _) = await show(tester, width: 880);- await tester.tap(_key('super-group-lead'));- await _settle(tester);- expectFixedPanes(tester);- expect(_key('super-tasks-lead'), findsOneWidget);- // The Tasks pane gives back to its minimum so the Board keeps room (#4211).- expect(tester.getSize(_key('super-right-pane')).width, 280);- expect(tester.takeException(), isNull);- await end(tester, c);- },- );+ /// Under 1000 the Board folds projects into their drawer, a menu button away (audit finding 12, #4445).+ void expectFoldedLeft(WidgetTester tester) {+ expect(_key('super-left-pane'), findsNothing);+ expect(find.byTooltip('Conversations'), findsOneWidget);+ expect(tester.getSize(_key('super-right-pane')).width, greaterThan(0));+ }++ testWidgets('the minimum Desktop window keeps the Board and chat, projects in their '+ 'drawer', (tester) async {+ final (c, _) = await show(tester, width: 880);+ await tester.tap(_key('super-group-lead'));+ await _settle(tester);+ expectFoldedLeft(tester);+ expect(_key('super-tasks-lead'), findsOneWidget);+ // The Tasks pane gives back only what keeps the Board two columns (#4211).+ expect(+ tester.getSize(_key('super-right-pane')).width,+ 880 - SuperTabPaneLayout.boardCenterWidth,+ );+ expect(tester.takeException(), isNull);+ await end(tester, c);+ });testWidgets('the right pane keeps its width whatever width was saved, and has no '@@ -375,9 +383,12 @@ void main() {expect(_key('super-resize-right'), findsNothing);await tester.binding.setSurfaceSize(const Size(880, 900));await _settle(tester);- // At the window minimum the Tasks pane is at its own minimum (#4211).- expect(tester.getSize(_key('super-right-pane')).width, 280);- expectFixedPanes(tester);+ // At the window minimum the Tasks pane gives back only what keeps the Board two columns (#4211).+ expect(+ tester.getSize(_key('super-right-pane')).width,+ 880 - SuperTabPaneLayout.boardCenterWidth,+ );+ expectFoldedLeft(tester);expect(tester.takeException(), isNull);await end(tester, c);},@@ -446,16 +457,18 @@ void main() {);await tester.tap(_key('super-group-lead'));await _settle(tester);- final left = tester.getSize(_key('super-left-pane')).width;+ // Under 1000 scaled, projects fold into their drawer.+ final folded = width < 1000 * scale;+ final left = folded ? 0.0 : tester.getSize(_key('super-left-pane')).width;final right = tester.getSize(_key('super-right-pane')).width;final center = tester.getSize(_key('super-center-pane')).width;- expect(left, greaterThanOrEqualTo(180));+ if (!folded) expect(left, greaterThanOrEqualTo(180));expect(right, greaterThanOrEqualTo(SuperTabPaneLayout.rightWidth));expect(center, greaterThanOrEqualTo(280));expect(left + center + right, closeTo(width, 0.01));// The Board itself is drawn, not an empty centre.expect(_key('super-tasks-lead'), findsOneWidget);- expectFixedPanes(tester);+ folded ? expectFoldedLeft(tester) : expectFixedPanes(tester);expect(tester.takeException(), isNull);await end(tester, c);});diff --git a/desktop/test/super_tab_board_navigation_test.dart b/desktop/test/super_tab_board_navigation_test.dartindex 1fb4b4ddd..398debaa7 100644--- a/desktop/test/super_tab_board_navigation_test.dart+++ b/desktop/test/super_tab_board_navigation_test.dart@@ -188,6 +188,28 @@ void main() {expect(_litRows(tester), ['super-group-lead']);});+ // 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',+ 'board-drawer-lights-project',+ (tester, c) async {+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));+ await _settle(tester);+ await tester.binding.setSurfaceSize(const Size(880, 800));+ await _settle(tester);+ expect(find.byKey(const ValueKey('super-left-pane')), findsNothing);+ await tester.tap(+ find.descendant(+ of: find.byKey(const ValueKey('super-board-header')),+ matching: find.byTooltip('Conversations'),+ ),+ );+ await _settle(tester);++ expect(_litRows(tester), ['super-group-lead']);+ },+ );+_scene('a PM lights its own row alone', 'pm-lights-one-row', (tester,c,diff --git a/desktop/test/super_tab_board_polish_shots_test.dart b/desktop/test/super_tab_board_polish_shots_test.dartnew file mode 100644index 000000000..46e365a2a--- /dev/null+++ b/desktop/test/super_tab_board_polish_shots_test.dart@@ -0,0 +1,61 @@+// The Board and middle of the Desktop 1.3.89 audit (task #4445), light and dark, for the PR's pictures: the Board at+// 1500 with Working in view, at 880 with the left pane folded and its drawer open, the empty Swarm, and List on.+// Writes nothing unless HARNESS_SUPER_TAB_CAPTURE names a folder.+import 'dart:io';++import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';++import 'super_tab_board_fit_test.dart' show closeWindow, crewServer, showWindow;+import 'super_tab_empty_swarm_test.dart' show endEmptySwarm, showEmptySwarm;+import 'support/capture.dart';++final shots = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];++void main() {+ setUpAll(() => loadCaptureFonts(shots));++ for (final brightness in Brightness.values) {+ final name = brightness.name;++ testWidgets('the Board at 1500 ($name)', (tester) async {+ if (shots == null) return;+ final c = await showWindow(tester, crewServer(), brightness: brightness);+ await captureWindow(tester, shots, 'board-1500-$name');+ await closeWindow(tester, c);+ });++ testWidgets('the Board at 880, folded and with its drawer ($name)', (+ tester,+ ) async {+ if (shots == null) return;+ final c = await showWindow(+ tester,+ crewServer(),+ width: 880,+ brightness: brightness,+ );+ await captureWindow(tester, shots, 'board-880-folded-$name');+ await tester.tap(find.byTooltip('Conversations'));+ await tester.pumpAndSettle();+ await captureWindow(tester, shots, 'board-880-drawer-$name');+ await closeWindow(tester, c);+ });++ testWidgets('the empty Swarm ($name)', (tester) async {+ if (shots == null) return;+ final c = await showEmptySwarm(tester, brightness: brightness);+ await captureWindow(tester, shots, 'empty-swarm-$name');+ await endEmptySwarm(tester, c);+ });++ testWidgets('List on, under the Board tab ($name)', (tester) async {+ if (shots == null) return;+ final c = await showWindow(tester, crewServer(), brightness: brightness);+ await tester.tap(find.byKey(const ValueKey('super-tasks-layout-list')));+ await tester.pumpAndSettle();+ await captureWindow(tester, shots, 'board-list-$name');+ await closeWindow(tester, c);+ });+ }+}diff --git a/desktop/test/super_tab_board_polish_test.dart b/desktop/test/super_tab_board_polish_test.dartnew file mode 100644index 000000000..9ea7ba131--- /dev/null+++ b/desktop/test/super_tab_board_polish_test.dart@@ -0,0 +1,95 @@+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';++import 'super_tab_board_fit_test.dart' show closeWindow, crewServer, showWindow;+import 'super_tab_tasks_view_test.dart' show taskFixture;++/// The Board's smaller polish of the Desktop 1.3.89 audit (task #4445): the off-screen pills, List and the Board tab,+/// and a card whose chat can't be read.++Finder _key(String k) => find.byKey(ValueKey(k));++/// Whether the project's Board tab draws as the view on: the tab shown has no action.+bool _boardTabOn(WidgetTester tester) =>+ tester.widget<TextButton>(_key('super-board-tab-board')).onPressed == null;++void main() {+ testWidgets('a pill names only the columns wholly out of view on its side', (+ tester,+ ) async {+ final c = await showWindow(tester, crewServer());+ // Proposal wholly out on the left, Next up and Shipped each partly in view.+ tester+ .widget<SingleChildScrollView>(_key('super-tasks-board'))+ .controller!+ .jumpTo(300);+ await tester.pump();+ expect(+ find.descendant(+ of: _key('super-tasks-board-more-left'),+ matching: find.text('Proposal 2'),+ ),+ findsOneWidget,+ );+ expect(_key('super-tasks-board-more-right'), findsNothing);+ await closeWindow(tester, c);+ });++ testWidgets('with List on the Board tab is a way back, not the view on, and '+ 'no Tasks title repeats it', (tester) async {+ final c = await showWindow(tester, crewServer());+ final view = _key('super-tasks-lead');+ expect(_boardTabOn(tester), isTrue);+ expect(+ find.descendant(of: view, matching: find.text('Tasks')),+ findsNothing,+ );+ await tester.tap(_key('super-tasks-layout-list'));+ await tester.pumpAndSettle();+ expect(_key('super-tasks-board'), findsNothing, reason: 'the List is on');+ expect(_boardTabOn(tester), isFalse);+ expect(+ find.descendant(of: view, matching: find.text('Tasks')),+ findsNothing,+ );+ await tester.tap(_key('super-board-tab-board'));+ await tester.pumpAndSettle();+ expect(_key('super-tasks-board'), findsOneWidget);+ expect(_boardTabOn(tester), isTrue);+ await closeWindow(tester, c);+ });++ testWidgets("clicking a card whose chat can't be read says so", (+ tester,+ ) async {+ final server = crewServer();+ // Shipped and closed: only the Board's read of closed tasks holds it.+ (server.state['conversations'] as List).add(+ taskFixture(+ 'old',+ 'Old shipped work',+ 35,+ status: 'done',+ agent: 'kestrel',+ pullRequest: 3701,+ merged: true,+ archived: true,+ shippedAt: DateTime.now().subtract(const Duration(hours: 2)),+ ),+ );+ final c = await showWindow(tester, server);+ final card = _key('super-task-card-old');+ await tester.ensureVisible(card);+ await tester.pumpAndSettle();+ final selected = c.selectedId;+ // Gone from the server since, so its chat can't be read.+ (server.state['conversations'] as List).removeWhere(+ (g) => (g as Map)['id'] == 'old',+ );+ await tester.tap(card);+ await tester.pumpAndSettle();+ expect(find.text("You can't open this task's chat."), findsOneWidget);+ expect(c.selectedId, selected);+ await closeWindow(tester, c);+ });+}diff --git a/desktop/test/super_tab_buddy_engine_test.dart b/desktop/test/super_tab_buddy_engine_test.dartindex a2ee12504..348130f1b 100644--- a/desktop/test/super_tab_buddy_engine_test.dart+++ b/desktop/test/super_tab_buddy_engine_test.dart@@ -271,17 +271,18 @@ void main() {await closeBuddyEngine(tester, c);});- testWidgets('a Codex Buddy model menu names the Codex subscription', (+ // Only Claude switches to a shared model, so a Codex Buddy's one choice is no menu (Desktop 1.3.89 audit).+ testWidgets('a Codex Buddy names its subscription with no model menu', (tester,) async {final c = await showBuddyEngine(tester, buddyEngineSwarm(engine: 'codex'));- await tester.tap(model);- await tester.pumpAndSettle();- final subscription = row('Your subscription');expect(- find.descendant(of: subscription, matching: find.text('Codex')),+ find.descendant(of: model, matching: find.text('Your subscription')),findsOneWidget,);+ await tester.tap(model);+ await tester.pumpAndSettle();+ expect(row('Your subscription'), findsNothing);expect(find.text('Claude Code'), findsNothing);expect(find.text('SHARED IN THIS SWARM'), findsNothing);await closeBuddyEngine(tester, c);diff --git a/desktop/test/super_tab_buddy_polish_test.dart b/desktop/test/super_tab_buddy_polish_test.dartnew file mode 100644index 000000000..fe875eea0--- /dev/null+++ b/desktop/test/super_tab_buddy_polish_test.dart@@ -0,0 +1,145 @@+import 'package:flutter/material.dart';+import 'package:flutter/rendering.dart';+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/shared/widgets/app_menu.dart';+import 'package:harness/super_tabs/buddies.dart';+import 'package:harness/super_tabs/buddy_machines.dart';+import 'package:harness/super_tabs/buddy_restart.dart';+import 'package:harness/super_tabs/controller.dart';++import 'support/buddy_engine_fixture.dart';+import 'support/buddy_fixture.dart';+import 'support/super_tab_fixture.dart';++/// Polish of the Buddy's dialogs, header and start form (Desktop 1.3.89 audit, "Buddy and Board").+void main() {+ Color? colorOf(WidgetTester t, Finder text) =>+ t.widget<Text>(text).style?.color;++ /// A Buddy dialog opened from a button, as its menus open it.+ Future<(ConversationServer, SuperTabController)> open(+ WidgetTester t,+ void Function(BuildContext, SuperTabController) show,+ ) async {+ final server = buddySwarm();+ giveBuddy(server, machineId: 'm');+ final c = server.controller(account: 'peer');+ addTearDown(c.dispose);+ await c.refresh();+ await t.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(),+ home: Builder(+ builder: (context) => TextButton(+ onPressed: () => show(context, c),+ child: const Text('open'),+ ),+ ),+ ),+ );+ await t.tap(find.text('open'));+ await t.pumpAndSettle();+ return (server, c);+ }++ testWidgets('a Restart error is drawn in the Buddy card\'s error colour', (+ t,+ ) async {+ // With no app to restart it through, Restart says so.+ await open(t, (context, c) => showRestartBuddy(context, c, 'lead'));+ await t.tap(find.widgetWithText(FilledButton, 'Restart'));+ await t.pumpAndSettle();+ final error = find.byKey(const ValueKey('super-buddy-launch-args-error'));+ expect(find.text('Restart is not available here.'), findsOneWidget);+ expect(colorOf(t, error), grid.AppPalette.dangerFill);+ });++ testWidgets('a Rename error is drawn in the Buddy card\'s error colour', (+ t,+ ) async {+ final (server, _) = await open(+ t,+ (context, c) => showRenameBuddy(context, c, 'lead'),+ );+ server.refuse = {'code': 'CONFLICT', 'message': 'That name is taken.'};+ await t.enterText(find.byKey(const ValueKey('super-buddy-name')), 'Moss');+ await t.tap(find.widgetWithText(FilledButton, 'Save'));+ await t.pumpAndSettle();+ final error = find.text('That name is taken.');+ expect(error, findsOneWidget);+ expect(colorOf(t, error), grid.AppPalette.dangerFill);+ });++ final model = find.byKey(const ValueKey('super-buddy-model'));+ Finder inModel(Finder f) => find.descendant(of: model, matching: f);++ ConversationServer withModel(String engine, String id) {+ final server = buddyEngineSwarm(engine: engine);+ (server.state['agents'] as List).cast<Map>().firstWhere(+ (a) => a['id'] == 'wren',+ )['configuration'] = {+ 'engine': engine,+ 'model': id,+ };+ return server;+ }++ testWidgets('the Buddy header names the model its subscription runs', (+ t,+ ) async {+ final c = await showBuddyEngine(t, withModel('claude', 'claude-opus-5-5'));+ expect(inModel(find.text('Opus 5.5')), findsOneWidget);+ expect(inModel(find.text('Your subscription')), findsNothing);+ // Claude's menu still offers the Swarm's shared models.+ expect(inModel(find.byIcon(AppIcons.chevronDown)), findsOneWidget);+ await closeBuddyEngine(t, c);+ });++ testWidgets('with only its subscription to choose, there is no menu', (+ t,+ ) async {+ final c = await showBuddyEngine(t, withModel('codex', 'gpt-5.6-sol'));+ expect(inModel(find.text('GPT-5.6 Sol')), findsOneWidget);+ expect(inModel(find.byIcon(AppIcons.chevronDown)), findsNothing);+ await t.tap(model);+ await t.pumpAndSettle();+ expect(find.byType(AppMenuItem), findsNothing);+ await closeBuddyEngine(t, c);+ });++ testWidgets('the start form shows Choose a machine whole at 880', (t) async {+ t.view.devicePixelRatio = 1;+ t.view.physicalSize = const Size(880, 600);+ addTearDown(t.view.reset);+ await t.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(),+ home: Scaffold(+ body: Align(+ alignment: Alignment.topLeft,+ child: BuddyMachineField(+ machines: const [+ (+ id: 'm',+ name: 'Mac',+ inSwarm: true,+ offline: true,+ paused: false,+ ),+ ],+ value: null,+ fitNames: true,+ onChanged: (_) {},+ ),+ ),+ ),+ ),+ );+ final label = t.renderObject<RenderParagraph>(+ find.text('Choose a machine'),+ );+ expect(label.didExceedMaxLines, isFalse);+ });+}diff --git a/desktop/test/super_tab_empty_swarm_test.dart b/desktop/test/super_tab_empty_swarm_test.dartnew file mode 100644index 000000000..8420cf6f6--- /dev/null+++ b/desktop/test/super_tab_empty_swarm_test.dart@@ -0,0 +1,129 @@+import 'package:flutter/material.dart';+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/state/app_state.dart';+import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/view.dart';++import 'super_tab_activity_lists_test.dart' show swarm;+import 'swarm_state_test.dart' show createApp;++/// Audit finding 20 (task #4445): a Swarm with no projects says one sentence for both ways to start, under two+/// matching buttons, and a pending action in plain words.++Finder _key(String k) => find.byKey(ValueKey(k));++/// The button in the middle whose label is [label].+Finder _button(String label) => find.ancestor(+ of: find.descendant(+ of: _key('super-center-pane'),+ matching: find.text(label),+ ),+ matching: find.byWidgetPredicate((w) => w is ButtonStyleButton),+);++Future<SuperTabController> showEmptySwarm(+ WidgetTester tester, {+ Map<String, dynamic>? pending,+ Brightness brightness = Brightness.light,+}) async {+ await tester.binding.setSurfaceSize(const Size(1500, 800));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final previous = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = previous);+ final server = swarm();+ server.state['projects'] = <dynamic>[];+ server.state['conversations'] = <dynamic>[];+ server.state['agents'] = <dynamic>[];+ final c = server.controller(+ account: 'owner',+ initial: {+ 'tabId': 'tab',+ 'accountId': 'owner',+ 'selectedId': 'lead',+ 'pending': ?pending,+ },+ );+ await tester.runAsync(c.refresh);+ // The memory store and a fake sign-in: nothing here reads the real CLI's login.+ final AppNotifier app = createApp();+ addTearDown(app.dispose);+ await tester.pumpWidget(+ MaterialApp(+ debugShowCheckedModeBanner: false,+ theme: grid.buildAppTheme(brightness: brightness),+ home: Scaffold(+ body: SuperTabView(+ controller: c,+ app: app,+ onNewSwarm: () {},+ onNewProject: () {},+ onNewAgent: () {},+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Mac Studio',+ board: true,+ rightPane: (_) => const SizedBox.expand(),+ ),+ ),+ ),+ );+ for (var i = 0; i < 3; i++) {+ await tester.runAsync(+ () => Future<void>.delayed(const Duration(milliseconds: 30)),+ );+ await tester.pump(const Duration(milliseconds: 50));+ }+ return c;+}++Future<void> endEmptySwarm(WidgetTester tester, SuperTabController c) async {+ await tester.pumpWidget(const SizedBox());+ await tester.runAsync(c.flush);+ c.dispose();+ await tester.pump(const Duration(seconds: 5));+}++void main() {+ testWidgets('one sentence for both ways to start, over two matching + '+ 'buttons', (tester) async {+ final c = await showEmptySwarm(tester);+ expect(+ find.text('Start a project, or bring an agent to work with you.'),+ findsOneWidget,+ );+ final project = _button('New project'), agent = _button('New agent');+ expect(project, findsOneWidget);+ expect(agent, findsOneWidget);+ expect(+ tester.widget(project).runtimeType,+ tester.widget(agent).runtimeType,+ reason: 'drawn by the same widget',+ );+ expect(tester.getSize(project), tester.getSize(agent));+ for (final button in [project, agent]) {+ expect(+ find.descendant(of: button, matching: find.byIcon(AppIcons.plus)),+ findsOneWidget,+ );+ }+ await endEmptySwarm(tester, c);+ });++ testWidgets('a pending action reads Check again', (tester) async {+ final c = await showEmptySwarm(+ tester,+ pending: {+ 'operationId': 'op-1',+ 'command': {'type': 'project.create', 'name': 'web'},+ },+ );+ expect(c.hasPendingAction, isTrue);+ expect(_button('Check again'), findsOneWidget);+ expect(find.text('Check pending action'), findsNothing);+ await endEmptySwarm(tester, c);+ });+}diff --git a/desktop/test/super_tab_join_polish_test.dart b/desktop/test/super_tab_join_polish_test.dartnew file mode 100644index 000000000..81b548dcb--- /dev/null+++ b/desktop/test/super_tab_join_polish_test.dart@@ -0,0 +1,134 @@+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/join_dialog.dart';+import 'package:harness/super_tabs/join_link.dart';+import 'package:harness/super_tabs/model.dart';+import 'package:harness/super_tabs/project_add_people.dart';+import 'package:harness/super_tabs/project_options.dart';+import 'package:harness/super_tabs/switch_pm.dart';+import 'package:harness/super_tabs/work_details.dart';++import 'support/super_tab_fixture.dart';++/// The join dialog's account and errors, and the words of every dialog's pending-action button (Desktop 1.3.89 audit).+void main() {+ const link = SwarmJoinLink('tab', token: 'invite-token');++ Future<void> join(WidgetTester t, SuperTabRequest request) async {+ await t.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(),+ home: Scaffold(+ body: SwarmJoinDialog(+ link: link,+ accountEmail: '[email protected]',+ isCurrent: () => true,+ onJoined: (_, _) {},+ request: request,+ ),+ ),+ ),+ );+ await t.pumpAndSettle();+ }++ testWidgets('the join dialog names the account it joins with', (t) async {+ await join(+ t,+ (_, _, {body}) async => {'id': 'tab', 'name': 'Pilot', 'role': 'viewer'},+ );+ expect(find.text('Signed in as [email protected]'), findsOneWidget);+ expect(find.text('[email protected]'), findsNothing);+ });++ testWidgets('the join dialog draws its error in the error colour', (t) async {+ await join(+ t,+ (_, _, {body}) async =>+ throw const SuperTabFailure('FORBIDDEN', 'private', statusCode: 403),+ );+ final error = find.text(+ 'This link is unavailable for your account. Ask the owner for an invitation.',+ );+ expect(error, findsOneWidget);+ expect(t.widget<Text>(error).style?.color, grid.AppPalette.dangerFill);+ });++ /// Opens a dialog, then leaves a command whose answer was lost: the dialog offers to check it.+ Future<void> pendingIn(+ WidgetTester t,+ Future<void> Function(BuildContext, SuperTabController) show,+ ) async {+ final server = ConversationServer();+ (server.state['people'] as List).add({+ 'id': 'dee',+ 'email': '[email protected]',+ 'role': 'collaborator',+ });+ server.state['projects'] = [+ {+ ...projectFixture('lead', 'test private', 'lead'),+ 'visibility': 'private',+ 'members': [+ {'id': 'dee'},+ ],+ },+ ];+ final c = server.controller(account: 'owner');+ addTearDown(c.dispose);+ await c.refresh();+ await t.pumpWidget(+ MaterialApp(+ home: Builder(+ builder: (context) => TextButton(+ onPressed: () => show(context, c),+ child: const Text('open'),+ ),+ ),+ ),+ );+ await t.tap(find.text('open'));+ await t.pumpAndSettle();+ server.loseReply = true;+ await c.command({+ 'type': 'project.rename',+ 'projectId': 'lead',+ 'name': 'x',+ });+ await t.pumpAndSettle();+ expect(c.hasPendingAction, isTrue);+ expect(find.widgetWithText(TextButton, 'Check again'), findsOneWidget);+ expect(find.text('Check pending action'), findsNothing);+ server.loseReply = false;+ await t.tap(find.widgetWithText(TextButton, 'Check again'));+ await t.pumpAndSettle();+ expect(c.hasPendingAction, isFalse);+ }++ SuperTabProject project(SuperTabController c) =>+ c.snapshot!.projectById('lead')!;++ testWidgets('Add people offers Check again', (t) async {+ await pendingIn(+ t,+ (context, c) => showProjectAddPeople(context, c, project(c)),+ );+ });++ testWidgets('Sharing offers Check again', (t) async {+ await pendingIn(+ t,+ (context, c) => showProjectAction(context, c, project(c), 'sharing'),+ );+ });++ testWidgets('Work details offers Check again', (t) async {+ await pendingIn(t, (context, c) => showSuperTabWork(context, c, 'offline'));+ });++ testWidgets('Switch Product Manager offers Check again', (t) async {+ await pendingIn(t, (context, c) => showSwitchPm(context, c, 'lead'));+ });+}diff --git a/desktop/test/super_tab_new_agent_names_test.dart b/desktop/test/super_tab_new_agent_names_test.dartnew file mode 100644index 000000000..1d1e4002b--- /dev/null+++ b/desktop/test/super_tab_new_agent_names_test.dart@@ -0,0 +1,85 @@+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/state/new_harness.dart';+import 'package:harness/super_tabs/launch.dart';+import 'package:harness/widgets/new_harness_form.dart';++import 'super_tab_launch_test.dart' show SuperTabLaunchFixture, tabId;+import 'super_tab_new_agent_words_test.dart'+ show mountSwarm, tapNewAgent, unmountSwarm;++/// The name + New agent sends for its new agent's chat, in a Swarm whose+/// agents already have [names].+Future<String> _sentName(String engine, List<String> names) async {+ final f = SuperTabLaunchFixture();+ final agents = f.connection.server.state['agents'] as List;+ for (final (i, name) in names.indexed) {+ agents.add({+ 'id': 'agent-$i',+ 'machineId': 'studio',+ 'harnessId': 'harness-$i',+ 'name': name,+ 'contributorId': 'owner',+ 'projectId': 'lead',+ 'configuration': {'engine': engine, 'model': 'default'},+ });+ }+ f.app.bindSuperTab(f.app.activeSwarmId, tabId, 'Company');+ final integration = await SuperTabLaunch.open(+ f.app,+ f.app.activeSwarm,+ 'new-agent',+ newAgent: true,+ );+ final box = NewHarnessController(+ f.app,+ machineId: 'm',+ engine: engine,+ folder: '/work/project',+ task: 'Tidy the docs.',+ integration: integration,+ );+ addTearDown(box.dispose);+ await Future<void>.delayed(Duration.zero);+ expect(await box.create(), NewHarnessOutcome.created, reason: box.error);+ final chat = [+ for (final post in f.connection.server.posts) post['command'] as Map,+ ].singleWhere((c) => c['type'] == 'agent.new');+ return chat['name'] as String;+}++void main() {+ TestWidgetsFlutterBinding.ensureInitialized();++ // Audit 1.3.89 polish (task #4445): every new agent was named after its+ // engine, so two read "Claude Code" side by side.+ for (final (engine, label) in [+ ('claude', 'Claude Code'),+ ('codex', 'Codex'),+ ]) {+ test('a second $label is $label 2, then $label 3', () async {+ expect(await _sentName(engine, []), label);+ expect(await _sentName(engine, [label]), '$label 2');+ expect(await _sentName(engine, [label, '$label 2']), '$label 3');+ });+ }++ // With no remembered project the chip showed the generated folder's name,+ // claude-2026-11-07-13-54. That name is still what is created.+ testWidgets('the folder chip of an automatic project reads New folder', (+ tester,+ ) async {+ final f = await mountSwarm(tester);+ await tapNewAgent(tester);+ final chip = find.byKey(const ValueKey('new-harness-field-project'));+ expect(+ find.descendant(of: chip, matching: find.text('New folder')),+ findsOneWidget,+ );+ final box = tester+ .widget<NewHarnessForm>(find.byType(NewHarnessForm))+ .controller;+ expect(box.project.generated?.name, matches(RegExp(r'^claude-\d{4}-')));+ await unmountSwarm(tester, f);+ });+}diff --git a/desktop/test/super_tab_new_agent_shots_test.dart b/desktop/test/super_tab_new_agent_shots_test.dartnew file mode 100644index 000000000..b0b053190--- /dev/null+++ b/desktop/test/super_tab_new_agent_shots_test.dart@@ -0,0 +1,48 @@+// Desktop 1.3.89 audit, findings 11 and 14 (task #4445): + New agent's form, for the PR's pictures, light and dark, at+// 880 and 1500 wide. Writes nothing unless HARNESS_SUPER_TAB_CAPTURE names a folder.+import 'dart:io';++import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';++import 'super_tab_new_agent_words_test.dart'+ show mountSwarm, tapNewAgent, unmountSwarm;+import 'support/capture.dart';++final shots = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];+final _kind = find.byKey(const ValueKey('new-harness-field-agent-kind'));++void main() {+ setUpAll(() => loadCaptureFonts(shots));++ for (final brightness in Brightness.values) {+ for (final width in [880.0, 1500.0]) {+ final suffix = '${width.toInt()}-${brightness.name}';+ testWidgets('+ New agent at $suffix', (tester) async {+ if (shots == null) return;+ final f = await mountSwarm(tester, brightness: brightness);+ await tapNewAgent(tester);+ tester.view.physicalSize = Size(width, 900);+ await tester.pumpAndSettle();+ // The role chip beside New agent (product owner's ask).+ await captureWindow(tester, shots, 'new-agent-role-chip-$suffix');++ await tester.tap(_kind);+ await tester.pumpAndSettle();+ await captureWindow(tester, shots, 'new-agent-role-menu-$suffix');++ await tester.tap(+ find.byKey(const ValueKey('new-harness-agent-kind-lead')),+ );+ await tester.pumpAndSettle();+ expect(+ find.byKey(const ValueKey('new-harness-project-visibility')),+ findsOneWidget,+ );+ expect(tester.takeException(), isNull);+ await captureWindow(tester, shots, 'new-agent-pm-visibility-$suffix');+ await unmountSwarm(tester, f);+ });+ }+ }+}diff --git a/desktop/test/super_tab_new_agent_visibility_test.dart b/desktop/test/super_tab_new_agent_visibility_test.dartnew file mode 100644index 000000000..b87291096--- /dev/null+++ b/desktop/test/super_tab_new_agent_visibility_test.dart@@ -0,0 +1,100 @@+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/state/new_harness.dart';+import 'package:harness/super_tabs/launch.dart';+import 'package:harness/widgets/new_harness_form.dart';++import 'super_tab_launch_test.dart' show SuperTabLaunchFixture, tabId;+import 'super_tab_new_agent_words_test.dart'+ show mountSwarm, tapNewAgent, unmountSwarm;++final _kind = find.byKey(const ValueKey('new-harness-field-agent-kind'));+final _visibility = find.byKey(+ const ValueKey('new-harness-project-visibility'),+);++Future<void> _choose(WidgetTester tester, String kind) async {+ await tester.tap(_kind);+ await tester.pumpAndSettle();+ await tester.tap(find.byKey(ValueKey('new-harness-agent-kind-$kind')));+ await tester.pumpAndSettle();+}++/// + New agent's journal, opened again as a closed form or a restart does.+Future<NewHarnessController> _newAgent(SuperTabLaunchFixture f) async {+ final integration = await SuperTabLaunch.open(+ f.app,+ f.app.activeSwarm,+ 'new-agent',+ newAgent: true,+ );+ final box = NewHarnessController(+ f.app,+ machineId: 'm',+ engine: 'claude',+ folder: '/work/project',+ task: 'Plan the docs site.',+ integration: integration,+ );+ addTearDown(box.dispose);+ await Future<void>.delayed(Duration.zero);+ return box;+}++void main() {+ // Audit 1.3.89 finding 14 (task #4445): a Product Manager's new project was+ // public without asking. It asks as + New project does.+ testWidgets('Product Manager shows the project visibility, Public first', (+ tester,+ ) async {+ final f = await mountSwarm(tester);+ await tapNewAgent(tester);+ expect(_visibility, findsNothing, reason: 'An agent makes no project');++ await _choose(tester, 'lead');+ expect(_visibility, findsOneWidget);+ expect(+ find.descendant(of: _visibility, matching: find.text('Public')),+ findsOneWidget,+ );+ await tester.tap(_visibility);+ await tester.pumpAndSettle();+ await tester.tap(find.text('Private'));+ await tester.pumpAndSettle();+ expect(+ find.descendant(of: _visibility, matching: find.text('Private')),+ findsOneWidget,+ );+ final box = tester+ .widget<NewHarnessForm>(find.byType(NewHarnessForm))+ .controller;+ expect(box.integration!.projectVisibility, 'private');++ await _choose(tester, 'member');+ expect(_visibility, findsNothing);+ await unmountSwarm(tester, f);+ });++ TestWidgetsFlutterBinding.ensureInitialized();++ test('the choice reaches project.create and is locked once sent', () async {+ final f = SuperTabLaunchFixture()..connection.failCreation = true;+ f.app.bindSuperTab(f.app.activeSwarmId, tabId, 'Company');+ final box = await _newAgent(f);+ expect(box.integration!.projectVisibility, 'public');+ box.setAgentKind('lead');+ box.integration!.projectVisibility = 'private';+ expect(await box.create(), NewHarnessOutcome.failed);++ final create = [+ for (final post in f.connection.server.posts) post['command'] as Map,+ ].singleWhere((c) => c['type'] == 'project.create');+ expect(create['visibility'], 'private');+ expect(box.integration!.projectVisibilityLocked, isTrue);++ // Reopened after the failed start: the project exists, as sent.+ final again = await _newAgent(f);+ expect(again.integration!.projectVisibility, 'private');+ expect(again.integration!.projectVisibilityLocked, isTrue);+ });+}diff --git a/desktop/test/super_tab_new_agent_words_test.dart b/desktop/test/super_tab_new_agent_words_test.dartnew file mode 100644index 000000000..3173f28eb--- /dev/null+++ b/desktop/test/super_tab_new_agent_words_test.dart@@ -0,0 +1,263 @@+import 'dart:async';++import 'package:flutter/material.dart';+import 'package:flutter/rendering.dart';+import 'package:flutter/services.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/screens/swarm_screen.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/shortcuts/app_keymap.dart';+import 'package:harness/state/new_harness.dart';+import 'package:harness/state/swarm_catalog.dart';+import 'package:harness/widgets/desktop_chrome.dart';+import 'package:harness/widgets/new_harness_form.dart';++import 'keymap_host_test.dart' show MemoryKeymap, key;+import 'super_tab_launch_test.dart' show SuperTabLaunchFixture, tabId;+import 'support/launch_menu.dart' show acceptSetupOrSearch;++final _kind = find.byKey(const ValueKey('new-harness-field-agent-kind'));+final _form = find.byType(NewHarnessForm);+const _menus = MethodChannel('harness/swarm_tabs');++/// An action from AppKit's menus, as the channel delivers it. Its reply is+/// not waited for: it comes once the frames the action asks for are pumped.+void _menu(WidgetTester tester, String method) {+ unawaited(+ tester.binding.defaultBinaryMessenger.handlePlatformMessage(+ _menus.name,+ const StandardMethodCodec().encodeMethodCall(MethodCall(method)),+ null,+ ),+ );+}++/// A Swarm v3 tab, its left pane with My agents and + New agent.+Future<SuperTabLaunchFixture> mountSwarm(+ WidgetTester tester, {+ double textScale = 1,+ Brightness brightness = Brightness.light,+ bool reader = false,+ // The title bar and menus are AppKit's, reached through their channel.+ bool native = false,+}) async {+ if (native) {+ final messenger = tester.binding.defaultBinaryMessenger;+ messenger.setMockMethodCallHandler(_menus, (_) async => true);+ addTearDown(() => messenger.setMockMethodCallHandler(_menus, null));+ }+ final oldEntry = newHarnessOpensInBox;+ newHarnessOpensInBox = true;+ addTearDown(() => newHarnessOpensInBox = oldEntry);+ final f = SuperTabLaunchFixture();+ if (reader) {+ (f.connection.server.state['people'] as List).first['role'] = 'viewer';+ }+ f.app.bindSuperTab(f.app.activeSwarmId, tabId, 'Pilot');+ final c = await f.app.superTabs.open(tabId);+ await c.refresh();+ final map = MemoryKeymap();+ addTearDown(map.dispose);+ final projects = SwarmProjectStore();+ addTearDown(projects.dispose);+ tester.view.devicePixelRatio = 1;+ tester.view.physicalSize = const Size(1500, 900);+ final previous = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = previous);+ addTearDown(tester.view.resetPhysicalSize);+ addTearDown(tester.view.resetDevicePixelRatio);+ await tester.pumpWidget(+ MaterialApp(+ debugShowCheckedModeBanner: false,+ theme: grid.buildAppTheme(brightness: brightness),+ builder: (context, child) => MediaQuery(+ data: MediaQuery.of(context)+ .copyWith(textScaler: TextScaler.linear(textScale)),+ child: KeymapProvider(keymap: map, child: child!),+ ),+ home: SwarmScreen(+ notifier: f.app,+ nativeTabs: native,+ projectStore: projects,+ ),+ ),+ );+ await tester.pumpAndSettle();+ return f;+}++/// Inside the test body: the Swarm's saves finish before the app goes.+Future<void> unmountSwarm(WidgetTester tester, SuperTabLaunchFixture f) async {+ await tester.pumpWidget(const SizedBox());+ await f.app.superTabs.peek(tabId)!.flush();+ f.app.superTabs.dispose();+}++Future<void> tapNewAgent(WidgetTester tester) async {+ final row = find.byKey(const ValueKey('super-new-agent-row'));+ await tester.ensureVisible(row);+ await tester.tap(row);+ await tester.pumpAndSettle();+}++/// + New agent's form: the role chip and a `New agent` button.+void _expectNewAgentForm(WidgetTester tester) {+ expect(_form, findsOneWidget);+ expect(_kind, findsOneWidget);+ expect(tester.widget<NewHarnessForm>(_form).controller.agentKind, 'member');+ expect(+ find.descendant(+ of: find.byKey(const ValueKey('new-harness-field-start')),+ matching: find.text('New agent'),+ ),+ findsOneWidget,+ );+}++void main() {+ // Audit 1.3.89 finding 11 (task #4445): the role reads as the+ // left pane names it, Product Manager, and the other role is a plain Agent, never Lead or Member.+ testWidgets('the role chip and menu say Agent or Product Manager, whole', (+ tester,+ ) async {+ final f = await mountSwarm(tester, textScale: 1.3);+ await tapNewAgent(tester);+ // The narrowest window, where the left pane may fold away: the form stays.+ tester.view.physicalSize = const Size(880, 900);+ await tester.pumpAndSettle();++ expect(+ find.descendant(of: _kind, matching: find.text('Agent')),+ findsOneWidget,+ );+ final words = RegExp(r'\b(Lead|Member)\b');+ expect(+ find.descendant(of: _form, matching: find.textContaining(words)),+ findsNothing,+ );++ await tester.tap(_kind);+ await tester.pumpAndSettle();+ final details = {+ 'Agent': 'Works with you in its own chat',+ 'Product Manager': 'Leads a project and its crew',+ };+ for (final MapEntry(key: label, value: detail) in details.entries) {+ final row = find.byKey(+ ValueKey(+ 'new-harness-agent-kind-${label == 'Agent' ? 'member' : 'lead'}',+ ),+ );+ expect(+ find.descendant(of: row, matching: find.text(label)),+ findsOneWidget,+ );+ for (final line in [label, detail]) {+ final paragraph = tester.renderObject<RenderParagraph>(+ find.descendant(of: row, matching: find.text(line)),+ );+ expect(paragraph.didExceedMaxLines, isFalse, reason: '$line is cut');+ }+ }+ await tester.tap(find.byKey(const ValueKey('new-harness-agent-kind-lead')));+ await tester.pumpAndSettle();+ expect(+ find.descendant(of: _kind, matching: find.text('Product Manager')),+ findsOneWidget,+ );+ expect(tester.widget<NewHarnessForm>(_form).controller.agentKind, 'lead');+ await unmountSwarm(tester, f);+ });++ // Audit 1.3.89 finding 11 (task #4445): in a Swarm, every way to New Agent+ // opens what + New agent opens, so a new agent means one thing.+ final ways = <String, Future<void> Function(WidgetTester)>{+ 'Cmd-N': (tester) => key(tester, LogicalKeyboardKey.keyN, cmd: true),+ 'File ▸ New Agent': (tester) async => _menu(tester, 'newAgent'),+ 'search’s New Harness': (tester) async {+ await key(tester, LogicalKeyboardKey.keyP, cmd: true, shift: true);+ await tester.enterText(+ find.byKey(const ValueKey('swarm-search-input')),+ '> New Harness',+ );+ await acceptSetupOrSearch(tester);+ },+ };+ for (final MapEntry(key: way, value: open) in ways.entries) {+ testWidgets('$way in a Swarm opens + New agent’s form', (tester) async {+ final f = await mountSwarm(tester, native: way == 'File ▸ New Agent');+ await open(tester);+ await tester.pumpAndSettle();+ _expectNewAgentForm(tester);+ await unmountSwarm(tester, f);+ });+ }++ testWidgets('Cmd-N gives a reader what + New agent does: nothing', (+ tester,+ ) async {+ final f = await mountSwarm(tester, reader: true);+ expect(find.byKey(const ValueKey('super-new-agent-row')), findsNothing);+ await key(tester, LogicalKeyboardKey.keyN, cmd: true);+ await tester.pumpAndSettle();+ expect(_form, findsNothing);+ await unmountSwarm(tester, f);+ });++ // Product owner, relayed by the PM (task #4445): the role is chosen where+ // the agent is started, beside New agent, not among the header's pickers.+ for (final way in ['+ New agent', 'Cmd-N']) {+ testWidgets('$way: the role chip sits just left of New agent', (+ tester,+ ) async {+ final f = await mountSwarm(tester);+ if (way == 'Cmd-N') {+ await key(tester, LogicalKeyboardKey.keyN, cmd: true);+ await tester.pumpAndSettle();+ } else {+ await tapNewAgent(tester);+ }+ final start = find.byKey(const ValueKey('new-harness-field-start'));+ final chip = tester.getRect(_kind);+ final button = tester.getRect(start);+ // Below the task's text, in the box's bottom row: no longer up among+ // the header's pickers.+ final task = tester.getRect(+ find.byKey(const ValueKey('new-harness-task')),+ );+ expect(chip.top, greaterThan(task.top), reason: 'Not the header');+ expect((chip.center.dy - button.center.dy).abs(), lessThan(2));+ expect(chip.right, lessThanOrEqualTo(button.left));+ expect(button.left - chip.right, lessThan(16), reason: 'Beside it');++ // Tab goes from the chip to New agent, and its menu still opens.+ tester.widget<DesktopPill>(_kind).focusNode!.requestFocus();+ await tester.pump();+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);+ await tester.pump();+ final focused = FocusManager.instance.primaryFocus!.context!;+ expect(+ find.descendant(+ of: start,+ matching: find.byElementPredicate((e) => e == focused),+ matchRoot: true,+ ),+ findsOneWidget,+ );+ await tester.tap(_kind);+ await tester.pumpAndSettle();+ expect(+ find.byKey(const ValueKey('new-harness-agent-kind-lead')),+ findsOneWidget,+ );+ await tester.tap(_kind, warnIfMissed: false);+ await tester.pumpAndSettle();+ expect(+ find.byKey(const ValueKey('new-harness-agent-kind-lead')),+ findsNothing,+ );+ await unmountSwarm(tester, f);+ });+ }+}diff --git a/desktop/test/super_tab_polish_d_shots_test.dart b/desktop/test/super_tab_polish_d_shots_test.dartnew file mode 100644index 000000000..3b3a91428--- /dev/null+++ b/desktop/test/super_tab_polish_d_shots_test.dart@@ -0,0 +1,219 @@+// Desktop 1.3.89 audit, smaller polish (task #4445, group D): the Tasks pane and task header, the Buddy header and+// Restart dialog, and the join dialog, for the PR's pictures, light and dark. Writes nothing unless+// HARNESS_SUPER_TAB_CAPTURE names a folder.+import 'dart:async';+import 'dart:io';++import 'package:flutter/material.dart';+import 'package:flutter/services.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/buddy_restart.dart';+import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/join_dialog.dart';+import 'package:harness/super_tabs/join_link.dart';+import 'package:harness/super_tabs/tasks/personal_tasks.dart';+import 'package:harness/super_tabs/tasks/personal_tasks_pane.dart';+import 'package:harness/super_tabs/tasks/task_header.dart';+import 'package:harness/super_tabs/zone_time.dart';++import 'super_tab_personal_tasks_pane_test.dart' show TasksFixture, inCard;+import 'super_tab_personal_tasks_test.dart' show task;+import 'super_tab_tasks_pane_polish_test.dart'+ show taskHeaderController, taskHeaderPr;+import 'support/buddy_engine_fixture.dart';+import 'support/buddy_fixture.dart';+import 'support/capture.dart';++final shots = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];++void main() {+ setUpAll(() async {+ await loadCaptureFonts(shots);+ await superTabLoadZones();+ });++ Future<void> theme(WidgetTester t, Brightness brightness, Size size) async {+ t.view.devicePixelRatio = 1;+ t.view.physicalSize = size;+ addTearDown(t.view.reset);+ final previous = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = previous);+ }++ Widget app(Brightness brightness, Widget home) => MaterialApp(+ debugShowCheckedModeBanner: false,+ theme: grid.buildAppTheme(brightness: brightness),+ home: Scaffold(body: home),+ );++ for (final brightness in Brightness.values) {+ final b = brightness.name;++ testWidgets('D1 Tasks pane and merged task header ($b)', (t) async {+ if (shots == null) return;+ await theme(t, brightness, const Size(1000, 640));+ final header = taskHeaderController(merged: true);+ addTearDown(header.dispose);+ final f = TasksFixture()+ ..rows = [+ {+ ...task('new', 1, 30),+ 'title': 'Add the project export',+ 'projectName': 'Desktop',+ },+ {+ ...task('old', 1, 20),+ 'title': 'Expand the settings page',+ 'projectName': 'Harness',+ },+ {+ ...task('done', 1, 10),+ 'title': 'Repair the retry state',+ 'projectName': 'Harness',+ 'status': 'done',+ 'suggested': false,+ 'canApprove': false,+ },+ ];+ addTearDown(f.controller.dispose);+ await t.runAsync(() async {+ await header.refresh();+ await f.controller.refresh();+ });+ await t.pumpWidget(+ app(+ brightness,+ Row(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Expanded(+ child: SuperTabTaskHeader(+ controller: header,+ task: SuperTabPersonalTask({+ ...task('aeef', 1, 20),+ 'title': 'Desktop Tasks pane: board-style cards',+ 'status': 'done',+ 'canApprove': false,+ 'requester': {'id': '6a86', 'name': 'Ken'},+ 'pullRequestUrl': taskHeaderPr,+ }),+ ),+ ),+ SizedBox(+ width: 340,+ child: SuperTabPersonalTasksPane(+ controller: f.controller,+ onOpenTask: (_) {},+ ),+ ),+ ],+ ),+ ),+ );+ await t.pumpAndSettle();+ await t.tap(find.byKey(const ValueKey('tasks-approval-mode')));+ await t.pumpAndSettle();+ expect(t.takeException(), isNull);+ await captureWindow(t, shots, 'd1-tasks-mode-$b');+ await t.sendKeyEvent(LogicalKeyboardKey.escape);+ await t.pumpAndSettle();+ f.hold = Completer<void>();+ await t.tap(inCard('new', find.text('Approve')));+ await t.pump();+ // The spinner a moment in, once its arc shows.+ await t.pump(const Duration(milliseconds: 400));+ expect(t.takeException(), isNull);+ await captureWindow(t, shots, 'd1-tasks-pending-$b');+ f.hold!.complete();+ await t.pumpAndSettle();+ });++ testWidgets('D2 Buddy header names its model ($b)', (t) async {+ if (shots == null) return;+ final server = buddyEngineSwarm();+ (server.state['agents'] as List).cast<Map>().firstWhere(+ (a) => a['id'] == 'wren',+ )['configuration'] = {+ 'engine': 'claude',+ 'model': 'claude-opus-5-5',+ };+ final c = await showBuddyEngine(t, server, brightness: brightness);+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = Brightness.light);+ await t.pumpAndSettle();+ expect(t.takeException(), isNull);+ await captureWindow(t, shots, 'd2-buddy-header-$b');+ await closeBuddyEngine(t, c);+ });++ testWidgets('D2 Restart dialog error ($b)', (t) async {+ if (shots == null) return;+ await theme(t, brightness, const Size(880, 600));+ final server = buddySwarm();+ giveBuddy(server, machineId: 'm');+ final c = server.controller(account: 'peer');+ addTearDown(c.dispose);+ await t.runAsync(c.refresh);+ await t.pumpWidget(+ app(+ brightness,+ Builder(+ builder: (context) => TextButton(+ onPressed: () => showRestartBuddy(context, c, 'lead'),+ child: const Text('open'),+ ),+ ),+ ),+ );+ await t.tap(find.text('open'));+ await t.pumpAndSettle();+ await t.tap(find.widgetWithText(FilledButton, 'Restart'));+ await t.pumpAndSettle();+ expect(find.text('Restart is not available here.'), findsOneWidget);+ await captureWindow(t, shots, 'd2-restart-error-$b');+ });++ for (final failed in [false, true]) {+ testWidgets('D3 join dialog${failed ? ' error' : ''} ($b)', (t) async {+ if (shots == null) return;+ await theme(t, brightness, const Size(880, 600));+ await t.pumpWidget(+ app(+ brightness,+ Builder(+ builder: (context) => TextButton(+ onPressed: () => showDialog<void>(+ context: context,+ builder: (_) => SwarmJoinDialog(+ link: const SwarmJoinLink('tab', token: 'invite-token'),+ accountEmail: '[email protected]',+ isCurrent: () => true,+ onJoined: (_, _) {},+ request: (_, _, {body}) async => failed+ ? throw const SuperTabFailure(+ 'FORBIDDEN',+ 'private',+ statusCode: 403,+ )+ : {+ 'id': 'tab',+ 'name': 'Pilot',+ 'role': 'collaborator',+ },+ ),+ ),+ child: const Text('open'),+ ),+ ),+ ),+ );+ await t.tap(find.text('open'));+ await t.pumpAndSettle();+ expect(find.text('Signed in as [email protected]'), findsOneWidget);+ await captureWindow(t, shots, 'd3-join${failed ? '-error' : ''}-$b');+ });+ }+ }+}diff --git a/desktop/test/super_tab_project_add_people_test.dart b/desktop/test/super_tab_project_add_people_test.dartindex ff94cd58d..62d7dd3ef 100644--- a/desktop/test/super_tab_project_add_people_test.dart+++ b/desktop/test/super_tab_project_add_people_test.dart@@ -253,7 +253,7 @@ void main() {await tester.pumpAndSettle();expect(c.hasPendingAction, isTrue);expect(tester.widget<FilledButton>(confirm).onPressed, isNull);- await tester.tap(find.widgetWithText(TextButton, 'Check pending action'));+ await tester.tap(find.widgetWithText(TextButton, 'Check again'));await tester.pumpAndSettle();expect(c.hasPendingAction, isFalse);expect(tester.widget<FilledButton>(confirm).onPressed, isNotNull);diff --git a/desktop/test/super_tab_project_delete_test.dart b/desktop/test/super_tab_project_delete_test.dartindex ecae44059..0691b5137 100644--- a/desktop/test/super_tab_project_delete_test.dart+++ b/desktop/test/super_tab_project_delete_test.dart@@ -207,7 +207,7 @@ void main() {await tester.pumpAndSettle();expect(c.hasPendingAction, isTrue);expect(c.snapshot!.projects, isEmpty);- await tester.tap(find.widgetWithText(TextButton, 'Check pending action'));+ await tester.tap(find.widgetWithText(TextButton, 'Check again'));await tester.pumpAndSettle();expect(c.hasPendingAction, isFalse);expect(server.posts, hasLength(2));diff --git a/desktop/test/super_tab_projects_folded_test.dart b/desktop/test/super_tab_projects_folded_test.dartnew file mode 100644index 000000000..36bed1a20--- /dev/null+++ b/desktop/test/super_tab_projects_folded_test.dart@@ -0,0 +1,72 @@+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_recovers_test.dart b/desktop/test/super_tab_recovers_test.dartindex 639fc10e9..59da112e1 100644--- a/desktop/test/super_tab_recovers_test.dart+++ b/desktop/test/super_tab_recovers_test.dart@@ -107,7 +107,7 @@ void main() {onNewProject: () => made++,);final sentence = find.text('Create a project to get started.');- final button = find.widgetWithText(FilledButton, 'New project');+ final button = find.widgetWithText(TextButton, 'New project');expect(sentence, findsOneWidget);expect(button, findsOneWidget);expect(@@ -126,7 +126,7 @@ void main() {server.state['projects'] = <dynamic>[];await show(tester, chrome: _recovers, server: server);expect(find.text('Create a project to get started.'), findsOneWidget);- expect(find.widgetWithText(FilledButton, 'New project'), findsNothing);+ expect(find.widgetWithText(TextButton, 'New project'), findsNothing);});});@@ -163,7 +163,7 @@ void main() {server.state['projects'] = <dynamic>[];await show(tester, chrome: null, server: server, onNewProject: () {});expect(find.text('Create a project to get started.'), findsOneWidget);- expect(find.widgetWithText(FilledButton, 'New project'), findsNothing);+ expect(find.widgetWithText(TextButton, 'New project'), findsNothing);});});}diff --git a/desktop/test/super_tab_sidebar_focus_test.dart b/desktop/test/super_tab_sidebar_focus_test.dartnew file mode 100644index 000000000..001f86284--- /dev/null+++ b/desktop/test/super_tab_sidebar_focus_test.dart@@ -0,0 +1,100 @@+import 'package:flutter/material.dart';+import 'package:flutter/services.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/widgets/desktop_chrome.dart';++import 'support/super_tab_fixture.dart';+import 'support/super_tab_left_pane.dart';++/// Audit finding 21 (Desktop 1.3.89, task #4445): after Tab the focused row wore the hover fill, and looked almost+/// like the selected one. Focus is a ring now; the fill stays the row's own.+void main() {+ Finder key(String k) => find.byKey(ValueKey(k));++ /// Kestrel at work on `offline`, selected; Orion the PM of web-project.+ void agents(ConversationServer 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';+ groups.firstWhere((g) => g['id'] == 'offline')['assignment'] = {+ 'id': 'a1',+ 'agentId': 'kestrel',+ 'status': 'working',+ };+ }++ Future<void> tabTo(WidgetTester tester, Finder row) async {+ for (var i = 0; i < 60; i++) {+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);+ await tester.pump();+ final focused = FocusManager.instance.primaryFocus?.context;+ final inRow = find.descendant(+ of: row,+ matching: find.byElementPredicate((e) => e == focused),+ );+ if (focused != null && inRow.evaluate().isNotEmpty) {+ // Past any highlight's fade.+ await tester.pump(const Duration(milliseconds: 400));+ return;+ }+ }+ fail('Tab never reached the row');+ }++ /// A fill of [color] over the row, as an ink highlight draws one.+ PaintPattern fill(Color color) => paints+ ..something(+ (method, args) =>+ method == #drawRRect &&+ (args[1] as Paint).color.toARGB32() == color.toARGB32(),+ );++ /// The focus ring: a [width] rim of [DesktopChrome.focusRing] around the row.+ PaintPattern ring({double width = 2}) => paints+ ..something((method, args) {+ if (method != #drawDRRect) return false;+ final outer = args[0] as RRect, inner = args[1] as RRect;+ return (args[2] as Paint).color.toARGB32() ==+ DesktopChrome.focusRing.toARGB32() &&+ (outer.width - inner.width - 2 * width).abs() < .01;+ });++ for (final (row, label) in [+ ('super-agent-orion', 'an agent row'),+ ('super-project-lead', 'a project row'),+ ('super-decisions', 'a page row'),+ ]) {+ testWidgets('Tab to $label that is not selected: a ring, and its fill '+ 'unchanged', (tester) async {+ 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);+ expect(drawn, isNot(fill(grid.SidebarInk.hover)));+ expect(drawn, ring());+ // The selected row keeps its fill and wears no ring.+ final selected = key('super-agent-kestrel');+ expect(+ tester+ .widget<Material>(+ find.descendant(of: selected, matching: find.byType(Material)),+ )+ .color,+ grid.SidebarInk.selected,+ );+ expect(selected, isNot(ring()));+ await tester.runAsync(c.flush);+ });+ }+}diff --git a/desktop/test/super_tab_sidebar_polish_shots_test.dart b/desktop/test/super_tab_sidebar_polish_shots_test.dartnew file mode 100644index 000000000..bfcf170d3--- /dev/null+++ b/desktop/test/super_tab_sidebar_polish_shots_test.dart@@ -0,0 +1,180 @@+// The left pane's fixes of the Desktop 1.3.89 audit (task #4445, group C), for the PR's pictures, light and dark, at+// an 880 window (the left pane at its least) and at 1500: a folded Projects with a tag waiting (finding 19), a row+// reached by Tab beside the selected one (finding 21), and the polish (a long Swarm name, a PM's project after a+// separator, an agent with no chat yet, "No projects yet."). Writes nothing unless HARNESS_SUPER_TAB_CAPTURE+// names a folder.+import 'dart:io';++import 'package:flutter/gestures.dart';+import 'package:flutter/material.dart';+import 'package:flutter/services.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/state/app_state.dart';+import 'package:harness/super_tabs/view.dart';++import 'super_tab_activity_lists_test.dart' show swarm;+import 'support/capture.dart';+import 'support/super_tab_fixture.dart';+import 'swarm_state_test.dart' show createApp;++final shots = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];++Map<String, dynamic> _agent(+ String id,+ String name,+ String kind,+ String? chat,+) => {+ 'id': id,+ 'projectId': 'lead',+ 'name': name,+ 'displayName': name,+ 'machineId': 'host',+ 'harnessId': 'session',+ 'contributorId': 'owner',+ 'configuration': {'engine': 'codex'},+ 'kind': kind,+ 'chatId': chat,+ 'myAgent': true,+};++void main() {+ setUpAll(() => loadCaptureFonts(shots));++ for (final brightness in Brightness.values) {+ for (final width in [880.0, 1500.0]) {+ for (final scene in [+ 'folded-waiting',+ 'focus',+ 'polish',+ 'no-projects',+ ]) {+ testWidgets('$scene at ${width.toInt()} (${brightness.name})', (+ tester,+ ) async {+ if (shots == null) return;+ await tester.binding.setSurfaceSize(Size(width, 800));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final before = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = before);+ final server = swarm()..followedThreads = null;+ final groups = (server.state['conversations'] as List)+ .cast<Map<String, dynamic>>();+ if (scene == 'no-projects') {+ server.state['projects'] = <dynamic>[];+ groups.clear();+ server.state['agents'] = <dynamic>[];+ } else {+ server.state['agents'] = [+ _agent('kestrel', 'Kestrel', 'regular', 'agent-chat-kestrel'),+ _agent('orion', 'Orion', 'pm', 'lead'),+ // Brought, with no chat yet: its row opens nothing.+ _agent('sparrow', 'Sparrow', 'regular', null),+ ];+ groups.firstWhere((g) => g['id'] == 'lead')['leadId'] = 'orion';+ groups.add({+ ...conversationFixture('agent-chat-kestrel', 'Kestrel'),+ 'kind': 'agent-chat',+ 'agentIds': ['kestrel'],+ });+ }+ if (scene == 'folded-waiting') server.tag('message-1');+ if (scene == 'polish') {+ server.state['name'] = 'Autonomous Robotics Collective';+ }+ final c = server.controller(+ account: 'owner',+ initial: {+ 'tabId': 'tab',+ 'accountId': 'owner',+ if (scene == 'focus') 'selectedId': 'agent-chat-kestrel',+ },+ );+ await tester.runAsync(c.refresh);+ final AppNotifier app = createApp();+ addTearDown(app.dispose);+ await tester.pumpWidget(+ MaterialApp(+ debugShowCheckedModeBanner: false,+ theme: grid.buildAppTheme(brightness: brightness),+ home: Scaffold(+ body: SuperTabView(+ controller: c,+ app: app,+ onNewSwarm: () {},+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Mac Studio',+ board: true,+ rightPane: (_) => const SizedBox(),+ ),+ ),+ ),+ );+ for (var i = 0; i < 3; i++) {+ await tester.runAsync(+ () => Future<void>.delayed(const Duration(milliseconds: 30)),+ );+ await tester.pump(const Duration(milliseconds: 50));+ }+ if (scene == 'polish') {+ // At 880 the Board folds the left pane into its drawer (finding 12): open it as a person would.+ if (find+ .byKey(const ValueKey('super-swarm-switcher'))+ .evaluate()+ .isEmpty) {+ await tester.tap(find.byTooltip('Conversations'));+ await tester.pump(const Duration(milliseconds: 300));+ }+ // The pointer on the cut Swarm name: its tooltip reads all of it.+ final mouse = await tester.createGesture(+ kind: PointerDeviceKind.mouse,+ );+ addTearDown(mouse.removePointer);+ await mouse.addPointer(location: Offset.zero);+ await mouse.moveTo(+ tester.getCenter(+ find.byKey(const ValueKey('super-swarm-switcher')),+ ),+ );+ // Past the hover's wait, then past the tooltip's fade.+ await tester.pump(const Duration(seconds: 1));+ await tester.pump(const Duration(milliseconds: 300));+ }+ if (scene == 'focus') {+ final orion = find.byKey(const ValueKey('super-agent-orion'));+ for (var i = 0; i < 100; i++) {+ await tester.sendKeyEvent(LogicalKeyboardKey.tab);+ await tester.pump();+ final focused = FocusManager.instance.primaryFocus?.context;+ if (focused != null &&+ find+ .descendant(+ of: orion,+ matching: find.byElementPredicate((e) => e == focused),+ )+ .evaluate()+ .isNotEmpty) {+ break;+ }+ }+ await tester.pump(const Duration(milliseconds: 400));+ }+ expect(tester.takeException(), isNull);+ await captureWindow(+ tester,+ shots,+ 'left-pane-$scene-${width.toInt()}-${brightness.name}',+ );+ await tester.pumpWidget(const SizedBox());+ await tester.runAsync(c.flush);+ c.dispose();+ await tester.pump(const Duration(seconds: 5));+ });+ }+ }+ }+}diff --git a/desktop/test/super_tab_sidebar_polish_test.dart b/desktop/test/super_tab_sidebar_polish_test.dartnew file mode 100644index 000000000..da97310eb--- /dev/null+++ b/desktop/test/super_tab_sidebar_polish_test.dart@@ -0,0 +1,73 @@+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).+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';+ await showLeftPane(+ tester,+ width: 180,+ setup: (server) => server.state['name'] = name,+ );+ expect(+ find.descendant(+ of: key('super-swarm-switcher'),+ matching: find.text(name),+ ),+ findsOneWidget,+ );+ 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_tasks_pane_polish_test.dart b/desktop/test/super_tab_tasks_pane_polish_test.dartnew file mode 100644index 000000000..e46704e19--- /dev/null+++ b/desktop/test/super_tab_tasks_pane_polish_test.dart@@ -0,0 +1,218 @@+import 'dart:async';++import 'package:flutter/material.dart';+import 'package:flutter/rendering.dart';+import 'package:flutter_svg/flutter_svg.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/pull_request_icon.dart';+import 'package:harness/shared/widgets/app_select_field.dart';+import 'package:harness/shared/widgets/skeleton.dart';+import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/tasks/personal_tasks.dart';+import 'package:harness/super_tabs/tasks/personal_tasks_pane.dart';+import 'package:harness/super_tabs/tasks/task_header.dart';+import 'package:harness/super_tabs/zone_time.dart';++import 'super_tab_parts_test.dart' show recorded;+import 'super_tab_personal_tasks_pane_test.dart' show TasksFixture, inCard;+import 'super_tab_personal_tasks_test.dart' show task;+import 'support/memory_key_value_store.dart';+import 'support/real_fonts.dart';++const taskHeaderPr = 'https://github.com/autonomous-ai/openharness/pull/3464';+const _waiting = 'Waiting for the last change to be confirmed';++/// A controller whose Swarm holds task `aeef` with its pull request's card, merged or not.+SuperTabController taskHeaderController({required bool merged}) {+ final store = MemoryKeyValueStore();+ return SuperTabController(+ tabId: 'c51479bd73b59e58176ad9e4',+ accountId: '6a86',+ initial: {+ 'tabId': 'c51479bd73b59e58176ad9e4',+ 'accountId': '6a86',+ 'selectedId': 'lead5701',+ },+ pollInterval: Duration.zero,+ save: (value) => store.write('controller', value.toString()),+ request: (method, path, {body}) async {+ final result = recorded('first_load');+ for (final part in (result['groups'] as List).cast<Map>()) {+ if (part['key'] != 'aeef') continue;+ (part['data'] as Map)['cards'] = {+ 'pullRequests': [+ {'url': taskHeaderPr, 'messageId': 'm1', if (merged) 'mergedAt': 1},+ ],+ };+ }+ return result;+ },+ );+}++Finder _prIcon(String state) => find.byWidgetPredicate(+ (w) =>+ w is SvgPicture &&+ w.bytesLoader is SvgAssetLoader &&+ (w.bytesLoader as SvgAssetLoader).assetName ==+ pullRequestIconAsset(state),+);++void main() {+ setUpAll(() async {+ await loadRealFonts();+ await superTabLoadZones();+ });+ late TasksFixture f;++ Future<void> pumpPane(WidgetTester t) => t.pumpWidget(+ MaterialApp(+ home: Scaffold(+ body: SizedBox(+ width: 340,+ child: SuperTabPersonalTasksPane(+ controller: f.controller,+ onOpenTask: (_) {},+ ),+ ),+ ),+ ),+ );++ Future<void> mount(WidgetTester t) async {+ f = TasksFixture();+ addTearDown(() => f.controller.dispose());+ await f.controller.refresh();+ await pumpPane(t);+ }++ Finder spinnerIn(Finder button) => find.descendant(+ of: button,+ matching: find.byType(CircularProgressIndicator),+ );++ testWidgets(+ 'the pressed Approve spins; the other buttons say why they wait',+ (t) async {+ await mount(t);+ f.hold = Completer<void>();+ await t.tap(inCard('new', find.text('Approve')));+ await t.pump();+ expect(+ spinnerIn(inCard('new', find.byType(FilledButton))),+ findsOneWidget,+ );+ expect(spinnerIn(inCard('new', find.byType(TextButton))), findsNothing);+ expect(+ inCard('old', find.byType(CircularProgressIndicator)),+ findsNothing,+ );+ // Every disabled decision names what it waits on.+ expect(inCard('old', find.byTooltip(_waiting)), findsNWidgets(2));+ f.hold!.complete();+ await t.pumpAndSettle();+ expect(find.byType(CircularProgressIndicator), findsNothing);+ expect(find.byTooltip(_waiting), findsNothing);+ },+ );++ testWidgets('the pressed Reject spins while its rejection is confirmed', (+ t,+ ) async {+ await mount(t);+ f.hold = Completer<void>();+ await t.tap(inCard('new', find.text('Reject')));+ await t.pumpAndSettle();+ await t.enterText(+ find.byKey(const ValueKey('task-reject-reason')),+ 'Too much scope',+ );+ await t.pump();+ await t.tap(find.text('Reject task').last);+ await t.pump();+ await t.pump(const Duration(milliseconds: 300));+ expect(spinnerIn(inCard('new', find.byType(TextButton))), findsOneWidget);+ expect(spinnerIn(inCard('new', find.byType(FilledButton))), findsNothing);+ f.hold!.complete();+ await t.pumpAndSettle();+ expect(find.byType(CircularProgressIndicator), findsNothing);+ });++ testWidgets(+ 'Auto approve and Review are the app select, saying what each does',+ (t) async {+ await mount(t);+ final mode = find.byKey(const ValueKey('tasks-approval-mode'));+ expect(t.widget(mode), isA<AppSelectField<String>>());+ expect(find.byType(DropdownButton<String>), findsNothing);+ await t.tap(mode);+ await t.pumpAndSettle();+ // Each says what it does, whole, in the pane's 340.+ for (final detail in [+ 'Tasks you ask for start right away.',+ 'Tasks you ask for wait until you approve them.',+ ]) {+ expect(+ t.renderObject<RenderParagraph>(find.text(detail)).didExceedMaxLines,+ isFalse,+ reason: detail,+ );+ }+ await t.tap(find.text('Review').last);+ await t.pumpAndSettle();+ expect(f.commands.single, {+ 'type': 'member.approvalMode',+ 'mode': 'review',+ });+ },+ );++ testWidgets('loading draws skeleton cards, not words', (t) async {+ f = TasksFixture();+ addTearDown(() => f.controller.dispose());+ await pumpPane(t);+ expect(find.byType(SkeletonBlock), findsOneWidget);+ expect(find.text('Loading Tasks…'), findsNothing);+ });++ testWidgets('the empty pane says what will show there', (t) async {+ f = TasksFixture()..rows = [];+ addTearDown(() => f.controller.dispose());+ await f.controller.refresh();+ await pumpPane(t);+ expect(+ find.text('No tasks yet. Tasks your agents start or propose show here.'),+ findsOneWidget,+ );+ });++ for (final merged in [false, true]) {+ testWidgets(+ 'the task header draws the ${merged ? 'merged' : 'open'} pull request icon',+ (t) async {+ final c = taskHeaderController(merged: merged);+ addTearDown(c.dispose);+ await c.refresh();+ expect(c.snapshot?.conversation('aeef'), isNotNull);+ await t.pumpWidget(+ MaterialApp(+ home: Scaffold(+ body: SuperTabTaskHeader(+ controller: c,+ task: SuperTabPersonalTask(+ task('aeef', 1, 20)+ ..['status'] = 'done'+ ..['canApprove'] = false+ ..['pullRequestUrl'] = taskHeaderPr,+ ),+ ),+ ),+ ),+ );+ expect(_prIcon('Merged'), merged ? findsOneWidget : findsNothing);+ expect(_prIcon('Open'), merged ? findsNothing : findsOneWidget);+ expect(find.text('#3464'), findsOneWidget);+ },+ );+ }+}diff --git a/desktop/test/super_tab_tasks_pane_surface_test.dart b/desktop/test/super_tab_tasks_pane_surface_test.dartindex 875db067d..82ea70806 100644--- a/desktop/test/super_tab_tasks_pane_surface_test.dart+++ b/desktop/test/super_tab_tasks_pane_surface_test.dart@@ -157,7 +157,12 @@ void main() {final pane = t.getRect(find.byType(SuperTabPersonalTasksPane));expect(pane.size, const Size(340, windowHeight));if (count == 0) {- expect(find.text('No tasks yet'), findsOneWidget);+ expect(+ find.text(+ 'No tasks yet. Tasks your agents start or propose show here.',+ ),+ findsOneWidget,+ );} else {expect(find.text('Task number 0'), findsOneWidget);// The card with no agent is on screen, as the person's own task, with no agent avatar (#4204's cardsdiff --git a/desktop/test/super_tab_v3_empty_org_test.dart b/desktop/test/super_tab_v3_empty_org_test.dartindex 32abb81a6..a41551467 100644--- a/desktop/test/super_tab_v3_empty_org_test.dart+++ b/desktop/test/super_tab_v3_empty_org_test.dart@@ -97,8 +97,11 @@ void main() {var made = 0;final c = await show(tester, onNewProject: () => made++);expect(find.text('Loading conversation…'), findsNothing);- expect(find.text('Create a project to get started.'), findsOneWidget);- final project = find.widgetWithText(FilledButton, 'New project');+ expect(+ find.text('Start a project, or bring an agent to work with you.'),+ findsOneWidget,+ );+ final project = find.widgetWithText(TextButton, 'New project');expect(project, findsOneWidget);expect(find.byKey(const ValueKey('super-empty-new-agent')), findsOneWidget);await tester.tap(project);@@ -120,11 +123,17 @@ void main() {];},);- expect(find.text('Create a project to get started.'), findsOneWidget);+ expect(+ find.text('Start a project, or bring an agent to work with you.'),+ findsOneWidget,+ );unawaited(c.select('agent-chat-kestrel'));await settle(tester);expect(c.selected?.id, 'agent-chat-kestrel');- expect(find.text('Create a project to get started.'), findsNothing);+ expect(+ find.text('Start a project, or bring an agent to work with you.'),+ findsNothing,+ );await end(tester, c);});diff --git a/desktop/test/super_tab_v3_left_test.dart b/desktop/test/super_tab_v3_left_test.dartindex a512f4703..1f67e539f 100644--- a/desktop/test/super_tab_v3_left_test.dart+++ b/desktop/test/super_tab_v3_left_test.dart@@ -362,15 +362,15 @@ 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));expect(- tester.widget<Text>(text('orion', 'web-project')).style?.color,+ tester.widget<Text>(text('orion', '· web-project')).style?.color,grid.SidebarInk.muted(tester.element(key('super-agent-orion'))),);expect(ring('kestrel'), findsNothing);- expect(text('kestrel', 'web-project'), findsNothing);+ expect(text('kestrel', '· web-project'), findsNothing);semantics.dispose();});@@ -388,7 +388,7 @@ void main() {bool cut(String shown) => tester.renderObject<RenderParagraph>(text('orion', shown)).didExceedMaxLines;- expect(cut('web-project'), isTrue);+ expect(cut('· web-project'), isTrue);expect(cut('Orion Lead'), isFalse);});diff --git a/desktop/test/support/super_tab_left_pane.dart b/desktop/test/support/super_tab_left_pane.dartnew file mode 100644index 000000000..2f17f08b3--- /dev/null+++ b/desktop/test/support/super_tab_left_pane.dart@@ -0,0 +1,76 @@+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/state/app_state.dart';+import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/places.dart';+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;+import 'super_tab_fixture.dart';++/// An agent of [contributor]'s in the fixture's one project.+Map<String, dynamic> leftPaneAgent(+ String id,+ String name, {+ String contributor = 'owner',+}) => {+ 'id': id,+ 'projectId': 'lead',+ 'name': name,+ 'displayName': name,+ 'machineId': 'host',+ 'harnessId': 'session',+ 'contributorId': contributor,+ 'configuration': {'engine': 'codex'},+};++/// The Desktop's left pane alone ([ProjectSidebar] with `board`), on the+/// fixture's Swarm after [setup], [width] wide.+Future<SuperTabController> showLeftPane(+ WidgetTester tester, {+ void Function(ConversationServer server)? setup,+ double width = 300,+ Brightness brightness = Brightness.light,+}) async {+ final server = swarm();+ setup?.call(server);+ final activity = (await tester.runAsync(() => load(server)))!;+ final c = activity.controller;+ final AppNotifier app = createApp();+ addTearDown(app.dispose);+ final previous = grid.AppTheme.brightness.value;+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = previous);+ await tester.binding.setSurfaceSize(Size(width, 900));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ await tester.pumpWidget(+ MaterialApp(+ debugShowCheckedModeBanner: false,+ theme: grid.buildAppTheme(brightness: brightness),+ home: Scaffold(+ body: ListenableBuilder(+ listenable: c,+ builder: (context, _) => ProjectSidebar(+ controller: c,+ app: app,+ onSelect: c.select,+ onNewAgent: () {},+ places: SuperTabPlaces.of(c),+ onNewSwarm: () {},+ onNewProject: () {},+ onPage: (_) {},+ activity: activity,+ attention: activity.attention,+ onManage: () {},+ board: true,+ ),+ ),+ ),+ ),+ );+ await tester.pump();+ addTearDown(() => tester.pumpWidget(const SizedBox()));+ return c;+}diff --git a/desktop/test/swarm_v3_new_agent_entry_test.dart b/desktop/test/swarm_v3_new_agent_entry_test.dartindex 44eed6096..77a319625 100644--- a/desktop/test/swarm_v3_new_agent_entry_test.dart+++ b/desktop/test/swarm_v3_new_agent_entry_test.dart@@ -11,9 +11,9 @@ import 'keymap_host_test.dart' show MemoryKeymap;import 'super_tab_launch_test.dart' show SuperTabLaunchFixture, tabId;// Task #4196 (anh Dee, 11-07): + New agent in My agents opens the workspace's-// Cmd-N form, with every picker and one more choice, Member or Lead.+// Cmd-N form, with every picker and one more choice, Agent or Product Manager.void main() {- testWidgets('+ New agent opens Cmd-N as a Member', (tester) async {+ testWidgets('+ New agent opens Cmd-N as an Agent', (tester) async {final oldEntry = newHarnessOpensInBox;newHarnessOpensInBox = true;addTearDown(() => newHarnessOpensInBox = oldEntry);@@ -32,8 +32,7 @@ void main() {await tester.pumpWidget(MaterialApp(theme: grid.buildAppTheme(brightness: Brightness.light),- builder: (context, child) =>- KeymapProvider(keymap: map, child: child!),+ builder: (context, child) => KeymapProvider(keymap: map, child: child!),home: SwarmScreen(notifier: f.app,nativeTabs: false,@@ -50,8 +49,10 @@ void main() {final form = find.byType(NewHarnessForm);expect(form, findsOneWidget);final kind = find.byKey(const ValueKey('new-harness-field-agent-kind'));- expect(find.descendant(of: kind, matching: find.text('Member')),- findsOneWidget);+ expect(+ find.descendant(of: kind, matching: find.text('Agent')),+ findsOneWidget,+ );for (final picker in ['agent', 'machine', 'project']) {expect(find.byKey(ValueKey('new-harness-field-$picker')), findsOneWidget);}diff --git a/docs/plans/2026-11-07-desktop-audit-polish-plan.md b/docs/plans/2026-11-07-desktop-audit-polish-plan.mdnew file mode 100644index 000000000..962eb1613--- /dev/null+++ b/docs/plans/2026-11-07-desktop-audit-polish-plan.md@@ -0,0 +1,192 @@+# Desktop 1.3.89 audit: words, Board fit, new-project visibility, left pane and polish — Implementation Plan++> Way of working: the Engineer implements this plan task by task, test first, each failing test committed before+> its code (project instructions, Roles › Engineer). Groups A–D share no files and run in parallel.++**Goal:** Fix audit findings 11, 12, 14, 19, 20, 21 and the "Smaller polish" list of the Desktop 1.3.89 audit, so the+screens a person meets first say one thing and fit a laptop window.++**Architecture:** Desktop-only changes in `desktop/lib/`, each a small edit to the widget the finding names, reusing+its existing components (`AppMenuItem`, `ProjectVisibility`, `SuperTabSectionHeading`, `DesktopPill`,+`AppSelectField`, `SkeletonText`). No server change.++**Tech Stack:** Flutter (Dart), widget tests with a memory store and a fake sign-in, shot tests that write PNGs only+when `HARNESS_SUPER_TAB_CAPTURE` names a folder (`test/support/capture.dart`).++**Spec:** `docs/audits/2026-11-07-desktop-1.3.89.md` (PR #3526, task #4436), findings 11, 12, 14, 19, 20, 21 and+"Smaller polish"; task #4445.++## Global Constraints++- Words follow `docs/naming-system.md`: the coordinator is **Product Manager** on screen, never "Lead"; Swarm, never+ "org".+- Change only what a finding names; reuse existing components and styles; no new setting or switch.+- No raw Material `DropdownButton`/`IconButton` (`desktop/CLAUDE.md`).+- Tests never sign in or read a login; they use `MemoryKeyValueStore` and the existing fakes.+- Every finding: a test that fails before its code, then passes; light and dark shots at 880 and/or 1500 wide.+- Shared Flutter code: macOS, Windows, Linux alike; nothing here starts a process.++## Review Focus++- A text scale above 1.0: the role menu's lines, the folded Projects count and the empty-org buttons still fit.+- A Swarm the reader can only read: Cmd-N and the empty-org buttons stay disabled or hidden, as + New agent is.+- A Board with every column empty but one, and one with all columns full: the fit never cuts a column mid-word.+- A recovered + New agent journal (phase starting): the role and the visibility stay locked as sent.+- Keyboard only: Tab through the left pane shows one ring on the focused row, distinct from the selected fill.++---++## Group A — New agent form (`widgets/new_harness_form.dart`, `screens/swarm_screen.dart`, `super_tabs/launch.dart`, `state/new_harness.dart`, `state/harness_launch_integration.dart`)++### Task A1: One name for the PM role, whole menu lines (finding 11, words)++**Files:** Modify `lib/widgets/new_harness_form.dart` (`_desktopKindMenu`, the agent-kind `DesktopPill`). Test:+`test/super_tab_new_agent_words_test.dart`.++- [ ] Failing test: open + New agent's form; the chip reads `Agent`; the menu lists `Agent` — `Works with you in its+ own chat` and `Product Manager` — `Leads a project and its crew`; no `Lead` or `Member` text anywhere in the form;+ each detail line renders unclipped (its `RenderParagraph.didExceedMaxLines` is false) at 880 wide and text scale+ 1.3. Choosing Product Manager makes the chip read `Product Manager` with the crown.+- [ ] Code: labels and details above; tooltip `Start as an agent or a Product Manager`; the menu is as wide as its+ longest line needs (at least today's `_machineMenuWidth`). Wire values stay `member`/`lead`.+- [ ] Shots light/dark at 880 and 1500 of the open menu.++### Task A2: Cmd-N in a Swarm opens + New agent's form (finding 11, two meanings)++**Files:** Modify `lib/screens/swarm_screen.dart` (`_newAgent`). Test: same file as A1.++- [ ] Failing test: in a Swarm v3 tab (the one that shows My agents and + New agent), Cmd-N, File ▸ New Agent and+ the search's New agent each open the form with the role chip and a `New agent` button — the same form + New agent+ opens. A reader who can't write gets what + New agent gives them (nothing).+- [ ] Code: in a Swarm tab where + New agent is offered, `_newAgent` with no explicit conversation, split or project+ takes the `newSwarmAgent: true` path.++### Task A3: Product Manager asks whether its project is public (finding 14)++**Files:** Modify `lib/super_tabs/launch.dart` (the `newAgent` journal and `projectVisibility`),+`lib/widgets/new_harness_form.dart` (show `ProjectVisibility` while the kind is `lead`). Test:+`test/super_tab_new_agent_visibility_test.dart`.++- [ ] Failing test: + New agent, choose Product Manager: the same `ProjectVisibility` control as + New project shows,+ defaulting to Public; choosing Private sends `project.create` with `visibility: private`. With Agent chosen the+ control is hidden. After the first request it is locked, as + New project's is.+- [ ] Code: the new-agent journal carries `visibility`; the integration's `projectVisibility` is set for a new agent;+ the form shows the control only while `agentKind == 'lead'`; `prepare` saves it as the + New project path does.++### Task A4: New agent names and folder chip (polish)++**Files:** Modify `lib/super_tabs/launch.dart` (`_openMemberChat` name), `lib/screens/swarm_screen.dart` (folder+chip with no remembered project). Test: `test/super_tab_new_agent_names_test.dart`.++- [ ] Failing test: with an agent already named `Claude Code` in the Swarm, a new Claude Code agent is sent as+ `Claude Code 2` (then `3`); Codex likewise.+- [ ] Failing test: with no remembered project the folder chip reads `New folder`, never the generated+ `claude-YYYY-…` name; the generated folder name is still what is created.+- [ ] Code: the first free name among the snapshot's agents; the chip's label for an auto project is `New folder`.++## Group B — Board and middle (`super_tabs/tasks_view.dart`, `super_tabs/view.dart`)++### Task B1: The Board shows Working at 1500 (finding 12)++**Files:** Modify `lib/super_tabs/tasks_view.dart` (`_fullWidth`). Test: `test/super_tab_board_fit_test.dart`.++- [ ] Failing test: a 1500×860 window with Proposal 2, Next up 2, Working 2, empty Review/Done/Merged, Shipped 1:+ Proposal, Next up and Working are fully on screen.+- [ ] Code: `_fullWidth` tries every count of full columns, with the slim lanes between them; trailing lanes are+ included when they fit and otherwise start at the view's edge, never cut. Today it only tries counts that end+ before a full column, so empty lanes after Working made it fall back to two.++### Task B2: At the smallest window the left pane folds into its drawer (finding 12)++**Files:** Modify `lib/super_tabs/view.dart` (`narrow` in the layout build, `_boardHeader`). Test:+`test/super_tab_board_fit_test.dart`.++- [ ] Failing test: at 880 wide with the Board on, the left pane is not laid out, the Board header has the+ `Conversations` menu button, pressing it opens the left pane as a drawer and Esc closes it; at 1100 the left pane+ is in place and the button is absent. The toolbar is one row at 880.+- [ ] Code: the Board layout folds the left pane below 1000 logical px (scaled by text scale), with the same drawer+ views without the Board use; the button goes in `_boardHeader`.++### Task B3: Empty Swarm says one thing (finding 20, middle)++**Files:** Modify `lib/super_tabs/view.dart` (`_conversation` empty state). Test:+`test/super_tab_empty_swarm_test.dart`.++- [ ] Failing test: a Swarm with no projects shows `Start a project, or bring an agent to work with you.`, then+ `New project` and `New agent` drawn by the same widget at the same size; a pending action reads `Check again`.+- [ ] Code: one sentence; both buttons the same secondary style with a + icon.++### Task B4: Board polish (polish)++**Files:** Modify `lib/super_tabs/tasks_view.dart` (`_offView`, the "Tasks" title), `lib/super_tabs/view.dart`+(`_openTask`/`_openPersonalTask` when the chat can't be read, Board/List tab). Test:+`test/super_tab_board_polish_test.dart`.++- [ ] Failing test: a pill names only columns wholly off screen.+- [ ] Failing test: with List on, the tab row shows which view is on and no `Tasks` title repeats it.+- [ ] Failing test: clicking a card whose chat can't be read shows `You can't open this task's chat.` where the+ pane shows action hints.+- [ ] Code: the smallest change for each.++## Group C — Left pane (`super_tabs/project_sidebar.dart`, `super_tabs/buddy_rows.dart`, `super_tabs/identity.dart`, `super_tabs/section_heading.dart`)++### Task C1: Folded Projects shows when something waits (finding 19)++**Files:** Modify `lib/super_tabs/section_heading.dart`, `lib/super_tabs/project_sidebar.dart`. Test:+`test/super_tab_projects_folded_test.dart`.++- [ ] Failing test: Projects folded with a mention in one project: the heading is bold and carries the waiting count+ (the same number the project rows' badges add up to); with nothing waiting it is the normal heading.+- [ ] Code: an optional `waiting` count on `SuperTabSectionHeading`, shown only while collapsed.++### Task C2: Keyboard focus is a ring, not a second selection (finding 21)++**Files:** Modify `lib/super_tabs/buddy_rows.dart`, `lib/super_tabs/project_sidebar.dart`. Test:+`test/super_tab_sidebar_focus_test.dart`.++- [ ] Failing test: Tab to a row that is not selected: its fill is unchanged (not the hover fill) and it draws a+ `DesktopChrome.focusRing`-coloured 2 px border; the selected row keeps its fill.+- [ ] Code: focus draws the ring; hover keeps the hover fill.++### Task C3: Left-pane polish and "No projects yet" (finding 20, polish)++**Files:** Modify `lib/super_tabs/project_sidebar.dart`, `lib/super_tabs/identity.dart`. Test:+`test/super_tab_sidebar_polish_test.dart`.++- [ ] Failing tests: a long Swarm name has a tooltip with the whole name; a PM's project reads `Orion · web-project`;+ the crown is at least 12 px on a 20 px avatar; an agent with no chat shows no hover fill or click cursor; open+ Projects with none shows `No projects yet.`+- [ ] Code: the smallest change for each.++## Group D — Tasks pane, Buddy dialogs, join dialog (`super_tabs/tasks/`, `super_tabs/buddy_*.dart`, `super_tabs/buddies.dart`, `super_tabs/join_dialog.dart`, and the other "Check pending action" sites)++### Task D1: Tasks pane and task header polish++**Files:** Modify `lib/super_tabs/tasks/personal_tasks_pane.dart`, `lib/super_tabs/tasks/task_header.dart`. Test:+`test/super_tab_tasks_pane_polish_test.dart`.++- [ ] Failing tests: the pressed Approve or Reject shows a spinner; buttons disabled by another pending action say+ why in their tooltip; a merged task's header draws the merged pull-request icon; Auto approve / Review is an+ `AppSelectField` whose options say what each does; loading draws skeleton cards; the empty pane says+ `No tasks yet. Tasks your agents start or propose show here.`+- [ ] Code: reuse the existing spinner, `AppIcons` merge icon, `AppSelectField` and `SkeletonText`. The header's ⋮+ is left out: nothing it would hold is missing from the header today (said in the PR).++### Task D2: Buddy dialogs and header polish++**Files:** Modify `lib/super_tabs/buddy_restart.dart`, `lib/super_tabs/buddies.dart`, `lib/super_tabs/buddy_model.dart`,+`lib/super_tabs/buddy_machines.dart`. Test: `test/super_tab_buddy_polish_test.dart`.++- [ ] Failing tests: Restart and Rename errors use the card's error colour; the Buddy header names its model, not+ `Your subscription`; with one model choice there is no menu arrow; `Choose a machine` is whole at 880.+- [ ] Code: the smallest change for each.++### Task D3: Join dialog and "Check pending action" words++**Files:** Modify `lib/super_tabs/join_dialog.dart`, `lib/super_tabs/project_add_people.dart`,+`lib/super_tabs/work_details.dart`, `lib/super_tabs/project_options.dart`, `lib/super_tabs/switch_pm.dart`. Test:+`test/super_tab_join_polish_test.dart`.++- [ ] Failing tests: the join dialog labels the account `Signed in as <email>` and draws errors in the error colour;+ every pending-action button reads `Check again`.+- [ ] Code: the smallest change for each.diff --git a/docs/plans/assets/desktop-audit-polish-4445/board-1500-dark.png b/docs/plans/assets/desktop-audit-polish-4445/board-1500-dark.pngnew file mode 100644index 000000000..296e3dcb9Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/board-1500-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/board-1500-light.png b/docs/plans/assets/desktop-audit-polish-4445/board-1500-light.pngnew file mode 100644index 000000000..f1e75f63bBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/board-1500-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/board-880-drawer-dark.png b/docs/plans/assets/desktop-audit-polish-4445/board-880-drawer-dark.pngnew file mode 100644index 000000000..2d630d08bBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/board-880-drawer-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/board-880-drawer-light.png b/docs/plans/assets/desktop-audit-polish-4445/board-880-drawer-light.pngnew file mode 100644index 000000000..d521c7193Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/board-880-drawer-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/board-880-folded-dark.png b/docs/plans/assets/desktop-audit-polish-4445/board-880-folded-dark.pngnew file mode 100644index 000000000..e6ebc5ea8Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/board-880-folded-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/board-880-folded-light.png b/docs/plans/assets/desktop-audit-polish-4445/board-880-folded-light.pngnew file mode 100644index 000000000..41dfa9e9aBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/board-880-folded-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/board-list-dark.png b/docs/plans/assets/desktop-audit-polish-4445/board-list-dark.pngnew file mode 100644index 000000000..9419de954Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/board-list-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/board-list-light.png b/docs/plans/assets/desktop-audit-polish-4445/board-list-light.pngnew file mode 100644index 000000000..5b8cc03deBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/board-list-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-mode-dark.png b/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-mode-dark.pngnew file mode 100644index 000000000..43eef88adBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-mode-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-mode-light.png b/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-mode-light.pngnew file mode 100644index 000000000..bd5ce5ce9Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-mode-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-pending-dark.png b/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-pending-dark.pngnew file mode 100644index 000000000..6e2567617Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-pending-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-pending-light.png b/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-pending-light.pngnew file mode 100644index 000000000..8d3e42c9dBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d1-tasks-pending-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d2-buddy-header-dark.png b/docs/plans/assets/desktop-audit-polish-4445/d2-buddy-header-dark.pngnew file mode 100644index 000000000..6802e8c7bBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d2-buddy-header-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d2-buddy-header-light.png b/docs/plans/assets/desktop-audit-polish-4445/d2-buddy-header-light.pngnew file mode 100644index 000000000..bb99aaf5fBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d2-buddy-header-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d2-restart-error-dark.png b/docs/plans/assets/desktop-audit-polish-4445/d2-restart-error-dark.pngnew file mode 100644index 000000000..d44d4afb1Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d2-restart-error-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d2-restart-error-light.png b/docs/plans/assets/desktop-audit-polish-4445/d2-restart-error-light.pngnew file mode 100644index 000000000..cab4192deBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d2-restart-error-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d3-join-dark.png b/docs/plans/assets/desktop-audit-polish-4445/d3-join-dark.pngnew file mode 100644index 000000000..30d9bbe1dBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d3-join-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d3-join-error-dark.png b/docs/plans/assets/desktop-audit-polish-4445/d3-join-error-dark.pngnew file mode 100644index 000000000..5e41ce5bbBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d3-join-error-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d3-join-error-light.png b/docs/plans/assets/desktop-audit-polish-4445/d3-join-error-light.pngnew file mode 100644index 000000000..251925abbBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d3-join-error-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/d3-join-light.png b/docs/plans/assets/desktop-audit-polish-4445/d3-join-light.pngnew file mode 100644index 000000000..c7c97959eBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/d3-join-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/empty-swarm-dark.png b/docs/plans/assets/desktop-audit-polish-4445/empty-swarm-dark.pngnew file mode 100644index 000000000..29f1a271eBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/empty-swarm-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/empty-swarm-light.png b/docs/plans/assets/desktop-audit-polish-4445/empty-swarm-light.pngnew file mode 100644index 000000000..9c677dac5Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/empty-swarm-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-1500-dark.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-1500-dark.pngnew file mode 100644index 000000000..74d66b2bfBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-1500-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-1500-light.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-1500-light.pngnew file mode 100644index 000000000..c6d6fab1eBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-1500-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-880-dark.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-880-dark.pngnew file mode 100644index 000000000..349f57669Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-880-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-880-light.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-880-light.pngnew file mode 100644index 000000000..22f981eceBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-focus-880-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-1500-dark.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-1500-dark.pngnew file mode 100644index 000000000..dcec36683Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-1500-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-1500-light.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-1500-light.pngnew file mode 100644index 000000000..4fc669ab4Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-1500-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-880-dark.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-880-dark.pngnew file mode 100644index 000000000..d0e42534eBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-880-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-880-light.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-880-light.pngnew file mode 100644index 000000000..9e583382cBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-folded-waiting-880-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-1500-dark.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-1500-dark.pngnew file mode 100644index 000000000..5001f8733Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-1500-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-1500-light.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-1500-light.pngnew file mode 100644index 000000000..17028fe94Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-1500-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-880-dark.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-880-dark.pngnew file mode 100644index 000000000..db0a65c58Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-880-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-880-light.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-880-light.pngnew file mode 100644index 000000000..4064492f1Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-no-projects-880-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-1500-dark.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-1500-dark.pngnew file mode 100644index 000000000..da96143a5Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-1500-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-1500-light.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-1500-light.pngnew file mode 100644index 000000000..f39ce4d50Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-1500-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-880-dark.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-880-dark.pngnew file mode 100644index 000000000..a0eba28f6Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-880-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-880-light.png b/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-880-light.pngnew file mode 100644index 000000000..45416b57fBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/left-pane-polish-880-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-1500-dark.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-1500-dark.pngnew file mode 100644index 000000000..0ef540377Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-1500-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-1500-light.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-1500-light.pngnew file mode 100644index 000000000..c7bcf7c8fBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-1500-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-880-dark.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-880-dark.pngnew file mode 100644index 000000000..62d32828cBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-880-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-880-light.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-880-light.pngnew file mode 100644index 000000000..20c541850Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-pm-visibility-880-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-1500-dark.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-1500-dark.pngnew file mode 100644index 000000000..a542e7a4eBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-1500-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-1500-light.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-1500-light.pngnew file mode 100644index 000000000..b1a738a77Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-1500-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-880-dark.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-880-dark.pngnew file mode 100644index 000000000..3b63ecad5Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-880-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-880-light.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-880-light.pngnew file mode 100644index 000000000..902a114a3Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-chip-880-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-1500-dark.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-1500-dark.pngnew file mode 100644index 000000000..31edea0c4Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-1500-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-1500-light.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-1500-light.pngnew file mode 100644index 000000000..c51bb0e38Binary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-1500-light.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-880-dark.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-880-dark.pngnew file mode 100644index 000000000..0b41e5f0eBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-880-dark.png differdiff --git a/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-880-light.png b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-880-light.pngnew file mode 100644index 000000000..3d6a2f2fcBinary files /dev/null and b/docs/plans/assets/desktop-audit-polish-4445/new-agent-role-menu-880-light.png differ