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
Swarm: one Humans list with the leaderboard in it; a DM click only highlights the DM; shipped points count (#1806)
0xken156cffb7b37dd5
diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.tsindex c5bc93960..8fd0d0f12 100644--- a/backend/src/superTabs/commands.ts+++ b/backend/src/superTabs/commands.ts@@ -2,7 +2,7 @@ import { admitMachineStart, expireRemoval, expireRemovals, failTeamWork, machineimport { assignAgentDisplayNames } from './agentNames.js'import { z } from 'zod'import {- activeWork, actorKey, agent, agentRole, author, conversation, crossProjectActive, fail, isLeads, person, stableId, syncLeads, numberConversations, nextConversationNumber, renderWorkTask,+ activeWork, actorKey, agent, agentRole, appendPullRequestUrls, author, conversation, crossProjectActive, fail, isLeads, person, stableId, syncLeads, numberConversations, nextConversationNumber, renderWorkTask,finishWorker, requireWorkerDecisions, reviewing, swarmGridName, AGENT_ONLY,type Actor, type Agent, type Author, type CommandEffects, type Conversation, type SuperTabState,} from './model.js'@@ -17,7 +17,8 @@ import { loseTasks, renewLease, renewOwnTask } from './liveness.js'import { digestStartsAfter, knownTimeZone } from './digest.js'import { credentialResult, redactCredentials, type CredentialKind } from './credentials.js'import { dirtyGroups, reportGroups, summarize } from './projectUpdates.js'-import { recordAnswer, recordAsked, recordStatus } from './leaderboard/record.js'+import { LEDGER_WEEKS, PULL_REQUEST_URL, recordAnswer, recordAsked, recordMerged, recordStatus } from './leaderboard/record.js'+import { WEEK_MS } from './leaderboard/week.js'import { agentKind, agentProjectId, audienceOf, agentSetRole, canReadProject, deleteProject, markConfidential, requireSingleRegistration, groupProject, inviteLanding, ledProject, manageProject, MAX_ROLES, mutableProjects, placeRules, projectMembers, projectOf, projectRules, projectsOf, readAgent, readConversation, readProject, roleVersion, sameProject, sharedWithLeads, SKILL_SET_NAMES, skillSetOf, type ProjectRole, type RoleKind, type SwarmProject } from './projects.js'const id = z.string().min(1).max(160).regex(/^[A-Za-z0-9_-]+$/)@@ -106,6 +107,9 @@ export const commandSchema = z.discriminatedUnion('type', [z.object({ type: z.literal('conversation.archive'), conversationId: id, archived: z.boolean() }).strict(),z.object({ type: z.literal('conversation.audience'), conversationId: id, personIds: z.array(id).max(200) }).strict(),z.object({ type: z.literal('conversation.requester'), conversationId: id, personId: id.nullable() }).strict(),+ // The Lead's record that a request's pull request merged (leaderboard/record.ts recordMerged); `mergedAt` for a backfill.+ z.object({ type: z.literal('conversation.merged'), conversationId: id, pullRequestUrl: z.string().max(400).regex(PULL_REQUEST_URL),+ mergedAt: z.iso.datetime().optional() }).strict(),z.object({ type: z.literal('agent.add'), conversationId: id, machineId: id, harnessId: id, name: title, configuration, lead: z.boolean(), project: project.optional(), roleId: roleId.optional(), initialMessage: text.optional() }).strict(),z.object({ type: z.literal('agent.start'), request: startRequestSchema, routeDecisionId: id.optional(), overrideReason: reason.optional() }).strict(),z.object({ type: z.literal('agent.startDispatch'), startId: id }).strict(),@@ -1048,6 +1052,27 @@ export function applyCommand(original: SuperTabState, actor: Actor, input: Commaelse delete group.requesterIdbreak}+ case 'conversation.merged': {+ chatOnly(command.conversationId)+ controls(state, actor, command.conversationId)+ // An archived group still takes the record: a backfill names work finished days ago.+ const group = conversation(state, command.conversationId)+ // It awards points, so only the group's Lead or an owner records it; reading the group is not enough.+ const owners = [state.ownerId, groupProject(state, group).ownerId]+ if (!(actor.kind === 'agent' && group.leadId === actor.agentId) && !(actor.kind === 'person' && owners.includes(actor.userId))) {+ fail('MERGE_RECORDER', 'Only the Lead or an owner records a merge.', 403)+ }+ if (group.reviewOf) fail('REVIEW_SHIPS_NOTHING', 'A review group ships nothing. Record the merge on the group it reviews.', 400)+ const mergedAt = command.mergedAt === undefined ? context.now : Date.parse(command.mergedAt)+ if (mergedAt > context.now || mergedAt <= context.now - (LEDGER_WEEKS - 1) * WEEK_MS) {+ fail('MERGE_TIME', 'Record a merge from the last four weeks, not one still to come.', 400)+ }+ const shippedAt = group.ledger?.shippedAt, linked = group.pullRequestUrls?.includes(command.pullRequestUrl)+ appendPullRequestUrls(group, [command.pullRequestUrl])+ recordMerged(group, mergedAt)+ if (!linked || group.ledger!.shippedAt !== shippedAt) message(group.id, `Merged ${command.pullRequestUrl}`, [], null, SYSTEM_ROW)+ break+ }case 'conversation.audience': {// Who may read it already passed (readConversation): only its listed people and the project's Lead get here.const group = open(state, command.conversationId)diff --git a/backend/src/superTabs/leaderboard/record.test.ts b/backend/src/superTabs/leaderboard/record.test.tsindex b05ce1084..d0b1b17af 100644--- a/backend/src/superTabs/leaderboard/record.test.ts+++ b/backend/src/superTabs/leaderboard/record.test.ts@@ -1,6 +1,8 @@import { describe, expect, it } from 'vitest'import { applyCommand, commandSchema, type Command, type CommandContext } from '../commands.js'import { createSuperTab, type Actor, type AgentConfiguration, type Conversation } from '../model.js'+import { leaderboard } from './stats.js'+import { DAY_MS, WEEK_MS, weekStart } from './week.js'const owner: Extract<Actor, { kind: 'person' }> = { kind: 'person', userId: 'owner', email: '[email protected]' }const peer: Extract<Actor, { kind: 'person' }> = { kind: 'person', userId: 'peer', email: '[email protected]' }@@ -118,6 +120,163 @@ describe('when a request ships', () => {})})+describe('when the Lead records a merge', () => {+ // Tuesday 2026-10-27 12:00 UTC.+ const NOW = Date.UTC(2026, 9, 27, 12), PR = 'https://github.com/o/r/pull/42'+ const merged = (conversationId: string, extra: Record<string, unknown> = {}) =>+ commandSchema.parse({ type: 'conversation.merged', conversationId, pullRequestUrl: PR, ...extra })+ /** A Lead, and a group it opened for the owner, at NOW. */+ const setup = () => {+ const f = fixture(), lead = f.add('lead', 'lead', true)+ f.at(NOW - DAY_MS)+ const id = f.create(f.asAgent(lead), { requesterId: 'owner' })+ f.at(NOW)+ return { f, lead: f.asAgent(lead), id }+ }+ const shippedFor = (f: ReturnType<typeof fixture>, personId: string) =>+ leaderboard({ state: f.state, groups: f.state.conversations, machines: [], projectId: 'lead', week: weekStart(NOW), now: NOW })+ .people.find(p => p.personId === personId)!++ it('ships the request when its PR merged, links the PR and says so in the group', () => {+ const { f, lead, id } = setup()+ const effects = f.run(merged(id), lead)+ expect(f.group(id).ledger?.shippedAt).toBe(NOW)+ expect(f.group(id).pullRequestUrls).toEqual([PR])+ expect(effects.messages.map(m => [m.conversationId, m.text])).toEqual([[id, `Merged ${PR}`]])+ expect(shippedFor(f, 'owner')).toMatchObject({ points: 3, shipped: { count: 1 } })+ })++ it('records an earlier merge time for a backfill', () => {+ const { f, lead, id } = setup()+ f.run(merged(id, { mergedAt: new Date(NOW - 5 * 3_600_000).toISOString() }), lead)+ expect(f.group(id).ledger?.shippedAt).toBe(NOW - 5 * 3_600_000)+ })++ it('still counts the request when its work is cancelled after the merge', () => {+ const { f, lead, id } = setup(), { assignmentId } = f.assign(id)+ f.run(merged(id), lead)+ f.at(NOW + 3_600_000)+ f.run({ type: 'work.cancel', conversationId: id, assignmentId, reason: 'Merged by hand' })+ expect(f.group(id).ledger?.shippedAt).toBe(NOW)+ expect(shippedFor(f, 'owner').shipped.count).toBe(1)+ })++ it('still counts the request when its attempt is lost after the merge', () => {+ const { f, lead, id } = setup(), { worker } = f.assign(id)+ f.run(merged(id), lead)+ f.at(NOW + 3_600_000)+ f.run({ type: 'agent.remove', agentId: worker })+ expect(f.group(id).assignment?.status).not.toBe('done')+ expect(shippedFor(f, 'owner').shipped.count).toBe(1)+ })++ it('keeps the merge as the ship time when the work is marked done later', () => {+ const { f, lead, id } = setup(), { worker, assignmentId } = f.assign(id)+ f.run(merged(id), lead)+ f.passChecks(id, assignmentId)+ f.at(NOW + 3_600_000)+ f.status(id, assignmentId, worker, 'done', `Merged ${PR}`)+ expect(f.group(id).ledger?.shippedAt).toBe(NOW)+ })++ it('moves the ship time back to the merge when Done was marked first', () => {+ const { f, lead, id } = setup(), { worker, assignmentId } = f.assign(id)+ f.passChecks(id, assignmentId)+ f.status(id, assignmentId, worker, 'done', 'Done')+ f.run(merged(id, { mergedAt: new Date(NOW - 3_600_000).toISOString() }), lead)+ expect(f.group(id).ledger?.shippedAt).toBe(NOW - 3_600_000)+ })++ it('keeps the first merge time when the same merge is recorded again', () => {+ const { f, lead, id } = setup()+ f.run(merged(id), lead)+ f.at(NOW + DAY_MS)+ expect(f.run(merged(id), lead).messages).toEqual([])+ expect(f.group(id).ledger?.shippedAt).toBe(NOW)+ expect(f.group(id).pullRequestUrls).toEqual([PR])+ })++ it('refuses a merge time in the future or older than the four weeks the board reads', () => {+ const { f, lead, id } = setup()+ expect(() => f.run(merged(id, { mergedAt: new Date(NOW + 60_000).toISOString() }), lead)).toThrow('four weeks')+ expect(() => f.run(merged(id, { mergedAt: new Date(NOW - 4 * WEEK_MS).toISOString() }), lead)).toThrow('four weeks')+ expect(f.group(id).ledger?.shippedAt).toBeUndefined()+ })++ it('takes only a GitHub pull request link', () => {+ const parse = (pullRequestUrl: string) => () => commandSchema.parse({ type: 'conversation.merged', conversationId: 'g', pullRequestUrl })+ expect(parse(PR)).not.toThrow()+ expect(parse('https://example.com/o/r/pull/1')).toThrow()+ expect(parse('https://github.com/o/r/issues/1')).toThrow()+ })++ it('keeps the record to the Lead and owners: a collaborator who reads the group cannot ship it', () => {+ const { f, id } = setup()+ f.invitePeer()+ expect(() => f.run(merged(id), peer)).toThrow('Lead or an owner')+ expect(f.group(id).ledger?.shippedAt).toBeUndefined()+ expect(f.group(id).pullRequestUrls).toBeUndefined()+ })++ it('takes the record from the Swarm and project owner', () => {+ const { f, id } = setup()+ f.run(merged(id), owner)+ expect(f.group(id).ledger?.shippedAt).toBe(NOW)+ })++ it('ships in the week of the merge when Done was marked the Sunday before', () => {+ const { f, lead, id } = setup(), { worker, assignmentId } = f.assign(id)+ // Sunday 2026-11-01 23:00 UTC, then Monday 2026-11-02 01:00 UTC: the next leaderboard week.+ const sunday = Date.UTC(2026, 10, 1, 23), monday = Date.UTC(2026, 10, 2, 1)+ f.passChecks(id, assignmentId)+ f.at(sunday)+ f.status(id, assignmentId, worker, 'done', 'Done')+ f.at(monday)+ f.run(merged(id), lead)+ expect(f.group(id).ledger?.shippedAt).toBe(monday)+ const board = (week: number) => leaderboard({ state: f.state, groups: f.state.conversations, machines: [], projectId: 'lead', week, now: monday })+ expect(board(weekStart(monday)).goal.thisWeek.shipped).toBe(1)+ expect(board(weekStart(sunday)).goal.thisWeek.shipped).toBe(0)+ })++ it('keeps the earliest of two merge records, whatever order they come in', () => {+ const { f, lead, id } = setup()+ f.run(merged(id, { mergedAt: new Date(NOW - 3_600_000).toISOString() }), lead)+ f.run(merged(id, { mergedAt: new Date(NOW - 2 * 3_600_000).toISOString() }), lead)+ expect(f.group(id).ledger?.shippedAt).toBe(NOW - 2 * 3_600_000)+ f.run(merged(id, { mergedAt: new Date(NOW - 3_600_000).toISOString() }), lead)+ expect(f.group(id).ledger?.shippedAt).toBe(NOW - 2 * 3_600_000)+ })++ it('keeps the merge as the ship time when Done came first and the work is cancelled later', () => {+ const { f, lead, id } = setup(), { worker, assignmentId } = f.assign(id)+ f.passChecks(id, assignmentId)+ f.at(NOW - DAY_MS + 3_600_000)+ f.status(id, assignmentId, worker, 'done', 'Done')+ f.at(NOW)+ f.run(merged(id), lead)+ f.run({ type: 'work.define', conversationId: id, brief: 'More', checks })+ const again = f.assign(id, worker)+ f.at(NOW + 3_600_000)+ f.run({ type: 'work.cancel', conversationId: id, assignmentId: again.assignmentId, reason: 'Not needed' })+ expect(f.group(id).ledger?.shippedAt).toBe(NOW)+ expect(shippedFor(f, 'owner').shipped.count).toBe(1)+ })++ it('keeps the record to the Lead: a worker in the group cannot ship it', () => {+ const { f, id } = setup(), worker = f.add('worker', id)+ expect(() => f.run(merged(id), f.asAgent(worker))).toThrow('coordinating lead')+ })++ it('refuses a review group and a private conversation: neither is a request', () => {+ const { f, lead, id } = setup()+ const review = f.create(lead, { reviewOf: id, title: 'Review', brief: 'Review it.' })+ expect(() => f.run(merged(review), lead)).toThrow('review group')+ const chat = f.run(commandSchema.parse({ type: 'conversation.create', title: 'Chat', brief: '', checks: [], audience: { personIds: ['owner'] } })).result.conversationId as string+ expect(() => f.run(merged(chat))).toThrow('chat only')+ })+})+describe('who unblocks waiting work', () => {it('credits the person the item waits on with their answer and how long the agent waited', () => {const f = fixture(), id = f.create(), { worker, assignmentId } = f.assign(id)diff --git a/backend/src/superTabs/leaderboard/record.ts b/backend/src/superTabs/leaderboard/record.tsindex 8ce4235ba..901f2b9dd 100644--- a/backend/src/superTabs/leaderboard/record.ts+++ b/backend/src/superTabs/leaderboard/record.ts@@ -10,8 +10,11 @@ export interface Unblock { personId: string; at: number; waitedMs: number }/** A group's leaderboard bookkeeping; readers never get it whole (read/views.ts groupView). */export interface GroupLedger {askedAt?: number- /** The first time its work was done; a group is one request, so finishing it again ships nothing new. */+ /** When it shipped: its earliest recorded merge, or without one the first time its work was done. A group is one request,+ * so finishing it again ships nothing new. */shippedAt?: number+ /** The earliest merge the Lead recorded (recordMerged); once there is one, it is the ship time. */+ mergedAt?: number/** The item waiting on a person: the attempt, since when, the "Needs a human" row it posted, and once a person answered it,* when. An answered item no longer waits, though its worker has not moved on yet. */waiting?: { assignmentId: string; since: number; messageId: string; answeredAt?: number }@@ -40,6 +43,17 @@ export function recordStatus(group: Conversation, assignment: Assignment, previoif (assignment.status === 'done') ledger.shippedAt ??= now}+/** One GitHub pull request link, as a merge record names it (model.ts appendPullRequestUrls finds the same in text). */+export const PULL_REQUEST_URL = /^https:\/\/github\.com\/[A-Za-z0-9_-]+\/[A-Za-z0-9_.-]+\/pull\/[1-9][0-9]*$/++/** The Lead's record that a request's PR merged (Lead, 2026-10-27): the request ships at its earliest recorded merge, even+ * when Done came first, and whatever its work does next, so work lost or cancelled after the merge still counts. */+export function recordMerged(group: Conversation, mergedAt: number): void {+ const ledger = group.ledger ??= {}+ ledger.mergedAt = Math.min(ledger.mergedAt ?? mergedAt, mergedAt)+ ledger.shippedAt = ledger.mergedAt+}+/** The person a waiting item waits on: its requester while still a member, otherwise the project's owner. */export function waitedOn(state: SuperTabState, group: Conversation): string {const requester = group.requesterId && state.people.some(p => p.id === group.requesterId) ? group.requesterId : undefineddiff --git a/backend/src/superTabs/parts/touches.ts b/backend/src/superTabs/parts/touches.tsindex c46dda976..f40a56b12 100644--- a/backend/src/superTabs/parts/touches.ts+++ b/backend/src/superTabs/parts/touches.ts@@ -73,6 +73,9 @@ export function touchesFor(command: Command, actor: Actor, before: SuperTabStatemember(command.requesterId)break}+ case 'conversation.merged':+ leadCheck(projectOfGroup(command.conversationId)?.id)+ breakcase 'conversation.requester':leadCheck(projectOfGroup(command.conversationId)?.id)member(command.personId ?? undefined)diff --git a/cli/src/lib/swarmSkills.spec.ts b/cli/src/lib/swarmSkills.spec.tsindex 093cbacd2..86e2a07a8 100644--- a/cli/src/lib/swarmSkills.spec.ts+++ b/cli/src/lib/swarmSkills.spec.ts@@ -66,7 +66,7 @@ describe('built-in Swarm skills', () => {const ask = '- When you know who decides, add ask to that needs-human (the person, 2 to 5 options, the one you recommend, what it unblocks) and keep working on your recommendation, marked provisional, until a notice says it was answered; read the answer with harness super-tab decisions --answered.\n'// The requests section (Lead's ruling for v2 G, the human leaderboard, 2026-10-27): the Lead's alone, in both modes, in a// section of its own so other groups' edits to the Lead text merge cleanly.- const requests = '## Requests and Done\n- When you open a group for a person\'s request, asked in the project chat or in their Chat with PM, name them as its requester: requesterId on conversation.create, or conversation.requester for a group already open. It records only that they asked, never what they wrote.\n- Mark a group Done only after its pull request has merged: the leaderboard counts a request as shipped once its group is Done with a linked PR.\n\n'+ const requests = '## Requests and Done\n- When you open a group for a person\'s request, asked in the project chat or in their Chat with PM, name them as its requester: requesterId on conversation.create, or conversation.requester for a group already open. It records only that they asked, never what they wrote.\n- Right after you merge a group\'s pull request, record it: conversation.merged with the group and the PR link, and mergedAt for a merge you record later. The leaderboard counts the request as shipped at the merge, even if its work is lost or cancelled afterwards. Mark a group Done only after its pull request has merged.\n\n'// Last in the Default Lead text, which has no red flags: after a blank line, ending the text.const requestsLast = `\n${requests.trimEnd()}\n`const twoHours = '- A Builder or Reviewer that has been down for 2 hours (machine offline, session gone or stopped): cancel its task with the reason, route it, and assign it to another agent with what the first one left (branch, last revision, last report).\n'diff --git a/cli/src/lib/swarmSkills.ts b/cli/src/lib/swarmSkills.tsindex 1ec915d10..adbcacf97 100644--- a/cli/src/lib/swarmSkills.ts+++ b/cli/src/lib/swarmSkills.ts@@ -165,7 +165,7 @@ For large work, post the group plan and get the owner's ok before assigning; onc## Requests and Done- When you open a group for a person's request, asked in the project chat or in their Chat with PM, name them as its requester: requesterId on conversation.create, or conversation.requester for a group already open. It records only that they asked, never what they wrote.-- Mark a group Done only after its pull request has merged: the leaderboard counts a request as shipped once its group is Done with a linked PR.+- Right after you merge a group's pull request, record it: conversation.merged with the group and the PR link, and mergedAt for a merge you record later. The leaderboard counts the request as shipped at the merge, even if its work is lost or cancelled afterwards. Mark a group Done only after its pull request has merged.## Red flags| Thought | Reality |@@ -435,7 +435,7 @@ When the project owner asks in chat to switch this project's skills (Default or## Requests and Done- When you open a group for a person's request, asked in the project chat or in their Chat with PM, name them as its requester: requesterId on conversation.create, or conversation.requester for a group already open. It records only that they asked, never what they wrote.-- Mark a group Done only after its pull request has merged: the leaderboard counts a request as shipped once its group is Done with a linked PR.+- Right after you merge a group's pull request, record it: conversation.merged with the group and the PR link, and mergedAt for a merge you record later. The leaderboard counts the request as shipped at the merge, even if its work is lost or cancelled afterwards. Mark a group Done only after its pull request has merged.`,dev: `---name: swarm-devdiff --git a/cli/src/superTabs/service.ts b/cli/src/superTabs/service.tsindex ee90e775c..237f8311a 100644--- a/cli/src/superTabs/service.ts+++ b/cli/src/superTabs/service.ts@@ -62,6 +62,7 @@ const HELP = {{ type: 'conversation.agent', conversationId: 'GROUP', agentId: 'AGENT', present: true, lead: false },{ type: 'work.define', conversationId: 'GROUP', task: { goal: 'What to deliver', changes: 'What changes', constraints: 'What must stay true', owns: ['Paths or code areas'] }, checks: [{ description: 'Observable acceptance evidence', independent: false }] },{ type: 'work.cancel', conversationId: 'GROUP', assignmentId: 'ATTEMPT', reason: 'Lead or tab owner only: why the task is cancelled, in one short sentence' },+ { type: 'conversation.merged', conversationId: 'GROUP', pullRequestUrl: 'https://github.com/OWNER/REPOSITORY/pull/NUMBER', mergedAt: 'Optional ISO time of a merge recorded later' },{ type: 'agent.release', agentId: 'AGENT', decision: 'keep|stop' },{ type: 'rule.set', rule: { kind: 'forbidModel', model: 'haiku' }, text: 'The owner\'s words: No Haiku.', askedIn: { conversationId: 'GROUP', messageId: 'OWNER_MESSAGE' } },{ type: 'rule.set', rule: { kind: 'minEffort', effort: 'high' }, text: 'At least high effort.', askedIn: { conversationId: 'GROUP', messageId: 'OWNER_MESSAGE' } },diff --git a/desktop/lib/super_tabs/controller.dart b/desktop/lib/super_tabs/controller.dartindex 249b4875d..38d2c2f28 100644--- a/desktop/lib/super_tabs/controller.dart+++ b/desktop/lib/super_tabs/controller.dart@@ -902,8 +902,10 @@ class SuperTabController extends ChangeNotifier {if (id == selectedId && !devicesSelected) return true;devicesSelected = false;_acted();- if (!snapshot!.isProjectLead(id)) {- final group = snapshot!.conversation(id)!;+ final group = snapshot!.conversation(id)!;+ // A workgroup is shown under its project, so its project opens. A Chat with+ // PM has its own row under Direct messages and leaves projects as they were.+ if (!snapshot!.isProjectLead(id) && pmChat(group.projectId)?.id != id) {expandedProjects.add(group.projectId);unawaited(loadDormant(group.projectId));if (group.closed) closedOpenProjects.add(group.projectId);diff --git a/desktop/lib/super_tabs/leaderboard/column.dart b/desktop/lib/super_tabs/leaderboard/column.dartdeleted file mode 100644index bfab65b4c..000000000--- a/desktop/lib/super_tabs/leaderboard/column.dart+++ /dev/null@@ -1,183 +0,0 @@-import 'dart:async';--import 'package:flutter/material.dart';--import '../../shared/theme/app_theme.dart' as grid;-import '../../shared/widgets/app_select_field.dart';-import '../../shared/widgets/skeleton.dart';-import '../../widgets/desktop_chrome.dart';-import '../pane_layout.dart';-import 'format.dart';-import 'goal_bar.dart';-import 'person_row.dart';-import 'reader.dart';-import 'waiting_line.dart';--/// The Swarm's human leaderboard, a fixed-width column on the right: the team-/// goal, everyone's three numbers this week with medals for the top three, and-/// who agents wait on now. People compete for fun; the reward is shared.-class SuperTabLeaderboardColumn extends StatefulWidget {- const SuperTabLeaderboardColumn({- super.key,- required this.reader,- required this.projectId,- required this.viewerId,- required this.nameOf,- required this.onAnswer,- this.now = DateTime.now,- });-- static const width = SuperTabPaneLayout.boardWidth;-- final SuperTabLeaderboardReader reader;- final String projectId, viewerId;- final String Function(String personId) nameOf;-- /// Opens a conversation where an agent waits on a person.- final ValueChanged<String> onAnswer;- final DateTime Function() now;-- @override- State<SuperTabLeaderboardColumn> createState() =>- _SuperTabLeaderboardColumnState();-}--class _SuperTabLeaderboardColumnState extends State<SuperTabLeaderboardColumn> {- String? _open;-- @override- void initState() {- super.initState();- unawaited(widget.reader.show(widget.projectId));- }-- @override- void didUpdateWidget(SuperTabLeaderboardColumn old) {- super.didUpdateWidget(old);- if (old.reader != widget.reader) old.reader.hide();- if (old.projectId != widget.projectId || old.reader != widget.reader) {- _open = null;- unawaited(widget.reader.show(widget.projectId));- }- }-- @override- void dispose() {- widget.reader.hide();- super.dispose();- }-- @override- Widget build(BuildContext context) {- grid.AppTheme.watch(context);- return ListenableBuilder(- listenable: widget.reader,- builder: (context, _) {- final reader = widget.reader, board = reader.board;- final current = leaderboardWeekOf(widget.now());- final top = board?.people.firstOrNull?.points ?? 0;- return ColoredBox(- color: DesktopChrome.surface,- child: Column(- crossAxisAlignment: CrossAxisAlignment.stretch,- children: [- _Header(- week: reader.week,- current: current,- onWeek: (week) =>- reader.showWeek(week == current ? null : week),- ),- if (reader.error != null)- Padding(- padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),- child: Text(reader.error!, style: DesktopChrome.metadata()),- ),- if (board == null)- const Expanded(- child: SkeletonList(- rows: 5,- padding: EdgeInsets.symmetric(horizontal: 16),- ),- )- else ...[- LeaderboardGoalBar(- goal: board.goal,- weekName: weekName(reader.week, current),- ),- Expanded(- child: ListView(- padding: const EdgeInsets.symmetric(horizontal: 8),- children: [- for (final person in board.people)- LeaderboardPersonRow(- score: person,- name: widget.nameOf(person.personId),- topPoints: top,- open: _open == person.personId,- onTap: () => setState(- () => _open = _open == person.personId- ? null- : person.personId,- ),- ),- ],- ),- ),- LeaderboardWaitingLine(- waiting: board.waiting,- viewerId: widget.viewerId,- nameOf: widget.nameOf,- onAnswer: widget.onAnswer,- ),- ],- ],- ),- );- },- );- }-}--class _Header extends StatelessWidget {- const _Header({- required this.week,- required this.current,- required this.onWeek,- });- final int? week;- final int current;- final ValueChanged<int> onWeek;-- @override- Widget build(BuildContext context) => Padding(- padding: const EdgeInsets.fromLTRB(16, 12, 12, 8),- child: Row(- children: [- Expanded(- child: Text(- 'Humans · ${weekName(week, current)}',- // As the People pane's section headings, beside it.- style: DesktopChrome.metadata().copyWith(- fontWeight: FontWeight.w600,- ),- ),- ),- AppSelectField<int>(- key: const ValueKey('leaderboard-week'),- value: week ?? current,- width: 120,- height: DesktopChrome.compactControlHeight,- semanticLabel: 'Week',- options: [- for (var back = 0; back < 4; back++)- SelectOption(- value: current - back * weekMs,- label: capitalized(weekName(current - back * weekMs, current)),- ),- ],- onChanged: onWeek,- ),- ],- ),- );-}diff --git a/desktop/lib/super_tabs/leaderboard/goal_bar.dart b/desktop/lib/super_tabs/leaderboard/goal_bar.dartdeleted file mode 100644index 88d39b8f1..000000000--- a/desktop/lib/super_tabs/leaderboard/goal_bar.dart+++ /dev/null@@ -1,68 +0,0 @@-import 'package:flutter/material.dart';--import '../../widgets/desktop_chrome.dart';-import 'format.dart';-import 'model.dart';-import 'progress_bar.dart';--/// The shared reward on top: the project's open requests and this week against-/// the one before. Everyone's points count toward it.-class LeaderboardGoalBar extends StatelessWidget {- const LeaderboardGoalBar({- super.key,- required this.goal,- required this.weekName,- });- final SuperTabTeamGoal goal;-- /// "this week", "last week", …: the week the board shows.- final String weekName;-- @override- Widget build(BuildContext context) {- final now = goal.thisWeek, before = goal.lastWeek;- final earlier = weekName == 'this week' ? 'last week' : 'the week before';- final median = _median(now.medianAskToShipMs, before.medianAskToShipMs);- return Container(- margin: const EdgeInsets.fromLTRB(12, 0, 12, 8),- padding: const EdgeInsets.all(12),- decoration: BoxDecoration(- color: DesktopChrome.field,- borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),- border: Border.all(color: DesktopChrome.rim),- ),- child: Column(- crossAxisAlignment: CrossAxisAlignment.start,- children: [- Text(- 'Team goal · ${plural(goal.openRequests, 'open request')}',- style: DesktopChrome.control(medium: true),- ),- const SizedBox(height: 6),- LeaderboardProgressBar(- fraction: now.points == 0- ? 0- : now.points /- (now.points > before.points ? now.points : before.points),- ),- const SizedBox(height: 6),- Text(- '${now.shipped} shipped $weekName (${before.shipped} $earlier) · ${plural(now.points, 'point')}',- style: DesktopChrome.metadata(),- ),- if (median != null) Text(median, style: DesktopChrome.metadata()),- ],- ),- );- }-- static String? _median(int? now, int? before) {- if (now == null) return null;- final text = 'Median ask to ship ${leaderboardDuration(now)}';- if (before == null) return text;- if (leaderboardDuration(now) == leaderboardDuration(before)) {- return '$text, as before';- }- return '$text, ${now < before ? 'down' : 'up'} from ${leaderboardDuration(before)}';- }-}diff --git a/desktop/lib/super_tabs/leaderboard/goal_line.dart b/desktop/lib/super_tabs/leaderboard/goal_line.dartnew file mode 100644index 000000000..c2302f46e--- /dev/null+++ b/desktop/lib/super_tabs/leaderboard/goal_line.dart@@ -0,0 +1,56 @@+import 'package:flutter/material.dart';++import '../../widgets/desktop_chrome.dart';+import 'format.dart';+import 'model.dart';++/// The shared reward on one line at the top of Humans: what shipped in the+/// week shown, everyone's points together and the project's open requests.+/// The week before and the median time to ship are on hover.+class LeaderboardGoalLine extends StatelessWidget {+ const LeaderboardGoalLine({+ super.key,+ required this.goal,+ required this.weekName,+ });+ final SuperTabTeamGoal goal;++ /// "this week", "last week", …: the week the board shows.+ final String weekName;++ @override+ Widget build(BuildContext context) {+ final now = goal.thisWeek, before = goal.lastWeek;+ final earlier = weekName == 'this week' ? 'last week' : 'the week before';+ final line =+ 'Team goal: ${now.shipped} shipped · ${now.points} pts · ${goal.openRequests} open';+ final median = _median(now.medianAskToShipMs, before.medianAskToShipMs);+ return Padding(+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 4),+ child: Tooltip(+ message: [+ line,+ '${before.shipped} shipped $earlier',+ ?median,+ ].join('\n'),+ child: Text(+ line,+ key: const ValueKey('leaderboard-goal'),+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: DesktopChrome.metadata(),+ ),+ ),+ );+ }++ static String? _median(int? now, int? before) {+ if (now == null) return null;+ final text = 'Median ask to ship ${leaderboardDuration(now)}';+ if (before == null) return text;+ if (leaderboardDuration(now) == leaderboardDuration(before)) {+ return '$text, as before';+ }+ return '$text, ${now < before ? 'down' : 'up'} from ${leaderboardDuration(before)}';+ }+}diff --git a/desktop/lib/super_tabs/leaderboard/person_row.dart b/desktop/lib/super_tabs/leaderboard/person_row.dartindex 80798b491..2f16b984b 100644--- a/desktop/lib/super_tabs/leaderboard/person_row.dart+++ b/desktop/lib/super_tabs/leaderboard/person_row.dart@@ -1,111 +1,124 @@import 'package:flutter/material.dart';import '../../widgets/desktop_chrome.dart';+import '../../widgets/finger_target.dart';import '../identity.dart';import 'format.dart';import 'model.dart';-import 'progress_bar.dart';-/// Where the name starts: after the medal (24) and the avatar (20) with its gap (6).-const _nameInset = 50.0;+/// Where the name and the quiet line start: after the avatar (24) and its gap (8).+const _nameInset = 32.0;-const _medals = {- SuperTabMedal.gold: '🏆',- SuperTabMedal.silver: '🥈',- SuperTabMedal.bronze: '🥉',-};+/// Figures of one width, so the numbers of one column line up row under row.+TextStyle _figures(TextStyle style) =>+ style.copyWith(fontFeatures: const [FontFeature.tabularFigures()]);-/// One person: medal, name, points bar and their three numbers; tapped, their week.+/// One person in the Humans section: avatar, name and this week's points in+/// fixed columns, with Shipped, Unblocked and Lent on a quiet line beneath.+/// Without a [score] (no board yet, or a server without one) only the name.class LeaderboardPersonRow extends StatelessWidget {const LeaderboardPersonRow({super.key,- required this.score,+ required this.personId,required this.name,- required this.topPoints,- required this.open,+ required this.email,+ required this.score,required this.onTap,});- final SuperTabPersonScore score;- final String name;- final int topPoints;- final bool open;+ final String personId, name, email;+ final SuperTabPersonScore? score;final VoidCallback onTap;- /// Today's Swarm avatar, sized for the shared avatar widget (v2 H) to drop in here.- Widget _avatar() => SuperTabAvatar(- identity: 'person:${score.personId}',- name: name,- size: 20,- );-@overrideWidget build(BuildContext context) {- final lent = score.lentMachines == 0- ? '—'- : plural(score.lentMachines, 'machine');+ final scale = MediaQuery.textScalerOf(context);+ final score = this.score;+ final quiet = _figures(DesktopChrome.metadata());+ Widget cell(double width, String text) => SizedBox(+ width: scale.scale(width),+ child: Text(+ text,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: quiet,+ ),+ );return InkWell(- key: ValueKey('leaderboard-person-${score.personId}'),- borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),+ key: ValueKey('super-person-$personId'),onTap: onTap,- child: Padding(- padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),- child: Column(- crossAxisAlignment: CrossAxisAlignment.start,- children: [- Row(- children: [- SizedBox(width: 24, child: Text(_medals[score.medal] ?? '')),- _avatar(),- const SizedBox(width: 6),- Flexible(- child: Text(- name,- overflow: TextOverflow.ellipsis,- style: DesktopChrome.control(medium: true),+ child: ConstrainedBox(+ // A phone's row is a finger's height; a mouse keeps 36.+ constraints: BoxConstraints(+ minHeight: fingerHeight(36, enabled: workspaceIsCompact(context)),+ ),+ child: Padding(+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ mainAxisAlignment: MainAxisAlignment.center,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Row(+ children: [+ SuperTabAvatar(+ identity: 'person:$personId',+ name: name,+ size: 24,),- ),- if (score.streakDays > 1) ...[- const SizedBox(width: 6),- Text(- '🔥 ${score.streakDays}',- style: DesktopChrome.metadata(),+ const SizedBox(width: _nameInset - 24),+ Expanded(+ child: Tooltip(+ message: email,+ child: Text(+ name,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: DesktopChrome.control(),+ ),+ ),),+ if (score != null)+ SizedBox(+ width: scale.scale(64),+ child: Text(+ '${score.points} pts',+ maxLines: 1,+ textAlign: TextAlign.right,+ style: _figures(DesktopChrome.control(medium: true)),+ ),+ ),],- const SizedBox(width: 8),- Expanded(- child: LeaderboardProgressBar(- fraction: topPoints == 0 ? 0 : score.points / topPoints,+ ),+ if (score != null)+ Padding(+ padding: const EdgeInsets.only(left: _nameInset, top: 2),+ child: Row(+ children: [+ cell(72, '${score.shipped} shipped'),+ cell(88, '${score.unblocked} unblocked'),+ Expanded(+ child: Text(+ '${leaderboardHours(score.lentMs)} h lent',+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: quiet,+ ),+ ),+ ],),),- const SizedBox(width: 8),- Text('${score.points} pts', style: DesktopChrome.control()),- ],- ),- Padding(- padding: const EdgeInsets.only(left: _nameInset, top: 2),- child: Text(- '🚀 ${score.shipped} shipped 🔓 ${score.unblocked} ⚡ $lent',- style: DesktopChrome.metadata(),- ),- ),- AnimatedSize(- duration: const Duration(milliseconds: 200),- curve: Curves.easeOutCubic,- alignment: Alignment.topCenter,- child: open- ? _Detail(score: score)- : const SizedBox(width: double.infinity),- ),- ],+ ],+ ),),),);}}-/// A person's week, as the mockup's "Tap a name" card.-class _Detail extends StatelessWidget {- const _Detail({required this.score});+/// A person's week, shown when their name is tapped: the medians, the time+/// freed and lent, and their shipping streak.+class LeaderboardPersonWeek extends StatelessWidget {+ const LeaderboardPersonWeek({super.key, required this.score});final SuperTabPersonScore score;@override@@ -114,63 +127,60 @@ class _Detail extends StatelessWidget {ms == null ? '' : ' · median ${leaderboardDuration(ms)}$what';final rows = [(- '🚀 Shipped',+ 'Points',+ score.medal == null+ ? '${score.points} this week'+ : '${score.points} this week · place ${score.rank}',+ ),+ (+ 'Shipped',score.shipped == 0? 'Nothing landed yet': '${plural(score.shipped, 'ask')} landed${median(score.medianAskToShipMs, ' to ship')}',),(- '🔓 Unblocked',+ 'Unblocked',score.unblocked == 0? 'Nothing answered yet': '${score.unblocked} answered${median(score.medianAnswerMs, '')} · ${leaderboardDuration(score.unblockedMs)} of agent time freed',),(- '⚡ Lent',+ 'Lent',score.lentMachines == 0? 'Nothing lent yet'- : '${plural(score.lentMachines, 'machine')} · ${leaderboardHours(score.lentMs)} slot-hours',+ : '${plural(score.lentMachines, 'machine')} · ${leaderboardHours(score.lentMs)} agent-hours',),(- '🔥 Streak',+ 'Streak',score.streakDays == 0? 'No streak yet': '${plural(score.streakDays, 'day')} shipping',),];- return Container(- width: double.infinity,- margin: const EdgeInsets.only(left: _nameInset, top: 8),- padding: const EdgeInsets.all(10),- decoration: BoxDecoration(- color: DesktopChrome.field,- borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),- border: Border.all(color: DesktopChrome.rim),- ),- child: Column(- crossAxisAlignment: CrossAxisAlignment.start,- children: [- for (final (label, value) in rows)- Padding(- padding: const EdgeInsets.symmetric(vertical: 2),- child: Row(- crossAxisAlignment: CrossAxisAlignment.start,- children: [- SizedBox(- width: 88,- child: Text(- label,- style: DesktopChrome.metadata(- color: DesktopChrome.foreground,- ),+ return Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ for (final (label, value) in rows)+ Padding(+ padding: const EdgeInsets.symmetric(vertical: 2),+ child: Row(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ SizedBox(+ width: 88,+ child: Text(+ label,+ style: DesktopChrome.metadata(+ color: DesktopChrome.foreground,),),- Expanded(child: Text(value, style: DesktopChrome.metadata())),- ],- ),+ ),+ Expanded(child: Text(value, style: DesktopChrome.metadata())),+ ],),- ],- ),+ ),+ ],);}}diff --git a/desktop/lib/super_tabs/leaderboard/progress_bar.dart b/desktop/lib/super_tabs/leaderboard/progress_bar.dartdeleted file mode 100644index 594379dd0..000000000--- a/desktop/lib/super_tabs/leaderboard/progress_bar.dart+++ /dev/null@@ -1,38 +0,0 @@-import 'package:flutter/material.dart';--import '../../widgets/desktop_chrome.dart';--/// A thin rounded bar that glides to its new length when the board refreshes.-class LeaderboardProgressBar extends StatelessWidget {- const LeaderboardProgressBar({- super.key,- required this.fraction,- this.height = 6,- });- final double fraction;- final double height;-- @override- Widget build(BuildContext context) => ClipRRect(- borderRadius: BorderRadius.circular(height),- child: SizedBox(- height: height,- child: ColoredBox(- color: DesktopChrome.rim,- child: Align(- alignment: Alignment.centerLeft,- child: TweenAnimationBuilder<double>(- tween: Tween(end: fraction.clamp(0, 1).toDouble()),- duration: const Duration(milliseconds: 450),- curve: Curves.easeOutCubic,- builder: (context, value, _) => FractionallySizedBox(- widthFactor: value,- heightFactor: 1,- child: ColoredBox(color: DesktopChrome.accent),- ),- ),- ),- ),- ),- );-}diff --git a/desktop/lib/super_tabs/leaderboard/reader.dart b/desktop/lib/super_tabs/leaderboard/reader.dartindex 20d92059d..f719f763e 100644--- a/desktop/lib/super_tabs/leaderboard/reader.dart+++ b/desktop/lib/super_tabs/leaderboard/reader.dart@@ -5,9 +5,9 @@ import 'package:flutter/foundation.dart';import '../controller.dart';import 'model.dart';-/// Reads one project's leaderboard while the column is shown, and again every-/// minute: the board sums a week, so it moves slowly. A failed refresh keeps the-/// last board and says why.+/// Reads one project's leaderboard while Humans are shown, and again every+/// [every]: the board sums a week, so it moves slowly. A failed refresh keeps+/// the last board and says why.class SuperTabLeaderboardReader extends ChangeNotifier {SuperTabLeaderboardReader({required this.tabId,@@ -51,7 +51,7 @@ class SuperTabLeaderboardReader extends ChangeNotifier {return refresh();}- /// Stops the minute refresh while the column is not shown; the board stays.+ /// Stops the refresh while Humans are not shown; the board stays.void hide() {_timer?.cancel();_timer = null;@@ -71,11 +71,18 @@ class SuperTabLeaderboardReader extends ChangeNotifier {if (read != _read) return;board = SuperTabLeaderboard.fromJson(answer);error = null;- } catch (failure) {+ } on SuperTabFailure catch (failure) {if (read != _read) return;- error = failure is SuperTabFailure- ? failure.message- : "Couldn't read the leaderboard.";+ // A server from before the leaderboard has none: Humans just list names.+ if (failure.statusCode == 404) {+ board = null;+ error = null;+ } else {+ error = failure.message;+ }+ } catch (_) {+ if (read != _read) return;+ error = "Couldn't read the leaderboard.";}_notify();}diff --git a/desktop/lib/super_tabs/leaderboard/swarm_board.dart b/desktop/lib/super_tabs/leaderboard/swarm_board.dartdeleted file mode 100644index c1015287d..000000000--- a/desktop/lib/super_tabs/leaderboard/swarm_board.dart+++ /dev/null@@ -1,69 +0,0 @@-import 'dart:async';--import 'package:flutter/material.dart';--import '../../shared/widgets/app_dialog.dart';-import '../../widgets/desktop_chrome.dart';-import '../controller.dart';-import '../identity.dart';-import 'column.dart';-import 'reader.dart';--/// The leaderboard of the Swarm a [SuperTabController] shows: the project of-/// the selected conversation, people named as the roster names them, Answer-/// opening the waiting conversation.-class SuperTabSwarmBoard {- SuperTabSwarmBoard(this.controller)- : reader = SuperTabLeaderboardReader(- tabId: controller.tabId,- request: controller.request,- );-- final SuperTabController controller;- final SuperTabLeaderboardReader reader;-- /// A window this wide, scaled, has room for the column beside People.- static const columnFrom = 1380.0;-- String get _projectId =>- controller.snapshot?.projectFor(controller.selectedId)?.id ?? 'lead';-- String _name(String personId) {- final person = controller.snapshot?.people- .where((p) => p.id == personId)- .firstOrNull;- return person == null ? 'Former member' : superTabPersonName(person.email);- }-- Widget column({required ValueChanged<String> onAnswer}) =>- SuperTabLeaderboardColumn(- reader: reader,- projectId: _projectId,- viewerId: controller.accountId,- nameOf: _name,- onAnswer: onAnswer,- );-- /// For a window without room for the column.- Future<void> openDialog(BuildContext context) => showAppDialog<void>(- context: context,- builder: (dialog) => Dialog(- shape: DesktopChrome.shape(),- child: SizedBox(- width: SuperTabLeaderboardColumn.width,- height: (MediaQuery.sizeOf(dialog).height - 120).clamp(320, 640),- child: ClipRRect(- borderRadius: BorderRadius.circular(DesktopChrome.dialogRadius),- child: column(- onAnswer: (id) {- Navigator.of(dialog).pop();- unawaited(controller.select(id));- },- ),- ),- ),- ),- );-- void dispose() => reader.dispose();-}diff --git a/desktop/lib/super_tabs/machines.dart b/desktop/lib/super_tabs/machines.dartindex ef5958e33..2a92778a2 100644--- a/desktop/lib/super_tabs/machines.dart+++ b/desktop/lib/super_tabs/machines.dart@@ -1563,9 +1563,15 @@ class _SuperTabMachinesState extends State<SuperTabMachines> {color: selected ? grid.AppSurface.selectedFill : Colors.transparent,borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),clipBehavior: Clip.antiAlias,+ // No chevron (Dee, 2026-10-27): a click expands the machine, and its+ // details are in the right-click menu, or a long press on a touch screen.child: InkWell(key: ValueKey('super-machine-${view.id}'),- onTap: () => unawaited(_openDetails(view)),+ onTap: () {+ c.toggleMachineExpanded(view.id);+ _changed();+ },+ onLongPress: () => unawaited(_openDetails(view)),onSecondaryTapUp: (event) =>unawaited(_menu(view, event.globalPosition)),hoverColor: grid.AppSurface.hoverFill,@@ -1580,16 +1586,14 @@ class _SuperTabMachinesState extends State<SuperTabMachines> {Tooltip.dismissAllToolTips();}},- child: _MachineLine(- view: view,+ child: Semantics(expanded: expanded,- onToggle: () {- c.toggleMachineExpanded(view.id);- _changed();- },- onSetUpTeam: view.setUpTeam- ? () => showTeamAccountSetup(context, widget.app!)- : null,+ child: _MachineLine(+ view: view,+ onSetUpTeam: view.setUpTeam+ ? () => showTeamAccountSetup(context, widget.app!)+ : null,+ ),),),);@@ -2065,18 +2069,11 @@ class _Allowance {);}-/// The same leading icon/name and trailing status/disclosure columns as projects.+/// The same leading icon/name and trailing status column as projects.class _MachineLine extends StatelessWidget {- const _MachineLine({- required this.view,- required this.expanded,- required this.onToggle,- this.onSetUpTeam,- });+ const _MachineLine({required this.view, this.onSetUpTeam});final _MachineView view;- final bool expanded;- final VoidCallback onToggle;/// This Mac's row, without its Harness Team account: Set up under the paused line.final VoidCallback? onSetUpTeam;@@ -2205,28 +2202,6 @@ class _MachineLine extends StatelessWidget {),),),- Semantics(- expanded: expanded,- button: true,- child: IconButton(- key: ValueKey('super-machine-toggle-${view.id}'),- icon: Icon(- expanded ? AppIcons.chevronDown : AppIcons.chevronRight,- size: AppIcons.inlineSize,- ),- color: DesktopChrome.muted,- style: const ButtonStyle(- minimumSize: WidgetStatePropertyAll(Size.square(32)),- padding: WidgetStatePropertyAll(EdgeInsets.all(6)),- tapTargetSize: MaterialTapTargetSize.shrinkWrap,- visualDensity: VisualDensity.standard,- overlayColor: WidgetStatePropertyAll(Colors.transparent),- backgroundColor: WidgetStatePropertyAll(Colors.transparent),- ),- tooltip: '${expanded ? 'Collapse' : 'Expand'} $name',- onPressed: onToggle,- ),- ),],),);diff --git a/desktop/lib/super_tabs/pane_layout.dart b/desktop/lib/super_tabs/pane_layout.dartindex c58a1eebf..d1b8efb62 100644--- a/desktop/lib/super_tabs/pane_layout.dart+++ b/desktop/lib/super_tabs/pane_layout.dart@@ -18,7 +18,6 @@ class SuperTabPaneLayout extends StatefulWidget {required this.onLeave,this.left,this.right,- this.board,this.storage,});@@ -35,10 +34,6 @@ class SuperTabPaneLayout extends StatefulWidget {(available * drawerMaxFraction).clamp(0, rightWidth).toDouble();final Widget? left, right;- /// The leaderboard, a fixed column at the far right beside [right]; the- /// resizable panes share what is left.- final Widget? board;- static const boardWidth = 300.0;final Widget center;final VoidCallback onLeave;final LocalKeyValueStore? storage;@@ -97,25 +92,7 @@ class _SuperTabPaneLayoutState extends State<SuperTabPaneLayout> {}@override- Widget build(BuildContext context) {- final board = widget.board;- if (board == null) return _panes();- return Row(- children: [- Expanded(child: _panes()),- SizedBox(- width: 1,- height: double.infinity,- child: ColoredBox(color: DesktopChrome.rim),- ),- SizedBox(- key: const ValueKey('super-board-pane'),- width: SuperTabPaneLayout.boardWidth,- child: board,- ),- ],- );- }+ Widget build(BuildContext context) => _panes();Widget _panes() => LayoutBuilder(builder: (context, constraints) {diff --git a/desktop/lib/super_tabs/project_sidebar.dart b/desktop/lib/super_tabs/project_sidebar.dartindex 89a6269d5..de314bdea 100644--- a/desktop/lib/super_tabs/project_sidebar.dart+++ b/desktop/lib/super_tabs/project_sidebar.dart@@ -6,7 +6,6 @@ import '../core/machine_resources.dart';import '../shared/theme/app_icons.dart';import '../shared/theme/app_theme.dart' as grid;import '../shared/theme/appearance_prefs_store.dart';-import '../shared/widgets/app_icon_button.dart';import '../state/app_state.dart';import '../terminal/terminal_theme_store.dart';import '../widgets/desktop_chrome.dart';@@ -156,7 +155,8 @@ class ProjectSidebar extends StatelessWidget {? onOpenPmChat!(projectId): unawaited(controller.openPmChat(projectId));- /// Project names open their PM chat; only the trailing control expands them.+ /// A project row opens the project's chat and shows its workgroups; clicked+ /// again while open, it hides them. It has no chevron (Dee, 2026-10-27).Widget _row(SuperTabConversation group, {SuperTabProject? project,@@ -196,7 +196,14 @@ class ProjectSidebar extends StatelessWidget {clipBehavior: Clip.antiAlias,child: InkWell(key: ValueKey(key ?? 'super-group-${group.id}'),- onTap: () => onSelect(group.id),+ onTap: project == null+ ? () => onSelect(group.id)+ : () {+ if (selected || !expanded) {+ controller.toggleProject(project.id);+ }+ if (!selected) onSelect(group.id);+ },hoverColor: grid.AppSurface.hoverFill,focusColor: grid.AppSurface.hoverFill,borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),@@ -211,6 +218,7 @@ class ProjectSidebar extends StatelessWidget {child: Semantics(label: project?.isPrivate == true ? 'Private project' : null,selected: selected,+ expanded: project == null ? null : expanded,child: Tooltip(message:label ??@@ -288,23 +296,6 @@ class ProjectSidebar extends StatelessWidget {: null,),),- if (project != null)- Semantics(- expanded: expanded,- child: AppIconButton(- key: ValueKey('super-project-expand-${project.id}'),- icon: expanded- ? AppIcons.chevronDown- : AppIcons.chevronRight,- color: DesktopChrome.muted,- hoverFill: Colors.transparent,- tooltip:- '${expanded ? 'Collapse' : 'Expand'} ${project.name}',- onPressed: () => controller.toggleProject(project.id),- ),- )- else- const SizedBox(width: _iconColumn),],),),diff --git a/desktop/lib/super_tabs/roles_editor.dart b/desktop/lib/super_tabs/roles_editor.dartindex 56d47a028..fae0de69f 100644--- a/desktop/lib/super_tabs/roles_editor.dart+++ b/desktop/lib/super_tabs/roles_editor.dart@@ -84,7 +84,7 @@ When the project owner asks in chat to switch this project's skills (Default or## Requests and Done- When you open a group for a person's request, asked in the project chat or in their Chat with PM, name them as its requester: requesterId on conversation.create, or conversation.requester for a group already open. It records only that they asked, never what they wrote.-- Mark a group Done only after its pull request has merged: the leaderboard counts a request as shipped once its group is Done with a linked PR.+- Right after you merge a group's pull request, record it: conversation.merged with the group and the PR link, and mergedAt for a merge you record later. The leaderboard counts the request as shipped at the merge, even if its work is lost or cancelled afterwards. Mark a group Done only after its pull request has merged.''';const _defaultEngineer = r'''---diff --git a/desktop/lib/super_tabs/roster.dart b/desktop/lib/super_tabs/roster.dartindex 0628c4d26..5db6dbe94 100644--- a/desktop/lib/super_tabs/roster.dart+++ b/desktop/lib/super_tabs/roster.dart@@ -7,24 +7,32 @@ import '../shared/theme/app_theme.dart' as grid;import '../shared/theme/appearance_prefs_store.dart';import '../shared/widgets/app_dialog.dart';import '../shared/widgets/app_icon_button.dart';+import '../shared/widgets/app_select_field.dart';import '../state/app_state.dart';import '../state/harness_activity.dart';import '../terminal/terminal_theme.dart';import '../terminal/terminal_theme_store.dart';import '../widgets/desktop_chrome.dart';import '../widgets/engine_identity.dart';-import '../widgets/finger_target.dart';import '../widgets/harness_activity_mark.dart';import 'agent_details.dart';import 'controller.dart';import 'dialog_scope.dart';import 'identity.dart';+import 'leaderboard/format.dart';+import 'leaderboard/goal_line.dart';+import 'leaderboard/model.dart';+import 'leaderboard/person_row.dart';+import 'leaderboard/reader.dart';+import 'leaderboard/waiting_line.dart';import 'model.dart';import 'section_heading.dart';import 'team_glance.dart';import 'team_glance_panel.dart';-/// The current Swarm's authorized people, with agents from the selected project.+/// The current Swarm's authorized people, each with their week on the+/// leaderboard of the open conversation's project, and agents from the+/// selected project.class SuperTabRoster extends StatefulWidget {const SuperTabRoster({super.key,@@ -32,22 +40,59 @@ class SuperTabRoster extends StatefulWidget {required this.onInvite,required this.onOpenAgent,required this.onAddAgent,+ required this.onAnswer,this.app,+ this.now = DateTime.now,});final SuperTabController controller;final AppNotifier? app;final VoidCallback onInvite;final ValueChanged<SuperTabAgent> onOpenAgent;final ValueChanged<SuperTabConversation> onAddAgent;++ /// Opens a conversation where an agent waits on a person.+ final ValueChanged<String> onAnswer;+ final DateTime Function() now;@overrideState<SuperTabRoster> createState() => _SuperTabRosterState();}class _SuperTabRosterState extends State<SuperTabRoster> {- static const _peopleShown = 5;- bool _allPeople = false;SuperTabController get c => widget.controller;+ /// The board moves only as work ships, is answered or runs: every five+ /// minutes is fresh enough, and keeps every open roster's reads rare.+ late final _board = SuperTabLeaderboardReader(+ tabId: c.tabId,+ request: c.request,+ every: const Duration(minutes: 5),+ );+ String? _boardProject;++ /// The project of the open conversation, whose board Humans show.+ String get _projectId => c.snapshot?.projectFor(c.selectedId)?.id ?? 'lead';++ void _followProject() {+ final projectId = _projectId;+ if (projectId == _boardProject) return;+ _boardProject = projectId;+ unawaited(_board.show(projectId));+ }++ @override+ void initState() {+ super.initState();+ c.addListener(_followProject);+ _followProject();+ }++ @override+ void dispose() {+ c.removeListener(_followProject);+ _board.dispose();+ super.dispose();+ }+String? _agentProjectId(SuperTabAgent agent) => agent.hasProjectId? agent.projectId: c.snapshot?.conversations@@ -195,6 +240,39 @@ class _SuperTabRosterState extends State<SuperTabRoster> {return native ?? HarnessActivity.unknown;}+ /// A person's email and role, and their week when the board has them.+ Future<void> _person(SuperTabPerson person, SuperTabPersonScore? score) =>+ showAppDialog<void>(+ context: context,+ builder: (context) => AlertDialog(+ title: Text(superTabPersonName(person.email)),+ content: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Text('${person.email}\n${person.role}'),+ if (score != null) ...[+ const SizedBox(height: 12),+ LeaderboardPersonWeek(score: score),+ ],+ ],+ ),+ actions: [+ TextButton(+ onPressed: () {+ Navigator.pop(context);+ widget.onInvite();+ },+ child: const Text('Manage people'),+ ),+ TextButton(+ onPressed: () => Navigator.pop(context),+ child: const Text('Close'),+ ),+ ],+ ),+ );+Future<void> _details(SuperTabAgent agent) => showSuperTabAgentDetails(context,c,@@ -419,71 +497,76 @@ class _SuperTabRosterState extends State<SuperTabRoster> {.where((p) => audience == null || audience.contains(p.id)).toList() ??const <SuperTabPerson>[];- final shownPeople = _allPeople ? people : people.take(_peopleShown);- final compact = workspaceIsCompact(context);+ final board = _board.board;+ final scores = {+ for (final score in board?.people ?? const []) score.personId: score,+ };+ // Most points first, as the board ranks them; anyone it has no score for after.+ final ranked = [+ ...?board?.people+ .map(+ (score) => people.where((p) => p.id == score.personId).firstOrNull,+ )+ .nonNulls,+ ...people.where((p) => !scores.containsKey(p.id)),+ ];+ final current = leaderboardWeekOf(widget.now());return [SuperTabSectionHeading('Humans',onAdd: c.isOwner ? widget.onInvite : null,addTooltip: 'Invite people',- ),- for (final person in shownPeople)- ListTile(- key: ValueKey('super-person-${person.id}'),- dense: true,- // A phone's row is a finger's height; a mouse keeps 36.- minTileHeight: fingerHeight(36, enabled: compact),- minVerticalPadding: 6,- minLeadingWidth: 24,- contentPadding: const EdgeInsets.symmetric(horizontal: 16),- horizontalTitleGap: 8,- leading: SuperTabAvatar(- identity: 'person:${person.id}',- name: superTabPersonName(person.email),- size: 24,- ),- title: Tooltip(- message: person.email,- child: Text(- superTabPersonName(person.email),- maxLines: 1,- overflow: TextOverflow.ellipsis,- style: DesktopChrome.control(),- ),- ),- onTap: () => showAppDialog<void>(- context: context,- builder: (context) => AlertDialog(- title: Text(superTabPersonName(person.email)),- content: Text('${person.email}\n${person.role}'),- actions: [- TextButton(- onPressed: () {- Navigator.pop(context);- widget.onInvite();- },- child: const Text('Manage people'),- ),- TextButton(- onPressed: () => Navigator.pop(context),- child: const Text('Close'),- ),+ actions: [+ if (board != null || _board.week != null)+ AppSelectField<int>(+ key: const ValueKey('leaderboard-week'),+ value: _board.week ?? current,+ width: 112,+ height: DesktopChrome.compactControlHeight,+ semanticLabel: 'Week',+ options: [+ for (var back = 0; back < 4; back++)+ SelectOption(+ value: current - back * weekMs,+ label: capitalized(+ weekName(current - back * weekMs, current),+ ),+ ),],+ onChanged: (week) =>+ unawaited(_board.showWeek(week == current ? null : week)),),- ),+ ],+ ),+ if (board != null)+ LeaderboardGoalLine(+ goal: board.goal,+ weekName: weekName(_board.week, current),),- if (people.length > _peopleShown)- ListTile(- dense: true,- minTileHeight: fingerHeight(36, enabled: compact),- contentPadding: const EdgeInsets.symmetric(horizontal: 16),- title: Text(- _allPeople- ? 'Show less'- : 'Show ${people.length - _peopleShown} more',- style: DesktopChrome.metadata(),- ),- onTap: () => setState(() => _allPeople = !_allPeople),+ if (_board.error case final error?)+ Padding(+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 4),+ child: Text(error, style: DesktopChrome.metadata()),+ ),+ for (final person in ranked)+ LeaderboardPersonRow(+ personId: person.id,+ name: superTabPersonName(person.email),+ email: person.email,+ score: scores[person.id],+ onTap: () => _person(person, scores[person.id]),+ ),+ if (board != null && board.waiting.total > 0)+ LeaderboardWaitingLine(+ waiting: board.waiting,+ viewerId: c.accountId,+ nameOf: (id) {+ final person = state?.people.where((p) => p.id == id).firstOrNull;+ return person == null+ ? 'Former member'+ : superTabPersonName(person.email);+ },+ onAnswer: widget.onAnswer,),const SizedBox(height: 16),SuperTabSectionHeading(@@ -519,6 +602,7 @@ class _SuperTabRosterState extends State<SuperTabRoster> {child: ListenableBuilder(listenable: Listenable.merge([c,+ _board,if (widget.app != null) ...[widget.app!, widget.app!.agentUnread],terminalThemeStore,appearancePrefsStore,diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dartindex a23c3ba87..5976bbdd8 100644--- a/desktop/lib/super_tabs/view.dart+++ b/desktop/lib/super_tabs/view.dart@@ -33,7 +33,6 @@ import 'work_details.dart';import 'project_sidebar.dart';import 'project_options.dart';import 'pane_layout.dart';-import 'leaderboard/swarm_board.dart';import '../widgets/dial_list_scroll.dart';typedef _ComposerChoice = ({String label, String? detail, VoidCallback choose});@@ -89,11 +88,6 @@ class _SuperTabViewState extends State<SuperTabView>bool _rosterOpen = false;bool _showPullRequests = false;- /// The human leaderboard (v2 G), read only once it is first opened; a column- /// when the window has room for it ([_boardRoomy], set by build), else a dialog.- bool _boardOpen = false, _boardRoomy = false;- SuperTabSwarmBoard? _boardRead;- SuperTabSwarmBoard get _board => _boardRead ??= SuperTabSwarmBoard(c);bool _showNotifications = false;// The message a tag opened, scrolled to once it is laid out.String? _target;@@ -368,7 +362,6 @@ class _SuperTabViewState extends State<SuperTabView>_composer.dispose();_focus.dispose();_pullRequestsFocus.dispose();- _boardRead?.dispose();for (final scroll in _scroll.values) {scroll.dispose();}@@ -1237,21 +1230,6 @@ class _SuperTabViewState extends State<SuperTabView>return 'Message ${group.title}';}- Widget _boardButton() {- final shown = _boardRoomy && _boardOpen;- return AppIconButton(- key: const ValueKey('super-leaderboard'),- icon: AppIcons.trophy,- size: AppIcons.inlineSize,- tooltip: 'Leaderboard',- selected: shown,- color: shown ? DesktopChrome.foreground : DesktopChrome.muted,- onPressed: _boardRoomy- ? () => setState(() => _boardOpen = !_boardOpen)- : () => unawaited(_board.openDialog(context)),- );- }-/// On a phone the header's bar holds Chat and ⋮, each a finger's size, and/// ⋮ names the rest (terminals, pull requests, people) instead of five bare/// icons. Desktop, which sets no [WorkspaceChrome.compactBelow], never.@@ -1441,7 +1419,6 @@ class _SuperTabViewState extends State<SuperTabView>_options(group, views: _menuNamesViews),),],- fingerTarget(enabled: _phone, _boardButton()),if (!showRoster)fingerTarget(enabled: _phone,@@ -2401,9 +2378,6 @@ class _SuperTabViewState extends State<SuperTabView>_readVisibleTailAfterFrame();}_chatCovered = chatCovered;- _boardRoomy =- constraints.maxWidth >=- MediaQuery.textScalerOf(context).scale(SuperTabSwarmBoard.columnFrom);final roster = SuperTabRoster(controller: c,app: widget.app,@@ -2419,6 +2393,13 @@ class _SuperTabViewState extends State<SuperTabView>setState(() => _rosterOpen = false);widget.onAddAgent(group);},+ onAnswer: (id) {+ setState(() {+ _showPullRequests = false;+ _rosterOpen = false;+ });+ unawaited(c.select(id));+ },);return Stack(children: [@@ -2429,14 +2410,6 @@ class _SuperTabViewState extends State<SuperTabView>onLeave: _leaveResize,left: narrow ? null : _sidebar(),right: showRoster ? roster : null,- board: _boardRoomy && _boardOpen- ? _board.column(- onAnswer: (id) {- setState(() => _showPullRequests = false);- unawaited(c.select(id));- },- )- : null,center: Column(children: [_header(c.selected, narrow, showRoster),diff --git a/desktop/test/super_tab_chat_test.dart b/desktop/test/super_tab_chat_test.dartindex c3918a578..5312bb9e7 100644--- a/desktop/test/super_tab_chat_test.dart+++ b/desktop/test/super_tab_chat_test.dart@@ -324,7 +324,7 @@ void main() {);expect(c.unread(c.selected!), isFalse);expect(projectDot(), findsOneWidget);- await tester.tap(find.byKey(const ValueKey('super-project-expand-lead')));+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-group-offline')));await tester.pumpAndSettle();diff --git a/desktop/test/super_tab_closed_groups_test.dart b/desktop/test/super_tab_closed_groups_test.dartindex 11457b3d2..5d91ad55d 100644--- a/desktop/test/super_tab_closed_groups_test.dart+++ b/desktop/test/super_tab_closed_groups_test.dart@@ -107,9 +107,7 @@ void main() {final sidebar = find.byType(ProjectSidebar);Finder inside(Finder f) => find.descendant(of: sidebar, matching: f);if (closedRow.evaluate().isEmpty) {- await tester.tap(- find.byKey(const ValueKey('super-project-expand-lead')),- );+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();}@@ -188,9 +186,7 @@ void main() {await tester.pumpWidget(_app(server, controller));await tester.pumpAndSettle();if (closedRow.evaluate().isEmpty) {- await tester.tap(- find.byKey(const ValueKey('super-project-expand-lead')),- );+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();}expect(find.text('Closed (1)'), findsOneWidget);diff --git a/desktop/test/super_tab_humans_shots_test.dart b/desktop/test/super_tab_humans_shots_test.dartnew file mode 100644index 000000000..d4140bb4a--- /dev/null+++ b/desktop/test/super_tab_humans_shots_test.dart@@ -0,0 +1,90 @@+import 'dart:io';+import 'dart:ui' as ui;++import 'package:flutter/material.dart';+import 'package:flutter/rendering.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/view.dart';++import 'box_render_preview_test.dart' show loadPreviewFonts;+import 'support/humans_fixture.dart';++/// Set to a folder to write the PR's screenshots there.+final shots = Platform.environment['SUPER_TAB_HUMANS_SHOTS'];++/// The Swarm's Humans section and sidebar as the PR shows them: the right+/// pane with everyone's week, the leaderboard column where one still exists,+/// the sidebar after a direct message is opened from collapsed projects, and+/// a project and a machine opened by a click on their rows.+void main() {+ setUpAll(() async {+ if (shots != null) await loadPreviewFonts();+ });++ for (final brightness in Brightness.values) {+ testWidgets('screenshots for review (${brightness.name})', (tester) async {+ final picture = GlobalKey();+ final server = humansSwarm();+ final c = server.controller(account: 'peer');+ addTearDown(c.dispose);+ await c.refresh();+ await c.select('lead');+ grid.AppTheme.brightness.value = brightness;+ addTearDown(() => grid.AppTheme.brightness.value = Brightness.light);+ await tester.binding.setSurfaceSize(const Size(1500, 860));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: brightness),+ builder: (context, child) =>+ RepaintBoundary(key: picture, child: child),+ home: Scaffold(+ body: SuperTabView(+ controller: c,+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Mac Studio',+ ),+ ),+ ),+ );+ c.expandedProjects.clear();+ if (!c.projectsGroupOpen) c.toggleProjectsGroup();+ await tester.pumpAndSettle();++ Future<void> shot(String name) => tester.runAsync(() async {+ final boundary =+ picture.currentContext!.findRenderObject()!+ as RenderRepaintBoundary;+ final image = await boundary.toImage(pixelRatio: 1.5);+ final bytes = await image.toByteData(format: ui.ImageByteFormat.png);+ await Directory(shots!).create(recursive: true);+ await File('$shots/humans-$name-${brightness.name}.png')+ .writeAsBytes(bytes!.buffer.asUint8List());+ image.dispose();+ });++ await shot('humans');+ final trophy = find.byKey(const ValueKey('super-leaderboard'));+ if (trophy.evaluate().isNotEmpty) {+ await tester.tap(trophy);+ await tester.pumpAndSettle();+ await shot('leaderboard');+ await tester.tap(trophy);+ await tester.pumpAndSettle();+ }+ await tester.tap(find.byKey(const ValueKey('super-pm-chat-lead')));+ await tester.pumpAndSettle();+ await shot('dm');+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));+ await tester.pumpAndSettle();+ await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await tester.pumpAndSettle();+ await shot('project');+ await tester.pumpWidget(const SizedBox());+ await c.flush();+ }, skip: shots == null);+ }+}diff --git a/desktop/test/super_tab_humans_test.dart b/desktop/test/super_tab_humans_test.dartnew file mode 100644index 000000000..f44d2db4d--- /dev/null+++ b/desktop/test/super_tab_humans_test.dart@@ -0,0 +1,217 @@+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/view.dart';++import 'support/humans_fixture.dart';+import 'support/super_tab_fixture.dart';++/// The leaderboard lives in the right pane's Humans section (Dee, 2026-10-27):+/// the team goal on one line with a small week picker, then everyone, most+/// points first, each one aligned row with a quiet line of their three numbers.+/// There is no separate leaderboard view.+void main() {+ Finder person(String id) => find.byKey(ValueKey('super-person-$id'));++ Future<SuperTabController> show(+ WidgetTester tester,+ ConversationServer server, {+ Size size = const Size(1300, 900),+ }) async {+ await tester.binding.setSurfaceSize(size);+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final controller = server.controller(+ account: 'peer',+ initial: {'tabId': 'tab', 'accountId': 'peer', 'selectedId': 'lead'},+ );+ await controller.refresh();+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: Brightness.light),+ home: Scaffold(+ body: SuperTabView(+ controller: controller,+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Studio',+ ),+ ),+ ),+ );+ await tester.pumpAndSettle();+ return controller;+ }++ Future<void> close(WidgetTester tester, SuperTabController controller) async {+ await tester.pumpWidget(const SizedBox());+ await controller.flush();+ controller.dispose();+ }++ testWidgets('lists every person, most points first, with no cut-off', (+ tester,+ ) async {+ final controller = await show(tester, humansSwarm());+ final ids = [+ 'peer',+ 'owner',+ 'tony',+ 'scholes',+ 'diego',+ 'huy',+ 'maximilian.alexander.longname',+ ];+ for (final id in ids) {+ expect(person(id), findsOneWidget);+ }+ expect(find.textContaining('Show '), findsNothing);+ final tops = [for (final id in ids) tester.getTopLeft(person(id)).dy];+ expect(tops, [...tops]..sort());+ await close(tester, controller);+ });++ testWidgets(+ 'gives each person their points on the right and a quiet line of their three numbers',+ (tester) async {+ final controller = await show(tester, humansSwarm());+ Finder within(String id, String text) =>+ find.descendant(of: person(id), matching: find.text(text));+ expect(within('peer', '21 pts'), findsOneWidget);+ expect(within('peer', '6 shipped'), findsOneWidget);+ expect(within('peer', '3 unblocked'), findsOneWidget);+ expect(within('peer', '0 h lent'), findsOneWidget);+ expect(within('owner', '13 pts'), findsOneWidget);+ expect(within('owner', '20 h lent'), findsOneWidget);+ // Fixed columns: points end at one edge, and each number starts where+ // the one above it does.+ final right = tester.getTopRight(within('peer', '21 pts')).dx;+ expect(tester.getTopRight(within('owner', '13 pts')).dx, right);+ expect(tester.getTopRight(within('huy', '0 pts')).dx, right);+ expect(+ tester.getTopLeft(within('owner', '4 unblocked')).dx,+ tester.getTopLeft(within('peer', '3 unblocked')).dx,+ );+ expect(+ tester.getTopLeft(within('owner', '20 h lent')).dx,+ tester.getTopLeft(within('peer', '0 h lent')).dx,+ );+ // A long name is cut short rather than pushing the points out.+ final name = tester.widget<Text>(+ within(+ 'maximilian.alexander.longname',+ 'maximilian.alexander.longname',+ ),+ );+ expect(name.overflow, TextOverflow.ellipsis);+ expect(+ tester.getTopRight(within('maximilian.alexander.longname', '0 pts')).dx,+ right,+ );+ expect(tester.takeException(), isNull);+ await close(tester, controller);+ },+ );++ testWidgets('puts the team goal on one line above the people', (+ tester,+ ) async {+ final controller = await show(tester, humansSwarm());+ final goal = find.byKey(const ValueKey('leaderboard-goal'));+ expect(+ tester.widget<Text>(goal).data,+ 'Team goal: 7 shipped · 46 pts · 9 open',+ );+ expect(tester.widget<Text>(goal).maxLines, 1);+ // The week before and the median are on hover.+ expect(+ find.byTooltip(+ 'Team goal: 7 shipped · 46 pts · 9 open\n4 shipped last week\nMedian ask to ship 2 h',+ ),+ findsOneWidget,+ );+ expect(+ tester.getTopLeft(goal).dy,+ lessThan(tester.getTopLeft(person('peer')).dy),+ );+ await close(tester, controller);+ });++ testWidgets('reads another week from the small week picker', (tester) async {+ final server = humansSwarm();+ final controller = await show(tester, server);+ final picker = find.byKey(const ValueKey('leaderboard-week'));+ expect(tester.getSize(picker).height, lessThanOrEqualTo(32));+ await tester.tap(picker);+ await tester.pumpAndSettle();+ await tester.tap(find.text('Last week').last);+ await tester.pumpAndSettle();+ expect(server.leaderboardReads.last, contains('&week='));+ await close(tester, controller);+ });++ testWidgets('has no separate leaderboard view or trophy', (tester) async {+ final controller = await show(+ tester,+ humansSwarm(),+ size: const Size(1500, 900),+ );+ expect(find.byKey(const ValueKey('super-leaderboard')), findsNothing);+ expect(find.byKey(const ValueKey('super-board-pane')), findsNothing);+ expect(find.byTooltip('Leaderboard'), findsNothing);+ await close(tester, controller);+ });++ testWidgets("shows a person's week when their name is tapped", (+ tester,+ ) async {+ final controller = await show(tester, humansSwarm());+ await tester.tap(person('peer'));+ await tester.pumpAndSettle();+ final dialog = find.byType(AlertDialog);+ expect(+ find.descendant(+ of: dialog,+ matching: find.text('6 asks landed · median 2 h to ship'),+ ),+ findsOneWidget,+ );+ expect(+ find.descendant(of: dialog, matching: find.text('6 days shipping')),+ findsOneWidget,+ );+ await close(tester, controller);+ });++ testWidgets('opens the waiting conversation from Answer', (tester) async {+ final controller = await show(tester, humansSwarm());+ await tester.tap(find.text('Answer'));+ await tester.pumpAndSettle();+ expect(controller.selectedId, 'offline');+ await close(tester, controller);+ });++ testWidgets('reads the board of the open conversation’s project', (+ tester,+ ) async {+ final server = humansSwarm();+ final controller = await show(tester, server);+ expect(server.leaderboardReads, [+ '/api/super-tabs/tab/leaderboard?projectId=lead',+ ]);+ await close(tester, controller);+ });++ testWidgets(+ 'lists people without numbers, quietly, where the server has no leaderboard',+ (tester) async {+ final server = humansSwarm()..leaderboard = null;+ final controller = await show(tester, server);+ expect(person('peer'), findsOneWidget);+ expect(find.textContaining('pts'), findsNothing);+ expect(find.textContaining('leaderboard'), findsNothing);+ await close(tester, controller);+ },+ );+}diff --git a/desktop/test/super_tab_leaderboard_mount_test.dart b/desktop/test/super_tab_leaderboard_mount_test.dartdeleted file mode 100644index e08d1bb6c..000000000--- a/desktop/test/super_tab_leaderboard_mount_test.dart+++ /dev/null@@ -1,143 +0,0 @@-import 'package:flutter/material.dart';-import 'package:flutter_test/flutter_test.dart';-import 'package:harness/shared/theme/app_theme.dart' as grid;-import 'package:harness/super_tabs/controller.dart';-import 'package:harness/super_tabs/leaderboard/column.dart';-import 'package:harness/super_tabs/view.dart';--import 'support/super_tab_fixture.dart';--/// Where the leaderboard opens in a Swarm (v2 G): a trophy in the conversation-/// header shows it as a column at the far right, beside People, on a wide-/// window, and as a dialog on a narrower one. Answer opens the waiting group.-void main() {- final trophy = find.byKey(const ValueKey('super-leaderboard'));- final boardPane = find.byKey(const ValueKey('super-board-pane'));-- ConversationServer swarm() => ConversationServer()- ..leaderboard = {- 'projectId': 'lead',- 'week': DateTime.utc(2026, 10, 26).millisecondsSinceEpoch,- 'goal': {- 'openRequests': 2,- 'thisWeek': {'shipped': 1, 'points': 3, 'medianAskToShipMs': 7200000},- 'lastWeek': {'shipped': 0, 'points': 0, 'medianAskToShipMs': null},- },- 'people': [- {- 'personId': 'owner',- 'points': 3,- 'rank': 1,- 'medal': 'gold',- 'shipped': {'count': 1, 'medianAskToShipMs': 7200000},- 'unblocked': {'count': 0, 'agentMs': 0, 'medianAnswerMs': null},- 'lent': {'machines': 0, 'agentMs': 0},- 'streakDays': 1,- },- ],- 'waiting': {- 'total': 1,- 'people': [- {- 'personId': 'owner',- 'count': 1,- 'conversationIds': ['offline'],- },- ],- },- };-- Future<SuperTabController> show(- WidgetTester tester,- ConversationServer server,- Size size,- ) async {- await tester.binding.setSurfaceSize(size);- addTearDown(() => tester.binding.setSurfaceSize(null));- final controller = server.controller(- account: 'owner',- initial: {'tabId': 'tab', 'accountId': 'owner', 'selectedId': 'lead'},- );- await controller.refresh();- await tester.pumpWidget(- MaterialApp(- theme: grid.buildAppTheme(brightness: Brightness.dark),- home: Scaffold(- body: SuperTabView(- controller: controller,- onInvite: () {},- onAddAgent: (_) {},- onOpenTerminal: (_) {},- machineName: (_) => 'Studio',- ),- ),- ),- );- await tester.pumpAndSettle();- return controller;- }-- Future<void> close(WidgetTester tester, SuperTabController controller) async {- await tester.pumpWidget(const SizedBox());- await controller.flush();- controller.dispose();- }-- testWidgets(- 'opens the board as a column at the far right of a wide window, and closes it again',- (tester) async {- final server = swarm();- final controller = await show(tester, server, const Size(1500, 800));- expect(boardPane, findsNothing);- expect(server.leaderboardReads, isEmpty);- await tester.tap(trophy);- await tester.pumpAndSettle();- expect(boardPane, findsOneWidget);- expect(tester.getSize(boardPane).width, SuperTabLeaderboardColumn.width);- expect(tester.getTopRight(boardPane).dx, 1500);- expect(find.text('Owner'), findsNothing);- expect(find.text('owner'), findsWidgets);- expect(server.leaderboardReads, [- '/api/super-tabs/tab/leaderboard?projectId=lead',- ]);- await tester.tap(trophy);- await tester.pumpAndSettle();- expect(boardPane, findsNothing);- await close(tester, controller);- },- );-- testWidgets('opens the waiting group from Answer', (tester) async {- final server = swarm();- final controller = await show(tester, server, const Size(1500, 800));- await tester.tap(trophy);- await tester.pumpAndSettle();- await tester.tap(find.text('Answer'));- await tester.pumpAndSettle();- expect(controller.selectedId, 'offline');- await close(tester, controller);- });-- testWidgets(- 'shows the board in a dialog when the window has no room for the column',- (tester) async {- final server = swarm();- final controller = await show(tester, server, const Size(1100, 800));- await tester.tap(trophy);- await tester.pumpAndSettle();- expect(boardPane, findsNothing);- expect(- find.descendant(- of: find.byType(Dialog),- matching: find.byType(SuperTabLeaderboardColumn),- ),- findsOneWidget,- );- await tester.tap(find.text('Answer'));- await tester.pumpAndSettle();- expect(find.byType(Dialog), findsNothing);- expect(controller.selectedId, 'offline');- await close(tester, controller);- },- );-}diff --git a/desktop/test/super_tab_leaderboard_test.dart b/desktop/test/super_tab_leaderboard_test.dartindex f57ecb09f..b8d1f5c68 100644--- a/desktop/test/super_tab_leaderboard_test.dart+++ b/desktop/test/super_tab_leaderboard_test.dart@@ -1,12 +1,8 @@import 'dart:async';import 'package:fake_async/fake_async.dart';-import 'package:flutter/material.dart';import 'package:flutter_test/flutter_test.dart';-import 'package:harness/shared/theme/app_theme.dart' as grid;import 'package:harness/super_tabs/controller.dart';-import 'package:harness/super_tabs/identity.dart';-import 'package:harness/super_tabs/leaderboard/column.dart';import 'package:harness/super_tabs/leaderboard/model.dart';import 'package:harness/super_tabs/leaderboard/reader.dart';@@ -101,8 +97,6 @@ Map<String, dynamic> answer({Map<String, dynamic>? waiting}) => {},};-String name(String id) => '${id[0].toUpperCase()}${id.substring(1)}';-class FakeRequests {final paths = <String>[];Object? Function(String path) respond = (_) => answer();@@ -199,6 +193,23 @@ void main() {expect(reader.error, 'No connection.');});+ test(+ 'reads a server without a leaderboard as no board, not as an error',+ () async {+ final requests = FakeRequests()+ ..respond = (_) =>+ const SuperTabFailure('NOT_FOUND', 'Not found.', statusCode: 404);+ final reader = SuperTabLeaderboardReader(+ tabId: 'tab',+ request: requests.call,+ );+ addTearDown(reader.dispose);+ await reader.show('lead');+ expect(reader.board, isNull);+ expect(reader.error, isNull);+ },+ );+test('drops a board read for another project once the project changes',() async {@@ -239,172 +250,4 @@ void main() {},);});-- group('the leaderboard column', () {- Future<(SuperTabLeaderboardReader, List<String>)> mount(- WidgetTester tester, {- Map<String, dynamic>? waiting,- String viewer = 'tony',- }) async {- final requests = FakeRequests()- ..respond = (_) => answer(waiting: waiting);- final reader = SuperTabLeaderboardReader(- tabId: 'tab',- request: requests.call,- );- addTearDown(reader.dispose);- final answered = <String>[];- await tester.binding.setSurfaceSize(const Size(400, 1000));- addTearDown(() => tester.binding.setSurfaceSize(null));- await tester.pumpWidget(- MaterialApp(- theme: grid.buildAppTheme(brightness: Brightness.dark),- home: Scaffold(- body: SuperTabLeaderboardColumn(- reader: reader,- projectId: 'lead',- viewerId: viewer,- nameOf: name,- onAnswer: answered.add,- now: () => DateTime.fromMillisecondsSinceEpoch(- week + 3 * 86400000,- isUtc: true,- ),- ),- ),- ),- );- await tester.pumpAndSettle();- return (reader, answered);- }-- testWidgets(- 'gives the top three their medals and everyone their three numbers',- (tester) async {- await mount(tester);- expect(find.text('Humans · this week'), findsOneWidget);- expect(find.text('🏆'), findsOneWidget);- expect(find.text('🥈'), findsOneWidget);- expect(find.text('🥉'), findsOneWidget);- expect(find.text('42 pts'), findsOneWidget);- expect(- find.text('🚀 9 shipped 🔓 14 ⚡ 2 machines'),- findsOneWidget,- );- expect(find.text('🚀 6 shipped 🔓 5 ⚡ —'), findsOneWidget);- expect(find.text('🚀 2 shipped 🔓 3 ⚡ 1 machine'), findsOneWidget);- expect(find.text('Tony'), findsWidgets);- expect(find.text('0 pts'), findsOneWidget);- },- );-- testWidgets(- 'shows each person\'s avatar beside their name, at the size the shared avatar takes',- (tester) async {- await mount(tester);- final avatars = tester- .widgetList<SuperTabAvatar>(find.byType(SuperTabAvatar))- .toList();- expect(avatars.map((a) => (a.identity, a.name, a.size)), [- ('person:ken', 'Ken', 20.0),- ('person:dee', 'Dee', 20.0),- ('person:scholes', 'Scholes', 20.0),- ('person:tony', 'Tony', 20.0),- ]);- },- );-- testWidgets('shows the team goal against last week', (tester) async {- await mount(tester);- expect(find.text('Team goal · 7 open requests'), findsOneWidget);- expect(- find.text('19 shipped this week (12 last week) · 108 points'),- findsOneWidget,- );- expect(- find.text('Median ask to ship 3 h, down from 5 h'),- findsOneWidget,- );- });-- testWidgets(- 'opens a person\'s week when their name is tapped, and closes it again',- (tester) async {- await mount(tester);- await tester.tap(find.byKey(const ValueKey('leaderboard-person-ken')));- await tester.pumpAndSettle();- expect(- find.text('9 asks landed · median 3.1 h to ship'),- findsOneWidget,- );- expect(- find.text('14 answered · median 6 min · 28 h of agent time freed'),- findsOneWidget,- );- expect(find.text('2 machines · 31 slot-hours'), findsOneWidget);- expect(find.text('5 days shipping'), findsOneWidget);- await tester.tap(find.byKey(const ValueKey('leaderboard-person-ken')));- await tester.pumpAndSettle();- expect(find.text('5 days shipping'), findsNothing);- },- );-- testWidgets(- 'names who agents wait on with counts only, never ranks or medals',- (tester) async {- await mount(tester);- final line = find.byKey(const ValueKey('leaderboard-waiting'));- expect(- find.descendant(- of: line,- matching: find.text('⏳ Agents waiting on a person now: 3'),- ),- findsOneWidget,- );- expect(- find.descendant(of: line, matching: find.text('Ken 2 · Tony 1')),- findsOneWidget,- );- for (final medal in ['🏆', '🥈', '🥉', 'pts']) {- expect(- find.descendant(of: line, matching: find.textContaining(medal)),- findsNothing,- );- }- },- );-- testWidgets('takes the viewer straight to what waits on them', (- tester,- ) async {- final (_, answered) = await mount(tester, viewer: 'tony');- await tester.tap(find.text('Answer'));- expect(answered, ['g3']);- });-- testWidgets('takes anyone else to the first item waiting', (tester) async {- final (_, answered) = await mount(tester, viewer: 'dee');- await tester.tap(find.text('Answer'));- expect(answered, ['g1']);- });-- testWidgets(- 'says nobody is waiting, without an answer button, when none is',- (tester) async {- await mount(tester, waiting: {'total': 0, 'people': []});- expect(find.text('No agent is waiting on a person.'), findsOneWidget);- expect(find.text('Answer'), findsNothing);- },- );-- testWidgets('reads an earlier week when one is picked', (tester) async {- final (reader, _) = await mount(tester);- await tester.tap(find.byKey(const ValueKey('leaderboard-week')));- await tester.pumpAndSettle();- await tester.tap(find.text('Last week').last);- await tester.pumpAndSettle();- expect(reader.week, week - 7 * 86400000);- expect(find.text('Humans · last week'), findsOneWidget);- });- });}diff --git a/desktop/test/super_tab_leads_test.dart b/desktop/test/super_tab_leads_test.dartindex dda907e3b..caf50da91 100644--- a/desktop/test/super_tab_leads_test.dart+++ b/desktop/test/super_tab_leads_test.dart@@ -149,7 +149,7 @@ void main() {lessThan(tester.getTopLeft(leadsRow).dy),);// It belongs to no project: never listed again as a workgroup of the first one.- await tester.tap(find.byKey(const ValueKey('super-project-expand-lead')));+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();expect(find.text('Leads'), findsNothing);expect(leadsRow, findsOneWidget);@@ -235,7 +235,7 @@ void main() {});final controller = await show(tester, server, account: 'viewer');// "This project" chosen in a workgroup does not follow into it.- await tester.tap(find.byKey(const ValueKey('super-project-expand-lead')));+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-group-offline')));await tester.pumpAndSettle();diff --git a/desktop/test/super_tab_machine_freshness_test.dart b/desktop/test/super_tab_machine_freshness_test.dartindex 06214f4a8..9e9fa0141 100644--- a/desktop/test/super_tab_machine_freshness_test.dart+++ b/desktop/test/super_tab_machine_freshness_test.dart@@ -305,7 +305,7 @@ void main() {final semantics = tester.ensureSemantics();await show(tester, c);expect(rowOf('m'), findsOneWidget);- await tester.tap(find.byKey(const ValueKey('super-machine-toggle-m')));+ await tester.tap(find.byKey(const ValueKey('super-machine-m')));await tester.pump();expect(find.byKey(const ValueKey('super-machine-readings-m')),diff --git a/desktop/test/super_tab_machines_test.dart b/desktop/test/super_tab_machines_test.dartindex d6c23ad61..774807679 100644--- a/desktop/test/super_tab_machines_test.dart+++ b/desktop/test/super_tab_machines_test.dart@@ -97,7 +97,7 @@ Future<void> _openConfigureDialog();await tester.pumpAndSettle();final card = find.byKey(const ValueKey('super-machine-m'));- await tester.tap(card);+ await openMachineDetails(tester, card);await tester.pumpAndSettle();await tester.tap(find.widgetWithText(TextButton, 'Configure'));await tester.pumpAndSettle();@@ -185,6 +185,14 @@ Future<void> _settleSave(WidgetTester tester) async {}}+/// A machine's details are in its right-click menu; a click expands it (Dee, 2026-10-27).+Future<void> openMachineDetails(WidgetTester tester, Finder row) async {+ await tester.tap(row, buttons: kSecondaryMouseButton);+ await tester.pumpAndSettle();+ await tester.tap(find.text('Details').last);+ await tester.pumpAndSettle();+}+void main() {test('an allowance\'s note names its tightest window and its reset, in either detail format', () {// Another machine's reading: the tightest window first.@@ -289,9 +297,7 @@ void main() {expect(find.textContaining('ago'), findsNothing);expect(offline, findsOneWidget);expect(find.text('Offline · 1'), findsNothing);- await tester.tap(- find.byKey(const ValueKey('super-machine-toggle-online')),- );+ await tester.tap(find.byKey(const ValueKey('super-machine-online')));await tester.pumpAndSettle();expect(find.byType(AlertDialog), findsNothing);expect(_hw(tester, 'online', 'CPU'), '0%');@@ -316,11 +322,14 @@ void main() {tester.getTopLeft(offline).dy,greaterThan(tester.getTopLeft(online).dy),);- // The entire row opens its details, including keyboard activation.+ // The entire row expands, from the keyboard too; its details are in the+ // right-click menu.Focus.of(tester.element(find.text('Studio Mac'))).requestFocus();await tester.pump();await tester.sendKeyEvent(LogicalKeyboardKey.enter);await tester.pumpAndSettle();+ expect(c.isMachineExpanded('online'), isFalse);+ await openMachineDetails(tester, online);expect(find.text('Available capacity'), findsOneWidget);expect(find.descendant(@@ -354,7 +363,7 @@ void main() {);await tester.tap(find.text('Close'));await tester.pumpAndSettle();- await tester.tap(offline);+ await openMachineDetails(tester, offline);await tester.pumpAndSettle();expect(find.byType(AlertDialog), findsOneWidget);expect(@@ -416,7 +425,7 @@ void main() {findsNothing,);expect(c.isMachineExpanded('a'), isFalse);- await tester.tap(find.byKey(const ValueKey('super-machine-toggle-a')));+ await tester.tap(find.byKey(const ValueKey('super-machine-a')));await tester.pumpAndSettle();expect(c.isMachineExpanded('a'), isTrue);expect(find.text('No agents yet'), findsOneWidget);@@ -425,7 +434,7 @@ void main() {expect(reopened.isMachineExpanded('a'), isTrue);expect(reopened.isMachineExpanded('b'), isFalse);reopened.dispose();- await tester.tap(find.byKey(const ValueKey('super-machine-toggle-a')));+ await tester.tap(find.byKey(const ValueKey('super-machine-a')));await tester.pumpAndSettle();expect(find.text('No agents yet'), findsNothing);await tester.pumpWidget(const SizedBox());@@ -529,7 +538,7 @@ void main() {await show();await tester.pumpAndSettle();expect(find.text('Quinn'), findsNothing);- await tester.tap(find.byKey(const ValueKey('super-machine-toggle-m')));+ await tester.tap(find.byKey(const ValueKey('super-machine-m')));await tester.pumpAndSettle();final pm = find.byKey(const ValueKey('super-machine-agent-m-pm'));final dev = find.byKey(const ValueKey('super-machine-agent-m-dev'));@@ -896,19 +905,12 @@ void main() {final row = tester.getRect(find.byKey(const ValueKey('super-machine-m')),);- final toggle = tester.getRect(- find.byKey(const ValueKey('super-machine-toggle-m')),- );final dot = tester.getRect(find.byKey(const ValueKey('super-machine-state-m-live')),);expect(row.width, width, reason: reason);- expect(toggle.right, row.right, reason: reason);- expect(- dot.center.dx,- closeTo(toggle.center.dx - 32, .01),- reason: reason,- );+ // No chevron: the status takes the last 32 px column, as on project rows.+ expect(dot.center.dx, closeTo(row.right - 16, .01), reason: reason);expect(tester.getTopLeft(find.byKey(const ValueKey('super-machine-name-m')))@@ -970,7 +972,7 @@ void main() {await tester.pumpAndSettle();final row = find.byKey(const ValueKey('super-machine-gone'));expect(row, findsOneWidget);- await tester.tap(row);+ await openMachineDetails(tester, row);await tester.pumpAndSettle();await tester.tap(find.widgetWithText(TextButton, 'Attach running agent'));await tester.pumpAndSettle();@@ -1047,9 +1049,7 @@ void main() {// Local models live in the sidebar now, not the Machines heading.expect(find.byKey(const ValueKey('super-local-models')), findsNothing);// Its expanded readings list what it offers, under labels; a model shared with its owner stays hidden.- await tester.tap(- find.byKey(const ValueKey('super-machine-toggle-studio')),- );+ await tester.tap(find.byKey(const ValueKey('super-machine-studio')));await tester.pumpAndSettle();expect(find.text('Local'), findsOneWidget);expect(@@ -1069,7 +1069,10 @@ void main() {findsOneWidget,);expect(find.text('muse'), findsNothing);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();expect(find.text('Models for this Swarm'), findsOneWidget);expect(@@ -1186,7 +1189,10 @@ void main() {final c = server.controller();await c.refresh();await mount(tester, c);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-machine-remove')));await tester.pumpAndSettle();@@ -1218,7 +1224,10 @@ void main() {isEmpty,);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-machine-remove')));await tester.pumpAndSettle();@@ -1279,7 +1288,10 @@ void main() {final c = server.controller();await c.refresh();await mount(tester, c);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();final remove = find.byKey(const ValueKey('super-machine-remove'));expect(remove, findsOneWidget);@@ -1308,7 +1320,10 @@ void main() {final c = server.controller();await c.refresh();await mount(tester, c);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-machine-remove')));await tester.pumpAndSettle();@@ -1338,7 +1353,10 @@ void main() {final c = server.controller();await c.refresh();await mount(tester, c);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-machine-remove')));await tester.pumpAndSettle();@@ -1375,7 +1393,10 @@ void main() {await c.refresh();await mount(tester, c);expect(find.text('Cleaning up'), findsOneWidget);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();expect(find.byKey(const ValueKey('super-machine-remove')), findsNothing);await tester.pumpWidget(const SizedBox());@@ -1392,7 +1413,10 @@ void main() {final c = server.controller();await c.refresh();await mount(tester, c);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();(server.state['conversations'] as List)[0]['leadId'] = 'a1';await c.refresh();@@ -1426,7 +1450,10 @@ void main() {final owner = server.controller();await owner.refresh();await mount(tester, owner);- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();expect(find.byKey(const ValueKey('super-machine-remove')), findsNothing);await tester.tap(find.widgetWithText(TextButton, 'Close'));@@ -1441,7 +1468,10 @@ void main() {await c.refresh();await mount(tester, c);await tester.pumpAndSettle();- await tester.tap(find.byKey(const ValueKey('super-machine-studio')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-studio')),+ );await tester.pumpAndSettle();expect(find.byKey(const ValueKey('super-machine-remove')),@@ -1579,10 +1609,8 @@ void main() {matching: find.byType(SuperTabMachineDot),),);- final toggle = tester.getRect(- find.byKey(const ValueKey('super-machine-toggle-m')),- );- expect(dot.center.dx, closeTo(toggle.center.dx - 32, .01));+ // No chevron: the status takes the last 32 px column, as on project rows.+ expect(dot.center.dx, closeTo(rowRect.right - 16, .01));expect(dot.center.dy, closeTo(rowRect.center.dy, .5));expect(tester@@ -1630,9 +1658,7 @@ void main() {expect(tester.takeException(), isNull);if (capture != null && textScale == 1) {- await tester.tap(- find.byKey(const ValueKey('super-machine-toggle-m')),- );+ await tester.tap(find.byKey(const ValueKey('super-machine-m')));await tester.pumpAndSettle();await tester.runAsync(() => precacheImage(@@ -1648,13 +1674,10 @@ void main() {capture,'machine-expanded-${brightness.name}-${width.toInt()}',);- await tester.tap(- find.byKey(const ValueKey('super-machine-toggle-m')),- );+ await tester.tap(find.byKey(const ValueKey('super-machine-m')));await tester.pumpAndSettle();}- // The full row owns hover; its name opens details while the- // rightmost disclosure remains an independent action.+ // The full row owns hover; its details are in its right-click menu.final mouse = await tester.createGesture(kind: PointerDeviceKind.mouse,);@@ -1673,11 +1696,11 @@ void main() {capture,'machine-hover-$captureName',);- await tester.tap(- find.byKey(const ValueKey('super-machine-name-m')),- );await mouse.removePointer();- await tester.pumpAndSettle();+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-m')),+ );if (capture != null) {// A frame can settle before asynchronous bitmap decoding has// finished. Wait for the real asset before photographing it.@@ -2303,7 +2326,7 @@ void main() {),);await tester.pumpAndSettle();- await tester.tap(find.byKey(const ValueKey('super-machine-toggle-m')));+ await tester.tap(find.byKey(const ValueKey('super-machine-m')));await tester.pumpAndSettle();// Only the known allowance of the two the list shows, Claude's, has a chip; so do the details.expect(@@ -2312,7 +2335,10 @@ void main() {.map((mark) => mark.engine),['claude'],);- await tester.tap(find.byKey(const ValueKey('super-machine-m')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-m')),+ );await tester.pumpAndSettle();expect(find.text('OpenCode'), findsNothing);expect(@@ -2356,7 +2382,10 @@ void main() {),);await tester.pumpAndSettle();- await tester.tap(find.byKey(const ValueKey('super-machine-m')));+ await openMachineDetails(+ tester,+ find.byKey(const ValueKey('super-machine-m')),+ );await tester.pumpAndSettle();await tester.tap(find.widgetWithText(TextButton, 'Configure'));await tester.pumpAndSettle();diff --git a/desktop/test/super_tab_phone_header_test.dart b/desktop/test/super_tab_phone_header_test.dartindex 09b20a595..d3212069c 100644--- a/desktop/test/super_tab_phone_header_test.dart+++ b/desktop/test/super_tab_phone_header_test.dart@@ -28,7 +28,6 @@ void main() {for (final control in [find.byTooltip('Conversations'),find.byKey(const ValueKey('super-chat')),- find.byKey(const ValueKey('super-leaderboard')),_people,_options,]) {diff --git a/desktop/test/super_tab_picker_test.dart b/desktop/test/super_tab_picker_test.dartindex 9c07386c4..0dec81fe1 100644--- a/desktop/test/super_tab_picker_test.dart+++ b/desktop/test/super_tab_picker_test.dart@@ -1,7 +1,9 @@+import 'dart:convert';import 'dart:io';import 'dart:ui' as ui;+import 'package:flutter/gestures.dart' show kSecondaryMouseButton;import 'package:flutter/material.dart';import 'package:flutter/rendering.dart';import 'package:flutter/services.dart';@@ -152,7 +154,10 @@ void main() {}await tester.ensureVisible(machine);await tester.pumpAndSettle();- await tester.tap(machine);+ // A machine's details are in its right-click menu; a click expands it.+ await tester.tap(machine, buttons: kSecondaryMouseButton);+ await tester.pumpAndSettle();+ await tester.tap(find.text('Details').last);await tester.pumpAndSettle();await tester.tap(find.text('Attach running agent'));await tester.pumpAndSettle();diff --git a/desktop/test/super_tab_polish_test.dart b/desktop/test/super_tab_polish_test.dartindex 67e93a8d6..3958443c5 100644--- a/desktop/test/super_tab_polish_test.dart+++ b/desktop/test/super_tab_polish_test.dart@@ -417,7 +417,6 @@ void main() {await mouse.addPointer(location: Offset.zero);for (final target in [('project-hover', const ValueKey('super-group-lead')),- ('disclosure-hover', const ValueKey('super-project-expand-lead')),('workgroup-hover', const ValueKey('super-group-offline')),]) {await mouse.moveTo(tester.getCenter(find.byKey(target.$2)));diff --git a/desktop/test/super_tab_roster_test.dart b/desktop/test/super_tab_roster_test.dartindex 2596b8e04..4d3f9e917 100644--- a/desktop/test/super_tab_roster_test.dart+++ b/desktop/test/super_tab_roster_test.dart@@ -93,6 +93,7 @@ class RosterFixture {app: nativeState ? app : null,onInvite: () {},onAddAgent: (group) => added = group,+ onAnswer: (_) {},onOpenAgent: (agent) => opened = agent,),),@@ -943,28 +944,12 @@ void main() {await f.close(tester);});- testWidgets('eight people show five, then expand and collapse', (- tester,- ) async {+ testWidgets('eight people all show, with no More row', (tester) async {final f = await fixtureWithPeople(tester, 8);- for (var i = 0; i < 8; i++) {- expect(person(i), i < 5 ? findsOneWidget : findsNothing);- }- expect(find.text('Show 3 more'), findsOneWidget);-- await tester.tap(find.text('Show 3 more'));- await tester.pumpAndSettle();for (var i = 0; i < 8; i++) {expect(person(i), findsOneWidget);}- expect(find.text('Show less'), findsOneWidget);-- await tester.tap(find.text('Show less'));- await tester.pumpAndSettle();- for (var i = 0; i < 8; i++) {- expect(person(i), i < 5 ? findsOneWidget : findsNothing);- }- expect(find.text('Show 3 more'), findsOneWidget);+ expect(find.textContaining('Show '), findsNothing);await f.close(tester);});diff --git a/desktop/test/super_tab_sidebar_rows_test.dart b/desktop/test/super_tab_sidebar_rows_test.dartnew file mode 100644index 000000000..8d15dd46e--- /dev/null+++ b/desktop/test/super_tab_sidebar_rows_test.dart@@ -0,0 +1,148 @@+import 'package:flutter/gestures.dart';+import 'package:flutter/material.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:harness/shared/theme/app_icons.dart';+import 'package:harness/shared/theme/app_theme.dart' as grid;+import 'package:harness/super_tabs/controller.dart';+import 'package:harness/super_tabs/pm_chat_rows.dart';+import 'package:harness/super_tabs/view.dart';++import 'support/humans_fixture.dart';+import 'support/super_tab_fixture.dart';++/// The sidebar's rows without chevrons (Dee, 2026-10-27): a direct message+/// click highlights only that row; a project click opens its chat and shows+/// its workgroups, and a second click hides them; a machine click expands it,+/// and its details are in the right-click menu.+void main() {+ final dm = find.byKey(const ValueKey('super-pm-chat-lead'));+ final project = find.byKey(const ValueKey('super-group-lead'));+ final workgroup = find.byKey(const ValueKey('super-group-offline'));+ final machine = find.byKey(const ValueKey('super-machine-studio'));++ Future<SuperTabController> show(+ WidgetTester tester,+ ConversationServer server,+ ) async {+ await tester.binding.setSurfaceSize(const Size(1300, 900));+ addTearDown(() => tester.binding.setSurfaceSize(null));+ final controller = server.controller(+ account: 'peer',+ initial: {'tabId': 'tab', 'accountId': 'peer', 'selectedId': 'lead'},+ );+ await controller.refresh();+ await tester.pumpWidget(+ MaterialApp(+ theme: grid.buildAppTheme(brightness: Brightness.light),+ home: Scaffold(+ body: SuperTabView(+ controller: controller,+ onInvite: () {},+ onAddAgent: (_) {},+ onOpenTerminal: (_) {},+ machineName: (_) => 'Studio',+ ),+ ),+ ),+ );+ await tester.pumpAndSettle();+ return controller;+ }++ Future<void> close(WidgetTester tester, SuperTabController controller) async {+ await tester.pumpWidget(const SizedBox());+ await controller.flush();+ controller.dispose();+ }++ Finder chevronIn(Finder row) => find.descendant(+ of: row,+ matching: find.byWidgetPredicate(+ (w) =>+ w is Icon &&+ (w.icon == AppIcons.chevronRight || w.icon == AppIcons.chevronDown),+ ),+ );++ testWidgets(+ 'a direct message click highlights only that row and leaves projects collapsed',+ (tester) async {+ final controller = await show(tester, humansSwarm());+ // Its chat exists already: opening it again is a plain selection.+ await controller.openPmChat('lead');+ await controller.select('lead');+ controller.expandedProjects.clear();+ await tester.pumpAndSettle();++ await tester.tap(dm);+ await tester.pumpAndSettle();+ expect(controller.selectedId, controller.pmChat('lead')!.id);+ expect(controller.expandedProjects, isEmpty);+ expect(workgroup, findsNothing);+ expect(tester.widget<SuperTabPmChatRow>(dm).selected, isTrue);+ await close(tester, controller);+ },+ );++ testWidgets(+ 'a direct message opened for the first time leaves projects collapsed',+ (tester) async {+ final controller = await show(tester, humansSwarm());+ controller.expandedProjects.clear();+ await tester.pumpAndSettle();+ await tester.tap(dm);+ await tester.pumpAndSettle();+ expect(controller.selectedId, controller.pmChat('lead')!.id);+ expect(controller.expandedProjects, isEmpty);+ await close(tester, controller);+ },+ );++ testWidgets(+ 'a project click opens its chat and shows its workgroups; a second click hides them',+ (tester) async {+ final controller = await show(tester, humansSwarm());+ await controller.openPmChat('lead');+ controller.expandedProjects.clear();+ await tester.pumpAndSettle();+ expect(chevronIn(project), findsNothing);++ await tester.tap(project);+ await tester.pumpAndSettle();+ expect(controller.selectedId, 'lead');+ expect(controller.expandedProjects, {'lead'});+ expect(workgroup, findsOneWidget);++ await tester.tap(project);+ await tester.pumpAndSettle();+ expect(controller.selectedId, 'lead');+ expect(controller.expandedProjects, isEmpty);+ expect(workgroup, findsNothing);+ await close(tester, controller);+ },+ );++ testWidgets(+ 'a machine click expands and collapses it; Details is in its right-click menu',+ (tester) async {+ final controller = await show(tester, humansSwarm());+ expect(chevronIn(machine), findsNothing);+ expect(controller.isMachineExpanded('studio'), isFalse);++ await tester.tap(machine);+ await tester.pumpAndSettle();+ expect(controller.isMachineExpanded('studio'), isTrue);+ expect(find.byType(Dialog), findsNothing);+ await tester.tap(machine);+ await tester.pumpAndSettle();+ expect(controller.isMachineExpanded('studio'), isFalse);++ await tester.tap(machine, buttons: kSecondaryButton);+ await tester.pumpAndSettle();+ await tester.tap(find.text('Details'));+ await tester.pumpAndSettle();+ expect(find.byType(Dialog), findsOneWidget);+ await close(tester, controller);+ },+ );+}diff --git a/desktop/test/super_tab_sidebar_test.dart b/desktop/test/super_tab_sidebar_test.dartindex ed22913f0..a26cc522c 100644--- a/desktop/test/super_tab_sidebar_test.dart+++ b/desktop/test/super_tab_sidebar_test.dart@@ -112,8 +112,8 @@ Future<SuperTabController> projectSidebar(ConversationServer server) async {void main() {for (final scale in [1.0, 2.0]) {- testWidgets('flat navigation shares text and selection bounds; disclosure does not '- 'switch chats at ${scale}x', (tester) async {+ testWidgets('flat navigation shares text and selection bounds; a project row '+ 'opens its chat and shows its workgroups at ${scale}x', (tester) async {addTearDown(() => tester.binding.setSurfaceSize(null));final app = createApp(connected: true);addTearDown(app.dispose);@@ -129,8 +129,8 @@ void main() {onNewProject: () => created++,onYourDevices: () => openedDevices++,);- final expand = find.byKey(const ValueKey('super-project-expand-lead'));- final empty = find.byKey(const ValueKey('super-project-expand-empty'));+ final project = find.byKey(const ValueKey('super-group-lead'));+ final empty = find.byKey(const ValueKey('super-group-empty-lead'));final devices = find.byKey(const ValueKey('super-your-devices'));final newProject = find.byKey(const ValueKey('super-new-project'));expect(find.byType(OutlinedButton), findsNothing);@@ -152,9 +152,9 @@ void main() {await tester.tap(sample);await tester.pumpAndSettle();expect(controller.selectedId, 'empty-lead');- await tester.tap(expand);+ await tester.tap(project);await tester.pumpAndSettle();- expect(controller.selectedId, 'empty-lead');+ expect(controller.selectedId, 'lead');expect(inRow('super-group-lead', find.text('#')), findsOneWidget);final work = find.byKey(const ValueKey('super-group-offline'));expect(work, findsOneWidget);@@ -174,10 +174,6 @@ void main() {tester.getCenter(unreadDot('offline')).dx,tester.getCenter(unreadDot('lead')).dx,);- expect(- tester.getCenter(unreadDot('lead')).dx,- lessThan(tester.getTopLeft(expand).dx),- );for (final row in [newProject, devices, work]) {final bounds = tester.getRect(row);final projectBounds = tester.getRect(@@ -192,12 +188,13 @@ void main() {expect(controller.selectedId, 'offline');await tester.tap(empty);await tester.pumpAndSettle();- expect(controller.selectedId, 'offline');+ expect(controller.selectedId, 'empty-lead');expect(find.text('No workgroups yet'), findsOneWidget);expect(tester.getTopLeft(find.text('No workgroups yet')).dx, textX);- expect(find.byTooltip('Collapse sample-project'), findsOneWidget);+ // A second click on the open project hides its workgroups again.await tester.tap(empty);await tester.pumpAndSettle();+ expect(controller.selectedId, 'empty-lead');expect(find.text('No workgroups yet'), findsNothing);// The plain top actions retain keyboard operation and do not create tabs.@@ -216,7 +213,7 @@ void main() {await tester.pumpAndSettle();expect(openedDevices, 1);expect(controller.devicesSelected, isTrue);- expect(controller.selectedId, 'offline');+ expect(controller.selectedId, 'empty-lead');expect(app.swarms, hasLength(tabsBefore));expect(rowMaterial(tester, 'super-your-devices').color,@@ -308,7 +305,7 @@ void main() {});testWidgets('section disclosure follows its label and + aligns with the '- 'right disclosure column', (tester) async {+ 'rows\' right status column', (tester) async {addTearDown(() => tester.binding.setSurfaceSize(null));final app = createApp(connected: true);addTearDown(app.dispose);@@ -335,9 +332,8 @@ void main() {}expect(tester.getCenter(find.byTooltip('New project')).dx,- tester- .getCenter(find.byKey(const ValueKey('super-project-expand-lead')))- .dx,+ tester.getRect(find.byKey(const ValueKey('super-group-lead'))).right -+ 16,);expect(tester.takeException(), isNull);}diff --git a/desktop/test/super_tab_team_glance_test.dart b/desktop/test/super_tab_team_glance_test.dartindex 27a50158e..6d49f867c 100644--- a/desktop/test/super_tab_team_glance_test.dart+++ b/desktop/test/super_tab_team_glance_test.dart@@ -111,6 +111,7 @@ Future<ConversationServer> _swarm(onInvite: () {},onOpenAgent: (_) {},onAddAgent: (_) {},+ onAnswer: (_) {},),),),diff --git a/desktop/test/super_tab_team_machine_test.dart b/desktop/test/super_tab_team_machine_test.dartindex 8ba40251e..a84fb1464 100644--- a/desktop/test/super_tab_team_machine_test.dart+++ b/desktop/test/super_tab_team_machine_test.dart@@ -106,7 +106,7 @@ void main() {expect(_row('mac'), findsOneWidget);expect(_row('mac-team'), findsNothing);expect(find.text('MacBook Pro · Team'), findsNothing);- await tester.tap(find.byKey(const ValueKey('super-machine-toggle-mac')));+ await tester.tap(find.byKey(const ValueKey('super-machine-mac')));await tester.pumpAndSettle();expect(find.byKey(const ValueKey('super-machine-agent-mac-a1')),@@ -145,7 +145,7 @@ void main() {expect(_row('mac-team-old'), findsNothing);expect(_state('mac', 'live'), findsOneWidget);expect(c.snapshot!.teamPoolOf('mac')!['machineId'], 'mac-team-new');- await tester.tap(find.byKey(const ValueKey('super-machine-toggle-mac')));+ await tester.tap(find.byKey(const ValueKey('super-machine-mac')));await tester.pumpAndSettle();for (final agent in ['a1', 'a2']) {expect(diff --git a/desktop/test/super_tab_view_test.dart b/desktop/test/super_tab_view_test.dartindex c12768a95..2ce5b381a 100644--- a/desktop/test/super_tab_view_test.dart+++ b/desktop/test/super_tab_view_test.dart@@ -209,7 +209,7 @@ void main() {await tester.tap(find.byTooltip('Conversations'));await tester.pumpAndSettle();}- await tester.tap(find.byKey(const ValueKey('super-project-expand-lead')));+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-group-offline')));await tester.pumpAndSettle();@@ -298,7 +298,7 @@ void main() {expect(server.posts, isEmpty);await tester.tap(find.byTooltip('Conversations'));await tester.pumpAndSettle();- await tester.tap(find.byKey(const ValueKey('super-project-expand-lead')));+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));await tester.pumpAndSettle();await tester.tap(find.byKey(const ValueKey('super-group-offline')));await tester.pumpAndSettle();diff --git a/desktop/test/support/humans_fixture.dart b/desktop/test/support/humans_fixture.dartnew file mode 100644index 000000000..71af622a5--- /dev/null+++ b/desktop/test/support/humans_fixture.dart@@ -0,0 +1,72 @@+import 'pm_chat_fixture.dart';+import 'super_tab_fixture.dart';++/// Seven people, so a cut-off list would hide some, with this week's scores.+ConversationServer humansSwarm() {+ final server = pmChatSwarm();+ (server.state['agents'] as List).first['displayName'] = 'River';+ server.state['people'] = [+ {'id': 'owner', 'email': '[email protected]', 'role': 'owner'},+ {'id': 'peer', 'email': '[email protected]', 'role': 'collaborator'},+ for (final name in [+ 'tony',+ 'scholes',+ 'diego',+ 'huy',+ 'maximilian.alexander.longname',+ ])+ {'id': name, 'email': '[email protected]', 'role': 'collaborator'},+ ];+ server.state['projects'] = [projectFixture('lead', 'Pilot', 'lead')];+ server.state['machines'] = [+ {'machineId': 'studio', 'name': 'Mac Studio', 'contributorId': 'owner'},+ ];+ Map<String, dynamic> score(+ String id,+ int points,+ int rank,+ int shipped,+ int unblocked,+ int lent,+ ) => {+ 'personId': id,+ 'points': points,+ 'rank': rank,+ 'medal': points > 0 && rank <= 3+ ? ['gold', 'silver', 'bronze'][rank - 1]+ : null,+ 'shipped': {'count': shipped, 'medianAskToShipMs': 7200000},+ 'unblocked': {'count': unblocked, 'agentMs': 0, 'medianAnswerMs': null},+ 'lent': {'machines': lent, 'agentMs': lent * 36000000},+ 'streakDays': shipped,+ };+ server.leaderboard = {+ 'projectId': 'lead',+ 'week': DateTime.utc(2026, 10, 26).millisecondsSinceEpoch,+ 'goal': {+ 'openRequests': 9,+ 'thisWeek': {'shipped': 7, 'points': 46, 'medianAskToShipMs': 7200000},+ 'lastWeek': {'shipped': 4, 'points': 20, 'medianAskToShipMs': null},+ },+ 'people': [+ score('peer', 21, 1, 6, 3, 0),+ score('owner', 13, 2, 1, 4, 2),+ score('tony', 6, 3, 2, 0, 0),+ score('scholes', 4, 4, 0, 2, 1),+ score('diego', 2, 5, 0, 1, 1),+ score('huy', 0, 6, 0, 0, 0),+ score('maximilian.alexander.longname', 0, 6, 0, 0, 0),+ ],+ 'waiting': {+ 'total': 1,+ 'people': [+ {+ 'personId': 'peer',+ 'count': 1,+ 'conversationIds': ['offline'],+ },+ ],+ },+ };+ return server;+}diff --git a/desktop/test/swarm_projects_test.dart b/desktop/test/swarm_projects_test.dartindex 04fdc0f22..b76451fef 100644--- a/desktop/test/swarm_projects_test.dart+++ b/desktop/test/swarm_projects_test.dart@@ -55,61 +55,61 @@ void main() {c.dispose();}- testWidgets(- 'project names open lead chats; chevrons independently reveal numbered workgroups',- (tester) async {- final server = projectsServer(), c = server.controller();- var creations = 0;- await mount(tester, c, onNewProject: () => creations++);- expect(find.byKey(const ValueKey('super-group-offline')), findsNothing);- expect(find.byIcon(AppIcons.lock), findsOneWidget);- expect(- find.byKey(const ValueKey('super-project-expand-design')),- findsOneWidget,- );- expect(find.text('Leads'), findsNothing);- expect(find.text('Projects'), findsOneWidget);- expect(find.text('Humans'), findsOneWidget);- expect(find.text('Agents'), findsOneWidget);- final create = find.byTooltip('New project');- final project = find.byKey(const ValueKey('super-group-lead'));- expect(- tester.getBottomLeft(create).dy,- lessThan(tester.getTopLeft(project).dy),- );- await tester.tap(find.byKey(const ValueKey('super-project-expand-lead')));- await tester.pumpAndSettle();- expect(c.selectedId, 'lead');- expect(find.text('12 Offline editing'), findsOneWidget);- await tester.tap(find.byKey(const ValueKey('super-group-offline')));- await tester.pumpAndSettle();- expect(c.selectedId, 'offline');- await tester.tap(find.byKey(const ValueKey('super-group-design-lead')));- await tester.pumpAndSettle();- expect(c.selectedId, 'design-lead');- expect(c.expandedProjects, {'lead'});- await tester.tap(find.byKey(const ValueKey('super-group-lead')));- await tester.pumpAndSettle();- expect(c.selectedId, 'lead');- await tester.tap(find.byTooltip('New project'));- expect(creations, 1);- expect(server.posts, isEmpty);- expect(tester.takeException(), isNull);- await unmount(tester, c);- },- );+ testWidgets('project rows open lead chats and reveal numbered workgroups', (+ tester,+ ) async {+ final server = projectsServer(), c = server.controller();+ var creations = 0;+ await mount(tester, c, onNewProject: () => creations++);+ expect(find.byKey(const ValueKey('super-group-offline')), findsNothing);+ expect(find.byIcon(AppIcons.lock), findsOneWidget);+ expect(+ find.byKey(const ValueKey('super-group-design-lead')),+ findsOneWidget,+ );+ expect(find.text('Leads'), findsNothing);+ expect(find.text('Projects'), findsOneWidget);+ expect(find.text('Humans'), findsOneWidget);+ expect(find.text('Agents'), findsOneWidget);+ final create = find.byTooltip('New project');+ final project = find.byKey(const ValueKey('super-group-lead'));+ expect(+ tester.getBottomLeft(create).dy,+ lessThan(tester.getTopLeft(project).dy),+ );+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));+ await tester.pumpAndSettle();+ expect(c.selectedId, 'lead');+ expect(find.text('12 Offline editing'), findsOneWidget);+ await tester.tap(find.byKey(const ValueKey('super-group-offline')));+ await tester.pumpAndSettle();+ expect(c.selectedId, 'offline');+ await tester.tap(find.byKey(const ValueKey('super-group-design-lead')));+ await tester.pumpAndSettle();+ expect(c.selectedId, 'design-lead');+ expect(c.expandedProjects, {'lead', 'design'});+ await tester.tap(find.byKey(const ValueKey('super-group-lead')));+ await tester.pumpAndSettle();+ expect(c.selectedId, 'lead');+ await tester.tap(find.byTooltip('New project'));+ expect(creations, 1);+ expect(server.posts, isEmpty);+ expect(tester.takeException(), isNull);+ await unmount(tester, c);+ });testWidgets(- 'project and workgroup rows align while both project actions remain keyboard accessible',+ 'project and workgroup rows align, and a project row works from the keyboard',(tester) async {final server = projectsServer(), c = server.controller();await mount(tester, c);final project = find.byKey(const ValueKey('super-group-lead'));- final disclosure = find.byKey(- const ValueKey('super-project-expand-lead'),+ final projectName = find.descendant(+ of: project,+ matching: find.text('Lamp OS'),);- final icon = find.descendant(of: disclosure, matching: find.byType(Icon));- Focus.of(tester.element(icon)).requestFocus();+ // Enter on the open project shows its workgroups.+ Focus.of(tester.element(projectName)).requestFocus();await tester.pump();await tester.sendKeyEvent(LogicalKeyboardKey.enter);await tester.pumpAndSettle();@@ -121,10 +121,6 @@ void main() {final workgroupBounds = tester.getRect(workgroup);expect(workgroupBounds.left, projectBounds.left);expect(workgroupBounds.right, projectBounds.right);- final projectName = find.descendant(- of: project,- matching: find.text('Lamp OS'),- );// Workgroups share the project name column in the compact sidebar.expect(tester.getTopLeft(find.text('12 Offline editing')).dx,@@ -135,15 +131,17 @@ void main() {await tester.tapAt(workgroupBounds.centerLeft + const Offset(8, 0));await tester.pumpAndSettle();expect(c.selectedId, 'offline');- Focus.of(tester.element(icon)).requestFocus();+ // From a workgroup, the project row opens the project's chat and keeps+ // its workgroups shown; once more, Space hides them.+ Focus.of(tester.element(projectName)).requestFocus();await tester.pump();- await tester.sendKeyEvent(LogicalKeyboardKey.space);+ await tester.sendKeyEvent(LogicalKeyboardKey.enter);await tester.pumpAndSettle();- expect(c.expandedProjects, isEmpty);- expect(c.selectedId, 'offline');+ expect(c.selectedId, 'lead');+ expect(c.expandedProjects, {'lead'});Focus.of(tester.element(projectName)).requestFocus();await tester.pump();- await tester.sendKeyEvent(LogicalKeyboardKey.enter);+ await tester.sendKeyEvent(LogicalKeyboardKey.space);await tester.pumpAndSettle();expect(c.selectedId, 'lead');expect(c.expandedProjects, isEmpty);@@ -264,7 +262,7 @@ void main() {expect(find.text('Private'), findsOneWidget);expect(find.byIcon(AppIcons.lock), findsOneWidget);expect(- find.byKey(const ValueKey('super-project-expand-design')),+ find.byKey(const ValueKey('super-group-design-lead')),findsNothing,);},diff --git a/docs/naming-system.md b/docs/naming-system.mdindex 05e3ecf93..11a195467 100644--- a/docs/naming-system.md+++ b/docs/naming-system.md@@ -102,13 +102,15 @@ Its sidebar reads like a chat app's. It starts with **New project**, **Manage mo**Your devices** and **Notifications**, then three sections in this order: **Projects**,**Direct messages** and **Machines**. Projects and Machines have section headings with disclosureafter the label and an add action at the right. Project rows read as channels, from A to Z:-**#** at the left, then their name, status and a right-hand disclosure. The Product Managers'-conversation is one of them, **# product-managers**, with no workgroups. Project names open their-product manager chats; disclosure reveals workgroups, shown by their number in grey with no **#**+**#** at the left, then their name and status, with no chevron. The Product Managers'+conversation is one of them, **# product-managers**, with no workgroups. A click on a project row+opens its product manager chat and reveals its workgroups; a second click on the open project+hides them. Workgroups are shown by their number in grey with no **#**and then their title (`12 Offline editing`), aligned with the project name. An expanded projectwithout workgroups says **No workgroups yet**. An open channel's heading reads as its row(`# openharness`). **Direct messages** holds the person's **Chat with PM** for each project,-listed by the product manager's name and avatar, with the project's name in grey brackets when+listed by the product manager's name and avatar; opening one highlights only that row and leaves+the projects as they were. The project's name is in grey brackets whenthe Swarm has several (`Finn (web-2)`) and a count of new messages. Hovering says**Chat with PM**, and ⇧⌘K opens the current project's.**Your devices** opens the Devices dashboard and its existing agent conversation inside the@@ -126,12 +128,13 @@ activity summaries or infer a work timer from the session's age. Engine names beChat headings and quoted replies use the same current agent identity as the roster, includingolder messages. When an agent has left, its recorded author name remains available in history.Machine rows show **~** at the left, then the name the person gave the machine (else the-Swarm's name for it), owner avatar, status and right-hand disclosure.+Swarm's name for it), owner avatar and status, with no chevron.In the Swarm's views, a Mac and its Harness Team account are one row, and agents in that accountread as on the Mac. App-wide machine lists still show the team account as its own machine.When teammates' agents cannot run on a machine, its row adds one line, such as**Teammates' agents paused: privacy check failed**. There is no badge.-Clicking the name opens labeled details; disclosure shows agents with their names, role badges+A click on the row expands it, and its labeled details are in the right-click menu (a long press+on a touch screen). Expanded, it shows agents with their names, role badgesand status, followed by known resources and model allowances. Offline machines stay in thesame list and omit stale readings. Rows share the projects' alignment and full-width highlight.The stored `lead` and `builder` routing roles and native harness names remain compatible.diff --git a/docs/swarms.md b/docs/swarms.mdindex a99f8f162..f87489434 100644--- a/docs/swarms.md+++ b/docs/swarms.md@@ -17,7 +17,8 @@ write the request, and choose the project's visibility. Store usesUse **+ Project** in the left sidebar to create another project in the currentSwarm. It uses the same form and creates a separate lead session. Clicking a-project name opens its lead chat. Its chevron expands numbered workgroups.+project row opens its lead chat and expands its numbered workgroups; a second+click on the open project hides them.The lead can create and coordinate those workgroups; people usually workthrough the project lead.@@ -97,7 +98,7 @@ a report every 15 seconds, so that a silent machine can be told from a quiet onethat fails waits a whole 15 seconds before the next.Each machine in the sidebar is one line, at a project row's height and on its columns: a-status dot where the project chevrons sit, the name where project names start (a computer's+status dot at the right edge, where project rows show theirs, the name where project names start (a computer'sreal hostname without `.local`, such as `MacBookPro2021`, or the name a person gave it), then threecolumns every row shares, so their figures line up down the list: Claude's allowance, Codex's,and the agents, whose avatars stand 16 points clear of the figures. An allowance is the engine's mark and the share left of its tightest window,@@ -187,18 +188,24 @@ product manager can see what its terminal shows.The leaderboard shows how each person helped the team ship this week. Peoplecompete for fun, but the reward is shared: the team's goal is on top, and-everyone's points count toward it. In Desktop and the web app, the trophy in the-conversation header opens it. On a wide window it opens as a column at the far-right, beside People. On a narrower one it opens as a dialog. It shows the project-of the open conversation to the people who can read that project.+everyone's points count toward it. In Desktop and the web app it is the right+pane's Humans section; there is no separate view. The team goal is one line at+the top, beside a small week picker. Below it, everyone is listed, with no+cut-off and most points first. Each person is one row: avatar, name and points+in fixed columns, with a quiet line of their Shipped, Unblocked and Lent under it.+It shows the project of the open conversation to the people who can read that+project. A server without a leaderboard leaves the names without numbers.Each person has three numbers:-- **Shipped**: requests the person asked for whose work is Done with a linked- pull request. A group records its requester when it is opened. A person's own- new group names them, and a product manager names the person who asked in the- project chat or in their Chat with PM. Product managers mark a group Done only- after its pull request has merged. 3 points each.+- **Shipped**: requests the person asked for whose pull request merged. A group+ records its requester when it is opened. A person's own new group names them,+ and a product manager names the person who asked in the project chat or in+ their Chat with PM. Right after merging, the product manager records the merge+ with the group and the PR link (and the merge time, for one recorded later, up+ to four weeks back). The request ships at the merge, even if its work is lost+ or cancelled afterwards. A group that is Done with a linked PR ships too; the+ earlier of the merge and Done is when it shipped. 3 points each.- **Unblocked**: items needing a person that the person answered. An answer countswhen it comes from the person the item waits on, or when it replies to thequestion itself. That person is the group's requester, or the project's owner@@ -208,12 +215,13 @@ Each person has three numbers:from each machine's readings. A product manager's session doesn't count: itcoordinates in confidence and doesn't build. 1 point for every 10 hours.-The top three get medals, and people with the same points share a place. A-streak counts the days in a row, up to today, with a shipped request. Tapping a-name shows that person's week: the median time from asking to shipping, the-median time to answer, and the hours freed and lent. The team goal compares the-project's open requests, what shipped and the median time from asking to-shipping with the week before. Weeks run from Monday 00:00 UTC, and the week+People with the same points share a place. A streak counts the days in a row,+up to today, with a shipped request. Tapping a name shows that person's week:+their place, the median time from asking to shipping, the median time to answer,+the hours freed and lent, and their streak. The team goal line shows what+shipped, everyone's points and the project's open requests; hovering it compares+what shipped with the week before and gives the median time from asking to+shipping. Weeks run from Monday 00:00 UTC, and the weekpicker reaches back three weeks.**Agents waiting on a person now** lists who agents are waiting on and how many