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: one Swarm surface, a quiet top bar and the six design rules (#4465) (#3536)
0xken15a1df11b33219
diff --git a/desktop/design/desktop-design-system.md b/desktop/design/desktop-design-system.mdindex 20fd5f377..21de0f3da 100644--- a/desktop/design/desktop-design-system.md+++ b/desktop/design/desktop-design-system.md@@ -142,6 +142,20 @@ project name, Enter GitHub URL, Run Blender with. Standard named destinationsretain their names, such as Harness Store and New Tab. Avoid repeated labels,internal state names, decorative punctuation and implementation details.+All copy is sharp, not only empty states (anh Dee, 2026-11-07, task #4465):++1. **One idea per line.** No line runs past one short sentence unless someone+ asked for an explanation.+2. **Buttons are one or two words, verb first:** Accept, New agent, Join.+3. **Labels and notes are a few words.**+4. **Cut filler:** please, you can, just, simply, currently, in order to,+ will appear here.+5. **Say it once.** Never repeat what the screen already shows.+6. **Errors say what happened and what to do**, in two short sentences at+ most.++An empty list or pane says nothing (Swarm elements, rule 7).+## Color and stateUse semantic light/dark tokens throughout. Floating surfaces share the same@@ -378,6 +392,50 @@ against `test/goldens/swarm-elements-{light,dark}.png`, holding each elementto its own area: a face or ring may barely differ, an icon or letter aquarter of its box, and nothing else outside the words more than 38 pixels.+Seven rules hold the whole Swarm screen to minimal, clear and quiet, with less+on it (anh Dee, 2026-11-07, task #4465). Every element below follows them.++1. **Grey everywhere; colour only on agent faces.** Grounds, text, rules and+ controls take the neutral ramp. The faces and the Lead ring are the colour.+2. **Blue only for the main action; red only for failed.** One filled blue+ action per surface; the semantic error ink only for what failed.+3. **Three text sizes: 14 chat, 13 names, 12 details.** Messages are 14,+ names and controls 13 (`AppType.label`), every detail 12+ (`AppType.caption`). In lists, bold means unread and nothing else.+4. **Every row: face, name, one quiet detail on the right.** One detail, in+ 12-point `AppPalette.textFaint`; anything more waits for hover or a menu.+5. **Dropdowns stay plain text until you hover.** At rest a dropdown is its+ value in quiet text; hover, focus or an open menu brings the chevron and+ the primary ink. The chevron's room is kept at rest, so hover moves nothing.+6. **If it doesn't help you decide, it's gone.** A line that only describes+ (a subscription, a machine, what an agent can read) leaves the screen; its+ full value stays in menus, tooltips and accessibility.+7. **Empty means empty.** An empty list or pane shows nothing, or only the+ action that fills it (such as + New agent). Words stay only when they help+ someone act: why something can't be used and who can fix it, or an error.+ "None yet", "No tasks yet", "Nothing here yet", "Start the conversation."+ and the like are not drawn. The gallery draws each element empty.++- **One surface.** The left, middle and right panes share one ground,+ `AppPalette.swarmField`, the colour the selected native tab joins. Only the+ layout's 1-point `AppDesktop.rim` hairlines split them. `SuperTabView` paints+ it under all three, and the Tasks pane paints it too, so no pane shows its+ host's colour. A palette the person chose that names its own sidebar (Plum)+ keeps it.+- **Top bar.** Every agent's chat has the same 44-high bar+ (`SuperTabAgentChatHeader`): at the left the 22-point face and the name in+ 13-point semibold, inset as the Buddy card button insets them, the name+ taking at most half the bar; at the right one line+ (`SuperTabEngineModelLine`), `Claude Code · Opus 5.5`, in 12-point+ `textFaint`, then the ⋯ menu (`AppIcons.ellipsis`). The line gives way with+ "…" before the name or ⋯ do. For the reader's own Swarm Buddy it is a+ dropdown by rule 5 and opens one menu: its engines first (the one it runs on+ takes it back from a shared model), then the models shared in the Swarm.+ The server switches no other agent, so theirs is the same words and opens+ nothing. A switch under way reads `Switching to Codex…`; a shared model+ nobody serves adds `not served now`. The subscription, the machine and+ "reads all your projects" are not in the bar. The gallery draws the bar of+ the reader's Buddy and of a member agent.- **Agent face.** An agent with no chosen picture wears a face(`SuperTabAvatarFace`, `avatar_art.dart`) in rows, cards, chat and profile:a round disc with a soft top-to-bottom fill, two eyes and a small smile.diff --git a/desktop/lib/super_tabs/buddy_card.dart b/desktop/lib/super_tabs/buddy_card.dartindex 876f9e832..94fb46ba8 100644--- a/desktop/lib/super_tabs/buddy_card.dart+++ b/desktop/lib/super_tabs/buddy_card.dart@@ -64,6 +64,7 @@ class _BuddyCardButtonState extends State<BuddyCardButton> {List<String> _words = const [];String? _marked, _message;var _busy = false, _flagsFocused = false, _warning = false;+ var _hover = false, _focus = false;SuperTabController get c => widget.controller;AppNotifier? get app => widget.app;@@ -218,6 +219,8 @@ class _BuddyCardButtonState extends State<BuddyCardButton> {key: const ValueKey('super-board-buddy-button'),focusNode: _buttonFocus,borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ onHover: (hover) => setState(() => _hover = hover),+ onFocusChange: (focus) => setState(() => _focus = focus),onTap: () => _portal.isShowing ? _close() : _open(),child: Padding(padding: const EdgeInsets.all(_gap),@@ -237,10 +240,14 @@ class _BuddyCardButtonState extends State<BuddyCardButton> {),),const SizedBox(width: _gap),- Icon(- AppIcons.chevronDown,- size: AppIcons.inlineSize,- color: DesktopChrome.muted,+ // Plain until hover (anh Dee's rule 5, task #4465); its room is kept, so hover never moves the name.+ Opacity(+ opacity: _hover || _focus || _portal.isShowing ? 1 : 0,+ child: Icon(+ AppIcons.chevronDown,+ size: AppIcons.inlineSize,+ color: DesktopChrome.muted,+ ),),],),diff --git a/desktop/lib/super_tabs/buddy_engine.dart b/desktop/lib/super_tabs/buddy_engine.dartindex 42e1bdec1..76ec5ab2a 100644--- a/desktop/lib/super_tabs/buddy_engine.dart+++ b/desktop/lib/super_tabs/buddy_engine.dart@@ -6,14 +6,17 @@ import '../shared/theme/app_icons.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/widgets/app_menu.dart';import '../widgets/desktop_chrome.dart';+import '../widgets/engine_identity.dart';import '../widgets/finger_target.dart';+import 'buddy_model.dart' show buddyModelBusy;import 'controller.dart';import 'model.dart';+/// An engine as a Swarm bar names it: the CLI's own name.String buddyEngineLabel(String engine) => switch (engine) {'claude' => 'Claude Code','codex' => 'Codex',- _ => engine,+ _ => engineIdentity(engine).label,};/// Match backend buddyEngine.ts: the owning computer must implement the@@ -61,8 +64,89 @@ List<String> buddyEngineOffers(];}-/// The compact header control and the limit notice share the same menu and-/// request. Only observations change its offers; it never probes a login.+/// The engine rows of a Swarm Buddy's menus: each engine its machine is signed in to in a fresh reading, checked+/// while the Buddy runs on it with its own sign-in. With [backFromShared] (the top bar's one menu, task #4465) the+/// engine it runs on is always listed and takes it back from a shared model to its own sign-in, as Your subscription+/// did. Only observations change the offers; nothing probes a login.+List<Widget> buddyEngineMenuRows({+ required SuperTabController controller,+ required SuperTabAgent agent,+ required MenuController menu,+ required bool phone,+ bool backFromShared = false,+}) {+ final c = controller;+ final snapshot = c.snapshot!;+ final chat = _buddyChatOf(c, agent);+ final busy = _buddyEngineBusy(c, agent);+ final offers = buddyEngineOffers(snapshot, agent, now: DateTime.now());+ final engines = [+ if (backFromShared && !offers.contains(agent.engine)) agent.engine,+ ...offers,+ ];+ final shared = agent.gridModel != null;+ return [+ for (final engine in engines)+ fingerTarget(+ enabled: phone,+ AppMenuItem(+ label: buddyEngineLabel(engine),+ icon: engine == agent.engine && !shared ? AppIcons.check : null,+ onPressed: backFromShared && engine == agent.engine+ ? (buddyModelBusy(c, agent)+ ? null+ : () {+ menu.close();+ if (shared) unawaited(c.switchBuddyModel(null));+ })+ : busy+ ? null+ : () {+ menu.close();+ if (engine == agent.engine && !shared) return;+ unawaited(+ c.switchBuddyEngine(engine, conversationId: chat?.id),+ );+ },+ ),+ ),+ if (engines.isEmpty)+ Padding(+ padding: const EdgeInsets.symmetric(+ horizontal: grid.AppDesktop.groupGap,+ vertical: grid.AppDesktop.menuInset,+ ),+ child: Text(+ 'No signed-in engine in a fresh machine reading.',+ style: DesktopChrome.metadata(),+ ),+ ),+ ];+}++/// With several Buddies, the chat of [agent] that an engine switch names; null with one Buddy.+SuperTabConversation? _buddyChatOf(SuperTabController c, SuperTabAgent agent) =>+ c.snapshot!.buddyCap == null+ ? null+ : c.snapshot!.conversations+ .where(+ (chat) =>+ chat.isSwarmBuddyChat &&+ chat.buddyOwnerId == c.accountId &&+ chat.agentIds.contains(agent.id),+ )+ .firstOrNull;++/// Whether a Buddy's engine choices wait: as its model choices, and also while it is down or, with several Buddies,+/// before its chat is known.+bool _buddyEngineBusy(SuperTabController c, SuperTabAgent agent) =>+ buddyModelBusy(c, agent) ||+ agent.modelRequest != null ||+ (c.snapshot!.buddyCap != null && _buddyChatOf(c, agent) == null) ||+ agent.downSince != null;++/// The compact bar control and the limit notice share the same menu and+/// request.class BuddyEnginePicker extends StatefulWidget {const BuddyEnginePicker({super.key,@@ -86,18 +170,6 @@ class _BuddyEnginePickerState extends State<BuddyEnginePicker> {Widget build(BuildContext context) {final c = widget.controller;final agent = widget.agent;- final snapshot = c.snapshot!;- final severalBuddies = snapshot.buddyCap != null;- final chat = severalBuddies- ? snapshot.conversations- .where(- (chat) =>- chat.isSwarmBuddyChat &&- chat.buddyOwnerId == c.accountId &&- chat.agentIds.contains(agent.id),- )- .firstOrNull- : null;final request = agent.switchRequest;if (request != null && !widget.limitAction) {return Text(@@ -106,51 +178,15 @@ class _BuddyEnginePickerState extends State<BuddyEnginePicker> {);}final phone = workspaceIsCompact(context);- final busy =- !c.canWrite ||- c.saving ||- c.hasPendingAction ||- request != null ||- agent.modelRequest != null ||- (severalBuddies && chat == null) ||- agent.downSince != null;- final offers = buddyEngineOffers(c.snapshot!, agent, now: DateTime.now());+ final busy = _buddyEngineBusy(c, agent);return AppDropdown(controller: _menu,- children: [- for (final engine in offers)- fingerTarget(- enabled: phone,- AppMenuItem(- label: buddyEngineLabel(engine),- icon: engine == agent.engine && agent.gridModel == null- ? AppIcons.check- : null,- onPressed: busy- ? null- : () {- _menu.close();- if (engine == agent.engine && agent.gridModel == null) {- return;- }- unawaited(- c.switchBuddyEngine(engine, conversationId: chat?.id),- );- },- ),- ),- if (offers.isEmpty)- Padding(- padding: const EdgeInsets.symmetric(- horizontal: grid.AppDesktop.groupGap,- vertical: grid.AppDesktop.menuInset,- ),- child: Text(- 'No signed-in engine in a fresh machine reading.',- style: DesktopChrome.metadata(),- ),- ),- ],+ children: buddyEngineMenuRows(+ controller: c,+ agent: agent,+ menu: _menu,+ phone: phone,+ ),builder: (context, menu, _) => fingerTarget(enabled: phone,InkWell(diff --git a/desktop/lib/super_tabs/buddy_model.dart b/desktop/lib/super_tabs/buddy_model.dartindex 5b99285c8..d891b3ba4 100644--- a/desktop/lib/super_tabs/buddy_model.dart+++ b/desktop/lib/super_tabs/buddy_model.dart@@ -53,13 +53,103 @@ String _sharer(SuperTabSnapshot snapshot, String machineId) =>'a member';/// Who serves [offer], as the server's lines say it (backend buddyModel.ts).-String _servers(BuddyModelOffer offer) {+String buddyModelServers(BuddyModelOffer offer) {final servers = offer.servedBy.join(', ');return offer.servedBy.every((s) => s.endsWith("'s saved API"))? servers: 'served by $servers';}+/// The name of [model] as the Buddy's lines say it: the offer's, else the last reading that served it (a model gone+/// quiet), else its id.+String buddyModelName(+ SuperTabSnapshot snapshot,+ String model, {+ required List<BuddyModelOffer> offers,+ required DateTime now,+}) =>+ offers.where((o) => o.model == model).firstOrNull?.name ??+ superTabLocalModelRows(+ snapshot,+ now: now,+ freshFor: null,+ ).where((r) => r.model == model).firstOrNull?.name ??+ model;++/// Whether a Swarm Buddy's model choices wait: the reader cannot write, something is saving, or a switch is under way.+bool buddyModelBusy(SuperTabController c, SuperTabAgent agent) =>+ !c.canWrite ||+ c.saving ||+ c.hasPendingAction ||+ agent.switchRequest != null;++/// The model rows of a Swarm Buddy's menus: [subscription] first for the bar's picker (the top bar's engine rows say+/// it there), then the models shared in this Swarm with who serves each. A refusal shows under the chat's composer,+/// as the bar's other Buddy actions' do (`SuperTabController.composerError`).+List<Widget> buddyModelMenuRows({+ required SuperTabController controller,+ required SuperTabAgent agent,+ required String machine,+ required MenuController menu,+ required List<BuddyModelOffer> offers,+ required bool phone,+ required bool busy,+ bool subscription = true,+}) {+ final current = agent.gridModel;+ final pool = controller.snapshot!.pool(agent.machineId);+ void pick(String? model) {+ menu.close();+ if (model == current) return;+ unawaited(controller.switchBuddyModel(model));+ }++ Widget row(AppMenuItem item) => fingerTarget(enabled: phone, item);+ Widget words(String text) => Padding(+ padding: const EdgeInsets.symmetric(+ horizontal: grid.AppDesktop.groupGap,+ vertical: grid.AppDesktop.menuInset,+ ),+ child: Text(text, style: DesktopChrome.metadata()),+ );+ return [+ if (subscription)+ row(+ AppMenuItem(+ icon: current == null ? AppIcons.check : null,+ label: 'Your subscription',+ note: buddyEngineLabel(agent.engine),+ onPressed: busy ? null : () => pick(null),+ ),+ ),+ // A Buddy-only machine never joins the Swarm's grid (backend+ // read/hostRows.ts), so nothing shared reaches a Buddy there: the line+ // says who fixes it. With nothing shared, nothing is said (rule 7).+ if (agent.engine == 'claude' &&+ (pool == null || pool['buddyOnly'] == true || offers.isNotEmpty)) ...[+ if (subscription) const AppMenuDivider(),+ words('SHARED IN THIS SWARM'),+ if (pool == null || pool['buddyOnly'] == true)+ words("Add $machine to the Swarm's Machines to use shared models.")+ else+ for (final offer in offers)+ row(+ AppMenuItem(+ icon: offer.model == current ? AppIcons.check : null,+ label: offer.name,+ // Under the name: a list of servers would be cut short beside it.+ detail: buddyModelServers(offer),+ onPressed: busy ? null : () => pick(offer.model),+ ),+ ),+ const AppMenuDivider(),+ words(+ 'What your Buddy reads and writes goes to the machine or API that serves the model you pick.',+ ),+ ],+ ];+}+/// The Buddy bar's line with the model picker first (task #2354): the/// subscription or the shared model the Buddy runs on and who serves it, then/// [rest]. While a switch is under way it says where to and opens nothing.@@ -69,7 +159,7 @@ class BuddyModelLine extends StatefulWidget {required this.controller,required this.agent,required this.machine,- this.rest,+ required this.rest,});final SuperTabController controller;@@ -80,8 +170,8 @@ class BuddyModelLine extends StatefulWidget {/// Its machine's name, for the line that asks to add it to the Swarm.final String machine;- /// The bar's line after the picker; null for the pickers alone, as the one-row chat header has them (#4204).- final String? rest;+ /// The bar's line after the picker.+ final String rest;@overrideState<BuddyModelLine> createState() => _BuddyModelLineState();@@ -92,14 +182,6 @@ class _BuddyModelLineState extends State<BuddyModelLine> {SuperTabController get c => widget.controller;- /// A refusal shows under the chat's composer, as the bar's other Buddy- /// actions' do (`SuperTabController.composerError`).- void _pick(String? model) {- _menu.close();- if (model == widget.agent.gridModel) return;- unawaited(c.switchBuddyModel(model));- }-@overrideWidget build(BuildContext context) {final snapshot = c.snapshot!;@@ -110,27 +192,17 @@ class _BuddyModelLineState extends State<BuddyModelLine> {: <BuddyModelOffer>[];final current = agent.gridModel;final on = offers.where((o) => o.model == current).firstOrNull;- // A model gone quiet is still named by the last reading that served it.String nameOf(String model) =>- offers.where((o) => o.model == model).firstOrNull?.name ??- superTabLocalModelRows(- snapshot,- now: now,- freshFor: null,- ).where((r) => r.model == model).firstOrNull?.name ??- model;+ buddyModelName(snapshot, model, offers: offers, now: now);final request = agent.modelRequest;final phone = workspaceIsCompact(context);- final busy =- !c.canWrite ||- c.saving ||- c.hasPendingAction ||- agent.switchRequest != null;+ final busy = buddyModelBusy(c, agent);final after = [if (request == null && current != null)- on == null ? 'not served now' : _servers(on),- ?widget.rest,+ on == null ? 'not served now' : buddyModelServers(on),+ widget.rest,].join(' · ');+ final label = current == null ? _subscriptionModel(agent) : nameOf(current);final picker = request != null? Text(request.gridModel == null@@ -140,47 +212,59 @@ class _BuddyModelLineState extends State<BuddyModelLine> {overflow: TextOverflow.ellipsis,style: DesktopChrome.metadata(),)- : _anchor(- label: current == null- ? _subscriptionModel(agent)- : nameOf(current),- offers: offers,- phone: phone,- busy: busy,- );- if (widget.rest == null) {- return Row(- mainAxisSize: MainAxisSize.min,- children: [- if (buddyEngineCapable(snapshot, agent)) ...[- BuddyEnginePicker(- key: const ValueKey('super-buddy-engine'),+ // Only Claude switches to a shared model: on its subscription, any other engine's menu would hold the one row+ // already chosen (#4445).+ : current == null && agent.engine != 'claude'+ ? Text(+ label,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: DesktopChrome.metadata(color: DesktopChrome.foreground),+ )+ : AppDropdown(+ controller: _menu,+ // Wide enough for a model and its servers; the longer lines wrap.+ width: 320,+ maxHeight: 520,+ children: buddyModelMenuRows(controller: c,agent: agent,+ machine: widget.machine,+ menu: _menu,+ offers: offers,+ phone: phone,+ busy: busy,),- const SizedBox(width: grid.AppDesktop.controlGap),- ] else ...[- Text(- buddyEngineLabel(agent.engine),- style: DesktopChrome.metadata(color: DesktopChrome.foreground),- ),- const SizedBox(width: grid.AppDesktop.controlGap),- ],- // The model gives way with "…" in a narrow header, not the Buddy's name or ⋮ (#4444).- Flexible(- child: KeyedSubtree(- key: const ValueKey('super-buddy-model'),- child: picker,+ builder: (context, menu, _) => fingerTarget(+ enabled: phone,+ InkWell(+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ onTap: busy+ ? null+ : () => menu.isOpen ? menu.close() : menu.open(),+ child: Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ Flexible(+ child: Text(+ label,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: DesktopChrome.metadata(+ color: DesktopChrome.foreground,+ ),+ ),+ ),+ Icon(+ AppIcons.chevronDown,+ size: AppIcons.inlineSize,+ color: DesktopChrome.muted,+ ),+ ],+ ),+ ),),- ),- // A picked shared model that stopped is a failure the reader acts on, so it stays (review 4 of #3464).- if (request == null && current != null && on == null) ...[- const SizedBox(width: grid.AppDesktop.menuInset),- Text('not served now', style: DesktopChrome.metadata()),- ],- ],- );- }+ );// Text.rich scales inline widgets as well as the Text they contain.// Ordinary children scale once and wrap naturally on a narrow header.return Wrap(@@ -199,102 +283,6 @@ class _BuddyModelLineState extends State<BuddyModelLine> {],);}-- Widget _anchor({- required String label,- required List<BuddyModelOffer> offers,- required bool phone,- 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(- padding: const EdgeInsets.symmetric(- horizontal: grid.AppDesktop.groupGap,- vertical: grid.AppDesktop.menuInset,- ),- child: Text(text, style: DesktopChrome.metadata()),- );- return AppDropdown(- controller: _menu,- // Wide enough for a model and its servers; the longer lines wrap.- width: 320,- maxHeight: 520,- children: [- row(- AppMenuItem(- icon: current == null ? AppIcons.check : null,- label: 'Your subscription',- note: buddyEngineLabel(widget.agent.engine),- onPressed: busy ? null : () => _pick(null),- ),- ),- if (widget.agent.engine == 'claude') ...[- const AppMenuDivider(),- words('SHARED IN THIS SWARM'),- // A Buddy-only machine never joins the Swarm's grid (backend- // read/hostRows.ts), so nothing shared reaches a Buddy there.- if (pool == null || pool['buddyOnly'] == true)- words(- "Add ${widget.machine} to the Swarm's Machines to use shared models.",- )- else if (offers.isEmpty)- words('Nobody shares a model in this Swarm yet.')- else- for (final offer in offers)- row(- AppMenuItem(- icon: offer.model == current ? AppIcons.check : null,- label: offer.name,- // Under the name: a list of servers would be cut short beside it.- detail: _servers(offer),- onPressed: busy ? null : () => _pick(offer.model),- ),- ),- const AppMenuDivider(),- words(- 'What your Buddy reads and writes goes to the machine or API that serves the model you pick.',- ),- ],- ],- builder: (context, menu, _) => fingerTarget(- enabled: phone,- InkWell(- borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),- onTap: busy ? null : () => menu.isOpen ? menu.close() : menu.open(),- child: Row(- mainAxisSize: MainAxisSize.min,- children: [- Flexible(- child: Text(- label,- maxLines: 1,- overflow: TextOverflow.ellipsis,- style: DesktopChrome.metadata(- color: DesktopChrome.foreground,- ),- ),- ),- Icon(- AppIcons.chevronDown,- size: AppIcons.inlineSize,- color: DesktopChrome.muted,- ),- ],- ),- ),- ),- );- }}/// The model a Buddy on its own subscription runs, as people know it ("Opus 5.5"); while its configuration names nonediff --git a/desktop/lib/super_tabs/chat/agent_chat_header.dart b/desktop/lib/super_tabs/chat/agent_chat_header.dartindex 978714d53..d64b4817b 100644--- a/desktop/lib/super_tabs/chat/agent_chat_header.dart+++ b/desktop/lib/super_tabs/chat/agent_chat_header.dart@@ -1,19 +1,18 @@import 'package:flutter/material.dart';-import '../../core/runtime_model_name.dart';import '../../shared/theme/app_theme.dart' as grid;import '../../state/app_state.dart';import '../../widgets/desktop_chrome.dart';-import '../../widgets/engine_identity.dart';import '../buddies.dart';-import '../buddy_model.dart';import '../controller.dart';import '../identity.dart';import '../model.dart';+import 'engine_model_line.dart';-/// An agent's chat in the middle, under one row (anh Dee, #4204): its avatar and name on the left; its engine, its-/// model and the chat's menu on the right; no other text. The reader's own Buddy switches engine and model there.-/// The server switches no other agent, so theirs are named in the same place.+/// An agent's chat in the middle, under one quiet 44-high bar that looks the same for every agent (anh Dee's six+/// rules, task #4465): its 22 face and its name in semibold on the left; on the right one 12-point line with its+/// engine and model, then the chat's ⋯ menu. The reader's own Swarm Buddy switches engine and model from that line;+/// the server switches no other agent, so theirs is only named there. Nothing else: no subscription, machine or reach.class SuperTabAgentChatHeader extends StatelessWidget {const SuperTabAgentChatHeader({super.key,@@ -24,16 +23,20 @@ class SuperTabAgentChatHeader extends StatelessWidget {this.title,});+ /// The face's size in the bar.+ static const faceSize = 22.0;+final SuperTabController controller;final SuperTabConversation group;- /// The chat's ⋮ menu.+ /// The chat's ⋯ menu.final Widget? menu;- /// For the model picker's line that asks to add the Buddy's machine to the Swarm.+ /// For the menu's line that asks to add the Buddy's machine to the Swarm.final AppNotifier? app;- /// In place of the avatar and the name, given the name: the reader's own Buddy chat's Buddy card button (view.dart).+ /// In place of the face and the name, given the name: the reader's own Buddy chat's Buddy card button (view.dart),+ /// which draws the same face and name with the same inset.final Widget Function(String name)? title;@override@@ -50,79 +53,58 @@ class SuperTabAgentChatHeader extends StatelessWidget {: group.isBuddyChat? 'Your Buddy': group.label;- final model = switch (agent?.configuration['model']) {- final String id when id.isNotEmpty && id != 'default' => modelDisplayName(- id,- ),- _ => null,- };- Widget label(String text) => Text(- text,- maxLines: 1,- overflow: TextOverflow.ellipsis,- style: DesktopChrome.metadata(color: DesktopChrome.foreground),- );- final left =- title?.call(name) ??- Row(- mainAxisSize: MainAxisSize.min,- children: [- if (agent != null) ...[- SuperTabAvatar.agent(- agent,- size: SuperTabAvatar.rowSize,- engineBadge: false,- ),- const SizedBox(width: grid.AppDesktop.menuInset),- ],- Flexible(- child: Text(- name,- maxLines: 1,- overflow: TextOverflow.ellipsis,- style: DesktopChrome.control().copyWith(- fontWeight: grid.AppFont.semibold,- ),- ),+ final identity = Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ if (agent != null) ...[+ SuperTabAvatar.agent(agent, size: faceSize, engineBadge: false),+ const SizedBox(width: grid.AppDesktop.menuInset),+ ],+ Flexible(+ child: Text(+ name,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: DesktopChrome.control().copyWith(+ fontWeight: grid.AppFont.semibold,),- ],- );- final right = buddy != null && group.isSwarmBuddyChat- ? BuddyModelLine(- controller: c,- agent: buddy,- machine: buddyMachineName(c, buddy.machineId, app: app),- )- : agent != null- ? Row(- mainAxisSize: MainAxisSize.min,- children: [- label(engineIdentity(agent.engine).label),- if (model != null) ...[- const SizedBox(width: grid.AppDesktop.controlGap),- Flexible(child: label(model)),- ],- ],- )- : null;+ ),+ ),+ ],+ );return SizedBox(key: const ValueKey('super-agent-chat-header'),height: 44,- // The name comes first, up to half the row; the engine and model take the rest, the model giving way with- // "…", so a long model id never pushes the name or ⋮ out (#4444).+ // The name comes first, up to half the row; the engine and model take the rest, giving way with "…", so a long+ // model id never pushes the name or ⋯ out (#4444).child: LayoutBuilder(builder: (context, box) => Row(children: [const SizedBox(width: grid.AppDesktop.controlGap),ConstrainedBox(constraints: BoxConstraints(maxWidth: box.maxWidth / 2),- child: left,+ child:+ title?.call(name) ??+ Padding(+ // The Buddy card button's inset, so every face sits in one place.+ padding: const EdgeInsets.all(grid.AppDesktop.menuInset),+ child: identity,+ ),),const SizedBox(width: grid.AppDesktop.controlGap),Expanded(- child: Align(alignment: Alignment.centerRight, child: right),+ child: Align(+ alignment: Alignment.centerRight,+ child: agent == null+ ? null+ : SuperTabEngineModelLine(+ controller: c,+ agent: agent,+ machine: buddyMachineName(c, agent.machineId, app: app),+ switchable: buddy != null && group.isSwarmBuddyChat,+ ),+ ),),- const SizedBox(width: grid.AppDesktop.menuInset),?menu,const SizedBox(width: grid.AppDesktop.menuInset),],diff --git a/desktop/lib/super_tabs/chat/engine_model_line.dart b/desktop/lib/super_tabs/chat/engine_model_line.dartnew file mode 100644index 000000000..7ef4fc533--- /dev/null+++ b/desktop/lib/super_tabs/chat/engine_model_line.dart@@ -0,0 +1,167 @@+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';+import '../../widgets/desktop_chrome.dart';+import '../../widgets/finger_target.dart';+import '../buddy_engine.dart';+import '../buddy_model.dart';+import '../controller.dart';+import '../model.dart';++/// The top bar's one quiet line (anh Dee's six rules, task #4465): the agent's engine and model, `Claude Code · Opus+/// 5.5`, in 12-point third grey. For the reader's own Swarm Buddy it is plain until hover and opens one menu, its+/// engines and then the models shared in the Swarm. The server switches no other agent, so theirs says the same and+/// opens nothing. The chevron's room is kept at rest, so hover never moves the line.+class SuperTabEngineModelLine extends StatefulWidget {+ const SuperTabEngineModelLine({+ super.key,+ required this.controller,+ required this.agent,+ required this.machine,+ required this.switchable,+ });++ final SuperTabController controller;+ final SuperTabAgent agent;++ /// The agent's machine's name, for the menu's line that asks to add it to the Swarm.+ final String machine;++ /// The reader's own Swarm Buddy, whose engine and model they switch here.+ final bool switchable;++ @override+ State<SuperTabEngineModelLine> createState() =>+ _SuperTabEngineModelLineState();+}++class _SuperTabEngineModelLineState extends State<SuperTabEngineModelLine> {+ final _menu = MenuController();+ var _hover = false, _focus = false, _open = false;++ @override+ Widget build(BuildContext context) {+ grid.AppTheme.watch(context);+ final c = widget.controller;+ final agent = widget.agent;+ final snapshot = c.snapshot!;+ final now = DateTime.now();+ final engine = buddyEngineLabel(agent.engine);+ final offers = agent.engine == 'claude' && widget.switchable+ ? buddyModelOffers(snapshot, now: now)+ : <BuddyModelOffer>[];+ String nameOf(String model) =>+ buddyModelName(snapshot, model, offers: offers, now: now);+ final shared = agent.gridModel;+ final model = shared != null+ ? nameOf(shared)+ : switch (agent.configuration['model']) {+ final String id when id.isNotEmpty && id != 'default' =>+ modelDisplayName(id),+ _ => null,+ };+ final engineSwitch = agent.switchRequest?['engine'];+ final modelSwitch = agent.modelRequest;+ final words = engineSwitch is String+ ? 'Switching to ${buddyEngineLabel(engineSwitch)}…'+ : modelSwitch != null+ ? 'Switching to ${modelSwitch.gridModel == null ? engine : modelSwitch.name ?? nameOf(modelSwitch.gridModel!)}…'+ : [+ engine,+ ?model,+ // A picked shared model that stopped is a failure the reader acts on, so it stays (review 4 of #3464).+ if (shared != null &&+ widget.switchable &&+ !offers.any((o) => o.model == shared))+ 'not served now',+ ].join(' · ');+ final opens =+ widget.switchable &&+ engineSwitch is! String &&+ modelSwitch == null &&+ !buddyModelBusy(c, agent);+ final lit = opens && (_hover || _focus || _open);+ Widget line() => Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ Flexible(+ child: Text(+ words,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: DesktopChrome.metadata(+ color: lit ? DesktopChrome.foreground : DesktopChrome.hint,+ ),+ ),+ ),+ if (opens)+ Opacity(+ opacity: lit ? 1 : 0,+ child: Icon(+ AppIcons.chevronDown,+ size: AppIcons.inlineSize,+ color: DesktopChrome.muted,+ ),+ )+ else+ const SizedBox(width: AppIcons.inlineSize),+ ],+ );+ Widget padded(Widget child) => Padding(+ padding: const EdgeInsets.symmetric(+ horizontal: grid.AppDesktop.menuInset,+ vertical: grid.AppDesktop.listRowGap,+ ),+ child: child,+ );+ if (!opens) {+ return KeyedSubtree(+ key: const ValueKey('super-agent-engine-model'),+ child: padded(line()),+ );+ }+ final phone = workspaceIsCompact(context);+ final models = buddyModelMenuRows(+ controller: c,+ agent: agent,+ machine: widget.machine,+ menu: _menu,+ offers: offers,+ phone: phone,+ busy: buddyModelBusy(c, agent),+ subscription: false,+ );+ return AppDropdown(+ controller: _menu,+ // Wide enough for a model and its servers; the longer lines wrap.+ width: 320,+ maxHeight: 520,+ onOpen: () => setState(() => _open = true),+ onClose: () => setState(() => _open = false),+ children: [+ ...buddyEngineMenuRows(+ controller: c,+ agent: agent,+ menu: _menu,+ phone: phone,+ backFromShared: true,+ ),+ if (models.isNotEmpty) ...[const AppMenuDivider(), ...models],+ ],+ builder: (context, menu, _) => fingerTarget(+ enabled: phone,+ InkWell(+ key: const ValueKey('super-agent-engine-model'),+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ onHover: (hover) => setState(() => _hover = hover),+ onFocusChange: (focus) => setState(() => _focus = focus),+ onTap: () => menu.isOpen ? menu.close() : menu.open(),+ child: padded(line()),+ ),+ ),+ );+ }+}diff --git a/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart b/desktop/lib/super_tabs/tasks/personal_tasks_pane.dartindex 7633e16e0..e01b5331d 100644--- a/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart+++ b/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart@@ -210,9 +210,10 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {};// One filled box as large as the slot, under a see-through Material that// only carries the rows' ink: a Material's own surface was drawn only as- // far as the rows, and the window's backing showed below them.+ // far as the rows, and the window's backing showed below them. It is the+ // Swarm's one surface, shared with the left and middle panes (#4465).return ColoredBox(- color: Theme.of(context).colorScheme.surface,+ color: AppPalette.swarmField,child: SizedBox.expand(child: Material(type: MaterialType.transparency,@@ -332,16 +333,9 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {)elseExpanded(+ // Empty means empty (anh Dee's rule 7, task #4465).child: tasks!.rows.isEmpty- ? 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,- ),- ),- )+ ? const SizedBox.shrink(): NotificationListener<ScrollNotification>(onNotification: _onScroll,child: LaidOutListView.builder(diff --git a/desktop/lib/super_tabs/tasks_view.dart b/desktop/lib/super_tabs/tasks_view.dartindex 9c12af350..26b6b63eb 100644--- a/desktop/lib/super_tabs/tasks_view.dart+++ b/desktop/lib/super_tabs/tasks_view.dart@@ -268,13 +268,9 @@ class _SuperTabTasksViewState extends State<SuperTabTasksView> {// Members draws the crew, free or not, though no task is open.child: _layout == SuperTabTasksLayout.members? _membersView(project, board, now)+ // Empty means empty (anh Dee's rule 7, task #4465).: empty- ? Center(- child: Text(- 'No tasks yet',- style: DesktopChrome.control(color: DesktopChrome.muted),- ),- )+ ? const SizedBox.shrink(): hidden? _noMatch(): _layout == SuperTabTasksLayout.listdiff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex 51415563a..940751e9b 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -3493,8 +3493,6 @@ class _SuperTabViewState extends State<SuperTabView>title: count == 1? '1 pane in this project': '$count panes in this project',- message:- 'Discuss the plan with ${c.snapshot!.coordinatorNameOf(group.projectId)}.',action: OutlinedButton(key: const ValueKey('super-project-show-panes'),onPressed: _openTerminals(group),@@ -3511,8 +3509,7 @@ class _SuperTabViewState extends State<SuperTabView>};/// A Personal project's empty chat with no Lead: the card that starts one- /// (Huy 11-04, task #2815), and under it what the chat says without it: its- /// panes when it holds any, else its plain line.+ /// (Huy 11-04, task #2815), and under it its panes when it holds any.Widget _leadWaiting(SuperTabConversation group) => Center(child: SingleChildScrollView(padding: const EdgeInsets.all(grid.AppDesktop.panelPadding),@@ -3527,20 +3524,8 @@ class _SuperTabViewState extends State<SuperTabView>conversationId: group.id,app: widget.app!,),- if (_personalPaneCount(group) > 0)- _panesWaiting(group)- else- Padding(- padding: const EdgeInsets.only(- top: grid.AppDesktop.panelPadding,- ),- child: Text(- 'Discuss the plan with '- '${c.snapshot!.coordinatorNameOf(group.projectId)}.',- textAlign: TextAlign.center,- style: DesktopChrome.text(color: DesktopChrome.muted),- ),- ),+ // Nothing more for a chat with no panes (rule 7, task #4465).+ if (_personalPaneCount(group) > 0) _panesWaiting(group),],),),@@ -4662,7 +4647,7 @@ class _SuperTabViewState extends State<SuperTabView>],builder: (context, menu, _) => AppIconButton(key: const ValueKey('super-group-options'),- icon: AppIcons.ellipsisVertical,+ icon: AppIcons.ellipsis,// On the Board the Buddy card holds the Buddy's own options, so this one is the chat's (audit finding 15).tooltip: _isBuddyChat(group)? widget.board@@ -5621,28 +5606,31 @@ class _SuperTabViewState extends State<SuperTabView>_personalPaneCount(group) > 0? _panesWaiting(group): messages.isEmpty && outgoing.isEmpty- ? Padding(- // The pane's side padding, as the composer has: a long line- // wraps inside it, centered.- padding: const EdgeInsets.symmetric(- horizontal: grid.AppDesktop.panelPadding,- ),- child: Center(- child: Text(- c.accessRevoked- ? 'Conversation unavailable.'- : group == null- ? 'Loading conversation…'- : c.snapshot!.isProjectLead(group.id)- ? 'Discuss the plan with ${c.snapshot!.coordinatorNameOf(group.projectId)}.'- : _buddyName(group) != null- ? "Only you and ${_buddyName(group)} read this chat. Say what you want to build; say 'send to the ${c.snapshot!.coordinatorNameOf(group.projectId)}' when it's ready."- : 'Start the conversation.',- textAlign: TextAlign.center,- style: DesktopChrome.text(color: DesktopChrome.muted),+ ? switch (c.accessRevoked+ ? 'Conversation unavailable.'+ : group == null+ ? 'Loading conversation…'+ : _buddyName(group) != null+ // One short line that helps the reader act (anh Dee's copy rules, task #4465).+ ? "Say what to build, then 'send to the ${c.snapshot!.coordinatorNameOf(group.projectId)}'."+ // Empty means empty (anh Dee's rule 7, task #4465): no words for a chat with nothing in it.+ : null) {+ final words? => Padding(+ // The pane's side padding, as the composer has: a long line+ // wraps inside it, centered.+ padding: const EdgeInsets.symmetric(+ horizontal: grid.AppDesktop.panelPadding,+ ),+ child: Center(+ child: Text(+ words,+ textAlign: TextAlign.center,+ style: DesktopChrome.text(color: DesktopChrome.muted),+ ),),),- )+ null => const SizedBox.expand(),+ }: Column(children: [// Above the list, never over a message.@@ -6514,6 +6502,11 @@ class _SuperTabViewState extends State<SuperTabView>onKeyEvent: _attentionKey,child: Stack(children: [+ // One surface under the left, middle and right panes, split only by the layout's hairlines (anh Dee's six+ // rules, task #4465): no pane shows its host's colour.+ Positioned.fill(+ child: ColoredBox(color: grid.AppPalette.swarmField),+ ),ExcludeFocus(excluding: chatCovered,child: SuperTabPaneLayout(diff --git a/desktop/test/goldens/swarm-elements-dark.png b/desktop/test/goldens/swarm-elements-dark.pngindex b92ea1f00..cc1c41603 100644Binary files a/desktop/test/goldens/swarm-elements-dark.png and b/desktop/test/goldens/swarm-elements-dark.png differdiff --git a/desktop/test/goldens/swarm-elements-light.png b/desktop/test/goldens/swarm-elements-light.pngindex 22333a508..7d7d0422a 100644Binary files a/desktop/test/goldens/swarm-elements-light.png and b/desktop/test/goldens/swarm-elements-light.png differdiff --git a/desktop/test/super_tab_agent_chat_header_test.dart b/desktop/test/super_tab_agent_chat_header_test.dartindex 078c9be38..f641f7a25 100644--- a/desktop/test/super_tab_agent_chat_header_test.dart+++ b/desktop/test/super_tab_agent_chat_header_test.dart@@ -1,20 +1,23 @@import 'dart:io';+import 'package:flutter/gestures.dart';import 'package:flutter/material.dart';import 'package:flutter/rendering.dart';import 'package:flutter_test/flutter_test.dart';import 'package:harness/core/runtime_model_name.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/state/workspace_chrome.dart';import 'package:harness/super_tabs/controller.dart';import 'package:harness/super_tabs/identity.dart';import 'package:harness/super_tabs/view.dart';import 'package:harness/super_tabs/zone_time.dart';-import 'package:harness/widgets/engine_identity.dart';import 'super_tab_personal_tasks_pane_test.dart' show TasksFixture;import 'support/buddy_engine_fixture.dart';import 'support/capture.dart';+import 'support/super_tab_fixture.dart';final shots = Platform.environment['HARNESS_SUPER_TAB_CAPTURE'];@@ -63,6 +66,19 @@ void main() {matching: find.byKey(const ValueKey('super-agent-chat-header')),);Finder inHeader(Finder f) => find.descendant(of: header, matching: f);+ bool chevronShown(WidgetTester t, Finder of) {+ final chevron = find.descendant(+ of: of,+ matching: find.byIcon(AppIcons.chevronDown),+ );+ if (chevron.evaluate().isEmpty) return false;+ final hidden = find.ancestor(+ of: chevron,+ matching: find.byWidgetPredicate((w) => w is Opacity && w.opacity == 0),+ );+ return hidden.evaluate().isEmpty;+ }+void oneRow(WidgetTester t, List<Finder> parts) {final row = t.getRect(parts.first).center.dy;for (final part in parts) {@@ -71,8 +87,107 @@ void main() {}}+ /// The bar's parts, in a 44-high row: a 22 face, the name in 13 semibold, then one 12-point line in the third grey and+ /// the ⋯ menu (anh Dee's six rules, task #4465).+ void quietBar(+ WidgetTester t, {+ required String identity,+ required String name,+ required String line,+ }) {+ expect(t.getSize(header).height, 44);+ final face = inHeader(+ find.byWidgetPredicate(+ (w) => w is SuperTabAvatar && w.identity == identity,+ ),+ );+ expect(t.getSize(face), const Size(22, 22));+ final title = t.widget<Text>(inHeader(find.text(name)));+ expect(title.style?.fontSize, 13);+ expect(title.style?.fontWeight, grid.AppFont.semibold);+ final quiet = inHeader(+ find.byKey(const ValueKey('super-agent-engine-model')),+ );+ final words = t.widget<Text>(+ find.descendant(of: quiet, matching: find.text(line)),+ );+ expect(words.style?.fontSize, 12);+ expect(words.style?.color, grid.AppPalette.textFaint);+ final menu = inHeader(find.byKey(const ValueKey('super-group-options')));+ expect(+ find.descendant(of: menu, matching: find.byIcon(AppIcons.ellipsis)),+ findsOneWidget,+ );+ oneRow(t, [face, inHeader(find.text(name)), quiet, menu]);+ expect(t.getRect(quiet).left, greaterThan(t.getRect(header).center.dx));+ expect(t.getRect(menu).left, greaterThan(t.getRect(quiet).left));+ // Plain until hover: no chevron shows at rest.+ expect(chevronShown(t, quiet), isFalse);+ // Nothing else: no subscription, machine or reach.+ for (final gone in [+ 'Your subscription',+ 'Kens-MacBook',+ 'reads all your projects',+ 'only you can read this chat',+ ]) {+ expect(inHeader(find.textContaining(gone)), findsNothing, reason: gone);+ }+ }++ Future<void> hover(WidgetTester t, Finder f) async {+ final mouse = await t.createGesture(kind: PointerDeviceKind.mouse);+ addTearDown(mouse.removePointer);+ await mouse.addPointer(location: Offset.zero);+ await mouse.moveTo(t.getCenter(f));+ await t.pumpAndSettle();+ }++ List<Map> commands(ConversationServer server, String type) => [+ for (final post in server.posts)+ if ((post['command'] as Map)['type'] == type) post['command'] as Map,+ ];+ Finder row(String label) => find.widgetWithText(AppMenuItem, label);+ final line = inHeader(find.byKey(const ValueKey('super-agent-engine-model')));++ testWidgets("the Buddy's bar: face, name, one quiet line and ⋯", (t) async {+ final server = buddyEngineSwarm();+ final c = server.controller(account: 'peer');+ addTearDown(c.dispose);+ await c.refresh();+ await c.select('swarm-buddy-peer');+ await show(t, c);+ final agent = c.snapshot!.agent('wren')!;+ quietBar(+ t,+ identity: 'agent:wren',+ name: c.snapshot!.agentName('wren', fallback: agent.name),+ line: 'Claude Code',+ );+ expect(find.text('Your Buddy'), findsNothing);+ });++ testWidgets("a member agent's bar looks the same", (t) async {+ final f = TasksFixture();+ addTearDown(f.controller.dispose);+ await f.controller.refresh();+ await f.controller.select('aeef');+ await show(t, f.controller, tasks: true);+ quietBar(+ t,+ identity: 'agent:0540',+ name: 'Hugo',+ line: 'Claude Code · ${modelDisplayName('opus')}',+ );+ // The server switches no other agent: its line opens nothing, even hovered.+ await hover(t, line);+ expect(chevronShown(t, line), isFalse);+ await t.tap(line);+ await t.pumpAndSettle();+ expect(find.byType(AppMenuItem), findsNothing);+ });+testWidgets(- 'the Buddy header is one row: avatar and name, then engine, model and menu',+ "hovering the Buddy's line shows its chevron in the same bounds, and it opens one menu",(t) async {final server = buddyEngineSwarm();final c = server.controller(account: 'peer');@@ -80,59 +195,67 @@ void main() {await c.refresh();await c.select('swarm-buddy-peer');await show(t, c);- expect(header, findsOneWidget);- final agent = c.snapshot!.agent('wren')!;- final avatar = inHeader(- find.byWidgetPredicate(- (w) => w is SuperTabAvatar && w.identity == 'agent:wren',- ),- );- final name = inHeader(- find.text(c.snapshot!.agentName('wren', fallback: agent.name)),- );- final engine = inHeader(find.byKey(const ValueKey('super-buddy-engine')));- final model = inHeader(find.byKey(const ValueKey('super-buddy-model')));- final menu = inHeader(find.byKey(const ValueKey('super-group-options')));- oneRow(t, [avatar, name, engine, model, menu]);- expect(t.getRect(avatar).left, lessThan(t.getRect(name).left));- final middle = t.getRect(header).center.dx;- expect(t.getRect(engine).left, greaterThan(middle));- expect(t.getRect(model).left, greaterThan(t.getRect(engine).left));- expect(t.getRect(menu).left, greaterThan(t.getRect(model).left));- // No other text, here or on a second line.- expect(find.textContaining('Kens-MacBook'), findsNothing);- expect(find.textContaining('reads all your projects'), findsNothing);- expect(find.textContaining('only you can read this chat'), findsNothing);- expect(find.text('Your Buddy'), findsNothing);+ final before = t.getRect(line);+ await hover(t, line);+ expect(chevronShown(t, line), isTrue);+ expect(t.getRect(line), before);+ await t.tap(line);+ await t.pumpAndSettle();+ // The engines, then the shared models, in one menu; nobody shares one here, so the menu says nothing of them+ // (rule 7).+ expect(row('Claude Code'), findsOneWidget);+ expect(row('Codex'), findsOneWidget);+ expect(find.text('SHARED IN THIS SWARM'), findsNothing);+ expect(row('Your subscription'), findsNothing);+ // The engine it is on sends nothing; another switches it.+ await t.tap(row('Claude Code'));+ await t.pumpAndSettle();+ expect(commands(server, 'buddy.engine'), isEmpty);+ await t.tap(line);+ await t.pumpAndSettle();+ await t.tap(row('Codex'));+ await t.pumpAndSettle();+ expect(commands(server, 'buddy.engine'), [+ {'type': 'buddy.engine', 'engine': 'codex'},+ ]);},);testWidgets(- "a member agent's header shows its engine and model in the same place",+ 'on a shared model, its engine row takes the Buddy back to its own sign-in',(t) async {- final f = TasksFixture();- addTearDown(f.controller.dispose);- await f.controller.refresh();- await f.controller.select('aeef');- await show(t, f.controller, tasks: true);- expect(header, findsOneWidget);- final avatar = inHeader(- find.byWidgetPredicate(- (w) => w is SuperTabAvatar && w.identity == 'agent:0540',- ),- );- final engine = inHeader(find.text(engineIdentity('claude').label));- final model = inHeader(find.text(modelDisplayName('opus')));- final menu = inHeader(find.byKey(const ValueKey('super-group-options')));- oneRow(t, [avatar, inHeader(find.text('Hugo')), engine, model, menu]);- expect(- inHeader(find.byKey(const ValueKey('super-buddy-engine'))),- findsNothing,- );- expect(t.getRect(engine).left, greaterThan(t.getRect(header).center.dx));+ final server = buddyEngineSwarm();+ (server.state['agents'] as List).cast<Map>().firstWhere(+ (a) => a['id'] == 'wren',+ )['gridModel'] = 'qwen3-coder';+ final c = server.controller(account: 'peer');+ addTearDown(c.dispose);+ await c.refresh();+ await c.select('swarm-buddy-peer');+ await show(t, c);+ await t.tap(line);+ await t.pumpAndSettle();+ await t.tap(row('Claude Code'));+ await t.pumpAndSettle();+ expect(commands(server, 'buddy.model'), [+ {'type': 'buddy.model', 'gridModel': null},+ ]);+ expect(commands(server, 'buddy.engine'), isEmpty);},);+ // Empty means empty (anh Dee's rule 7, 11-07): an empty chat shows nothing under its bar.+ testWidgets('an empty chat says nothing', (t) async {+ final f = TasksFixture();+ addTearDown(f.controller.dispose);+ await f.controller.refresh();+ await f.controller.select('aeef');+ await show(t, f.controller, tasks: true);+ expect(f.controller.messages('aeef'), isEmpty);+ expect(find.text('Start the conversation.'), findsNothing);+ expect(find.textContaining('Discuss the plan with'), findsNothing);+ });+testWidgets('with a thread open the Buddy chat is in the full view and keeps its pickers',(t) async {@@ -166,11 +289,17 @@ void main() {await c.refresh();await c.select('swarm-buddy-peer');await show(t, c);- expect(inHeader(find.text('not served now')), findsOneWidget);+ expect(+ find.descendant(+ of: line,+ matching: find.textContaining('not served now'),+ ),+ findsOneWidget,+ );});// The header sits between the left pane and the Tasks pane, so at 880 it is far narrower than the window.- group('at 880 wide the model gives way, not the name or ⋮ (#4444)', () {+ group('at 880 wide the model gives way, not the name or ⋯ (#4444)', () {const long = 'openrouter/qwen/qwen3-coder-480b-a35b-instruct';setUpAll(() => loadCaptureFonts(shots));@@ -181,13 +310,10 @@ void main() {.didExceedMaxLines;// [title] is what holds the name: the name itself, or the Buddy card's button.- void fits(- WidgetTester t, {- required Finder name,- Finder? title,- required Finder engine,- required Finder model,- }) {+ void fits(WidgetTester t, {required Finder name, Finder? title}) {+ // The engine and model are one line; it gives way with "…".+ final engine = line;+ final model = find.descendant(of: line, matching: find.byType(Text));expect(t.takeException(), isNull);final row = t.getRect(header);final menu = t.getRect(@@ -196,7 +322,7 @@ void main() {expect(row.left <= menu.left && menu.right <= row.right,isTrue,- reason: '⋮ $menu is outside the header $row',+ reason: '⋯ $menu is outside the header $row',);expect(cut(t, name), isFalse, reason: 'the name is cut');expect(cut(t, model), isTrue, reason: 'the model has no …');@@ -207,7 +333,7 @@ void main() {);}- testWidgets("a member agent's name and ⋮ stay; its model ends in …", (+ testWidgets("a member agent's name and ⋯ stay; its model ends in …", (t,) async {final f = TasksFixture();@@ -245,17 +371,12 @@ void main() {(Brightness.dark, 'dark'),]) {await show(t, c, tasks: true, width: 880, brightness: brightness);- fits(- t,- name: inHeader(find.text('Hugo')),- engine: inHeader(find.text(engineIdentity('claude').label)),- model: inHeader(find.text(modelDisplayName(long))),- );+ fits(t, name: inHeader(find.text('Hugo')));await captureWindow(t, shots, '06-chat-header-880-$mode');}});- testWidgets("the Buddy's name and ⋮ stay; its model ends in …", (t) async {+ testWidgets("the Buddy's name and ⋯ stay; its model ends in …", (t) async {final server = buddyEngineSwarm();// A model nobody serves is named by its id, and said not to be served.(server.state['agents'] as List).cast<Map>().firstWhere(@@ -279,8 +400,6 @@ void main() {title: inHeader(find.byKey(const ValueKey('super-board-buddy-button')),),- engine: inHeader(find.byKey(const ValueKey('super-buddy-engine'))),- model: inHeader(find.byKey(const ValueKey('super-buddy-model'))),);await captureWindow(t, shots, '06-buddy-header-880-$mode');}diff --git a/desktop/test/super_tab_buddies_test.dart b/desktop/test/super_tab_buddies_test.dartindex dd4a141a7..d14a10c09 100644--- a/desktop/test/super_tab_buddies_test.dart+++ b/desktop/test/super_tab_buddies_test.dart@@ -1105,7 +1105,7 @@ void main() {await tester.tap(buddyEntry);await tester.pumpAndSettle();- final text = tester.getRect(find.textContaining('Only you and Wren'));+ final text = tester.getRect(find.textContaining('Say what to build'));final composer = tester.getRect(find.byKey(const ValueKey('super-message-composer-row')),);@@ -1123,7 +1123,7 @@ void main() {});testWidgets(- 'an empty Buddy chat says who reads it and how to reach the coordinator',+ 'an empty Buddy chat says, in one line, how to reach the coordinator (anh Dee\'s copy rules, #4465)',(tester) async {final server = buddySwarm();giveBuddy(server);@@ -1132,9 +1132,7 @@ void main() {await tester.pumpAndSettle();expect(- find.text(- "Only you and Wren read this chat. Say what you want to build; say 'send to the Product Manager' when it's ready.",- ),+ find.text("Say what to build, then 'send to the Product Manager'."),findsOneWidget,);await close(tester, c);@@ -1150,9 +1148,7 @@ void main() {await tester.tap(buddyEntry);await tester.pumpAndSettle();expect(- find.text(- "Only you and Wren read this chat. Say what you want to build; say 'send to the Coordinator' when it's ready.",- ),+ find.text("Say what to build, then 'send to the Coordinator'."),findsOneWidget,);await close(tester, c);diff --git a/desktop/test/super_tab_buddy_model_test.dart b/desktop/test/super_tab_buddy_model_test.dartindex a8a8257b4..94277f7ed 100644--- a/desktop/test/super_tab_buddy_model_test.dart+++ b/desktop/test/super_tab_buddy_model_test.dart@@ -431,15 +431,17 @@ void main() {},);- testWidgets('with no model shared, it says nobody shares one yet', (+ // Empty means empty (anh Dee's rule 7, #4465): no heading or words for models nobody shares.+ testWidgets('with no model shared, it shows only the subscription', (tester,) async {final c = await show(tester, swarm(localModels: false));await open(tester);- expect(find.text('SHARED IN THIS SWARM'), findsOneWidget);+ expect(find.text('SHARED IN THIS SWARM'), findsNothing);+ expect(find.textContaining('Nobody shares'), findsNothing);expect(- find.text('Nobody shares a model in this Swarm yet.'),- findsOneWidget,+ find.textContaining('What your Buddy reads and writes'),+ findsNothing,);expect(find.byType(AppMenuItem), findsOneWidget);await close(tester, c);diff --git a/desktop/test/super_tab_personal_projects_test.dart b/desktop/test/super_tab_personal_projects_test.dartindex 4698c414f..9693257b2 100644--- a/desktop/test/super_tab_personal_projects_test.dart+++ b/desktop/test/super_tab_personal_projects_test.dart@@ -1177,10 +1177,8 @@ void main() {c.select(code.leadConversationId);await show(tester, f);expect(find.text('2 panes in this project'), findsOneWidget);- expect(- find.text('Discuss the plan with Product Manager.'),- findsOneWidget,- );+ // An empty chat says nothing (rule 7, #4465).+ expect(find.textContaining('Discuss the plan'), findsNothing);await tester.tap(find.text('Show panes'));for (var i = 0; i < 20; i++) {await tester.pump(const Duration(milliseconds: 20));@@ -1225,10 +1223,8 @@ void main() {await show(tester, f);expect(find.textContaining('panes in this project'), findsNothing);expect(find.text('Show panes'), findsNothing);- expect(- find.text('Discuss the plan with Product Manager.'),- findsOneWidget,- );+ // An empty chat says nothing (rule 7, #4465).+ expect(find.textContaining('Discuss the plan'), findsNothing);await close(tester, f, c);});});diff --git a/desktop/test/super_tab_role_names_test.dart b/desktop/test/super_tab_role_names_test.dartindex 68d02f98b..033bbc298 100644--- a/desktop/test/super_tab_role_names_test.dart+++ b/desktop/test/super_tab_role_names_test.dart@@ -100,12 +100,10 @@ void main() {});testWidgets(- 'an empty project chat names its coordinator as the project does',+ // Empty means empty (anh Dee's rule 7, #4465): whatever the project calls its coordinator.+ 'an empty project chat says nothing',(tester) async {- for (final (coordinator, line) in [- (null, 'Discuss the plan with Product Manager.'),- ('Coordinator', 'Discuss the plan with Coordinator.'),- ]) {+ for (final coordinator in [null, 'Coordinator']) {final server = ConversationServer();server.state['projects'] = [{@@ -130,7 +128,7 @@ void main() {),);await tester.pumpAndSettle();- expect(find.text(line), findsOneWidget);+ expect(find.textContaining('Discuss the plan'), findsNothing);await tester.pumpWidget(const SizedBox());await c.flush();c.dispose();diff --git a/desktop/test/super_tab_tasks_pane_polish_test.dart b/desktop/test/super_tab_tasks_pane_polish_test.dartindex e46704e19..83f2ba098 100644--- a/desktop/test/super_tab_tasks_pane_polish_test.dart+++ b/desktop/test/super_tab_tasks_pane_polish_test.dart@@ -175,15 +175,13 @@ void main() {expect(find.text('Loading Tasks…'), findsNothing);});- testWidgets('the empty pane says what will show there', (t) async {+ // anh Dee's rule 7 (task #4465): empty means empty, no words where there is nothing.+ testWidgets('the empty pane says nothing', (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,- );+ expect(find.textContaining('No tasks yet'), findsNothing);});for (final merged in [false, true]) {diff --git a/desktop/test/super_tab_tasks_pane_surface_test.dart b/desktop/test/super_tab_tasks_pane_surface_test.dartindex 82ea70806..4a4e3c0c8 100644--- a/desktop/test/super_tab_tasks_pane_surface_test.dart+++ b/desktop/test/super_tab_tasks_pane_surface_test.dart@@ -49,17 +49,20 @@ void main() {Future<TasksFixture> mount(WidgetTester t,Brightness brightness,- int count,- ) async {+ int count, {+ double width = windowWidth,+ String? chat,+ }) async {final f = TasksFixture();addTearDown(f.controller.dispose);f.rows..clear()..addAll(rowsOf(count));await f.controller.refresh();+ if (chat != null) await f.controller.select(chat);final app = createApp();addTearDown(app.dispose);- t.view.physicalSize = const Size(windowWidth, windowHeight);+ t.view.physicalSize = Size(width, windowHeight);t.view.devicePixelRatio = 1;addTearDown(t.view.reset);grid.AppTheme.brightness.value = brightness;@@ -93,10 +96,28 @@ void main() {return f;}- Color surface(WidgetTester t) =>- Theme.of(t.element(find.byType(SuperTabPersonalTasksPane)))- .colorScheme- .surface;+ /// The Swarm's one surface: the left, middle and right panes share it (anh Dee's six rules, task #4465).+ Color surface(WidgetTester t) => grid.AppPalette.swarmField;++ Future<List<List<int>>> pixelRow(WidgetTester t, int y) async {+ final row = <List<int>>[];+ await t.runAsync(() async {+ final view = t.binding.renderViews.first;+ final image = await (view.debugLayer! as OffsetLayer).toImage(+ Offset.zero & view.size,+ pixelRatio: 1,+ );+ final data = (await image.toByteData(+ format: ui.ImageByteFormat.rawRgba,+ ))!;+ for (var x = 0; x < image.width; x++) {+ final i = (y * image.width + x) * 4;+ row.add([for (var k = 0; k < 4; k++) data.getUint8(i + k)]);+ }+ image.dispose();+ });+ return row;+ }/// The pane's pixels down a strip no row reaches: every one must be the/// pane's surface, fully opaque.@@ -157,11 +178,13 @@ void main() {final pane = t.getRect(find.byType(SuperTabPersonalTasksPane));expect(pane.size, const Size(340, windowHeight));if (count == 0) {+ // Empty means empty (anh Dee's rule 7): no words where there is nothing.expect(- find.text(- 'No tasks yet. Tasks your agents start or propose show here.',+ find.descendant(+ of: find.byType(SuperTabPersonalTasksPane),+ matching: find.text('No tasks yet'),),- findsOneWidget,+ findsNothing,);} else {expect(find.text('Task number 0'), findsOneWidget);@@ -191,6 +214,51 @@ void main() {}}+ for (final brightness in Brightness.values) {+ for (final width in [880.0, 1600.0]) {+ testWidgets(+ 'the three panes are one surface split by hairlines: ${brightness.name}, $width wide',+ (t) async {+ // An agent's chat in the middle, as after choosing it on the left.+ await mount(t, brightness, 0, width: width, chat: 'aeef');+ expect(t.takeException(), isNull);+ // Below the left pane's rows and the chat's messages, above the composer: only grounds and dividers.+ final y = (windowHeight * .7).round();+ final want = surface(t);+ int byte(double channel) => (channel * 255).round();+ final field = [byte(want.r), byte(want.g), byte(want.b), 255];+ final row = await pixelRow(t, y);+ final runs = <String>[];+ for (var x = 0; x < row.length; x++) {+ if (row[x].join(',') == field.join(',')) continue;+ var end = x;+ while (end + 1 < row.length &&+ row[end + 1].join(',') != field.join(',')) {+ end++;+ }+ runs.add('x=$x..$end ${row[x]}');+ x = end;+ }+ // Two 1-point hairlines between three panes, and nothing else; a hairline at a fractional x covers two pixels.+ expect(+ runs.where((r) {+ final m = RegExp(r'x=(\d+)\.\.(\d+)').firstMatch(r)!;+ return int.parse(m[2]!) - int.parse(m[1]!) > 1;+ }),+ isEmpty,+ reason: '$runs',+ );+ expect(runs.length, lessThanOrEqualTo(2), reason: '$runs');+ await captureWindow(+ t,+ shots,+ 'one-surface-${brightness.name}-${width.round()}',+ );+ },+ );+ }+ }+testWidgets('the pane draws its own filled surface under its list', (t,) async {diff --git a/desktop/test/super_tab_tasks_view_test.dart b/desktop/test/super_tab_tasks_view_test.dartindex 48a538505..8592503d5 100644--- a/desktop/test/super_tab_tasks_view_test.dart+++ b/desktop/test/super_tab_tasks_view_test.dart@@ -955,9 +955,10 @@ void main() {await _close(tester, c);});- testWidgets('a project with no tasks says so', (tester) async {+ // Empty means empty (anh Dee's rule 7, #4465).+ testWidgets('a project with no tasks shows an empty Board', (tester) async {final c = await _show(tester, tasksServer(empty: true));- expect(find.text('No tasks yet'), findsOneWidget);+ expect(find.text('No tasks yet'), findsNothing);expect(_column('proposals'), findsNothing);await _close(tester, c);});@@ -1173,10 +1174,10 @@ void main() {await _close(tester, lonely);});- testWidgets('a project with no tasks still says so, with no filter to '+ testWidgets('a project with no tasks is empty, with no filter to ''clear', (tester) async {final c = await _show(tester, tasksServer(empty: true));- expect(find.text('No tasks yet'), findsOneWidget);+ expect(find.text('No tasks yet'), findsNothing);expect(noCards, findsNothing);await _close(tester, c);});diff --git a/desktop/test/swarm_elements_gallery_test.dart b/desktop/test/swarm_elements_gallery_test.dartindex 575ae45cc..98c4dcc65 100644--- a/desktop/test/swarm_elements_gallery_test.dart+++ b/desktop/test/swarm_elements_gallery_test.dart@@ -10,14 +10,22 @@ import 'package:harness/shared/theme/app_theme.dart' as grid;import 'package:harness/state/harness_activity.dart';import 'package:harness/shared/theme/app_icons.dart';import 'package:harness/shared/theme/app_type.dart';+import 'package:harness/shared/widgets/app_icon_button.dart';+import 'package:harness/super_tabs/buddy_card.dart';import 'package:harness/super_tabs/buddy_rows.dart';+import 'package:harness/super_tabs/chat/agent_chat_header.dart';+import 'package:harness/super_tabs/controller.dart';import 'package:harness/super_tabs/avatar_art.dart';import 'package:harness/super_tabs/identity.dart';import 'package:harness/super_tabs/model.dart';import 'package:harness/super_tabs/tasks/personal_task_card.dart';import 'package:harness/super_tabs/tasks/personal_tasks.dart';+import 'package:harness/super_tabs/tasks/personal_tasks_pane.dart';import 'package:harness/terminal/terminal_typography.dart';+import 'super_tab_personal_tasks_pane_test.dart' show TasksFixture;+import 'support/buddy_engine_fixture.dart';+/// The Swarm elements gallery (desktop-design-system.md, Swarm elements): every/// element drawn in light and dark against its checked-in image. A new or/// changed element updates the doc and this gallery in the same pull request.@@ -72,19 +80,24 @@ void main() {testWidgets('every Swarm element matches its image in ${brightness.name}', (tester,) async {- await _show(tester, brightness);+ final bars = await _show(tester, brightness);(goldenFileComparator as _NearlyComparator).parts = _parts(tester);await expectLater(find.byKey(_Gallery.boundary),matchesGoldenFile('goldens/swarm-elements-${brightness.name}.png'),);+ await _close(tester, bars);});}// Review of task #4461: a whole-image tolerance let a changed element pass. Ellis has Kai's colour with another// tilt: only its eyes and smile move.testWidgets('one changed face fails the gallery', (tester) async {- await _show(tester, Brightness.light, faces: ['Ellis', ..._faces.skip(1)]);+ final bars = await _show(+ tester,+ Brightness.light,+ faces: ['Ellis', ..._faces.skip(1)],+ );final boundary = tester.renderObject<RenderRepaintBoundary>(find.byKey(_Gallery.boundary),);@@ -99,10 +112,11 @@ void main() {);});expect(problem, contains('agent face Ellis'));+ await _close(tester, bars);});}-Future<void> _show(+Future<List<SuperTabController>> _show(WidgetTester tester,Brightness brightness, {List<String> faces = _faces,@@ -110,8 +124,19 @@ Future<void> _show(final old = grid.AppTheme.brightness.value;grid.AppTheme.brightness.value = brightness;addTearDown(() => grid.AppTheme.brightness.value = old);+ // The top bars' chats: the reader's own Buddy, and a member agent of a project (task #4465).+ final buddy = buddyEngineSwarm().controller(account: 'peer');+ final member = TasksFixture().controller;+ // A Swarm with no tasks, for the empty Tasks pane (rule 7).+ final empty = (TasksFixture()..rows.clear()).controller;+ for (final c in [buddy, member, empty]) {+ addTearDown(c.dispose);+ await c.refresh();+ }+ await buddy.select('swarm-buddy-peer');+ await member.select('aeef');tester.view.devicePixelRatio = 1;- tester.view.physicalSize = const Size(760, 720);+ tester.view.physicalSize = const Size(760, 1080);addTearDown(tester.view.reset);await tester.pumpWidget(MaterialApp(@@ -120,12 +145,26 @@ Future<void> _show(// A still spinner, so the image holds one frame.home: MediaQuery(data: const MediaQueryData(disableAnimations: true),- child: _Gallery(brightness, faces: faces),+ child: _Gallery(+ brightness,+ faces: faces,+ bars: [buddy, member],+ empty: empty,+ ),),),);await tester.pump();expect(tester.takeException(), isNull);+ return [buddy, member, empty];+}++/// Takes the gallery down and lets the bars' chats save, so no timer outlives the test.+Future<void> _close(WidgetTester tester, List<SuperTabController> bars) async {+ await tester.pumpWidget(const SizedBox());+ for (final c in bars) {+ await c.flush();+ }}/// One element's area in the gallery and the share of it that may differ.@@ -318,9 +357,20 @@ final _person = SuperTabPerson.fromJson({});class _Gallery extends StatelessWidget {- const _Gallery(this.brightness, {required this.faces});+ const _Gallery(+ this.brightness, {+ required this.faces,+ required this.bars,+ required this.empty,+ });final Brightness brightness;final List<String> faces;++ /// Chats whose top bars the gallery draws: the reader's Buddy, then a member agent.+ final List<SuperTabController> bars;++ /// A Swarm with no tasks: the Tasks pane empty.+ final SuperTabController empty;static const boundary = ValueKey('swarm-elements-gallery');@override@@ -494,6 +544,74 @@ class _Gallery extends StatelessWidget {),],),+ title('Top bar: your Buddy, a member agent'),+ for (final c in bars)+ SizedBox(+ width: 720,+ child: SuperTabAgentChatHeader(+ controller: c,+ group: c.selected!,+ menu: AppIconButton(+ icon: AppIcons.ellipsis,+ tooltip: 'Chat options',+ onPressed: () {},+ ),+ title: c.selected!.isBuddyChat+ ? (name) => BuddyCardButton(+ controller: c,+ projectId: c.selected!.projectId,+ label: name,+ )+ : null,+ ),+ ),+ // Empty means empty (anh Dee's rule 7): each element with nothing optional, and no words for what+ // is not there.+ title('Empty: a row, a task card and the Tasks pane'),+ Row(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ SizedBox(+ width: 280,+ child: SuperTabQuietRow(+ leading: SuperTabAvatar.agent(+ _agent('Ivy'),+ size: SuperTabQuietRow.faceSize,+ engineBadge: false,+ ),+ name: 'Ivy',+ onTap: () {},+ ),+ ),+ gap(),+ SizedBox(+ width: 340,+ child: SuperTabPersonalTaskCard(+ task: SuperTabPersonalTask({+ 'id': 't2',+ 'version': 1,+ 'at': 0,+ 'projectId': 'harness',+ 'projectName': 'harness',+ 'title': 'A task nobody has taken',+ 'status': 'planned',+ }),+ project: 'harness',+ selected: false,+ onOpen: () {},+ ),+ ),+ ],+ ),+ const SizedBox(height: 8),+ SizedBox(+ width: 340,+ height: 120,+ child: SuperTabPersonalTasksPane(+ controller: empty,+ onOpenTask: (_) {},+ ),+ ),],),),diff --git a/docs/plans/2026-11-07-swarm-surface-top-bar-plan.md b/docs/plans/2026-11-07-swarm-surface-top-bar-plan.mdnew file mode 100644index 000000000..c893fda5d--- /dev/null+++ b/docs/plans/2026-11-07-swarm-surface-top-bar-plan.md@@ -0,0 +1,81 @@+# Swarm screen: six rules, one surface, a quiet top bar (task #4465)++**Goal:** anh Dee's redrawn Swarm screen (11-07 15:35, "sure"): write the six rules into the design system's Swarm+elements section and its gallery, give the left, middle and right panes one background split by hairlines, and make+every agent's chat bar the same quiet 44-high row.++**Architecture:** The bar stays `SuperTabAgentChatHeader`. Its right side becomes one widget,+`SuperTabEngineModelLine` (new, `chat/engine_model_line.dart`): `Claude Code · Opus 5.5` in 12-point `textFaint`,+plain until hover. For the reader's own Swarm Buddy it opens one menu holding the engine rows (today's+`BuddyEnginePicker` rows) and the shared models (today's `BuddyModelLine` rows), so the two menus' rows are pulled into+functions both callers share. Other agents' lines are the same text and open nothing, since the server switches no+other agent. The one surface is `AppPalette.swarmField`, the colour the left and middle panes already sit on in the app+and the one the selected native tab joins; the Tasks pane paints it instead of the theme surface, and `SuperTabView`+paints it under all three panes so no pane depends on its host.++**Tech Stack:** Flutter (Desktop), flutter_test widget and screenshot tests.++**Spec:** task #4465 brief; the six rules: 1. Grey everywhere; colour only on agent faces. 2. Blue only for the main+action; red only for failed. 3. Three text sizes: 14 chat, 13 names, 12 details; in lists, bold means unread. 4. Every+row: face, name, one quiet detail on the right. 5. Dropdowns stay plain text until you hover. 6. If it doesn't help you+decide, it's gone.++Way of working: the project's Engineer flow: plan first, each task's failing test committed before its code, one pull+request, one independent review.++## Global Constraints++- Desktop only. Light and dark, at 880 and wide. Windows rules apply (nothing here starts a process).+- Named roles only; `scripts/check-ui-style.py` stays clean.+- Builds on #4461 (faces, gold Lead ring, status marks) and its gallery test: main is merged in after it lands, last.+- Out of scope: dropping Buddy as a kind; the left pane's rows (#4461 and later tasks).+- A palette the person chose that names its own sidebar (Plum) keeps it; the rule is one surface for the rest.++## Review Focus++- The combined menu does exactly what the two menus did: the current engine on a shared model goes back with+ `switchBuddyModel(null)` (was Your subscription), another engine with `switchBuddyEngine`, a shared model with+ `switchBuddyModel(model)`; a named Buddy still targets its own chat; busy states still disable rows.+- The bar keeps its geometry through hover (the chevron's room is kept at rest).+- Nothing else in the bar: no subscription, machine or "reads all your projects".++## Task 1: the quiet top bar++**Files:** `desktop/lib/super_tabs/chat/agent_chat_header.dart`, `desktop/lib/super_tabs/chat/engine_model_line.dart`+(new), `desktop/lib/super_tabs/buddy_engine.dart`, `desktop/lib/super_tabs/buddy_model.dart`,+`desktop/lib/super_tabs/buddy_card.dart`, `desktop/lib/super_tabs/view.dart` (the ⋯ icon),+`desktop/test/super_tab_agent_chat_header_test.dart`, tests that tapped the header's two pickers.++**Interfaces:** `SuperTabEngineModelLine({controller, agent, machine, buddy})`, key `super-agent-engine-model`;+`buddyEngineMenuRows(...)`, `buddyModelMenuRows(...)` → `List<Widget>`; `BuddyModelLine.rest` required.++- [ ] Test: every agent's bar is 44 high with a 22 face and the name in 13 semibold; on the right one line+ `engine · model` in 12 `textFaint`, no chevron at rest, a chevron and primary ink on hover with the same+ bounds; the Buddy's line opens one menu with its engines and the shared models and sends the same commands+ as before; another agent's line opens nothing; no subscription, machine or "reads all your projects"+ anywhere in the bar; the menu button is ⋯.+- [ ] Watch it fail.+- [ ] Build the line, share the menu rows, drop `BuddyModelLine`'s header-only branch, hide the Buddy card's chevron+ until hover, switch ⋮ to ⋯.+- [ ] Pass; run the Buddy engine, model and header tests.++## Task 2: one surface++**Files:** `desktop/lib/super_tabs/view.dart`, `desktop/lib/super_tabs/tasks/personal_tasks_pane.dart`,+`desktop/test/super_tab_tasks_pane_surface_test.dart`, `desktop/test/super_tab_one_surface_test.dart` (new).++- [ ] Test: over a host of another colour, the left, middle and right panes' pixels away from content are all+ `swarmField`, and the only lines between them are the 1-point `rim` hairlines; light and dark, at 880 and 1600.+- [ ] Watch it fail (the Tasks pane is the theme surface).+- [ ] Paint `swarmField` under the panes and in the Tasks pane.+- [ ] Pass; run the pane layout and Tasks pane tests.++## Task 3: design system and gallery++**Files:** `desktop/design/desktop-design-system.md`, `desktop/test/swarm_elements_gallery_test.dart` and its images+(from #4461).++- [ ] Gallery: the top bar of a Buddy and of a member agent, at rest and hovered, in light and dark; fails before the+ images exist.+- [ ] Generate, inspect, commit the images.+- [ ] Doc: the six rules, one surface, and the top bar's anatomy in the Swarm elements section.diff --git a/docs/plans/assets/swarm-surface-4465/06-buddy-header-880-dark.png b/docs/plans/assets/swarm-surface-4465/06-buddy-header-880-dark.pngnew file mode 100644index 000000000..19619bc66Binary files /dev/null and b/docs/plans/assets/swarm-surface-4465/06-buddy-header-880-dark.png differdiff --git a/docs/plans/assets/swarm-surface-4465/06-buddy-header-880-light.png b/docs/plans/assets/swarm-surface-4465/06-buddy-header-880-light.pngnew file mode 100644index 000000000..e2ff5320bBinary files /dev/null and b/docs/plans/assets/swarm-surface-4465/06-buddy-header-880-light.png differdiff --git a/docs/plans/assets/swarm-surface-4465/06-chat-header-880-dark.png b/docs/plans/assets/swarm-surface-4465/06-chat-header-880-dark.pngnew file mode 100644index 000000000..4b449de35Binary files /dev/null and b/docs/plans/assets/swarm-surface-4465/06-chat-header-880-dark.png differdiff --git a/docs/plans/assets/swarm-surface-4465/06-chat-header-880-light.png b/docs/plans/assets/swarm-surface-4465/06-chat-header-880-light.pngnew file mode 100644index 000000000..997534772Binary files /dev/null and b/docs/plans/assets/swarm-surface-4465/06-chat-header-880-light.png differdiff --git a/docs/plans/assets/swarm-surface-4465/one-surface-dark-1600.png b/docs/plans/assets/swarm-surface-4465/one-surface-dark-1600.pngnew file mode 100644index 000000000..8c82b7cfcBinary files /dev/null and b/docs/plans/assets/swarm-surface-4465/one-surface-dark-1600.png differdiff --git a/docs/plans/assets/swarm-surface-4465/one-surface-dark-880.png b/docs/plans/assets/swarm-surface-4465/one-surface-dark-880.pngnew file mode 100644index 000000000..d623ae4d1Binary files /dev/null and b/docs/plans/assets/swarm-surface-4465/one-surface-dark-880.png differdiff --git a/docs/plans/assets/swarm-surface-4465/one-surface-light-1600.png b/docs/plans/assets/swarm-surface-4465/one-surface-light-1600.pngnew file mode 100644index 000000000..0deee0e9bBinary files /dev/null and b/docs/plans/assets/swarm-surface-4465/one-surface-light-1600.png differdiff --git a/docs/plans/assets/swarm-surface-4465/one-surface-light-880.png b/docs/plans/assets/swarm-surface-4465/one-surface-light-880.pngnew file mode 100644index 000000000..b690cf765Binary files /dev/null and b/docs/plans/assets/swarm-surface-4465/one-surface-light-880.png differ