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 v3 UX fixes from the review (#4220) (#3471)
0xken156ed24e564219
diff --git a/desktop/lib/super_tabs/buddy_rows.dart b/desktop/lib/super_tabs/buddy_rows.dartindex b79924d1c..f30b474b0 100644--- a/desktop/lib/super_tabs/buddy_rows.dart+++ b/desktop/lib/super_tabs/buddy_rows.dart@@ -254,8 +254,15 @@ class SuperTabBuddyRow extends StatelessWidget {),SizedBox(width: _column,- // Unread is drawn as a bold name and heard in words.- child: Semantics(label: unread ? 'Unread messages' : null),+ // Unread is drawn as a bold name and heard in words. A row with no detail line has its status here,+ // quiet, at its end (task #4220).+ child: Semantics(+ label: unread ? 'Unread messages' : null,+ child: switch ((detail, status)) {+ (null, final status?) => Center(child: status),+ _ => null,+ },+ ),),const SizedBox(width: _column),],diff --git a/desktop/lib/super_tabs/join/bring_agent.dart b/desktop/lib/super_tabs/join/bring_agent.dartindex 3be0ea4c6..b9a393292 100644--- a/desktop/lib/super_tabs/join/bring_agent.dart+++ b/desktop/lib/super_tabs/join/bring_agent.dart@@ -23,7 +23,7 @@ Future<Map<String, dynamic>?> showBringAgentForm(bool Function()? isCurrent,}) async {final accountId = app.currentUser?.id;- final here = app.machineStates.values+ MachineState? thisComputer() => app.machineStates.values.where((m) =>m.isLocalMachine &&@@ -40,24 +40,14 @@ Future<Map<String, dynamic>?> showBringAgentForm(!controller.accessRevoked &&(isCurrent?.call() ?? true);if (!current()) return null;- if (here == null) {- await showAppDialog<void>(- context: context,- builder: (context) => AlertDialog(- title: const Text('Connect this computer'),- content: const Text(- 'Wait for this computer’s Harness connection, then try bringing your agent again.',- ),- actions: [- TextButton(- onPressed: () => Navigator.pop(context),- child: const Text('Close'),- ),- ],- ),- );- return null;- }+ // Before this computer's Harness connection is up, the box waits for it and goes on by itself (task #4220).+ final here =+ thisComputer() ??+ await showAppDialog<MachineState>(+ context: context,+ builder: (_) => _ConnectThisComputer(app: app, find: thisComputer),+ );+ if (here == null || !context.mounted || !current()) return null;// One start per computer chosen, each keeping its receipt across retries.final launchers = <String, (SwarmAgentLauncher, String)>{};SwarmAgentLauncher launcherFor(String machineId) => SwarmAgentLauncher(@@ -194,3 +184,69 @@ Future<Map<String, dynamic>?> showBringAgentForm(}return current() ? result : null;}++/// "Connect this computer": waits for this computer's Harness connection and closes with it once it is up, so the+/// agent box goes on by itself; Open Machines is where a computer that needs its link is connected (task #4220).+class _ConnectThisComputer extends StatefulWidget {+ const _ConnectThisComputer({required this.app, required this.find});+ final AppNotifier app;+ final MachineState? Function() find;++ @override+ State<_ConnectThisComputer> createState() => _ConnectThisComputerState();+}++class _ConnectThisComputerState extends State<_ConnectThisComputer> {+ bool _done = false;++ @override+ void initState() {+ super.initState();+ widget.app.addListener(_follow);+ }++ @override+ void dispose() {+ widget.app.removeListener(_follow);+ super.dispose();+ }++ void _follow() {+ if (_done || !mounted) return;+ if (widget.find() case final here?) _close(here);+ }++ void _close([MachineState? here]) {+ _done = true;+ Navigator.pop(context, here);+ }++ @override+ Widget build(BuildContext context) => AlertDialog(+ title: const Text('Connect this computer'),+ content: const Row(+ children: [+ SizedBox.square(+ dimension: 16,+ child: CircularProgressIndicator(strokeWidth: 2),+ ),+ SizedBox(width: 12),+ Flexible(+ child: Text(+ 'Waiting for this computer’s Harness connection. This goes on by itself once it is up.',+ ),+ ),+ ],+ ),+ actions: [+ TextButton(onPressed: _close, child: const Text('Cancel')),+ TextButton(+ onPressed: () {+ _close();+ widget.app.requestMachines();+ },+ child: const Text('Open Machines'),+ ),+ ],+ );+}diff --git a/desktop/lib/super_tabs/leaderboard/weekly_page.dart b/desktop/lib/super_tabs/leaderboard/weekly_page.dartindex d2fe83bb2..180fa79c0 100644--- a/desktop/lib/super_tabs/leaderboard/weekly_page.dart+++ b/desktop/lib/super_tabs/leaderboard/weekly_page.dart@@ -28,7 +28,7 @@ class _WeeklyBoardState extends State<SuperTabWeeklyLeaderboardPage> {static const _places = {1: 'one', 2: 'two', 3: 'three'};SuperTabLeaderboard? _board;String? _error;- Object? _stamp;+ (int?, (bool, String?))? _stamp;bool _busy = false, _again = false;int _generation = 0;SuperTabController get c => widget.controller;@@ -51,21 +51,23 @@ class _WeeklyBoardState extends State<SuperTabWeeklyLeaderboardPage> {}void _follow() {- final stamp = (- c.lastChangedAt,+ final audience = (c.accessRevoked,c.snapshot?.projects.map((p) => p.id).join(','),);+ final stamp = (c.lastChangedAt, audience);if (stamp == _stamp) return;+ final audienceChanged = _stamp?.$2 != audience;_stamp = stamp;- _refresh();+ _refresh(clear: audienceChanged);}- void _refresh() {+ /// Reads the board again, keeping the one shown until the answer lands (task #4220); [clear] drops it at once, for+ /// another audience, including while a request is in flight.+ void _refresh({bool clear = false}) {_generation++;- // Clear old audience data immediately, including while a request is in flight.setState(() {- _board = null;+ if (clear) _board = null;_error = null;});if (_busy) {@@ -100,13 +102,17 @@ class _WeeklyBoardState extends State<SuperTabWeeklyLeaderboardPage> {board.people.any((p) => p.accepted == null || p.agentsBrought == null,)) {+ _board = null;_error = 'The weekly org leaderboard needs a newer server.';} else {_board = board;}} on SuperTabFailure catch (failure) {if (!mounted || generation != _generation) return;- _error = failure.statusCode == 403 || failure.statusCode == 404+ // A board the reader may no longer read goes; any other failure keeps the last one beside why.+ final gone = failure.statusCode == 403 || failure.statusCode == 404;+ if (gone) _board = null;+ _error = gone? 'This leaderboard is no longer available.': failure.message;} catch (_) {@@ -170,7 +176,7 @@ class _WeeklyBoardState extends State<SuperTabWeeklyLeaderboardPage> {],),const SizedBox(height: 24),- if (_error case final error?)+ if (_error case final error? when board == null)Expanded(child: Center(child: Column(@@ -189,7 +195,7 @@ class _WeeklyBoardState extends State<SuperTabWeeklyLeaderboardPage> {),),)- else if (_busy)+ else if (_busy && board == null)const Expanded(child: Center(child: CircularProgressIndicator(strokeWidth: 2)),)@@ -205,8 +211,16 @@ class _WeeklyBoardState extends State<SuperTabWeeklyLeaderboardPage> {),),)- else+ else ...[+ if (_error case final error?)+ Row(+ children: [+ Flexible(child: Text(error, style: DesktopChrome.text())),+ TextButton(onPressed: _refresh, child: const Text('Retry')),+ ],+ ),Expanded(child: _table(board)),+ ],const SizedBox(height: 16),Text('Agents brought earn no points.',diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dartindex 35de31f05..64e35e40c 100644--- a/desktop/lib/super_tabs/project_sidebar.dart+++ b/desktop/lib/super_tabs/project_sidebar.dart@@ -65,6 +65,8 @@ class ProjectSidebar extends StatelessWidget {this.board = false,this.onNewAgent,this.onOpenAgentChat,+ this.boardProjectId,+ this.onOpenAgentTerminal,});final SuperTabController controller;@@ -80,6 +82,13 @@ class ProjectSidebar extends StatelessWidget {/// Opens the chat of an agent chosen in My agents in the middle; [onSelect] when not given.final ValueChanged<String>? onOpenAgentChat;++ /// The project whose Board holds the Desktop's middle, if one does. Its row is then the lit one, though the selected+ /// chat is the Buddy's on the right (task #4220).+ final String? boardProjectId;++ /// Opens the terminal of an agent in My agents that has no chat to open (task #4220); without it the row opens nothing.+ final ValueChanged<SuperTabAgent>? onOpenAgentTerminal;final ValueChanged<String> onSelect;final AppNotifier? app;final VoidCallback? onNewProject;@@ -119,6 +128,16 @@ class ProjectSidebar extends StatelessWidget {/// the main pane.bool get _paneCovered => manageSelected || devicesSelected || page != null;+ /// A project's Board holds the Desktop's middle: no chat's row is lit.+ bool get _boardOpen => board && boardProjectId != null;++ /// Whether [chat]'s row is the open one: its chat holds the main pane.+ bool _chatLit(SuperTabConversation? chat) =>+ chat != null &&+ !_paneCovered &&+ !_boardOpen &&+ controller.selectedId == chat.id;+/// Opens the reader's Buddy chat in a project, by project id; the/// controller's [SuperTabController.openBuddyChat] when not given.final ValueChanged<String>? onOpenBuddyChat;@@ -287,7 +306,10 @@ class ProjectSidebar extends StatelessWidget {String? key,}) {final project = reading?.project;- final selected = !_paneCovered && controller.selectedId == group.id;+ // On the Desktop the lit project is the one whose Board is in the middle (task #4220).+ final selected = _boardOpen+ ? !_paneCovered && project?.id == boardProjectId+ : _chatLit(group);// A project's row is bold for its own chat (Huy, 11-04, task #2638): a// person's message or a tag of the reader there, never agents' progress// alone (#2427). A task's unread is on its card and in Activity.@@ -334,9 +356,11 @@ class ProjectSidebar extends StatelessWidget {}) {// A project shows as selected while one of its tasks is open; the// reader's Buddy chat has a row of its own.+ // The Desktop lights one row, the middle's: never a project for a chat of its in the middle (task #4220).final highlighted =selected ||- (project != null &&+ (!board &&+ project != null &&!_paneCovered &&selectedProjectId == project.id &&controller.selectedId != buddyChat?.id);@@ -391,7 +415,7 @@ class ProjectSidebar extends StatelessWidget {label: project?.isPrivate == true? 'Private project': null,- selected: selected,+ selected: highlighted,child: Tooltip(// Beside the row, level with it, never over// the rows below (Huy, 11-03, #2427).@@ -563,8 +587,7 @@ class ProjectSidebar extends StatelessWidget {(final agent?, _) when agent.downSince != null => 'offline',_ => null,},- selected:- chat != null && !_paneCovered && controller.selectedId == chat.id,+ selected: _chatLit(chat),unread: chat != null && controller.unreadShown(chat),badge: chat == null ? 0 : attention?.mentionsIn(chat.id) ?? 0,badgeTooltip: chat == null ? null : attention?.badgeTooltipIn(chat.id),@@ -601,8 +624,7 @@ class ProjectSidebar extends StatelessWidget {name: 'Buddy',tooltip: 'Your Buddy',status: agent == null ? null : _buddyMark(agent),- selected:- chat != null && !_paneCovered && controller.selectedId == chat.id,+ selected: _chatLit(chat),unread: chat != null && !muted && controller.unreadShown(chat),onTap: switch (chat) {null when busy => null,@@ -615,8 +637,7 @@ class ProjectSidebar extends StatelessWidget {chat ?? _unopenedSwarmBuddyChat,label: 'Buddy',key: 'super-swarm-buddy',- selected:- chat != null && !_paneCovered && controller.selectedId == chat.id,+ selected: _chatLit(chat),// Muted, it is greyed and never bold, as every chat (_drawRow).unread: chat != null && controller.unreadShown(chat),trailing: agent == null ? null : _buddyMark(agent),@@ -675,14 +696,21 @@ class ProjectSidebar extends StatelessWidget {agentId: agent.id,agent: agent,name: name,- tooltip: chat == null ? '$name · no chat yet' : name,+ tooltip: chat != null+ ? name+ : onOpenAgentTerminal != null+ ? '$name · opens its terminal'+ : '$name · no chat yet',crown: pm,note: pm ? snapshot.leadProjectForAgent(agent.id)?.name : null,status: _buddyMark(agent),- selected:- chat != null && !_paneCovered && controller.selectedId == chat.id,+ selected: _chatLit(chat),unread: chat != null && controller.unreadShown(chat),- onTap: chat == null ? null : () => (onOpenAgentChat ?? onSelect)(chat.id),+ onTap: switch ((chat, onOpenAgentTerminal)) {+ (final chat?, _) => () => (onOpenAgentChat ?? onSelect)(chat.id),+ (null, final terminal?) => () => terminal(agent),+ _ => null,+ },);}@@ -744,15 +772,19 @@ class ProjectSidebar extends StatelessWidget {/// swipes projects in this order (cli superTabs/cards.ts `leadsOf`); a/// Personal project whose panes are all closed leaves this list but stays/// on the dial (task #3042: the brief is the project list).+ /// [taggedOnly]: only the projects whose chat tags the reader, as folded Projects lists them.List<(String, Widget)> _channels(SuperTabSnapshot? snapshot,- _SidebarReading reading,- ) {+ _SidebarReading reading, {+ bool taggedOnly = false,+ }) {final hidden = superTabHiddenProjects(controller, app: app);return [for (final project in ([...?snapshot?.projects]..sort(_compareProjects)))if (reading.of(project) case final readwhen read.lead != null &&+ (!taggedOnly ||+ (attention?.chatTagsIn(read.lead!.id) ?? 0) > 0) &&(!controller.unreadOnly || _hasUnread(read)) &&!_paneless(project, read.lead!, hidden))(@@ -902,9 +934,13 @@ class ProjectSidebar extends StatelessWidget {// The reader's one Buddy, the first item under Projects (anh// Dee, 11-05).if (controller.oneBuddy && !board) ?_swarmBuddyRow(),- if (!board || controller.projectsOpen)- for (final (_, channel) in _channels(snapshot, reading))- channel,+ // 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,const SizedBox(height: 16),// Buddies replaced Chat with PM in every Swarm (Ken, 10-29); where the// server gives one Buddy for the whole Swarm, it is # buddy above.diff --git a/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart b/desktop/lib/super_tabs/tasks/personal_tasks_pane.dartindex 31ae42eb0..33580d159 100644--- a/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart+++ b/desktop/lib/super_tabs/tasks/personal_tasks_pane.dart@@ -88,12 +88,17 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {: await owner.command(_action!, operationId: _operationId);if (!mounted || !identical(owner, c)) return;setState(() {- if (answer != null) {+ // Done, or refused: the controller holds it no more, so neither does Tasks (task #4220).+ final settled = answer != null || !owner.hasPendingAction;+ if (settled) {_action = null;_operationId = null;- } else {+ }+ if (answer == null) {_error = owner.operationErrorCode == 'UPDATE_REQUIRED'? 'Update Harness to change Tasks.'+ : settled+ ? owner.operationError ?? 'The change was refused.': 'The change is not confirmed. Retry to check it.';}});@@ -251,12 +256,14 @@ class _TasksPaneState extends State<SuperTabPersonalTasksPane> {color: Theme.of(context).colorScheme.error,),),- TextButton(- onPressed: _sending- ? null- : () => _send(_action!, retry: true),- child: const Text('Retry'),- ),+ // Only a change whose answer was lost is retried: a refused one would be refused again.+ if (_action case final action?)+ TextButton(+ onPressed: _sending+ ? null+ : () => _send(action, retry: true),+ child: const Text('Retry'),+ ),],),),diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex fd8df7344..767895280 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -269,6 +269,18 @@ class _SuperTabViewState extends State<SuperTabView>_closeSidebar();}+ /// Opens the terminal of an agent chosen in My agents that has no chat to open (task #4220), as Members opens one.+ void _openAgentTerminal(SuperTabAgent agent) {+ setState(() {+ _showPullRequests = _showTasks = false;+ _rosterOpen = false;+ _showManage = false;+ _page = null;+ });+ (widget.onChooseAgentTerminal ?? widget.onOpenTerminal)(agent);+ _closeSidebar();+ }+bool get _projectChatOnly {final group = c.selected;return _boardProjectId == null &&@@ -2103,14 +2115,17 @@ class _SuperTabViewState extends State<SuperTabView>c.select(selected);}- Widget _sidebar() => ProjectSidebar(+ /// [boardProjectId]: the project whose Board holds the middle, whose row is then lit.+ Widget _sidebar({String? boardProjectId}) => ProjectSidebar(board: widget.board,+ boardProjectId: boardProjectId,controller: c,compact: _phone,app: widget.app,onNewProject: widget.onNewProject,onNewAgent: widget.onNewAgent,onOpenAgentChat: _openAgentChat,+ onOpenAgentTerminal: _openAgentTerminal,onNewSwarm: widget.onNewSwarm,page: _pageShown,places: SuperTabPlaces.of(c),@@ -6232,15 +6247,24 @@ class _SuperTabViewState extends State<SuperTabView>!_terminalsVisible &&!_showPullRequests &&_pageShown == null;+ // The Desktop's Tasks pane stays on the right under a page or Manage too, unless a thread or Members takes that+ // side (task #4220).+ final tasksStay =+ widget.board &&+ hasTasksPane &&+ thread == null &&+ !_rosterOpen &&+ !_terminalsVisible;+ final fixedSides = boardLayout || tasksStay;// The fixed layout never drops a side pane; every other surface keeps// its own width rules.final narrow =- !boardLayout &&+ !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 =- boardLayout ||+ fixedSides ||constraints.maxWidth >= MediaQuery.textScalerOf(context).scale(1080);final threadDrawer = thread != null && !wide;// A terminal on screen keeps its chat beside it, in the right pane, as@@ -6325,11 +6349,11 @@ class _SuperTabViewState extends State<SuperTabView>child: SuperTabPaneLayout(storage: widget.paneStore ?? widget.app?.localStore,onLeave: _leaveResize,- left: narrow ? null : _sidebar(),+ left: narrow ? null : _sidebar(boardProjectId: boardProject),// An open thread takes the roster's side, as in Slack.right: !wide? null- : boardLayout+ : fixedSides? widget.rightPane?.call(context) ??(c.personalTasks?.supported == true? SuperTabPersonalTasksPane(@@ -6347,14 +6371,14 @@ class _SuperTabViewState extends State<SuperTabView>: chatBeside? chat: null),- rightDefault: boardLayout+ rightDefault: fixedSides? SuperTabPaneLayout.boardRightWidth: !boardLayout && thread == null && !chatBeside? SuperTabPaneLayout.rightWidth: SuperTabPaneLayout.threadWidth,// The Desktop's right pane is the Tasks pane's 340, giving back only to keep two Board columns- // in a small window (River, Swarm v3; #4211).- rightFixed: boardLayout,+ // in a small window (River, Swarm v3; #4211). It stays under a page or Manage too (#4220).+ rightFixed: fixedSides,// Over the chat, beside an open thread, as in Slack.over: wide ? viewer : null,// A project's own chat keeps its header and tabs (Project options, Tasks): the full chat view.diff --git a/desktop/test/super_tab_personal_tasks_pane_test.dart b/desktop/test/super_tab_personal_tasks_pane_test.dartindex 6f1e1a5c0..281c4dfae 100644--- a/desktop/test/super_tab_personal_tasks_pane_test.dart+++ b/desktop/test/super_tab_personal_tasks_pane_test.dart@@ -24,6 +24,9 @@ import 'support/memory_key_value_store.dart';class TasksFixture {final store = MemoryKeyValueStore();bool supported = true, fail = false;++ /// The server's answer to the next command: refused, as a 4xx.+ SuperTabFailure? refuse;Completer<void>? hold;String mode = 'autoApprove';var rows = [task('old', 1, 10), task('new', 1, 20)];@@ -60,6 +63,7 @@ class TasksFixture {commands.add(command);await hold?.future;if (fail) throw StateError('fixture private payload');+ if (refuse case final refusal?) throw refusal;if (command['type'] == 'member.approvalMode') {mode = command['mode'] as String;}@@ -295,6 +299,34 @@ void main() {expect(f.operations.toSet().length, 1);expect(f.commands.length, 2);});+ // Task #4220: the controller drops a refused change, but the pane kept it, so Tasks stayed disabled and its Retry sent+ // the refused change again.+ testWidgets('a refused change says the server\'s reason and Tasks works '+ 'again', (t) async {+ await mount(t);+ f.refuse = const SuperTabFailure(+ 'FORBIDDEN',+ 'Only the project\'s owner changes this.',+ statusCode: 403,+ );+ await t.tap(find.byKey(const ValueKey('tasks-approval-mode')));+ await t.pumpAndSettle();+ await t.tap(find.text('Review').last);+ await t.pumpAndSettle();+ expect(+ find.text('Only the project\'s owner changes this.'),+ findsOneWidget,+ );+ expect(find.text('Retry'), findsNothing);+ f.refuse = null;+ await t.tap(find.byKey(const ValueKey('tasks-approval-mode')));+ await t.pumpAndSettle();+ await t.tap(find.text('Review').last);+ await t.pumpAndSettle();+ expect(f.commands.length, 2);+ expect(f.operations.toSet().length, 2);+ expect(f.controller.personalTasks!.mode, 'review');+ });testWidgets('old backend has no approval controls', (t) async {await mount(t);f.supported = false;diff --git a/desktop/test/super_tab_v3_left_shots_test.dart b/desktop/test/super_tab_v3_left_shots_test.dartindex ee25c1105..2e6639746 100644--- a/desktop/test/super_tab_v3_left_shots_test.dart+++ b/desktop/test/super_tab_v3_left_shots_test.dart@@ -28,7 +28,8 @@ Map<String, dynamic> _agent(String id, String name) => {/// Swarm v3's left pane and middle (task #4118), in both appearances: My agents with the Buddy first, a PM's crown and an/// unread name in bold; the chat of a selected agent in the middle; a project's Board with Projects open. Task #4192: no-/// arrows under the org switcher, the Buddy's own avatar, only the server's My agents, and My agents folded.+/// arrows under the org switcher, the Buddy's own avatar, only the server's My agents, and My agents folded. Task #4220:+/// folded Projects keeps a project that tags you, and Decisions in the middle keeps Tasks on the right.void main() {setUpAll(() async {await loadCaptureFonts(shots);@@ -41,7 +42,14 @@ void main() {});for (final brightness in Brightness.values) {- for (final scene in ['agent-chat', 'no-agents', 'board', 'folded']) {+ for (final scene in [+ 'agent-chat',+ 'no-agents',+ 'board',+ 'folded',+ 'tagged',+ 'decisions',+ ]) {testWidgets('$scene (${brightness.name})', (tester) async {await tester.binding.setSurfaceSize(const Size(1500, 800));addTearDown(() => tester.binding.setSurfaceSize(null));@@ -56,8 +64,9 @@ void main() {} else {server.state['swarmBuddy'] = true;server.state['agents'] = [+ // The person's one Buddy is of no project, as the server sends it.{- ..._agent('buddy', 'Buddy'),+ ...(_agent('buddy', 'Buddy')..remove('projectId')),'buddyScope': 'swarm','buddyOf': {'personId': 'owner'},'kind': 'buddy',@@ -117,6 +126,7 @@ void main() {};}server.append('Working on the fix.', conversationId: 'offline');+ if (scene == 'tagged') server.tag('message-1', conversationId: 'lead');final c = server.controller(account: 'owner',initial: {@@ -172,6 +182,9 @@ void main() {} else if (scene == 'board') {await tester.tap(find.byKey(const ValueKey('super-group-lead')));await settle();+ } else if (scene == 'decisions') {+ await tester.tap(find.byKey(const ValueKey('super-decisions')));+ await settle();}await captureWindow(tester, shots, '$scene-${brightness.name}');await tester.pumpWidget(const SizedBox());diff --git a/desktop/test/super_tab_v3_left_test.dart b/desktop/test/super_tab_v3_left_test.dartindex fab26417e..e3fcffdf1 100644--- a/desktop/test/super_tab_v3_left_test.dart+++ b/desktop/test/super_tab_v3_left_test.dart@@ -14,6 +14,7 @@ import 'package:harness/super_tabs/model.dart' show SuperTabAgent;import 'package:harness/super_tabs/places.dart';import 'package:harness/super_tabs/project_sidebar.dart';import 'package:harness/super_tabs/view.dart';+import 'package:harness/widgets/harness_activity_mark.dart' show ActivityMark;import 'super_tab_activity_lists_test.dart' show load, swarm;import 'support/capture.dart';@@ -64,6 +65,7 @@ void main() {void Function(ConversationServer server)? setup,List<String>? selected,List<String>? created,+ List<String>? terminals,double width = 300,Brightness brightness = Brightness.light,}) async {@@ -96,6 +98,7 @@ void main() {c.select(id);},onNewAgent: () => created?.add('new'),+ onOpenAgentTerminal: (agent) => terminals?.add(agent.id),places: SuperTabPlaces.of(c),onNewSwarm: () {},onNewProject: () {},@@ -172,6 +175,24 @@ void main() {expect(key('super-project-lead'), findsOneWidget);});+ // Task #4220: the Desktop has no Mentions row, so a tag in a folded project's chat showed nowhere.+ testWidgets('folded, it still lists a project whose chat tags you, with '+ 'its number', (tester) async {+ await show(+ tester,+ setup: (server) => server.tag('message-1', conversationId: 'lead'),+ );+ expect(find.byTooltip('Expand Projects'), findsOneWidget);+ expect(key('super-project-lead'), findsOneWidget);+ expect(+ find.descendant(+ of: key('super-project-lead'),+ matching: key('super-mentions-lead'),+ ),+ findsOneWidget,+ );+ });+testWidgets('its heading opens and closes it', (tester) async {final c = await show(tester);await tester.tap(find.byTooltip('Expand Projects'));@@ -273,6 +294,34 @@ void main() {expect(key('super-agent-fir'), findsNothing);});+ // Task #4220: the row drew its status only beside a detail line, and My agents rows have none.+ testWidgets('each row shows its status, quietly, at its end', (+ tester,+ ) async {+ // The person's one running Buddy, of no project.+ await show(+ tester,+ agents: [+ {...buddy}..remove('projectId'),+ ...mine.skip(1),+ ],+ setup: agents,+ );+ for (final row in ['super-swarm-buddy', 'super-agent-kestrel']) {+ final mark = find.descendant(+ of: key(row),+ matching: find.byType(ActivityMark),+ );+ expect(mark, findsOneWidget, reason: row);+ // At the row's end, in the column the unread state is heard in.+ expect(+ tester.getRect(mark).left,+ greaterThan(tester.getRect(key(row)).right - 64),+ reason: row,+ );+ }+ });+// Task #4421 (anh Dee 11-07): "let's just put a leader crown on the avatar. it's too much." and "let's put the project// name next to the one that it leads".testWidgets('a PM wears its crown on its avatar and names the project it '@@ -378,10 +427,9 @@ void main() {await tester.runAsync(c.flush);});- testWidgets('an agent with no chat yet opens nothing and says why', (- tester,- ) async {- final selected = <String>[];+ // Task #4220: an agent from before its own chat (#4116), with no open task, was a row that did nothing.+ testWidgets('an agent with no chat opens its terminal', (tester) async {+ final selected = <String>[], terminals = <String>[];await show(tester,agents: mine,@@ -392,11 +440,13 @@ void main() {.remove('assignment');},selected: selected,+ terminals: terminals,);await tester.tap(key('super-agent-kestrel'));await tester.pump();expect(selected, isEmpty);- expect(find.byTooltip('Kestrel · no chat yet'), findsOneWidget);+ expect(terminals, ['kestrel']);+ expect(find.byTooltip('Kestrel · opens its terminal'), findsOneWidget);});testWidgets('+ New agent is the last row, below the agents, and hands on 'diff --git a/desktop/test/super_tab_v3_ux_fixes_test.dart b/desktop/test/super_tab_v3_ux_fixes_test.dartnew file mode 100644index 000000000..afff47c32--- /dev/null+++ b/desktop/test/super_tab_v3_ux_fixes_test.dart@@ -0,0 +1,188 @@+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/core/models.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/join/bring_agent.dart';+import 'package:harness/super_tabs/view.dart';++import 'super_tab_activity_lists_test.dart' show swarm;+import 'swarm_state_test.dart' show createApp;+import 'support/memory_key_value_store.dart';+import 'support/super_tab_fixture.dart';++/// Task #4220 (anh Dee's Buddy's review of main 0413586e, 2026-11-07): the Desktop v3 findings, each verified in the code+/// and fixed here.+Finder _key(String k) => find.byKey(ValueKey(k));++/// Whether the row under [k] reads as the open one.+bool _lit(String k) => find+ .descendant(+ of: _key(k),+ matching: find.byWidgetPredicate(+ (w) => w is Semantics && w.properties.selected == true,+ ),+ )+ .evaluate()+ .isNotEmpty;++void main() {+ /// The Desktop's view of a Swarm with one Buddy for the whole Swarm, as Swarm v3 has.+ Future<(SuperTabController, ConversationServer)> showDesktop(+ WidgetTester tester, {+ void Function(ConversationServer server)? setup,+ Widget Function(BuildContext)? rightPane,+ }) async {+ await tester.binding.setSurfaceSize(const Size(1500, 900));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final server = swarm()..state['swarmBuddy'] = true;+ (server.state['conversations'] as List).add({+ ...conversationFixture('swarm-buddy-owner', 'Buddy'),+ 'kind': 'swarm-buddy',+ 'projectId': null,+ 'buddyOwnerId': 'owner',+ 'agentIds': <String>[],+ });+ setup?.call(server);+ final c = server.controller(+ account: 'owner',+ initial: {+ 'tabId': 'tab',+ 'projectsGroupOpen': true,+ 'accountId': 'owner',+ 'selectedId': 'swarm-buddy-owner',+ },+ );+ await tester.runAsync(c.refresh);+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: Brightness.light),+ home: Scaffold(+ body: SuperTabView(+ controller: c,+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Mac Studio',+ paneStore: MemoryKeyValueStore(),+ board: true,+ rightPane: rightPane,+ ),+ ),+ ),+ );+ await tester.pumpAndSettle();+ addTearDown(() async {+ await tester.pumpWidget(const SizedBox());+ c.dispose();+ await tester.pump(const Duration(seconds: 5));+ });+ return (c, server);+ }++ // Finding 1: opening a project put its Board in the middle and selected the Buddy chat for the right side, so the+ // Buddy's row lit up and the project's did not.+ testWidgets('a project\'s row is highlighted while its Board is open, not '+ 'the Buddy\'s', (tester) async {+ final (c, _) = await showDesktop(tester);+ expect(_lit('super-swarm-buddy'), isTrue);+ await tester.tap(_key('super-group-lead'));+ await tester.pumpAndSettle();+ expect(c.selectedId, 'swarm-buddy-owner');+ expect(_lit('super-group-lead'), isTrue);+ expect(_lit('super-swarm-buddy'), isFalse);+ // Choosing the Buddy again puts its chat in the middle, and its row is the lit one.+ await tester.tap(_key('super-swarm-buddy'));+ await tester.pumpAndSettle();+ expect(_lit('super-swarm-buddy'), isTrue);+ expect(_lit('super-group-lead'), isFalse);+ });++ // Finding 3: a page or Manage in the middle turned the board layout off, and the Tasks pane with it.+ testWidgets('the Tasks pane stays on the right while Decisions, the '+ 'Leaderboard or Manage holds the middle', (tester) async {+ await showDesktop(+ tester,+ rightPane: (_) => const Text('Tasks pane', key: ValueKey('tasks-pane')),+ );+ final tasks = find.descendant(+ of: _key('super-right-pane'),+ matching: _key('tasks-pane'),+ );+ expect(tasks, findsOneWidget);+ for (final row in [+ 'super-decisions',+ 'super-leaderboard',+ 'super-manage',+ ]) {+ await tester.tap(_key(row));+ await tester.pumpAndSettle();+ expect(tasks, findsOneWidget, reason: row);+ }+ });++ // Finding 6: with this computer not connected yet, the box said to wait and try again, with only Close.+ group('Connect this computer', () {+ /// The agent box opened before this computer's Harness connection is up: the app knows only another computer.+ Future<(AppNotifier, Future<Map<String, dynamic>?>)> open(+ WidgetTester tester,+ ) async {+ final server = swarm();+ final c = server.controller(account: 'owner');+ addTearDown(c.dispose);+ await tester.runAsync(c.refresh);+ final app = createApp()+ ..status = AppStatus.authenticated+ ..currentUser = const CurrentUserProfile(+ id: 'owner',+ email: '[email protected]',+ );+ addTearDown(app.dispose);+ late BuildContext context;+ await tester.pumpWidget(+ MaterialApp(+ home: Builder(+ builder: (c) {+ context = c;+ return const SizedBox();+ },+ ),+ ),+ );+ var open = true;+ final result = showBringAgentForm(+ context,+ controller: c,+ app: app,+ isCurrent: () => open,+ );+ addTearDown(() => open = false);+ // The box's spinner never settles: pump its opening alone.+ await tester.pump();+ await tester.pump(const Duration(milliseconds: 300));+ expect(find.text('Connect this computer'), findsOneWidget);+ return (app, result);+ }++ testWidgets('the box waits, and goes on by itself once this computer '+ 'connects', (tester) async {+ final (app, _) = await open(tester);+ expect(find.text('Close'), findsNothing);+ app.machineStates['m']!.localOnly = true;+ app.notifyListeners();+ await tester.pump();+ await tester.pump(const Duration(milliseconds: 300));+ expect(find.text('Connect this computer'), findsNothing);+ });++ testWidgets('Open Machines closes it and opens Machines', (tester) async {+ final (app, result) = await open(tester);+ await tester.tap(find.text('Open Machines'));+ await tester.pumpAndSettle();+ expect(find.text('Connect this computer'), findsNothing);+ expect(app.machinesRequest, isNotNull);+ expect(await result, isNull);+ });+ });+}diff --git a/desktop/test/super_tab_weekly_leaderboard_test.dart b/desktop/test/super_tab_weekly_leaderboard_test.dartindex 59451ae73..e922af1f1 100644--- a/desktop/test/super_tab_weekly_leaderboard_test.dart+++ b/desktop/test/super_tab_weekly_leaderboard_test.dart@@ -267,6 +267,32 @@ void main() {},);+ // Task #4220: every change in the Swarm cleared the board and showed a spinner until the next read landed.+ testWidgets('a change in the Swarm refreshes the board without blanking '+ 'it, and a failed refresh keeps it', (tester) async {+ final server = weeklySwarm();+ final c = await showBoard(tester, server);+ await tester.pumpAndSettle();+ final peer = find.byKey(const ValueKey('weekly-person-peer'));+ expect(peer, findsOneWidget);+ final gate = Completer<void>();+ server.leaderboardGate = gate.future;+ server.state['name'] = 'Changed';+ await c.refresh();+ await tester.pump();+ expect(server.leaderboardReads, hasLength(2));+ expect(peer, findsOneWidget);+ gate.complete();+ await tester.pumpAndSettle();+ expect(peer, findsOneWidget);+ server.leaderboardGate = null;+ server.failLeaderboardReads = 1;+ await tester.tap(find.byTooltip('Refresh leaderboard'));+ await tester.pumpAndSettle();+ expect(peer, findsOneWidget);+ expect(find.text('No connection.'), findsOneWidget);+ });+testWidgets('empty week and narrow pane remain usable', (tester) async {final server = weeklySwarm();server.leaderboard!['people'] = <dynamic>[];diff --git a/docs/plans/2026-11-07-desktop-v3-ux-fixes-plan.md b/docs/plans/2026-11-07-desktop-v3-ux-fixes-plan.mdnew file mode 100644index 000000000..c4f98aeb5--- /dev/null+++ b/docs/plans/2026-11-07-desktop-v3-ux-fixes-plan.md@@ -0,0 +1,165 @@+# Desktop v3 UX fixes from the review: implementation plan++> Written by the project's Engineer way of working (project instructions, Engineer): plan first, then each task test first,+> the failing test committed before its code. No Execution Handoff.++**Goal:** Task #4220 (anh Dee's Buddy's review of main 0413586e, 2026-11-07 06:45 VN, "verify each before fixing"): fix the+eight Desktop v3 findings, each checked against the code first.++**Architecture:** Delta to what the Desktop already shows; no new screen, setting or server change. Everything is in+`desktop/lib/super_tabs/`.++**Tech Stack:** Dart and Flutter widget tests on the fake Swarm of `test/support/super_tab_fixture.dart`; light and dark+pictures by `test/super_tab_v3_left_shots_test.dart`.++**Spec:** Task #4220's brief; the Swarm v3 left pane (#4118, #4192: `2026-11-07-desktop-left-pane-cleanup-plan.md`).++## Verification (main d1f33f5c)++Each finding was read in the code before planning. All eight are real:++1. **Clicking a project highlights Buddy.** `view.dart _openBoard` puts the project's Board in the middle and selects the+ Buddy chat for the right side (`_showBuddy`). The sidebar highlights by `controller.selectedId`, so the Buddy row lights+ and the project's does not.+2. **Tags are invisible in collapsed Projects.** `project_sidebar.dart` drops every project row while Projects is folded+ (closed by default once the person has an agent), and the Desktop has no Mentions row, so a tag in a project chat shows+ nowhere.+3. **Tasks vanishes on Decisions, Leaderboard and Manage.** `view.dart _swarm`: a page or Manage turns `boardLayout` off, and+ the Tasks pane is drawn only in `boardLayout`.+4. **Tasks stays locked after a failed change.** `tasks/personal_tasks_pane.dart _send`: when the server refuses a change+ (4xx) the controller drops it, but the pane keeps `_action`, so every control stays disabled, it says "not confirmed", and+ its Retry sends the refused change again.+5. **Leaderboard blanks on each refresh.** `leaderboard/weekly_page.dart _refresh` sets the board to null on every+ `lastChangedAt`, though only an audience change (another Swarm, access gone, the project set) needs it cleared.+6. **'Connect this computer' is a dead end.** `join/new_agent_dialog.dart` (renamed `bring_agent.dart` by #4196, which keeps+ this box) says to wait and try again, with only Close.+7. **Older idle agents are dead rows.** An agent made before v3's own agent chats (#4116) has no `chatId`; with no open task+ `superTabAgentChat` is null and its My agents row does nothing.+8. **My agents shows no status.** `buddy_rows.dart` draws `status` only beside `detail`; My agents rows have no detail.++## Mockup++```+ +---------------------------++ | [ Company v ] |+ | Decisions |+ | Leaderboard |+ | |+ | v My agents |+ | (B) Buddy ○ | 8: quiet status dot at the row's end+ | (A) Kestrel ⠋ | (working spins, idle ○, offline ×)+ | (A) Fir ○ | 7: no chat: opens its terminal+ | + New agent |+ | |+ | > Projects [+] | folded+ | # openharness (2) | 2: a project that tags you stays listed+ |---------------------------|+ | Manage |+ +---------------------------++ 1: clicking # openharness highlights # openharness (its Board), not Buddy.+ 3: Decisions / Leaderboard / Manage in the middle, Tasks stays on the right.+ 4: a refused Tasks change says the server's reason, with no Retry; the controls work again.+ 5: the Leaderboard keeps its rows while it refreshes.+ 6: "Connect this computer" waits for the connection and goes on by itself; Open Machines when it needs a link.+```++## Global Constraints++- Owns `desktop/lib/super_tabs/` only. #4196 (Cmd-N, renames `join/new_agent_dialog.dart`), #4204 (Tasks cards, `view.dart`+ right pane and `_middleChat`) and #4191 (Tasks pane background) own nearby code: keep each change small and rebase on+ whichever merges first.+- No new setting or switch; no new runtime dependency.+- Never read or print a secret or a login.+- Test first: each task's failing test is committed before its code.++## Review Focus++- A project chat that tags the reader while Projects is folded and the unread filter is on: still listed (Task 2 test).+- A Tasks change that fails without an answer (network): stays pending with Retry, as before (Task 4 test).+- A Leaderboard refresh that fails: keeps the last rows and says why (Task 5 test).+- A page opened with a thread open: the thread keeps the right side, as before (Task 3 test).+- The Buddy chat opened from My agents while a Board was open: the Buddy row is highlighted again (Task 1 test).++---++### Task 1: the open Board's project is the highlighted row++**Files:** Modify `desktop/lib/super_tabs/project_sidebar.dart`, `desktop/lib/super_tabs/view.dart`;+Test `desktop/test/super_tab_v3_ux_fixes_test.dart`.++**Interfaces:** Produces `ProjectSidebar({String? boardProjectId})`: the project whose Board holds the middle. On the Desktop+(`board`), while it is set, that project's row is highlighted and no My agents row is.++- [ ] Test `a project's row is highlighted while its Board is open, not the Buddy`: with `boardProjectId: 'lead'` and the+ Buddy chat selected, the project row's surface is selected and `super-swarm-buddy`'s Semantics is not; with+ `boardProjectId: null` and the Buddy chat selected, the Buddy row is.+- [ ] Run it: FAIL (no `boardProjectId`).+- [ ] Add `boardProjectId`; `view.dart _sidebar` passes the Board shown (`_boardProjectId` while the board layout holds it).+- [ ] Run it: PASS. Commit.++### Task 2: folded Projects keeps the projects that tag you++**Files:** Modify `desktop/lib/super_tabs/project_sidebar.dart`; Test `desktop/test/super_tab_v3_ux_fixes_test.dart`.++- [ ] Test `folded Projects still lists a project whose chat tags you, with its number`: a tag of the reader in `lead`'s chat,+ Projects folded: `super-project-lead` and its `SuperTabCountBadge` show; a project with no tag does not.+- [ ] Run it: FAIL. Implement: while folded, `_channels` keeps a project whose chat tags the reader+ (`attention.chatTagsIn(lead) > 0`). Run it: PASS. Commit.++### Task 3: Tasks stays on the right under Decisions, Leaderboard and Manage++**Files:** Modify `desktop/lib/super_tabs/view.dart`; Test `desktop/test/super_tab_v3_ux_fixes_test.dart`.++- [ ] Test `the Tasks pane stays while Decisions, the Leaderboard or Manage holds the middle`: `SuperTabView(board: true)`+ with personal Tasks supported; tap `super-decisions`, `super-leaderboard`, `super-manage` in turn: each time+ `SuperTabPersonalTasksPane` is found.+- [ ] Run it: FAIL. Implement: on the Desktop with the Tasks pane, the right side is the Tasks pane whenever no thread or+ Members holds it, at the board's fixed width. Run it: PASS. Commit.++### Task 4: a refused Tasks change unlocks Tasks and says why++**Files:** Modify `desktop/lib/super_tabs/tasks/personal_tasks_pane.dart`; Test `desktop/test/super_tab_v3_ux_fixes_test.dart`.++- [ ] Test `a refused change says the server's reason and Tasks works again`: the server refuses `member.approvalMode` with+ 403; the pane shows the server's sentence, no Retry, and the mode menu is enabled again.+- [ ] Test `a change with no answer keeps Retry`: the request throws; "not confirmed" and Retry show, as before.+- [ ] Run them: the first FAILS. Implement: after a failed `_send`, when the controller no longer holds a pending command,+ clear `_action`/`_operationId` and show `operationError`; Retry only while one is pending. Run: PASS. Commit.++### Task 5: the Leaderboard keeps its rows while it refreshes++**Files:** Modify `desktop/lib/super_tabs/leaderboard/weekly_page.dart`; Test `desktop/test/super_tab_v3_ux_fixes_test.dart`.++- [ ] Test `a change in the Swarm refreshes the board without blanking it`: board shown; a change moves `lastChangedAt` while+ the next read is held: the rows stay; the new read replaces them.+- [ ] Run it: FAIL. Implement: `_refresh` clears the board only when the audience changes (access, the project set, another+ controller). Run it: PASS. Commit.++### Task 6: 'Connect this computer' waits and goes on++**Files:** Modify `desktop/lib/super_tabs/join/new_agent_dialog.dart`; Test `desktop/test/super_tab_v3_ux_fixes_test.dart`.++- [ ] Test `with this computer not connected yet, the box waits and goes on once it connects`: no local machine; the box shows+ "Connecting this computer…"; the local machine connects; the box closes and the agent form opens.+- [ ] Test `a computer that needs its link offers Open Machines`: tapping it closes the box and asks the app for Machines.+- [ ] Run them: FAIL. Implement the box as a listener on the app with Cancel and Open Machines (`app.requestMachines`).+ Run: PASS. Commit.++### Task 7: an agent with no chat opens its terminal++**Files:** Modify `desktop/lib/super_tabs/project_sidebar.dart`, `desktop/lib/super_tabs/view.dart`;+Test `desktop/test/super_tab_v3_left_test.dart` (its "no chat yet opens nothing" test becomes this one).++**Interfaces:** Produces `ProjectSidebar({ValueChanged<SuperTabAgent>? onOpenAgentTerminal})`.++- [ ] Test `an agent with no chat opens its terminal`: Kestrel with no task: tapping it calls `onOpenAgentTerminal(kestrel)`.+- [ ] Run it: FAIL. Implement; `view.dart` passes `widget.onChooseAgentTerminal ?? widget.onOpenTerminal`. Run: PASS. Commit.++### Task 8: My agents rows show a quiet status dot++**Files:** Modify `desktop/lib/super_tabs/buddy_rows.dart`; Test `desktop/test/super_tab_v3_left_test.dart`;+pictures `desktop/test/super_tab_v3_left_shots_test.dart`.++- [ ] Test `each agent row shows its status at the end`: `super-agent-kestrel` contains an `ActivityMark`.+- [ ] Run it: FAIL. Implement: with no `detail`, `SuperTabBuddyRow` draws `status` at the row's end. Run: PASS.+- [ ] Shots: light and dark of the left pane with a folded Projects listing a tagged project. Commit.