Skip to content

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.

Merge batch 11-04 b1600: #2975 #2974 #2965 #2966 #2971 (#2980)

0xken15b9cc6f49e508
diff --git a/backend/integration/superTabCosts.test.ts b/backend/integration/superTabCosts.test.ts
index 835135da2..b5ee8d416 100644
--- a/backend/integration/superTabCosts.test.ts
+++ b/backend/integration/superTabCosts.test.ts
@@ -254,8 +254,9 @@ describe('costs and a project\'s GitHub access, read through the read cache (tas
describe('a route decision as stored (task #2488)', () => {
// As production's routes were on 2026-11-03: every engine on every machine, 13 candidates with labels of ~540 characters and
- // 47 exclusions of 5 reasons, ~20 KB a row. Only the pick's label and each reason once are kept; readers get the record whole.
- it('keeps the pick\'s label and each exclusion reason once, reads back every candidate and exclusion, and still links its start', async () => {
+ // 47 exclusions of 5 reasons, ~20 KB a row. The pick is kept whole, of the others who and where they are and their titles (task
+ // #2769), and each reason once; readers get every candidate and exclusion back.
+ it('keeps the pick whole and each exclusion reason once, reads back every candidate and exclusion, and still links its start', async () => {
const f = await swarm()
const long = (text: string, size: number) => `${text} ${'·'.repeat(Math.max(0, size - text.length - 1))}`
const fit = { status: 'fits', coverage: 1.5, effectiveCost: 3, expiring: 0, spend: { '5-hour': 30, weekly: 4 }, account: 'k'.repeat(64) }
@@ -279,7 +280,8 @@ describe('a route decision as stored (task #2488)', () => {
const record = read.record as unknown as typeof decision
expect(record.candidates.map(c => c.id)).toEqual(candidates.map(c => c.id))
expect(record.candidates.map(c => c.label)).toEqual([candidates[0]!.label, ...Array(12).fill(undefined)])
- expect(record.candidates.map(({ label: _label, ...c }) => c)).toEqual(candidates.map(({ label: _label, ...c }) => c))
+ expect(record.candidates[0]).toEqual(candidates[0])
+ expect(record.candidates.slice(1)).toEqual(candidates.slice(1).map(({ label: _l, quality: _q, cost: _c, fit: _f, ...c }) => c))
expect(record.excluded).toHaveLength(47)
expect(new Set(record.excluded.map(e => JSON.stringify(e)))).toEqual(new Set(excluded.map(e => JSON.stringify(e))))
expect(read).not.toHaveProperty('record.unavailable')
diff --git a/backend/src/superTabs/commands.ts b/backend/src/superTabs/commands.ts
index ea67c732c..3804ced2c 100644
--- a/backend/src/superTabs/commands.ts
+++ b/backend/src/superTabs/commands.ts
@@ -14,7 +14,7 @@ import {
import { jobKindOf } from './evidence/jobKind.js'
import { endSteps, stepEndedRows, holdsStepOf, isStep, ownerOf, taskOwner } from './steps.js'
import { recordCheckVerdict } from './checkVerdicts.js'
-import { routeRecordSchema, routeTitle, startedAs, type RouteCandidate, type RouteDecision, type RouteFinal, type RouteOverride } from './routeRecord.js'
+import { routeRecordSchema, routeTitle, startedAs, type KeptCandidate, type RouteDecision, type RouteFinal, type RouteOverride } from './routeRecord.js'
import { routingOverrideSaveSchema } from './routingPolicy.js'
import { askedInSchema, RULE_MESSAGE_MS, ruleSchema, ruleTextSchema } from './rules.js'
import { MAX_ATTACHMENTS, type Attachment } from './attachments.js'
@@ -1103,7 +1103,7 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
}
/** The candidate a start or assignment should match, and whether it does. Following another needs no reason (project
* instructions, phase 4: the route is advice); it is still recorded as an override, with the reason when one is given. */
- const linkDecision = (conversationId: string, matches: (c: RouteCandidate, d: RouteDecision) => boolean,
+ const linkDecision = (conversationId: string, matches: (c: KeptCandidate, d: RouteDecision) => boolean,
finalOf: (d: RouteDecision) => RouteFinal, reasonText: string | undefined, assignmentId?: string) => {
const decision = openDecision()
if (decision.conversationId !== conversationId) fail('ROUTE_MISMATCH', 'This routing decision belongs to another group.')
@@ -1122,7 +1122,7 @@ function applyCommandOnce(original: SuperTabState, actor: Actor, input: Command,
/** Why a route candidate cannot take a teammate's work in [conversationId], or null (machines.ts teamWorkCheck). A
* member runs under its own contributor's grant; a new agent under the contribution's, or off the Machines list under
* the grant of whoever will start it ([starter]). */
- const candidateRefusal = (candidate: RouteCandidate, conversationId: string, starter: string) => {
+ const candidateRefusal = (candidate: KeptCandidate, conversationId: string, starter: string) => {
const project = groupProject(state, conversation(state, conversationId))
const member = candidate.kind === 'member' ? state.agents.find(a => a.id === candidate.agentId) : undefined
if (candidate.kind === 'member' && !member) return null
diff --git a/backend/src/superTabs/routeRecord.test.ts b/backend/src/superTabs/routeRecord.test.ts
index 4c8b14bc7..b4257827b 100644
--- a/backend/src/superTabs/routeRecord.test.ts
+++ b/backend/src/superTabs/routeRecord.test.ts
@@ -1,5 +1,6 @@
+import { BSON } from 'mongodb'
import { describe, expect, it } from 'vitest'
-import { readRecord, routeRecordSchema, storedRecord, type RouteRecord } from './routeRecord.js'
+import { finalMatches, readRecord, routeRecordSchema, storedRecord, type RouteRecord } from './routeRecord.js'
const candidate = (i: number) => ({ id: `c${i}`, kind: 'new', machineId: `m${i}`, engine: 'claude', model: 'opus', effort: 'high', quality: 3, cost: 3,
title: `New agent · Claude opus high · m${i}`, label: `New agent · Claude opus high · m${i}` })
@@ -27,10 +28,11 @@ describe('a route decision as stored (task #2488: ~20 KB a row since every engin
return r
}
- it('keeps the label of the pick only, and every other candidate field', () => {
+ it('keeps the pick whole, and of every other candidate who and where it is and its title', () => {
const r = routed(), stored = storedRecord(r)
- expect(stored.candidates.map(c => c.label)).toEqual([undefined, r.candidates[1]!.label, undefined])
- expect(stored.candidates.map(({ label: _label, ...c }) => c)).toEqual(r.candidates.map(({ label: _label, ...c }) => c))
+ expect(stored.candidates[1]).toEqual(r.candidates[1])
+ const kept = ({ id, kind, machineId, engine, model, effort, title }: RouteRecord['candidates'][number]) => ({ id, kind, machineId, engine, model, effort, title })
+ expect([stored.candidates[0], stored.candidates[2]]).toEqual([kept(r.candidates[0]!), kept(r.candidates[2]!)])
})
it('keeps each exclusion reason once, with its titles in order', () => {
@@ -60,3 +62,52 @@ describe('a route decision as stored (task #2488: ~20 KB a row since every engin
expect(readRecord(storedRecord(none)).excluded).toEqual([])
})
})
+
+// Ken's prod scan, 11-04 14:30: 12.9 KB a decision on average, rows of 12 candidates mostly. A route lists every engine on every
+// machine now (#2723): 42 candidates on 11-04, each with its quota fit, which no reader takes back but the pick's.
+describe('a route decision of every engine on every machine, as stored (task #2769)', () => {
+ const hex = (n: number, seed: number) => Array.from({ length: n }, (_, i) => ((i * 7 + seed) % 16).toString(16)).join('')
+ const routed = (): RouteRecord => {
+ const machines = Array.from({ length: 21 }, (_, i) => hex(24, i))
+ const candidates = machines.flatMap((machineId, m) => (['claude', 'codex'] as const).map((engine, e) => {
+ const i = m * 2 + e
+ return { id: `c${i}`, ...(i % 9 === 4 ? { kind: 'member' as const, agentId: hex(24, 50 + i) } : { kind: 'new' as const }), machineId, engine,
+ model: engine === 'claude' ? 'opus' : 'default', effort: engine === 'claude' ? 'high' : 'default', quality: 3, cost: 40,
+ title: `New agent · ${engine === 'claude' ? 'Claude opus high' : 'Codex default default'} · MacBooks-MacBook-Pro-${m}.local`,
+ label: `New agent · Claude opus high · MacBooks-MacBook-Pro-${m}.local · strength 3, cost 40 · fits: weekly 1% of 64% left, resets in 3d4h`,
+ fit: { status: 'fits' as const, coverage: 3.21, effectiveCost: 1.2, expiring: 0.4, spend: { '5-hour': 2.5, weekly: 1 }, account: hex(64, i) } }
+ }))
+ return { assessment: { difficulty: 'medium', risk: 'medium', why: 'Route decision size and index suggestions from Ken scan', size: 'medium', kind: 'backend' },
+ candidates, excluded: [], floor: 1, notes: false, pick: 'c2', via: 'order', p: null, belowFloor: false,
+ why: 'First by strength, then price and quota fit.', jobKind: 'backend', instructionsRevision: 52 } as RouteRecord
+ }
+ const size = (value: unknown) => BSON.calculateObjectSize({ record: value })
+
+ it('stores its 42 candidates in under 10 KB: 24.7 KB as routed, 18.9 KB with only the labels left out (task #2488)', () => {
+ const r = routed()
+ expect(size(r)).toBeGreaterThan(24_000)
+ expect(size(storedRecord(r))).toBeLessThan(10_000)
+ })
+
+ it('reads back what each reader takes: the pick whole (routeHistory: its account and spend), every title (Desktop Details), and each candidate a start or a person may choose', () => {
+ const r = routed(), back = readRecord(storedRecord(r))
+ expect(back.candidates.find(c => c.id === r.pick)).toEqual(r.candidates.find(c => c.id === r.pick))
+ expect(back.candidates.map(c => c.title)).toEqual(r.candidates.map(c => c.title))
+ for (const [i, c] of r.candidates.entries()) {
+ const kept = back.candidates[i]!
+ expect({ id: kept.id, kind: kept.kind, agentId: kept.agentId, machineId: kept.machineId, engine: kept.engine, model: kept.model, effort: kept.effort })
+ .toEqual({ id: c.id, kind: c.kind, agentId: c.agentId, machineId: c.machineId, engine: c.engine, model: c.model, effort: c.effort })
+ const final = c.kind === 'member' ? { kind: 'member' as const, agentId: c.agentId!, machineId: c.machineId }
+ : { kind: 'new' as const, startId: 's', machineId: c.machineId, engine: c.engine, model: c.model, effort: c.effort }
+ expect(finalMatches(kept, final)).toBe(true)
+ }
+ })
+
+ it('keeps a grid model on a candidate that runs one', () => {
+ const r = routed()
+ r.candidates[5] = { ...r.candidates[5]!, kind: 'new', agentId: undefined, model: 'default', effort: 'default', gridModel: 'kimi-k3', gridName: 'Kimi K3' }
+ delete r.candidates[5]!.agentId
+ const kept = storedRecord(r).candidates[5]!
+ expect([kept.gridModel, kept.gridName]).toEqual(['kimi-k3', 'Kimi K3'])
+ })
+})
diff --git a/backend/src/superTabs/routeRecord.ts b/backend/src/superTabs/routeRecord.ts
index 0cd83905e..784730591 100644
--- a/backend/src/superTabs/routeRecord.ts
+++ b/backend/src/superTabs/routeRecord.ts
@@ -73,19 +73,29 @@ export const routeRecordSchema = z.object({
}).strict().refine(d => d.candidates.some(c => c.id === d.pick), 'The pick must be one of the candidates.')
.refine(d => new Set(d.candidates.map(c => c.id)).size === d.candidates.length, 'Candidate ids must be unique.')
-/** A record as stored (routeDecisions.ts): the pick keeps its label, and the exclusions are kept once per reason. On production
- * (2026-11-03) labels were 5.4 KB of a 20.9 KB row and exclusions 8.9 KB, 47 of them sharing ~5 reasons (task #2488). Rows
- * written before keep `excluded` and no `unavailable`. */
-export interface StoredRouteRecord extends Omit<RouteRecord, 'excluded'> {
+/** A candidate as a decision keeps it: the pick whole; any other only who and where it is and its title (storedRecord). */
+export type KeptCandidate = Omit<RouteCandidate, 'quality' | 'cost' | 'label' | 'fit'> & Partial<Pick<RouteCandidate, 'quality' | 'cost' | 'label' | 'fit'>>
+/** A record as its readers get it back (readRecord): its candidates as kept. */
+export type ReadRouteRecord = Omit<RouteRecord, 'candidates'> & { candidates: KeptCandidate[] }
+
+/** A record as stored (routeDecisions.ts): the pick whole, the other candidates as KeptCandidate, and the exclusions kept once
+ * per reason. On production (2026-11-03) labels were 5.4 KB of a 20.9 KB row and exclusions 8.9 KB, 47 of them sharing ~5
+ * reasons (task #2488); the 42 candidates of an 11-04 route were still ~18.9 KB, ~8.5 KB of it quota fits (task #2769). Rows
+ * written before keep `excluded` and no `unavailable`, and every candidate whole. */
+export interface StoredRouteRecord extends Omit<ReadRouteRecord, 'excluded'> {
excluded?: RouteRecord['excluded']
unavailable?: Array<{ reason: string; titles: string[] }>
}
-/** What a decision keeps of [record]: a label only on the pick (the route showed the others when it ran; Desktop's Details shows
- * a candidate's label only when it has one), and each exclusion reason once, with its titles in order. */
+/** What a decision keeps of [record]: the pick whole, and of every other candidate only what a reader takes back of one: who
+ * and where it is (a start or assignment matching it, startedAs; a person choosing it, route.override; its Team-work check) and
+ * its title (the chat lines, Desktop's Details). Its label, strength, cost and quota fit are read of the pick only: the route
+ * showed the others when it ran, and the route history takes the account and spend of the pick (cli service.ts routeHistory).
+ * Each exclusion reason is kept once, with its titles in order. */
export function storedRecord(record: RouteRecord): StoredRouteRecord {
const { excluded, ...rest } = record
- const candidates = record.candidates.map(({ label, ...c }) => c.id === record.pick ? { ...c, label } : c) as RouteCandidate[]
+ const candidates = record.candidates.map(({ label: _label, quality: _quality, cost: _cost, fit: _fit, ...c }, i) =>
+ c.id === record.pick ? record.candidates[i]! : c)
const byReason = new Map<string, string[]>()
for (const { title, reason } of excluded) byReason.set(reason, [...byReason.get(reason) ?? [], title])
return { ...rest, candidates, ...byReason.size ? { unavailable: [...byReason].map(([reason, titles]) => ({ reason, titles })) } : { excluded: [] } }
@@ -93,23 +103,23 @@ export function storedRecord(record: RouteRecord): StoredRouteRecord {
/** Either stored form back as readers get a record: `unavailable` expanded into `excluded`, reason by reason in the order each
* first appeared. A record written before this is returned as it is. */
-export function readRecord(stored: StoredRouteRecord | RouteRecord): RouteRecord {
- if (!('unavailable' in stored) || !stored.unavailable) return stored as RouteRecord
+export function readRecord(stored: StoredRouteRecord | RouteRecord): ReadRouteRecord {
+ if (!('unavailable' in stored) || !stored.unavailable) return stored as ReadRouteRecord
const { unavailable, ...rest } = stored
- return { ...rest, excluded: unavailable.flatMap(({ reason, titles }) => titles.map(title => ({ title, reason }))) } as RouteRecord
+ return { ...rest, excluded: unavailable.flatMap(({ reason, titles }) => titles.map(title => ({ title, reason }))) } as ReadRouteRecord
}
/**
* Whether a started agent is the candidate's: the same machine, engine, and the model and effort that were
* requested. After a failed switch `final` holds what ran, so the request is the one that names the candidate.
*/
-export const startedAs = (candidate: RouteCandidate, final: Extract<RouteFinal, { kind: 'new' }>): boolean =>
+export const startedAs = (candidate: KeptCandidate, final: Extract<RouteFinal, { kind: 'new' }>): boolean =>
final.machineId === candidate.machineId && final.engine === candidate.engine &&
(final.requested?.model ?? final.model) === candidate.model && (final.requested?.effort ?? final.effort) === candidate.effort &&
(final.gridModel ?? null) === (candidate.gridModel ?? null) && (final.gridName ?? null) === (candidate.gridName ?? null)
/** Whether a decision's final names this candidate: the same agent, or the same start. */
-export const finalMatches = (candidate: RouteCandidate, final: RouteFinal | null): boolean => !!final && (candidate.kind === 'member'
+export const finalMatches = (candidate: KeptCandidate, final: RouteFinal | null): boolean => !!final && (candidate.kind === 'member'
? final.kind === 'member' && final.agentId === candidate.agentId
: final.kind === 'new' && startedAs(candidate, final))
@@ -122,7 +132,7 @@ export type RouteFinal =
gridModel?: string; gridName?: string }
export interface RouteOverride { by: 'lead' | 'person'; actorKey: string; candidateId?: string; reason: string }
export interface RouteDecision {
- id: string; conversationId: string; record: RouteRecord
+ id: string; conversationId: string; record: ReadRouteRecord
final: RouteFinal | null; override: RouteOverride | null; assignmentId: string | null; outcome: string | null
/** Its attempt's run: what it ran on, how it was paid, its session's token totals at start and end (costs/attempts.ts). */
run: RouteRun | null
diff --git a/desktop/lib/shared/theme/app_theme.dart b/desktop/lib/shared/theme/app_theme.dart
index 81eaae0c5..3f7c5ce9f 100644
--- a/desktop/lib/shared/theme/app_theme.dart
+++ b/desktop/lib/shared/theme/app_theme.dart
@@ -1460,6 +1460,15 @@ abstract final class AppDesktop {
static const double groupGap = 16;
static const double controlGap = 8;
+ /// The Swarm composer's box, as the phone draws it (Huy, 11-04): the
+ /// phone's corners (`SwarmComposer.cardRadius`), the text [composerTop]
+ /// below the top and [composerSide] in from each side, and [composerRowGap]
+ /// between the text and the row of actions under it.
+ static const double composerRadius = 24;
+ static const double composerTop = 12;
+ static const double composerSide = groupGap;
+ static const double composerRowGap = 12;
+
/// Between one sidebar row and the next (design system: Geometry).
static const double listRowGap = 2;
diff --git a/desktop/lib/super_tabs/backlog.dart b/desktop/lib/super_tabs/backlog.dart
index 6d883e051..bc2f9103d 100644
--- a/desktop/lib/super_tabs/backlog.dart
+++ b/desktop/lib/super_tabs/backlog.dart
@@ -121,3 +121,48 @@ List<SuperTabConversation> superTabProjectTasks(
g,
];
}
+
+/// A task's priority as its title marks it (task #2774).
+enum SuperTabTaskPriority {
+ urgent('URGENT'),
+ high('HIGH');
+
+ const SuperTabTaskPriority(this.badge);
+ final String badge;
+}
+
+final _leading = RegExp(r'^\s*URGENT\b\s*:?\s*', caseSensitive: false);
+final _trailing = RegExp(
+ r'\s*\((?:[^()]*,\s*)?(urgent|high)(?:\s+priority)?\)\s*$',
+ caseSensitive: false,
+);
+
+/// [title]'s priority and the title without its marker (Scholes's mockup,
+/// task #2774). Tasks carry no priority field: the PM writes it into the
+/// title, as a leading URGENT or a closing "(Name, high)". Any other
+/// parenthetical stays.
+({SuperTabTaskPriority? priority, String title}) superTabTitlePriority(
+ String title,
+) {
+ if (_leading.firstMatch(title) case final match?) {
+ final rest = title.substring(match.end);
+ if (rest.isNotEmpty) {
+ return (
+ priority: SuperTabTaskPriority.urgent,
+ title: rest[0].toUpperCase() + rest.substring(1),
+ );
+ }
+ }
+ if (_trailing.firstMatch(title) case final match?) {
+ final rest = title.substring(0, match.start);
+ if (rest.isNotEmpty) {
+ return (
+ priority: match.group(1)!.toLowerCase() == 'urgent'
+ ? SuperTabTaskPriority.urgent
+ : SuperTabTaskPriority.high,
+ title: rest,
+ );
+ }
+ }
+ return (priority: null, title: title);
+}
diff --git a/desktop/lib/super_tabs/backlog_view.dart b/desktop/lib/super_tabs/backlog_view.dart
index 82bbf35ee..cf87b56e1 100644
--- a/desktop/lib/super_tabs/backlog_view.dart
+++ b/desktop/lib/super_tabs/backlog_view.dart
@@ -2,11 +2,15 @@ import 'dart:async';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import '../shared/theme/app_icons.dart';
import '../shared/theme/app_theme.dart' as grid;
+import '../shared/theme/pull_request_icon.dart';
import '../shared/widgets/app_select_field.dart';
import '../widgets/desktop_chrome.dart';
import '../widgets/laid_out_list.dart';
+import '../widgets/swarm_search_field.dart';
import 'backlog.dart';
import 'controller.dart';
import 'machine_status.dart';
@@ -14,10 +18,55 @@ import 'model.dart';
import 'pull_request_facts.dart';
import 'task_status.dart';
-/// Manage ▸ Backlog (Scholes, task #2355): every task of the Swarm the reader
-/// can read, across projects, in the groups of its state, two lines a row. It
-/// reads only what the controller already holds; the checks of open tasks'
-/// pull requests come from [facts], watched only while it shows.
+/// How many shipped tasks show before "Show N more shipped" (Scholes's
+/// mockup, task #2774).
+const superTabBacklogShippedShown = 7;
+
+/// The widest the Backlog's column grows, as the mockup centres it.
+const _maxWidth = 1120.0;
+
+/// What each group means, in one line beside its heading (task #2774).
+String _meaning(SuperTabBacklogGroup group) => switch (group) {
+ SuperTabBacklogGroup.waitingForMachine => 'No agent on it yet',
+ SuperTabBacklogGroup.working => 'An agent is on it right now',
+ SuperTabBacklogGroup.waitingOnSomeone => 'Waiting on a person’s answer',
+ SuperTabBacklogGroup.inReview => 'Pull request open, waiting on a human',
+ SuperTabBacklogGroup.readyToMerge => 'Passed review, waiting for its merge',
+ SuperTabBacklogGroup.shipped => 'Merged in the last 7 days',
+};
+
+/// Each group's mark: its color on the heading's dot and the row's icon.
+Color _tone(SuperTabBacklogGroup group) => switch (group) {
+ SuperTabBacklogGroup.waitingForMachine => grid.AppPalette.offline,
+ SuperTabBacklogGroup.working => grid.AppPalette.warn,
+ SuperTabBacklogGroup.waitingOnSomeone => grid.AppPalette.usageLow,
+ SuperTabBacklogGroup.inReview => _merged,
+ SuperTabBacklogGroup.readyToMerge => grid.AppPalette.teal,
+ SuperTabBacklogGroup.shipped => grid.AppPalette.online,
+};
+
+IconData _icon(SuperTabBacklogGroup group) => switch (group) {
+ SuperTabBacklogGroup.waitingForMachine => AppIcons.hourglass,
+ SuperTabBacklogGroup.working => AppIcons.loaderCircle,
+ SuperTabBacklogGroup.waitingOnSomeone => AppIcons.hand,
+ SuperTabBacklogGroup.inReview => AppIcons.gitPullRequest,
+ SuperTabBacklogGroup.readyToMerge => AppIcons.circleDot,
+ SuperTabBacklogGroup.shipped => AppIcons.circleCheck,
+};
+
+Brightness get _brightness =>
+ grid.AppTheme.isDark ? Brightness.dark : Brightness.light;
+
+/// GitHub's merged purple, as the pull request cards draw it.
+Color get _merged =>
+ pullRequestIconColor('Merged', null, brightness: _brightness);
+
+/// Manage ▸ Backlog (Scholes, tasks #2355 and #2774): every task of the Swarm
+/// the reader can read, across projects, in the groups of its state. Summary
+/// cards count Working, In review and Shipped; search, Mine or Everyone and a
+/// project narrow all of it. It reads only what the controller already holds;
+/// the checks of open tasks' pull requests come from [facts], watched only
+/// while it shows.
class SuperTabBacklogView extends StatefulWidget {
const SuperTabBacklogView({
super.key,
@@ -39,7 +88,12 @@ class SuperTabBacklogView extends StatefulWidget {
class _SuperTabBacklogViewState extends State<SuperTabBacklogView> {
String? _project;
bool _mine = false;
- SuperTabBacklogGroup? _group;
+ String _query = '';
+
+ /// Mine with nothing open was asked to show what the reader shipped.
+ bool _mineShipped = false;
+ bool _allShipped = false;
+ final _folded = <SuperTabBacklogGroup>{};
/// The pull requests watched for their checks: open tasks' alone.
Set<String> _watched = const {};
@@ -86,6 +140,24 @@ class _SuperTabBacklogViewState extends State<SuperTabBacklogView> {
_watched = next;
}
+ void _setMine(bool mine) => setState(() {
+ _mine = mine;
+ _mineShipped = false;
+ });
+
+ /// Whether [task] answers the search: its title, its number, or the name
+ /// of the agent on it.
+ bool _matches(SuperTabConversation task, String query) {
+ if (query.isEmpty) return true;
+ final number = query.startsWith('#') ? query.substring(1) : query;
+ if (task.number != null && '${task.number}' == number) return true;
+ if (task.title.toLowerCase().contains(query)) return true;
+ final agentId = task.assignment?['agentId'];
+ if (agentId is! String) return false;
+ final name = widget.controller.snapshot?.agentName(agentId, fallback: '');
+ return name != null && name.toLowerCase().contains(query);
+ }
+
// Rebuilt when GitHub's answer lands, as the live cards are, and when a page
// of closed tasks does: Manage rebuilds only on the controller (review of
// #2776), which a page does not tell.
@@ -100,7 +172,7 @@ class _SuperTabBacklogViewState extends State<SuperTabBacklogView> {
Widget _build(BuildContext context) {
grid.AppTheme.watch(context);
- final c = widget.controller, snapshot = c.snapshot;
+ final c = widget.controller;
final now = widget.now();
final placed = [
for (final task in superTabBacklogTasks(c, closed: c.closedShipped))
@@ -114,235 +186,544 @@ class _SuperTabBacklogViewState extends State<SuperTabBacklogView> {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) _watch(open);
});
+ final query = _query.trim().toLowerCase();
final matching = [
for (final (task, group) in placed)
if ((_project == null || task.projectId == _project) &&
(!_mine || task.requesterId == c.accountId) &&
- (_group == null || group == _group))
+ _matches(task, query))
(task, group),
];
- // Mine with nothing open says so and links to what shipped, whatever else
- // the reader asked for. All of it is shipped here, or it would be open.
+ // Mine with nothing open says so and links to what shipped (#2551). All
+ // of it is shipped here, or it would be open.
final noneOpen =
_mine &&
- _group == null &&
+ !_mineShipped &&
+ query.isEmpty &&
matching.every((e) => e.$2 == SuperTabBacklogGroup.shipped);
final shown = noneOpen
? const <(SuperTabConversation, SuperTabBacklogGroup)>[]
: matching;
- final entries = <Object>[
+ final byGroup = <SuperTabBacklogGroup, List<SuperTabConversation>>{
for (final group in SuperTabBacklogGroup.values)
- if (shown.where((e) => e.$2 == group).toList() case final tasks
- when tasks.isNotEmpty) ...[
- (group, tasks.length),
- for (final (task, _) in tasks) task,
+ group: [
+ for (final (task, g) in shown)
+ if (g == group) task,
],
- ];
- final projects = snapshot?.projects ?? const <SuperTabProject>[];
- return Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Padding(
- padding: const EdgeInsets.fromLTRB(
- grid.AppDesktop.groupGap,
- grid.AppDesktop.controlGap,
- grid.AppDesktop.groupGap,
- grid.AppDesktop.controlGap,
+ };
+ // Shipped reads newest first: by when it shipped, not its number.
+ mergeSort(
+ byGroup[SuperTabBacklogGroup.shipped]!,
+ compare: (a, b) =>
+ (b.shippedAt ?? DateTime(0)).compareTo(a.shippedAt ?? DateTime(0)),
+ );
+ final entries = <Object>[];
+ for (final MapEntry(key: group, value: tasks) in byGroup.entries) {
+ if (tasks.isEmpty) continue;
+ final folded = _folded.contains(group);
+ entries.add(_Heading(group: group, count: tasks.length, folded: folded));
+ if (folded) continue;
+ final cut =
+ group == SuperTabBacklogGroup.shipped &&
+ !_allShipped &&
+ tasks.length > superTabBacklogShippedShown
+ ? superTabBacklogShippedShown
+ : tasks.length;
+ for (final (i, task) in tasks.take(cut).indexed) {
+ entries.add(
+ _Place(
+ task: task,
+ group: group,
+ first: i == 0,
+ last: i == cut - 1 && cut == tasks.length,
),
- child: Row(
+ );
+ }
+ if (cut < tasks.length) entries.add(_More(tasks.length - cut));
+ }
+ // The cards count what the filters match, Mine's shipped tasks too while
+ // its empty list links to them.
+ int count(SuperTabBacklogGroup group) =>
+ matching.where((e) => e.$2 == group).length;
+ final projects = c.snapshot?.projects ?? const <SuperTabProject>[];
+ final muted = DesktopChrome.metadata(color: DesktopChrome.muted);
+ final synced = c.syncedAt;
+ return Align(
+ alignment: Alignment.topCenter,
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: _maxWidth),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: grid.AppDesktop.groupGap,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- AppSelectField<String?>(
- key: const ValueKey('super-backlog-project'),
- semanticLabel: 'Project',
- width: AppSelectField.fitWidth(
- context,
- labels: ['All projects', for (final p in projects) p.name],
+ if (synced != null)
+ Padding(
+ padding: const EdgeInsets.only(
+ top: grid.AppDesktop.controlGap,
+ ),
+ child: Text(
+ _syncedText(now.difference(synced)),
+ key: const ValueKey('super-backlog-synced'),
+ textAlign: TextAlign.end,
+ style: muted,
+ ),
),
- value: _project,
- options: [
- const SelectOption(value: null, label: 'All projects'),
- for (final project in projects)
- SelectOption(value: project.id, label: project.name),
- ],
- onChanged: (value) => setState(() => _project = value),
- ),
- const SizedBox(width: grid.AppDesktop.controlGap),
- DesktopPill(
- key: const ValueKey('super-backlog-mine'),
- label: 'Mine',
- selected: _mine,
- tooltip: 'Only the tasks you asked for',
- onPressed: () => setState(() => _mine = !_mine),
- ),
- const SizedBox(width: grid.AppDesktop.controlGap),
- AppSelectField<SuperTabBacklogGroup?>(
- key: const ValueKey('super-backlog-state'),
- semanticLabel: 'State',
- width: AppSelectField.fitWidth(
- context,
- labels: [
- 'All states',
- for (final group in SuperTabBacklogGroup.values)
- group.label,
+ const SizedBox(height: grid.AppDesktop.controlGap),
+ Row(
+ children: [
+ for (final (i, group) in const [
+ SuperTabBacklogGroup.working,
+ SuperTabBacklogGroup.inReview,
+ SuperTabBacklogGroup.shipped,
+ ].indexed) ...[
+ if (i > 0)
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ Expanded(
+ child: _Summary(group: group, count: count(group)),
+ ),
],
- ),
- value: _group,
- options: [
- const SelectOption(value: null, label: 'All states'),
- for (final group in SuperTabBacklogGroup.values)
- SelectOption(value: group, label: group.label),
],
- onChanged: (value) => setState(() => _group = value),
- ),
- const Spacer(),
- Text(
- shown.length == 1 ? '1 task' : '${shown.length} tasks',
- style: DesktopChrome.metadata(color: DesktopChrome.muted),
),
- ],
- ),
- ),
- if (c.closedShippedFailed)
- Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: grid.AppDesktop.groupGap,
- ),
- child: Row(
- children: [
- Text(
- 'Some shipped tasks could not be read.',
- style: DesktopChrome.metadata(color: DesktopChrome.muted),
- ),
- const SizedBox(width: grid.AppDesktop.controlGap),
- DesktopPill(
- key: const ValueKey('super-backlog-shipped-retry'),
- label: 'Try again',
- quiet: true,
- compact: true,
- onPressed: _readClosed,
- ),
- ],
- ),
- ),
- Expanded(
- child: entries.isEmpty
- ? Center(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- noneOpen
- ? 'No open tasks of yours'
- : _mine
- ? 'No tasks you asked for'
- : 'No tasks',
- style: DesktopChrome.control(
- color: DesktopChrome.muted,
- ),
+ const SizedBox(height: grid.AppDesktop.groupGap),
+ Row(
+ children: [
+ Expanded(
+ child: KeyedSubtree(
+ key: const ValueKey('super-backlog-search'),
+ child: SwarmSearchField(
+ hintText: 'Search by title, number or agent',
+ onChanged: (value) => setState(() => _query = value),
),
- if (noneOpen && matching.isNotEmpty)
+ ),
+ ),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ // Mine or Everyone, one choice in one frame (the mockup).
+ Container(
+ padding: const EdgeInsets.all(grid.AppDesktop.badgeInset),
+ decoration: BoxDecoration(
+ color: grid.AppSurface.wellFill,
+ border: Border.all(color: grid.AppPalette.divider),
+ borderRadius: BorderRadius.circular(
+ DesktopChrome.controlRadius,
+ ),
+ ),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
DesktopPill(
- key: const ValueKey('super-backlog-mine-shipped'),
- label:
- 'Your shipped tasks from the last 7 days · '
- '${matching.length}',
- quiet: true,
- compact: true,
- onPressed: () => setState(
- () => _group = SuperTabBacklogGroup.shipped,
- ),
+ key: const ValueKey('super-backlog-mine'),
+ label: 'Mine',
+ selected: _mine,
+ capsule: false,
+ quiet: !_mine,
+ tooltip: 'Only the tasks you asked for',
+ onPressed: () => _setMine(true),
+ ),
+ const SizedBox(width: grid.AppDesktop.listRowGap),
+ DesktopPill(
+ key: const ValueKey('super-backlog-everyone'),
+ label: 'Everyone',
+ selected: !_mine,
+ capsule: false,
+ quiet: _mine,
+ onPressed: () => _setMine(false),
),
+ ],
+ ),
+ ),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ AppSelectField<String?>(
+ key: const ValueKey('super-backlog-project'),
+ semanticLabel: 'Project',
+ width: AppSelectField.fitWidth(
+ context,
+ labels: [
+ 'All projects',
+ for (final p in projects) p.name,
+ ],
+ ),
+ value: _project,
+ options: [
+ const SelectOption(value: null, label: 'All projects'),
+ for (final project in projects)
+ SelectOption(value: project.id, label: project.name),
],
+ onChanged: (value) => setState(() => _project = value),
),
- )
- : LaidOutListView.builder(
- padding: const EdgeInsets.symmetric(
- horizontal: grid.AppDesktop.groupGap,
+ ],
+ ),
+ if (c.closedShippedFailed)
+ Padding(
+ padding: const EdgeInsets.only(
+ top: grid.AppDesktop.controlGap,
+ ),
+ child: Row(
+ children: [
+ Text(
+ 'Some shipped tasks could not be read.',
+ style: muted,
+ ),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ DesktopPill(
+ key: const ValueKey('super-backlog-shipped-retry'),
+ label: 'Try again',
+ quiet: true,
+ compact: true,
+ onPressed: _readClosed,
+ ),
+ ],
),
- itemCount: entries.length,
- itemBuilder: (context, i) => switch (entries[i]) {
- (final SuperTabBacklogGroup group, final int count) =>
- _Heading(group: group, count: count),
- final SuperTabConversation task => _Row(
- task: task,
- controller: c,
- facts: widget.facts,
- now: now,
- onOpen: () => _open(task),
- ),
- _ => const SizedBox.shrink(),
- },
),
+ Expanded(
+ child: entries.isEmpty
+ ? Center(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ noneOpen
+ ? 'No open tasks of yours'
+ : query.isNotEmpty
+ ? 'No tasks match “${_query.trim()}”'
+ : _mine
+ ? 'No tasks you asked for'
+ : 'No tasks',
+ style: DesktopChrome.control(
+ color: DesktopChrome.muted,
+ ),
+ ),
+ if (noneOpen && matching.isNotEmpty)
+ DesktopPill(
+ key: const ValueKey(
+ 'super-backlog-mine-shipped',
+ ),
+ label:
+ 'Your shipped tasks from the last 7 days · '
+ '${matching.length}',
+ quiet: true,
+ compact: true,
+ onPressed: () =>
+ setState(() => _mineShipped = true),
+ ),
+ ],
+ ),
+ )
+ : LaidOutListView.builder(
+ padding: const EdgeInsets.only(
+ bottom: grid.AppDesktop.groupGap,
+ ),
+ itemCount: entries.length,
+ itemBuilder: (context, i) => switch (entries[i]) {
+ final _Heading heading => _HeadingRow(
+ heading: heading,
+ onToggle: () => setState(() {
+ if (!_folded.remove(heading.group)) {
+ _folded.add(heading.group);
+ }
+ }),
+ ),
+ final _Place place => _Row(
+ place: place,
+ controller: c,
+ facts: widget.facts,
+ now: now,
+ onOpen: () => _open(place.task),
+ ),
+ final _More more => _MoreRow(
+ count: more.count,
+ onPressed: () => setState(() => _allShipped = true),
+ ),
+ _ => const SizedBox.shrink(),
+ },
+ ),
+ ),
+ ],
+ ),
),
- ],
+ ),
);
}
}
+String _syncedText(Duration age) => age.inSeconds < 60
+ ? 'Synced just now'
+ : 'Synced ${superTabAgoShort(age)} ago';
+
/// The task's pull request the row shows: the newest one it names.
String? _pullRequest(SuperTabConversation task) =>
task.cards.pullRequests.lastOrNull?.url ?? task.pullRequestUrls.lastOrNull;
-class _Heading extends StatelessWidget {
- const _Heading({required this.group, required this.count});
+/// A group's heading in the list.
+class _Heading {
+ const _Heading({
+ required this.group,
+ required this.count,
+ required this.folded,
+ });
+ final SuperTabBacklogGroup group;
+ final int count;
+ final bool folded;
+}
+
+/// A task's place in its group's card: the first and last round its corners.
+class _Place {
+ const _Place({
+ required this.task,
+ required this.group,
+ required this.first,
+ required this.last,
+ });
+ final SuperTabConversation task;
final SuperTabBacklogGroup group;
+ final bool first, last;
+}
+
+/// Shipped's foot: how many more it holds.
+class _More {
+ const _More(this.count);
final int count;
+}
+
+/// The small round mark of a group's color.
+class _Dot extends StatelessWidget {
+ const _Dot(this.color);
+ final Color color;
@override
- Widget build(BuildContext context) => Padding(
- key: ValueKey('super-backlog-group-${group.name}'),
- padding: const EdgeInsets.only(
- top: grid.AppDesktop.groupGap,
- bottom: grid.AppDesktop.menuInset,
- ),
- child: Text(
- '${group.label} · $count',
- style: DesktopChrome.control(medium: true),
+ Widget build(BuildContext context) => Container(
+ width: grid.AppDesktop.controlGap,
+ height: grid.AppDesktop.controlGap,
+ decoration: BoxDecoration(color: color, shape: BoxShape.circle),
+ );
+}
+
+/// The label a summary card and a heading share: the group's name in capitals.
+TextStyle _label({Color? color}) =>
+ DesktopChrome.metadata(color: color ?? DesktopChrome.muted)
+ .copyWith(fontWeight: FontWeight.w600, letterSpacing: .6);
+
+BoxDecoration _card({bool top = true, bool bottom = true}) => BoxDecoration(
+ color: grid.AppPalette.cardBg,
+ border: Border.all(color: grid.AppPalette.divider),
+ borderRadius: BorderRadius.vertical(
+ top: top ? const Radius.circular(DesktopChrome.rowRadius) : Radius.zero,
+ bottom: bottom
+ ? const Radius.circular(DesktopChrome.rowRadius)
+ : Radius.zero,
+ ),
+);
+
+/// One of the counts at the top: Working, In review or Shipped.
+class _Summary extends StatelessWidget {
+ const _Summary({required this.group, required this.count});
+ final SuperTabBacklogGroup group;
+ final int count;
+
+ @override
+ Widget build(BuildContext context) => Container(
+ key: ValueKey('super-backlog-summary-${group.name}'),
+ decoration: _card(),
+ padding: const EdgeInsets.all(grid.AppDesktop.groupGap),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ _Dot(_tone(group)),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ Text(group.label.toUpperCase(), style: _label()),
+ ],
+ ),
+ const SizedBox(height: grid.AppDesktop.menuInset),
+ Text(
+ '$count',
+ key: ValueKey('super-backlog-summary-${group.name}-count'),
+ style: DesktopChrome.text(size: 28, medium: true, height: 1.1),
+ ),
+ ],
),
);
}
-/// One task: its number and title, project and who asked; then its agent and
-/// machine, its pull request and checks, and what it waits on; how long since
-/// it last changed at the right.
+/// A group's heading: its fold, mark, name and count, and what it means.
+class _HeadingRow extends StatelessWidget {
+ const _HeadingRow({required this.heading, required this.onToggle});
+ final _Heading heading;
+ final VoidCallback onToggle;
+
+ @override
+ Widget build(BuildContext context) {
+ final group = heading.group;
+ return Padding(
+ padding: const EdgeInsets.only(
+ top: grid.AppDesktop.groupGap + grid.AppDesktop.controlGap,
+ bottom: grid.AppDesktop.controlGap,
+ ),
+ child: Semantics(
+ button: true,
+ expanded: !heading.folded,
+ child: InkWell(
+ key: ValueKey('super-backlog-group-${group.name}'),
+ onTap: onToggle,
+ borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),
+ child: Row(
+ children: [
+ Icon(
+ heading.folded ? AppIcons.chevronRight : AppIcons.chevronDown,
+ size: grid.AppDesktop.iconSize,
+ color: DesktopChrome.muted,
+ ),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ _Dot(_tone(group)),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ Text(
+ group.label.toUpperCase(),
+ style: _label(color: DesktopChrome.foreground),
+ ),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ _Chip(text: '${heading.count}'),
+ const SizedBox(width: grid.AppDesktop.controlGap),
+ Expanded(
+ child: Text(
+ _meaning(group),
+ textAlign: TextAlign.end,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: DesktopChrome.metadata(color: DesktopChrome.muted),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
+
+/// A small rounded label: a count, a project, a badge or a pull request.
+class _Chip extends StatelessWidget {
+ const _Chip({
+ required this.text,
+ this.color,
+ this.fill,
+ this.outlined = false,
+ this.leading,
+ this.bold = false,
+ });
+ final String text;
+ final Color? color, fill;
+ final bool outlined, bold;
+ final Widget? leading;
+
+ @override
+ Widget build(BuildContext context) {
+ final ink = color ?? DesktopChrome.muted;
+ return Container(
+ padding: const EdgeInsets.symmetric(
+ horizontal: grid.AppDesktop.menuInset,
+ vertical: grid.AppDesktop.listRowGap,
+ ),
+ decoration: BoxDecoration(
+ color: fill ?? (outlined ? null : grid.AppSurface.wellFill),
+ border: outlined ? Border.all(color: grid.AppPalette.divider) : null,
+ borderRadius: BorderRadius.circular(DesktopChrome.controlRadius),
+ ),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ if (leading case final leading?) ...[
+ leading,
+ const SizedBox(width: grid.AppDesktop.badgeInset),
+ ],
+ Text(
+ text,
+ style: DesktopChrome.metadata(color: ink).copyWith(
+ fontWeight: bold ? FontWeight.w600 : null,
+ letterSpacing: bold ? .6 : null,
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+}
+
+/// A tinted chip: [color] ink on a wash of it.
+_Chip _tinted(String text, Color color, {Widget? leading, bool bold = false}) =>
+ _Chip(
+ text: text,
+ color: color,
+ fill: color.withValues(alpha: .14),
+ leading: leading,
+ bold: bold,
+ );
+
+/// One task as a card row (Scholes's mockup): its group's mark; its number,
+/// priority and title; then agent, machine, state and project; at the right
+/// how long since it changed, its pull request with its checks or merge, and
+/// an approval.
class _Row extends StatelessWidget {
const _Row({
- required this.task,
+ required this.place,
required this.controller,
required this.facts,
required this.now,
required this.onOpen,
});
- final SuperTabConversation task;
+ final _Place place;
final SuperTabController controller;
final SuperTabPullRequestFacts? facts;
final DateTime now;
final VoidCallback onOpen;
+ SuperTabConversation get task => place.task;
+
String? _personName(String id) => controller.snapshot?.people
.where((p) => p.id == id)
.firstOrNull
?.shownName;
- String get _pullRequestText {
+ /// The pull request chip: its number, then merged, its checks, or its
+ /// state; colored as GitHub colors it.
+ Widget? _pullRequestChip() {
final url = _pullRequest(task);
- if (url == null) return '';
+ if (url == null) return null;
final number = Uri.parse(url).pathSegments.elementAtOrNull(3) ?? '';
final merged =
task.cards.pullRequests.firstWhereOrNull((p) => p.url == url)?.merged ==
true;
final entry = facts?.of(url);
- final checks = merged
- ? 'merged'
+ final (state, words) = merged
+ ? ('Merged', 'merged')
: entry == null
- ? ''
+ ? ('', '')
: entry.finalState
- ? entry.state.toLowerCase()
- : entry.total > 0
- ? entry.checksLabel
- : '';
- return ['PR #$number', if (checks.isNotEmpty) checks].join(' ');
+ ? (entry.state, entry.state.toLowerCase())
+ : (entry.state, entry.total > 0 ? entry.checksLabel : '');
+ final color = switch (state) {
+ 'Merged' => _merged,
+ _ when entry != null && entry.failed > 0 => grid.AppPalette.usageCritical,
+ _ when entry != null && entry.total > 0 && entry.pending == 0 =>
+ grid.AppPalette.online,
+ _ => DesktopChrome.muted,
+ };
+ return KeyedSubtree(
+ key: ValueKey('super-backlog-pr-${task.id}'),
+ child: _tinted(
+ ['PR $number', if (words.isNotEmpty) words].join(' · '),
+ color,
+ leading: SvgPicture.asset(
+ pullRequestIconAsset(state.isEmpty ? 'Open' : state),
+ width: grid.AppControl.iconSizeChip,
+ height: grid.AppControl.iconSizeChip,
+ colorFilter: ColorFilter.mode(color, BlendMode.srcIn),
+ ),
+ ),
+ );
}
@override
@@ -350,78 +731,156 @@ class _Row extends StatelessWidget {
final snapshot = controller.snapshot!;
final assignment = task.assignment;
final agentId = assignment?['agentId'];
- final agent = agentId is String ? snapshot.agent(agentId) : null;
final execution = assignment?['execution'];
+ final agent = agentId is String ? snapshot.agent(agentId) : null;
final machineId = execution is Map && execution['machineId'] is String
? execution['machineId'] as String
: agent?.machineId;
final status = superTabTaskStatus(task, now, personName: _personName);
- final second = [
+ final details = [
if (agentId is! String)
'No agent yet'
else ...[
snapshot.agentName(agentId, fallback: 'Agent unavailable'),
if (machineId != null) ?controller.sessionMachineName(machineId),
],
- if (_pullRequestText case final pr when pr.isNotEmpty) pr,
if (status != null) status.reason,
].join(' · ');
- final first = [
- snapshot.projectById(task.projectId)?.name,
- if (task.requesterId case final id?) _personName(id),
- ].nonNulls.join(' · ');
- // One read for the list alone is not held: when it shipped stands in.
- final changed = controller.groupChangedAt(task.id) ?? task.shippedAt;
+ final project = snapshot.projectById(task.projectId)?.name;
+ final (:priority, :title) = superTabTitlePriority(task.title);
+ final url = _pullRequest(task);
+ final approved = url != null && facts?.of(url)?.review == 'APPROVED';
+ final pullRequest = _pullRequestChip();
+ // Shipped reads how long since it shipped, as the mockup does; the rest
+ // since it last changed. One read for the list alone is not held: when
+ // it shipped stands in.
+ final changed = place.group == SuperTabBacklogGroup.shipped
+ ? task.shippedAt ?? controller.groupChangedAt(task.id)
+ : controller.groupChangedAt(task.id) ?? task.shippedAt;
final muted = DesktopChrome.metadata(color: DesktopChrome.muted);
- return InkWell(
- key: ValueKey('super-backlog-row-${task.id}'),
- onTap: onOpen,
- hoverColor: grid.AppSurface.hoverFill,
- borderRadius: BorderRadius.circular(DesktopChrome.rowRadius),
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: grid.AppDesktop.controlGap,
- vertical: grid.AppDesktop.menuInset,
+ final group = place.group;
+ final radius = BorderRadius.vertical(
+ top: place.first
+ ? const Radius.circular(DesktopChrome.rowRadius)
+ : Radius.zero,
+ bottom: place.last
+ ? const Radius.circular(DesktopChrome.rowRadius)
+ : Radius.zero,
+ );
+ return Container(
+ decoration: BoxDecoration(
+ color: grid.AppPalette.cardBg,
+ borderRadius: radius,
+ border: Border(
+ left: BorderSide(color: grid.AppPalette.divider),
+ right: BorderSide(color: grid.AppPalette.divider),
+ top: BorderSide(color: grid.AppPalette.divider),
+ bottom: place.last
+ ? BorderSide(color: grid.AppPalette.divider)
+ : BorderSide.none,
),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
+ ),
+ child: Material(
+ type: MaterialType.transparency,
+ child: InkWell(
+ key: ValueKey('super-backlog-row-${task.id}'),
+ onTap: onOpen,
+ hoverColor: grid.AppSurface.hoverFill,
+ borderRadius: radius,
+ child: Padding(
+ padding: const EdgeInsets.all(grid.AppDesktop.groupGap),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Icon(
+ _icon(group),
+ size: grid.AppDesktop.iconSize + grid.AppDesktop.listRowGap,
+ color: _tone(group),
+ ),
+ const SizedBox(width: grid.AppDesktop.groupGap),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Flexible(
- child: Text(
- task.label,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: DesktopChrome.control(),
- ),
+ Wrap(
+ spacing: grid.AppDesktop.controlGap,
+ runSpacing: grid.AppDesktop.listRowGap,
+ crossAxisAlignment: WrapCrossAlignment.center,
+ children: [
+ if (task.number case final number?)
+ Text('#$number', style: muted),
+ if (priority != null)
+ _tinted(
+ priority.badge,
+ priority == SuperTabTaskPriority.urgent
+ ? grid.AppPalette.usageCritical
+ : grid.AppPalette.warn,
+ bold: true,
+ ),
+ Text(
+ title,
+ style: DesktopChrome.control(medium: true),
+ ),
+ ],
+ ),
+ const SizedBox(height: grid.AppDesktop.menuInset),
+ Wrap(
+ spacing: grid.AppDesktop.controlGap,
+ runSpacing: grid.AppDesktop.listRowGap,
+ crossAxisAlignment: WrapCrossAlignment.center,
+ children: [
+ Text(details, style: muted),
+ if (project != null)
+ _Chip(text: project, outlined: true),
+ if (approved)
+ _tinted('Approved', grid.AppPalette.online),
+ ],
),
- if (first.isNotEmpty) ...[
- const SizedBox(width: grid.AppDesktop.controlGap),
- Text(first, maxLines: 1, style: muted),
- ],
],
),
- Text(
- second,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: muted,
- ),
- ],
- ),
+ ),
+ const SizedBox(width: grid.AppDesktop.groupGap),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ if (changed != null)
+ Text(
+ superTabAgoShort(now.difference(changed)),
+ style: muted,
+ ),
+ if (pullRequest != null) ...[
+ const SizedBox(height: grid.AppDesktop.menuInset),
+ pullRequest,
+ ],
+ ],
+ ),
+ ],
),
- if (changed != null) ...[
- const SizedBox(width: grid.AppDesktop.controlGap),
- Text(superTabAgoShort(now.difference(changed)), style: muted),
- ],
- ],
+ ),
),
),
);
}
}
+
+/// Shipped's foot: "Show N more shipped", closing its card.
+class _MoreRow extends StatelessWidget {
+ const _MoreRow({required this.count, required this.onPressed});
+ final int count;
+ final VoidCallback onPressed;
+
+ @override
+ Widget build(BuildContext context) => Container(
+ decoration: _card(top: false),
+ padding: const EdgeInsets.all(grid.AppDesktop.controlGap),
+ alignment: Alignment.center,
+ child: TextButton(
+ key: const ValueKey('super-backlog-shipped-more'),
+ onPressed: onPressed,
+ child: Text(
+ 'Show $count more shipped',
+ style: DesktopChrome.control(color: DesktopChrome.accent),
+ ),
+ ),
+ );
+}
diff --git a/desktop/lib/super_tabs/composer_actions.dart b/desktop/lib/super_tabs/composer_actions.dart
index 3872ebb63..f12ab0f03 100644
--- a/desktop/lib/super_tabs/composer_actions.dart
+++ b/desktop/lib/super_tabs/composer_actions.dart
@@ -1,8 +1,39 @@
+import 'dart:math' as math;
+
import 'package:flutter/material.dart';
import '../shared/theme/app_icons.dart';
+import '../shared/theme/app_theme.dart' as grid;
import '../shared/widgets/app_icon_button.dart';
+/// How far a composer's row of [target]-square buttons sits in from the box's
+/// sides, and up from its bottom, so the glyphs of + and send keep the text's
+/// edges and the arrow sits as far up as the text sits down (Huy, 11-04). A
+/// phone's finger targets take what they need.
+EdgeInsets composerRowInsets({required double target}) {
+ final glyph = (target - AppIcons.inlineSize) / 2;
+ final side = math.max(0.0, grid.AppDesktop.composerSide - glyph);
+ return EdgeInsets.fromLTRB(
+ side,
+ 0,
+ side,
+ math.max(0.0, grid.AppDesktop.composerTop - glyph),
+ );
+}
+
+/// The text's insets in a composer's box, above [composerRowInsets]' row of
+/// [target]-square buttons: the same air between the text and the glyphs as
+/// over Desktop's 32pt targets, so a phone's taller ones add none.
+EdgeInsets composerFieldInsets({required double target}) => EdgeInsets.fromLTRB(
+ grid.AppDesktop.composerSide,
+ grid.AppDesktop.composerTop,
+ grid.AppDesktop.composerSide,
+ math.max(
+ 0.0,
+ grid.AppDesktop.composerRowGap - (target - grid.AppControl.height) / 2,
+ ),
+);
+
/// @ Tag on a composer's row, as on the phone: it types `@` at the caret
/// ([superTabTagPrompt]), and the tag list opens as for one typed.
class SuperTabComposerTagButton extends StatelessWidget {
diff --git a/desktop/lib/super_tabs/composer_files.dart b/desktop/lib/super_tabs/composer_files.dart
index 54189308e..cc985d6a6 100644
--- a/desktop/lib/super_tabs/composer_files.dart
+++ b/desktop/lib/super_tabs/composer_files.dart
@@ -23,9 +23,12 @@ class SuperTabComposerChips extends StatelessWidget {
builder: (context, _) => files.isEmpty
? const SizedBox.shrink()
: Padding(
- padding: const EdgeInsets.only(
- bottom: grid.AppDesktop.controlGap,
- right: grid.AppDesktop.controlGap,
+ // The text's edges; the field keeps its own air below them.
+ padding: const EdgeInsets.fromLTRB(
+ grid.AppDesktop.composerSide,
+ grid.AppDesktop.composerTop,
+ grid.AppDesktop.composerSide,
+ 0,
),
child: NewHarnessAttachmentChips(
attachments: files,
diff --git a/desktop/lib/super_tabs/controller.dart b/desktop/lib/super_tabs/controller.dart
index ef251b74b..5c225489b 100644
--- a/desktop/lib/super_tabs/controller.dart
+++ b/desktop/lib/super_tabs/controller.dart
@@ -723,6 +723,9 @@ class SuperTabController extends ChangeNotifier {
/// When the parts held were last read: how old a [savedView] of them is.
DateTime? _partsReadAt;
+ /// When the Swarm was last read (Manage ▸ Backlog's "Synced", #2774).
+ DateTime? get syncedAt => _partsReadAt;
+
/// The rows each conversation's messages were read from, kept only to save
/// the view ([SuperTabReading.drawsSaved]).
final _rows = <String, Map<String, Map<String, dynamic>>>{};
diff --git a/desktop/lib/super_tabs/reply_box.dart b/desktop/lib/super_tabs/reply_box.dart
index dcb9b8d1d..0f970f133 100644
--- a/desktop/lib/super_tabs/reply_box.dart
+++ b/desktop/lib/super_tabs/reply_box.dart
@@ -101,22 +101,17 @@ class SuperTabReplyBox extends StatelessWidget {
key: surfaceKey,
decoration: BoxDecoration(
color: DesktopChrome.field,
- borderRadius: BorderRadius.circular(DesktopChrome.controlRadius),
+ borderRadius: BorderRadius.circular(grid.AppDesktop.composerRadius),
border: Border.all(color: DesktopChrome.rim),
),
- child: Padding(
- padding: const EdgeInsets.fromLTRB(
- grid.AppDesktop.groupGap,
- grid.AppDesktop.controlGap,
- grid.AppDesktop.controlGap,
- grid.AppDesktop.controlGap,
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- SuperTabComposerChips(controller: controller, files: files),
- Focus(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ SuperTabComposerChips(controller: controller, files: files),
+ Padding(
+ padding: composerFieldInsets(target: grid.AppControl.height),
+ child: Focus(
onKeyEvent: (_, event) {
if (onKey?.call(event) case final handled?) return handled;
switch (composerEnter(
@@ -169,17 +164,24 @@ class SuperTabReplyBox extends StatelessWidget {
),
),
),
- if (error case final error?)
- Padding(
- padding: const EdgeInsets.only(top: grid.AppDesktop.controlGap),
- child: Text(
- error,
- key: const ValueKey('super-thread-error'),
- style: DesktopChrome.control(),
- ),
+ ),
+ if (error case final error?)
+ Padding(
+ padding: const EdgeInsets.fromLTRB(
+ grid.AppDesktop.composerSide,
+ 0,
+ grid.AppDesktop.composerSide,
+ grid.AppDesktop.controlGap,
+ ),
+ child: Text(
+ error,
+ key: const ValueKey('super-thread-error'),
+ style: DesktopChrome.control(),
),
- const SizedBox(height: grid.AppDesktop.controlGap),
- Row(
+ ),
+ Padding(
+ padding: composerRowInsets(target: grid.AppControl.height),
+ child: Row(
children: [
FocusTraversalOrder(
order: toolsOrder,
@@ -225,8 +227,8 @@ class SuperTabReplyBox extends StatelessWidget {
),
],
),
- ],
- ),
+ ),
+ ],
),
),
);
diff --git a/desktop/lib/super_tabs/thread_panel.dart b/desktop/lib/super_tabs/thread_panel.dart
index 1a2b01308..d581a9601 100644
--- a/desktop/lib/super_tabs/thread_panel.dart
+++ b/desktop/lib/super_tabs/thread_panel.dart
@@ -14,7 +14,7 @@ import 'composer_toggle.dart';
import 'day_pill.dart';
import 'reply_box.dart';
import 'controller.dart';
-import 'message_row.dart' show SuperTabMessageHighlight, SuperTabMessageRow;
+import 'message_row.dart' show SuperTabMessageRow;
import 'jump_to_latest.dart';
import 'model.dart';
import 'thread_scroll.dart';
@@ -94,87 +94,14 @@ class _SuperTabThreadPanelState extends State<SuperTabThreadPanel> {
SuperTabController get c => widget.controller;
- // The day pill's jump (Huy 11-04): the row it lands on, and the one lit.
- final _targetKey = GlobalKey();
- String? _target, _lit;
- Timer? _litTimer;
- int _jumps = 0;
-
/// [row] with its message's time, for the day pill over the list. Keyed
/// by the message, so the list keeps each row's place as replies arrive.
Widget _dated(SuperTabMessage message, Widget row) => SuperTabDayMark(
key: ValueKey('super-thread-day-${message.id}'),
time: message.createdAt,
- child: KeyedSubtree(
- key: message.id == _target ? _targetKey : null,
- child: SuperTabMessageHighlight(on: message.id == _lit, child: row),
- ),
+ child: row,
);
- /// The day pill's choice, as in the chat: the first of the root and its
- /// replies on or after [from], lit; the root for the very beginning (null),
- /// the newest reply for a time after everything said. Earlier replies are
- /// read until one from before [from] is held, at most 50 pages.
- Future<void> _jumpToTime(DateTime? from) async {
- final jump = ++_jumps;
- bool before(SuperTabMessage m) =>
- from == null || (m.createdAt?.isBefore(from) ?? false);
- List<SuperTabMessage> held() => c.threadMessages(widget.root);
- void say(String text) =>
- ScaffoldMessenger.maybeOf(context)
- ?.showSnackBar(SnackBar(content: Text(text)));
- // They read on from the row they land on, not the newest.
- _scroll.holdPlace();
- // The root is always held, at the top: the very beginning reads nothing.
- for (var page = 0; from != null; page++) {
- final reached = held().any((m) => m.id != widget.root && before(m));
- if (reached || !c.hasEarlierReplies(widget.root)) break;
- if (page == 50) {
- say('That day is too far back to open.');
- return;
- }
- // A read that fails keeps its error and its place: nothing came.
- final loaded = held().length;
- await c.loadThread(earlier: true);
- if (!mounted || jump != _jumps) return;
- if (held().length == loaded) {
- say('Couldn’t load earlier replies.');
- return;
- }
- }
- final messages = held();
- final target = from == null
- ? messages.firstOrNull
- : messages.where((m) => !before(m)).firstOrNull ?? messages.lastOrNull;
- if (target == null) return;
- _litTimer?.cancel();
- setState(() => _target = _lit = target.id);
- _litTimer = Timer(const Duration(seconds: 2), () {
- if (mounted) setState(() => _lit = null);
- });
- _reveal(jump, messages.indexOf(target) / messages.length, 0);
- }
-
- /// The list is lazy: jump near the target's place ([at], its share of the
- /// thread) until its row is built, then bring it into view.
- void _reveal(int jump, double at, int attempt) {
- WidgetsBinding.instance.addPostFrameCallback((_) {
- if (!mounted || jump != _jumps || !_scroll.hasClients) return;
- if (_targetKey.currentContext case final row?) {
- unawaited(Scrollable.ensureVisible(row, alignment: .3));
- return;
- }
- if (attempt > 20) return;
- final position = _scroll.position;
- _scroll.jumpTo(
- position.minScrollExtent +
- at * (position.maxScrollExtent - position.minScrollExtent),
- );
- _reveal(jump, at, attempt + 1);
- });
- WidgetsBinding.instance.scheduleFrame();
- }
-
/// The conversation this thread is in.
String get _conversationId => c.openedThread?.conversationId ?? c.selectedId;
@@ -208,7 +135,6 @@ class _SuperTabThreadPanelState extends State<SuperTabThreadPanel> {
@override
void dispose() {
- _litTimer?.cancel();
widget.onScroll?.call(null);
_scroll.dispose();
_composer.dispose();
@@ -479,7 +405,6 @@ class _SuperTabThreadPanelState extends State<SuperTabThreadPanel> {
children: [
SuperTabStickyDay(
pillKey: const ValueKey('super-thread-day-pill'),
- onJump: (from) => unawaited(_jumpToTime(from)),
// As in the chat, a message's text can be selected and
// copied.
child: SelectionArea(
diff --git a/desktop/lib/super_tabs/view.dart b/desktop/lib/super_tabs/view.dart
index c42850077..573cd5a78 100644
--- a/desktop/lib/super_tabs/view.dart
+++ b/desktop/lib/super_tabs/view.dart
@@ -1887,77 +1887,6 @@ class _SuperTabViewState extends State<SuperTabView>
return message;
}
- /// The date pill's choice (day_jump.dart): [id]'s first message on or
- /// after [from], lit, as a link opens one. The very beginning (null) is
- /// its first message, and a time after everything said is its newest.
- /// Older pages are read until one from before [from] is held, at most 50
- /// as a link reads; past them it says so, and the list stays.
- Future<void> _jumpToTime(String id, DateTime? from) async {
- void say(String text) =>
- ScaffoldMessenger.maybeOf(context)
- ?.showSnackBar(SnackBar(content: Text(text)));
- final request = ++_jumpRequest;
- bool current() =>
- mounted &&
- request == _jumpRequest &&
- c.selectedId == id &&
- !c.accessRevoked;
- bool before(SuperTabMessage m) =>
- from != null && (m.createdAt?.isBefore(from) ?? false);
- try {
- if (from == null) {
- await c.loadBackTo(id, 0);
- } else {
- // A copy read back to an early page holds nothing from then on: the
- // latest first, then back from there.
- final newest = _shownMessages(id).lastOrNull;
- if (c.hasNewer(id) && (newest == null || before(newest))) {
- await c.showLatest(id);
- }
- for (var page = 0; !_shownMessages(id).any(before); page++) {
- if (!current() || !c.hasOlder(id)) break;
- if (page == 50) {
- say('That day is too far back to open.');
- return;
- }
- // A read that fails keeps its error and its place: nothing came.
- final loaded = c.messages(id).length;
- await c.loadMessages(id, older: true);
- if (current() && c.messages(id).length == loaded) {
- say('Couldn’t load earlier messages.');
- return;
- }
- }
- }
- } catch (_) {
- if (current()) say('Messages could not be read.');
- return;
- }
- if (!current()) return;
- final shown = _shownMessages(id);
- final target = from == null
- ? shown.firstOrNull
- : shown.where((m) => !before(m)).firstOrNull ?? shown.lastOrNull;
- if (target == null) return;
- final row = _rowShowing(id, target.id) ?? target.id;
- setState(() {
- _target = row;
- // Stop following the end: that day's message is what to see.
- _scrollRequest++;
- _jumpingToEnd = false;
- _follow(id, false);
- });
- _revealTarget(
- id,
- 0,
- arrived: (at) {
- unawaited(Scrollable.ensureVisible(at, alignment: .3));
- _light(row);
- },
- );
- _focus.requestFocus();
- }
-
/// What the reader asked to open by a message link ([SuperTabController.openMessageLink]).
void _takeMessageRequest() {
final request = c.messageRequest;
@@ -2712,20 +2641,28 @@ class _SuperTabViewState extends State<SuperTabView>
// up): the actions take the row's end. A narrow phone with so little
// height gets the squeezed row, which beats a composer that overflows; it
// has no room for @ Tag there, and an @ typed still opens the list.
+ final target = _phone ? kFingerTarget : grid.AppControl.height;
+ final row = composerRowInsets(target: target);
if (_phone && room < _phoneComposerTwoRowsFrom) {
- return ConstrainedBox(
- constraints: BoxConstraints(
- minHeight: grid.AppControl.heightFieldScaled,
+ return Padding(
+ padding: EdgeInsets.only(
+ left: grid.AppDesktop.composerSide,
+ right: row.right,
),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Expanded(child: field),
- attach,
- ...options,
- ...trailing,
- send,
- ],
+ child: ConstrainedBox(
+ constraints: BoxConstraints(
+ minHeight: grid.AppControl.heightFieldScaled,
+ ),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Expanded(child: field),
+ attach,
+ ...options,
+ ...trailing,
+ send,
+ ],
+ ),
),
);
}
@@ -2734,26 +2671,26 @@ class _SuperTabViewState extends State<SuperTabView>
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
- padding: const EdgeInsets.only(
- right: grid.AppDesktop.controlGap,
- bottom: grid.AppDesktop.controlGap,
- ),
+ padding: composerFieldInsets(target: target),
child: field,
),
- Row(
- key: const ValueKey('super-message-composer-actions'),
- children: [
- attach,
- tag,
- Expanded(
- child: Wrap(
- crossAxisAlignment: WrapCrossAlignment.center,
- children: options,
+ Padding(
+ padding: row,
+ child: Row(
+ key: const ValueKey('super-message-composer-actions'),
+ children: [
+ attach,
+ tag,
+ Expanded(
+ child: Wrap(
+ crossAxisAlignment: WrapCrossAlignment.center,
+ children: options,
+ ),
),
- ),
- ...trailing,
- send,
- ],
+ ...trailing,
+ send,
+ ],
+ ),
),
],
);
@@ -4263,8 +4200,6 @@ class _SuperTabViewState extends State<SuperTabView>
SuperTabStickyDay(
pillKey: const ValueKey('super-day-pill'),
hidden: finding != null,
- onJump: (from) =>
- unawaited(_jumpToTime(c.selectedId, from)),
child: NotificationListener<ScrollNotification>(
onNotification: (event) {
if (event.depth != 0) return false;
@@ -4665,7 +4600,7 @@ class _SuperTabViewState extends State<SuperTabView>
decoration: BoxDecoration(
color: DesktopChrome.field,
borderRadius: BorderRadius.circular(
- DesktopChrome.controlRadius,
+ grid.AppDesktop.composerRadius,
),
border: Border.all(color: DesktopChrome.rim),
),
@@ -4680,147 +4615,141 @@ class _SuperTabViewState extends State<SuperTabView>
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: writable ? _focus.requestFocus : null,
- child: Padding(
- padding: const EdgeInsets.fromLTRB(12, 3, 4, 3),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- SuperTabComposerChips(controller: c, files: _files),
- ViewRoom(
- builder: (context, room) => _composerLayout(
- room: room,
- field: NewHarnessPasteTarget(
- key: _composerFieldKey,
- attachments: _files,
- enabled: writable && !busy,
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ SuperTabComposerChips(controller: c, files: _files),
+ ViewRoom(
+ builder: (context, room) => _composerLayout(
+ room: room,
+ field: NewHarnessPasteTarget(
+ key: _composerFieldKey,
+ attachments: _files,
+ enabled: writable && !busy,
+ focusNode: _focus,
+ child: TextField(
+ key: const ValueKey('super-message-composer'),
+ controller: _composer,
focusNode: _focus,
- child: TextField(
- key: const ValueKey('super-message-composer'),
- controller: _composer,
- focusNode: _focus,
- autofocus: !_terminalsVisible,
- enabled: writable,
- minLines: 1,
- // A phone's keyboard takes the height, so
- // its height says nothing about the room
- // a draft should have (Huy, 2026-11-02).
- maxLines: _phone
- ? _phoneComposerLines(room)
- : MediaQuery.sizeOf(context).height < 600
- ? 3
- : 8,
- maxLength: kComposerMaxLength,
- inputFormatters: [_tagBackspace],
- keyboardType: TextInputType.multiline,
- textAlignVertical: TextAlignVertical.center,
- style: SwarmType.composer(context),
- decoration: InputDecoration(
- // The row centers the line. Inheriting a decorated
- // field's minimum height leaves slack below its text.
- isCollapsed: true,
- constraints: const BoxConstraints(),
- visualDensity: VisualDensity.standard,
- hintStyle: SwarmType.composer(
- context,
- color: DesktopChrome.hint,
- ),
- contentPadding: EdgeInsets.zero,
- hintMaxLines: _phone ? 1 : null,
- hintText: _readsFirst && c.snapshot == null
- ? null
- : group == null
- ? 'Loading conversation…'
- : c.canWrite
- ? _messageHint(group)
- : 'Read-only conversation',
- border: InputBorder.none,
- enabledBorder: InputBorder.none,
- focusedBorder: InputBorder.none,
- disabledBorder: InputBorder.none,
- filled: false,
- counterText: '',
+ autofocus: !_terminalsVisible,
+ enabled: writable,
+ minLines: 1,
+ // A phone's keyboard takes the height, so
+ // its height says nothing about the room
+ // a draft should have (Huy, 2026-11-02).
+ maxLines: _phone
+ ? _phoneComposerLines(room)
+ : MediaQuery.sizeOf(context).height < 600
+ ? 3
+ : 8,
+ maxLength: kComposerMaxLength,
+ inputFormatters: [_tagBackspace],
+ keyboardType: TextInputType.multiline,
+ textAlignVertical: TextAlignVertical.center,
+ style: SwarmType.composer(context),
+ decoration: InputDecoration(
+ // The row centers the line. Inheriting a decorated
+ // field's minimum height leaves slack below its text.
+ isCollapsed: true,
+ constraints: const BoxConstraints(),
+ visualDensity: VisualDensity.standard,
+ hintStyle: SwarmType.composer(
+ context,
+ color: DesktopChrome.hint,
),
- onChanged: _composerEdited,
+ contentPadding: EdgeInsets.zero,
+ hintMaxLines: _phone ? 1 : null,
+ hintText: _readsFirst && c.snapshot == null
+ ? null
+ : group == null
+ ? 'Loading conversation…'
+ : c.canWrite
+ ? _messageHint(group)
+ : 'Read-only conversation',
+ border: InputBorder.none,
+ enabledBorder: InputBorder.none,
+ focusedBorder: InputBorder.none,
+ disabledBorder: InputBorder.none,
+ filled: false,
+ counterText: '',
),
+ onChanged: _composerEdited,
),
- attach: fingerTarget(
- enabled: _phone,
- NewHarnessAttachButton(
- attachments: _files,
- enabled: writable && !busy,
- icon: AppIcons.plus,
- ),
+ ),
+ attach: fingerTarget(
+ enabled: _phone,
+ NewHarnessAttachButton(
+ attachments: _files,
+ enabled: writable && !busy,
+ icon: AppIcons.plus,
),
- tag: fingerTarget(
- enabled: _phone,
- SuperTabComposerTagButton(
- key: const ValueKey('super-composer-tag'),
- onPressed: writable ? _promptTag : null,
- ),
+ ),
+ tag: fingerTarget(
+ enabled: _phone,
+ SuperTabComposerTagButton(
+ key: const ValueKey('super-composer-tag'),
+ onPressed: writable ? _promptTag : null,
),
- options: [
- if (c.offersChatSessions)
- Padding(
- padding: const EdgeInsets.only(
- left: grid.AppDesktop.controlGap,
- ),
- child: _chatSessionChoice(writable),
- ),
- if (c.offersChatSessions &&
- c.selected?.isSwarmBuddyChat == true &&
- _chatSessions.contains(c.selectedId))
- Padding(
- padding: const EdgeInsets.only(
- left: grid.AppDesktop.controlGap,
- ),
- child: _chatSessionProject(writable),
+ ),
+ options: [
+ if (c.offersChatSessions)
+ Padding(
+ padding: const EdgeInsets.only(
+ left: grid.AppDesktop.controlGap,
),
- ],
- trailing: [
- if (widget.voiceRecorder case final recorder?)
- fingerTarget(
- enabled: _phone,
- SuperTabComposerMic(
- key: const ValueKey('super-composer-mic'),
- onPressed: writable
- ? () => unawaited(
- recorder.start(
- conversationId: chatId,
- ),
- )
- : null,
- ),
+ child: _chatSessionChoice(writable),
+ ),
+ if (c.offersChatSessions &&
+ c.selected?.isSwarmBuddyChat == true &&
+ _chatSessions.contains(c.selectedId))
+ Padding(
+ padding: const EdgeInsets.only(
+ left: grid.AppDesktop.controlGap,
),
- ],
- send: ListenableBuilder(
- listenable: Listenable.merge([
- _composer,
- _files,
- ]),
- builder: (context, _) => fingerTarget(
+ child: _chatSessionProject(writable),
+ ),
+ ],
+ trailing: [
+ if (widget.voiceRecorder case final recorder?)
+ fingerTarget(
enabled: _phone,
- AppIconButton(
- icon: AppIcons.arrowUp,
- tooltip: 'Send message',
- color: DesktopChrome.accent,
- onPressed:
- writable &&
- !c.uploading &&
- ((!busy && !c.hasPendingAction) ||
- (_files.isEmpty &&
- c.canQueueText)) &&
- (_composer.text.trim().isNotEmpty ||
- !_files.isEmpty)
- ? () => unawaited(_send())
+ SuperTabComposerMic(
+ key: const ValueKey('super-composer-mic'),
+ onPressed: writable
+ ? () => unawaited(
+ recorder.start(
+ conversationId: chatId,
+ ),
+ )
: null,
),
),
+ ],
+ send: ListenableBuilder(
+ listenable: Listenable.merge([_composer, _files]),
+ builder: (context, _) => fingerTarget(
+ enabled: _phone,
+ AppIconButton(
+ icon: AppIcons.arrowUp,
+ tooltip: 'Send message',
+ color: DesktopChrome.accent,
+ onPressed:
+ writable &&
+ !c.uploading &&
+ ((!busy && !c.hasPendingAction) ||
+ (_files.isEmpty &&
+ c.canQueueText)) &&
+ (_composer.text.trim().isNotEmpty ||
+ !_files.isEmpty)
+ ? () => unawaited(_send())
+ : null,
+ ),
),
),
),
- ],
- ),
+ ),
+ ],
),
),
),
diff --git a/desktop/pubspec.lock b/desktop/pubspec.lock
index 836ff91b2..b31c4f35d 100644
--- a/desktop/pubspec.lock
+++ b/desktop/pubspec.lock
@@ -821,13 +821,13 @@ packages:
source: hosted
version: "2.12.2"
video_player_avfoundation:
- dependency: transitive
+ dependency: "direct overridden"
description:
name: video_player_avfoundation
- sha256: "7d620d8c69d00c158a5c57bf3d2a051833b547631203ff724664fbf301024bc1"
+ sha256: "4f8a845173377ab250a50f9b9dfe4a43500cc76a7c49dd8410d02d8fc29dfd8b"
url: "https://pub.dev"
source: hosted
- version: "2.12.3"
+ version: "2.12.1"
video_player_platform_interface:
dependency: transitive
description:
@@ -965,4 +965,4 @@ packages:
version: "0.0.6"
sdks:
dart: ">=3.13.0 <4.0.0"
- flutter: ">=3.47.0"
+ flutter: ">=3.44.0"
diff --git a/desktop/pubspec.yaml b/desktop/pubspec.yaml
index 269cdf114..6df180808 100644
--- a/desktop/pubspec.yaml
+++ b/desktop/pubspec.yaml
@@ -137,6 +137,13 @@ dev_dependencies:
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
+dependency_overrides:
+ # 2.12.2 rewrote the macOS player in Swift against the macOS 26 SDK
+ # (`AVAsset.load(_:isolation:)`); the release runner's Xcode 16 cannot build
+ # it, which failed every Desktop build since #2887. 2.12.1 is the last
+ # Objective-C release. Lift this once release-desktop.yml builds on Xcode 26.
+ video_player_avfoundation: 2.12.1
+
flutter:
fonts:
- family: Roboto Mono
diff --git a/desktop/test/screenshots/composer-padding/after/composer-chat-dark.png b/desktop/test/screenshots/composer-padding/after/composer-chat-dark.png
new file mode 100644
index 000000000..45083a1ae
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/after/composer-chat-dark.png differ
diff --git a/desktop/test/screenshots/composer-padding/after/composer-chat-light.png b/desktop/test/screenshots/composer-padding/after/composer-chat-light.png
new file mode 100644
index 000000000..13fcd4e48
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/after/composer-chat-light.png differ
diff --git a/desktop/test/screenshots/composer-padding/after/composer-chat-mic-dark.png b/desktop/test/screenshots/composer-padding/after/composer-chat-mic-dark.png
new file mode 100644
index 000000000..a7f9d0c72
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/after/composer-chat-mic-dark.png differ
diff --git a/desktop/test/screenshots/composer-padding/after/composer-chat-mic-light.png b/desktop/test/screenshots/composer-padding/after/composer-chat-mic-light.png
new file mode 100644
index 000000000..cac9f98cb
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/after/composer-chat-mic-light.png differ
diff --git a/desktop/test/screenshots/composer-padding/after/composer-thread-dark.png b/desktop/test/screenshots/composer-padding/after/composer-thread-dark.png
new file mode 100644
index 000000000..29bfd34ce
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/after/composer-thread-dark.png differ
diff --git a/desktop/test/screenshots/composer-padding/after/composer-thread-light.png b/desktop/test/screenshots/composer-padding/after/composer-thread-light.png
new file mode 100644
index 000000000..3499de59b
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/after/composer-thread-light.png differ
diff --git a/desktop/test/screenshots/composer-padding/after/composer-web-phone-dark.png b/desktop/test/screenshots/composer-padding/after/composer-web-phone-dark.png
new file mode 100644
index 000000000..cd8ac92ae
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/after/composer-web-phone-dark.png differ
diff --git a/desktop/test/screenshots/composer-padding/after/composer-web-phone-light.png b/desktop/test/screenshots/composer-padding/after/composer-web-phone-light.png
new file mode 100644
index 000000000..192c94765
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/after/composer-web-phone-light.png differ
diff --git a/desktop/test/screenshots/composer-padding/before/composer-chat-dark.png b/desktop/test/screenshots/composer-padding/before/composer-chat-dark.png
new file mode 100644
index 000000000..36bbd1986
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/before/composer-chat-dark.png differ
diff --git a/desktop/test/screenshots/composer-padding/before/composer-chat-light.png b/desktop/test/screenshots/composer-padding/before/composer-chat-light.png
new file mode 100644
index 000000000..3182f99ab
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/before/composer-chat-light.png differ
diff --git a/desktop/test/screenshots/composer-padding/before/composer-chat-mic-dark.png b/desktop/test/screenshots/composer-padding/before/composer-chat-mic-dark.png
new file mode 100644
index 000000000..8ed6ac16f
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/before/composer-chat-mic-dark.png differ
diff --git a/desktop/test/screenshots/composer-padding/before/composer-chat-mic-light.png b/desktop/test/screenshots/composer-padding/before/composer-chat-mic-light.png
new file mode 100644
index 000000000..dc084014b
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/before/composer-chat-mic-light.png differ
diff --git a/desktop/test/screenshots/composer-padding/before/composer-thread-dark.png b/desktop/test/screenshots/composer-padding/before/composer-thread-dark.png
new file mode 100644
index 000000000..55745243d
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/before/composer-thread-dark.png differ
diff --git a/desktop/test/screenshots/composer-padding/before/composer-thread-light.png b/desktop/test/screenshots/composer-padding/before/composer-thread-light.png
new file mode 100644
index 000000000..6eb426828
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/before/composer-thread-light.png differ
diff --git a/desktop/test/screenshots/composer-padding/before/composer-web-phone-dark.png b/desktop/test/screenshots/composer-padding/before/composer-web-phone-dark.png
new file mode 100644
index 000000000..44d02a40e
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/before/composer-web-phone-dark.png differ
diff --git a/desktop/test/screenshots/composer-padding/before/composer-web-phone-light.png b/desktop/test/screenshots/composer-padding/before/composer-web-phone-light.png
new file mode 100644
index 000000000..4306383dd
Binary files /dev/null and b/desktop/test/screenshots/composer-padding/before/composer-web-phone-light.png differ
diff --git a/desktop/test/super_tab_backlog_shots_test.dart b/desktop/test/super_tab_backlog_shots_test.dart
index c586f4b5c..94fc00530 100644
--- a/desktop/test/super_tab_backlog_shots_test.dart
+++ b/desktop/test/super_tab_backlog_shots_test.dart
@@ -6,7 +6,9 @@ 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/shared/widgets/app_menu.dart';
import 'package:harness/super_tabs/backlog_view.dart';
+import 'package:harness/super_tabs/pull_request_facts.dart';
import 'box_render_preview_test.dart' show loadPreviewFonts;
import 'support/super_tab_fixture.dart';
@@ -71,11 +73,12 @@ void main() {
{'machineId': 'pro9', 'name': 'MacBook Pro-9'},
{'machineId': 'studio', 'name': 'Mac Studio'},
];
+ // Two marked with a priority, as the PM writes it into a title (#2774).
const titles = [
'New session starts on the last project',
- 'Sidebar task groups',
+ 'URGENT: sidebar task groups lose their counts',
'Machine names in every row',
- 'Thread reply bar',
+ 'Thread reply bar (Scholes, high)',
'Status menu fixture',
'GitHub setup line clears in seconds',
];
@@ -181,12 +184,44 @@ void main() {
]);
}
+ /// [count] more shipped tasks, an hour apart, so Shipped folds the rest
+ /// under Show N more (#2774).
+ void manyShipped(ConversationServer server, int count) {
+ final shipped = DateTime(2026, 11, 3, 16).millisecondsSinceEpoch;
+ (server.state['conversations'] as List).addAll(<Map<String, dynamic>>[
+ for (var i = 0; i < count; i++)
+ {
+ ...conversationFixture('more-$i', 'Shipped work number ${i + 1}'),
+ 'projectId': 'p${i % 2}',
+ 'number': 2100 - i,
+ 'requesterId': 'owner',
+ 'agentIds': ['quill'],
+ 'assignment': {'id': 'a-m$i', 'agentId': 'quill', 'status': 'done'},
+ 'shippedAt': shipped - i * 3600000,
+ 'pullRequestUrls': [
+ 'https://github.com/autonomous-ai/openharness/pull/${2500 + i}',
+ ],
+ 'cards': {
+ 'pullRequests': [
+ {
+ 'url':
+ 'https://github.com/autonomous-ai/openharness/pull/${2500 + i}',
+ 'messageId': 'card-m$i',
+ 'mergedAt': shipped,
+ },
+ ],
+ },
+ },
+ ]);
+ }
+
Future<void> show(
WidgetTester tester,
ConversationServer server, {
Brightness brightness = Brightness.light,
GlobalKey? picture,
Stopwatch? firstFrame,
+ SuperTabPullRequestFacts? facts,
}) async {
final c = server.controller();
addTearDown(c.dispose);
@@ -195,7 +230,7 @@ void main() {
if (firstFrame != null) server.holdReads = Completer<void>();
grid.AppTheme.brightness.value = brightness;
addTearDown(() => grid.AppTheme.brightness.value = Brightness.light);
- await tester.binding.setSurfaceSize(const Size(900, 640));
+ await tester.binding.setSurfaceSize(const Size(1280, 1900));
addTearDown(() => tester.binding.setSurfaceSize(null));
firstFrame?.start();
await tester.pumpWidget(
@@ -209,6 +244,7 @@ void main() {
listenable: c,
builder: (context, _) => SuperTabBacklogView(
controller: c,
+ facts: facts,
onOpenConversation: (_) {},
now: () => (c.groupChangedAt('t2301') ?? DateTime(2026)).add(
const Duration(minutes: 7),
@@ -225,6 +261,7 @@ void main() {
for (final brightness in Brightness.values) {
for (final scene in [
'all',
+ 'many-shipped',
'mine',
'project',
'mine-empty',
@@ -236,7 +273,35 @@ void main() {
final picture = GlobalKey();
final server = swarm(perProject: 3);
if (scene.startsWith('mine-')) nothingOpenWithArchived(server);
- await show(tester, server, brightness: brightness, picture: picture);
+ if (scene == 'many-shipped') manyShipped(server, 12);
+ // GitHub's answer for the open pull requests: checks passed on the
+ // one in review, and its approval; checks running on the others.
+ final facts = SuperTabPullRequestFacts(
+ (urls) async => {
+ 'account': 'scholes',
+ 'rows': [
+ for (final url in urls)
+ {
+ 'url': url,
+ 'status': 'found',
+ 'title': 'PR',
+ 'state': 'Open',
+ 'reviewDecision': url.endsWith('/2703') ? 'APPROVED' : '',
+ 'checks': url.endsWith('/2703')
+ ? {'passed': 8, 'failed': 0, 'pending': 0, 'total': 8}
+ : {'passed': 3, 'failed': 0, 'pending': 5, 'total': 8},
+ },
+ ],
+ },
+ );
+ addTearDown(facts.dispose);
+ await show(
+ tester,
+ server,
+ brightness: brightness,
+ picture: picture,
+ facts: facts,
+ );
if (scene.startsWith('mine')) {
await tester.tap(find.byKey(const ValueKey('super-backlog-mine')));
await tester.pumpAndSettle();
@@ -249,7 +314,7 @@ void main() {
} else if (scene == 'project') {
await tester.tap(find.byKey(const ValueKey('super-backlog-project')));
await tester.pumpAndSettle();
- await tester.tap(find.text('lampos').last);
+ await tester.tap(find.widgetWithText(AppMenuItem, 'lampos').last);
await tester.pumpAndSettle();
}
await tester.runAsync(() async {
diff --git a/desktop/test/super_tab_backlog_test.dart b/desktop/test/super_tab_backlog_test.dart
index e39fd7e79..59bd0aa51 100644
--- a/desktop/test/super_tab_backlog_test.dart
+++ b/desktop/test/super_tab_backlog_test.dart
@@ -3,6 +3,7 @@ import 'dart:async';
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/shared/widgets/app_menu.dart';
import 'package:harness/super_tabs/backlog.dart';
import 'package:harness/super_tabs/backlog_view.dart';
import 'package:harness/super_tabs/controller.dart';
@@ -311,6 +312,40 @@ void main() {
]);
});
+ // Task #2774 (Scholes's mockup): tasks carry no priority field; the badge
+ // reads the title's own marker, which the row then drops.
+ test('a title\'s URGENT or "(Name, high)" marker is its priority badge', () {
+ for (final (title, priority, shown) in [
+ (
+ 'URGENT: agents\' GitHub tokens also carry workflows',
+ SuperTabTaskPriority.urgent,
+ 'Agents\' GitHub tokens also carry workflows',
+ ),
+ (
+ 'URGENT bug in #2608: the date pill crashes',
+ SuperTabTaskPriority.urgent,
+ 'Bug in #2608: the date pill crashes',
+ ),
+ (
+ 'Manage Backlog tab redesigned (Scholes, high)',
+ SuperTabTaskPriority.high,
+ 'Manage Backlog tab redesigned',
+ ),
+ (
+ 'Round dial fix (Huy, urgent)',
+ SuperTabTaskPriority.urgent,
+ 'Round dial fix',
+ ),
+ ('Thread tags (Dee, 2026-11-04)', null, 'Thread tags (Dee, 2026-11-04)'),
+ ('Urgently needed docs', null, 'Urgently needed docs'),
+ ('A high bar for review', null, 'A high bar for review'),
+ ]) {
+ final read = superTabTitlePriority(title);
+ expect(read.priority, priority, reason: title);
+ expect(read.title, shown, reason: title);
+ }
+ });
+
test('lists every task across projects, newest first, and no project chat, '
'Buddy chat, step or private chat', () async {
final server = ConversationServer();
@@ -498,7 +533,7 @@ void main() {
await c.refresh();
}
beforeBuild?.call();
- await tester.binding.setSurfaceSize(const Size(1100, 900));
+ await tester.binding.setSurfaceSize(const Size(1100, 2000));
addTearDown(() => tester.binding.setSurfaceSize(null));
await tester.pumpWidget(
MaterialApp(
@@ -544,6 +579,40 @@ void main() {
'super-backlog-row-'.length,
),
];
+ ({int working, int review, int shipped}) summary(WidgetTester tester) {
+ int count(String name) => int.parse(
+ tester
+ .widget<Text>(
+ find.byKey(ValueKey('super-backlog-summary-$name-count')),
+ )
+ .data!,
+ );
+ return (
+ working: count('working'),
+ review: count('inReview'),
+ shipped: count('shipped'),
+ );
+ }
+
+ Future<void> search(WidgetTester tester, String text) async {
+ await tester.enterText(
+ find.descendant(
+ of: find.byKey(const ValueKey('super-backlog-search')),
+ matching: find.byType(EditableText),
+ ),
+ text,
+ );
+ await tester.pumpAndSettle();
+ }
+
+ Future<void> chooseProject(WidgetTester tester, String name) async {
+ await tester.tap(find.byKey(const ValueKey('super-backlog-project')));
+ await tester.pumpAndSettle();
+ // The menu's row, not a project chip in the list.
+ await tester.tap(find.widgetWithText(AppMenuItem, name).last);
+ await tester.pumpAndSettle();
+ }
+
String rowText(WidgetTester tester, String id) => [
for (final t in tester.widgetList<Text>(
find.descendant(of: row(id), matching: find.byType(Text)),
@@ -566,11 +635,16 @@ void main() {
expect(
find.descendant(
of: header(group),
- matching: find.text('${group.label} · $count'),
+ matching: find.text(group.label.toUpperCase()),
),
findsOneWidget,
reason: group.label,
);
+ expect(
+ find.descendant(of: header(group), matching: find.text('$count')),
+ findsOneWidget,
+ reason: group.label,
+ );
}
// The groups' order, top to bottom.
final tops = [
@@ -586,18 +660,20 @@ void main() {
'done',
'shipped',
]);
- expect(find.text('6 tasks'), findsOneWidget);
- // Line one: number and title, project and who asked; line two: agent,
- // machine, pull request, what it waits on; then how long ago.
+ expect(summary(tester), (working: 1, review: 1, shipped: 1));
+ // Scholes's mockup (#2774): number and title; then agent, machine and
+ // state with a project chip; the pull request's chip and how long ago
+ // at the right.
final working = rowText(tester, 'working');
- expect(working, contains('#11 Sidebar task groups'));
- expect(working, contains('web-project · owner'));
- expect(working, contains('Kestrel · Mac Studio · PR #2733'));
+ expect(working, contains('#11 | Sidebar task groups'));
+ expect(working, contains('Kestrel · Mac Studio · Working'));
+ expect(working, contains('web-project'));
+ expect(working, contains('PR 2733'));
expect(working, contains('5m'));
- expect(rowText(tester, 'asking'), contains('api · pilot'));
+ expect(rowText(tester, 'asking'), contains('api'));
expect(rowText(tester, 'asking'), contains('Waiting on pilot'));
expect(rowText(tester, 'queued'), contains('No agent yet'));
- expect(rowText(tester, 'shipped'), contains('PR #2713'));
+ expect(rowText(tester, 'shipped'), contains('PR 2713 · merged'));
});
testWidgets('who asked and who it waits on read by the name they set '
@@ -607,7 +683,6 @@ void main() {
(p) => p['id'] == 'pilot',
)['name'] = 'Pilot Pham';
await show(tester, server);
- expect(rowText(tester, 'asking'), contains('api · Pilot Pham'));
expect(rowText(tester, 'asking'), contains('Waiting on Pilot Pham'));
expect(rowText(tester, 'asking'), isNot(contains('pilot')));
});
@@ -640,30 +715,147 @@ void main() {
await tester.pumpAndSettle();
expect(listed(tester), isNot(contains('asking')));
expect(listed(tester), hasLength(5));
- expect(find.text('5 tasks'), findsOneWidget);
+ await tester.tap(find.byKey(const ValueKey('super-backlog-everyone')));
+ await tester.pumpAndSettle();
+ expect(listed(tester), hasLength(6));
});
- testWidgets('the project and state filters narrow the list and the count', (
- tester,
- ) async {
+ testWidgets('the summary counts what the filters show', (tester) async {
await show(tester, swarm());
- await tester.tap(find.byKey(const ValueKey('super-backlog-project')));
+ expect(summary(tester), (working: 1, review: 1, shipped: 1));
+ await chooseProject(tester, 'api');
+ expect(listed(tester), ['asking']);
+ expect(summary(tester), (working: 0, review: 0, shipped: 0));
+ await chooseProject(tester, 'All projects');
+ await search(tester, 'thread');
+ expect(summary(tester), (working: 0, review: 1, shipped: 0));
+ });
+
+ testWidgets('search reads title, number or agent, with Mine and the '
+ 'project menu together', (tester) async {
+ await show(tester, swarm());
+ await search(tester, 'Thread reply');
+ expect(listed(tester), ['review']);
+ await search(tester, '#14');
+ expect(listed(tester), ['done']);
+ await search(tester, '15');
+ expect(listed(tester), ['shipped']);
+ // Every task Kestrel holds, and none without an agent.
+ await search(tester, 'kestrel');
+ expect(listed(tester), [
+ 'working',
+ 'asking',
+ 'review',
+ 'done',
+ 'shipped',
+ ]);
+ await tester.tap(find.byKey(const ValueKey('super-backlog-mine')));
await tester.pumpAndSettle();
- await tester.tap(find.text('api').last);
+ expect(listed(tester), ['working', 'review', 'done', 'shipped']);
+ await tester.tap(find.byKey(const ValueKey('super-backlog-everyone')));
await tester.pumpAndSettle();
+ await chooseProject(tester, 'api');
expect(listed(tester), ['asking']);
- expect(find.text('1 task'), findsOneWidget);
+ await search(tester, 'nothing like this');
+ expect(listed(tester), isEmpty);
+ expect(find.text('No tasks match “nothing like this”'), findsOneWidget);
+ });
- await tester.tap(find.byKey(const ValueKey('super-backlog-project')));
- await tester.pumpAndSettle();
- await tester.tap(find.text('All projects').last);
+ testWidgets('each group says what it means, and folds to its heading', (
+ tester,
+ ) async {
+ await show(tester, swarm());
+ for (final line in [
+ 'An agent is on it right now',
+ 'Pull request open, waiting on a human',
+ 'Merged in the last 7 days',
+ ]) {
+ expect(find.text(line), findsOneWidget, reason: line);
+ }
+ await tester.tap(header(SuperTabBacklogGroup.working));
await tester.pumpAndSettle();
- await tester.tap(find.byKey(const ValueKey('super-backlog-state')));
+ expect(row('working'), findsNothing);
+ expect(
+ find.descendant(
+ of: header(SuperTabBacklogGroup.working),
+ matching: find.text('1'),
+ ),
+ findsOneWidget,
+ );
+ expect(summary(tester), (working: 1, review: 1, shipped: 1));
+ await tester.tap(header(SuperTabBacklogGroup.working));
await tester.pumpAndSettle();
- await tester.tap(find.text('In review').last);
+ expect(row('working'), findsOneWidget);
+ });
+
+ testWidgets('Shipped shows its newest 7, then Show N more shipped', (
+ tester,
+ ) async {
+ final server = swarm();
+ final conversations = server.state['conversations'] as List;
+ for (var i = 0; i < 9; i++) {
+ final pr = 'https://github.com/acme/app/pull/${3000 + i}';
+ conversations.add(<String, dynamic>{
+ ...conversationFixture('ship-$i', 'Shipped $i'),
+ 'projectId': 'lead',
+ 'number': 40 + i,
+ 'requesterId': 'owner',
+ 'assignment': {'id': 'a-s$i', 'agentId': 'kestrel', 'status': 'done'},
+ // Newest is ship-0, an hour apart; the number order is the other way.
+ 'shippedAt': now - (i + 1) * 3600000,
+ 'pullRequestUrls': [pr],
+ 'cards': {
+ 'pullRequests': [
+ {'url': pr, 'messageId': 'card-s$i', 'mergedAt': now},
+ ],
+ },
+ });
+ }
+ await show(tester, server);
+ expect(summary(tester).shipped, 10);
+ final shipped = [
+ for (final id in listed(tester))
+ if (id == 'shipped' || id.startsWith('ship-')) id,
+ ];
+ expect(shipped, [
+ 'shipped',
+ 'ship-0',
+ 'ship-1',
+ 'ship-2',
+ 'ship-3',
+ 'ship-4',
+ 'ship-5',
+ ]);
+ final more = find.byKey(const ValueKey('super-backlog-shipped-more'));
+ expect(
+ find.descendant(of: more, matching: find.text('Show 3 more shipped')),
+ findsOneWidget,
+ );
+ await tester.tap(more);
await tester.pumpAndSettle();
- expect(listed(tester), ['review']);
- expect(header(SuperTabBacklogGroup.working), findsNothing);
+ expect(row('ship-8'), findsOneWidget);
+ expect(more, findsNothing);
+ });
+
+ testWidgets('a row shows the title\'s priority as a badge', (tester) async {
+ final server = swarm();
+ final conversations = (server.state['conversations'] as List).cast<Map>();
+ conversations.firstWhere((g) => g['id'] == 'working')['title'] =
+ 'URGENT: sidebar task groups';
+ conversations.firstWhere((g) => g['id'] == 'review')['title'] =
+ 'Thread reply bar (Scholes, high)';
+ await show(tester, server);
+ expect(
+ rowText(tester, 'working'),
+ contains('URGENT | Sidebar task groups'),
+ );
+ expect(rowText(tester, 'review'), contains('HIGH | Thread reply bar'));
+ expect(rowText(tester, 'review'), isNot(contains('Scholes')));
+ });
+
+ testWidgets('says when the Swarm was last read', (tester) async {
+ await show(tester, swarm(), today: DateTime.now());
+ expect(find.text('Synced just now'), findsOneWidget);
});
// Review of #2776: GitHub's answer lands after the first frame, in a quiet
@@ -690,7 +882,10 @@ void main() {
});
await tester.pump();
await tester.pump();
- expect(rowText(tester, 'working'), contains('PR #2733 12 checks passed'));
+ expect(
+ rowText(tester, 'working'),
+ contains('PR 2733 · 12 checks passed'),
+ );
});
testWidgets('clicking a row opens its chat', (tester) async {
@@ -714,7 +909,8 @@ void main() {
await tester.pumpAndSettle();
final review = tester.getTopLeft(header(SuperTabBacklogGroup.inReview));
expect(tester.getTopLeft(row('working')).dy, greaterThan(review.dy));
- expect(find.text('5 tasks'), findsOneWidget);
+ expect(listed(tester), hasLength(5));
+ expect(summary(tester), (working: 0, review: 2, shipped: 1));
});
testWidgets('no tasks, and none asked for by the reader, each say so', (
@@ -735,7 +931,7 @@ void main() {
await tester.tap(find.byKey(const ValueKey('super-backlog-mine')));
await tester.pumpAndSettle();
expect(find.text('No open tasks of yours'), findsOneWidget);
- expect(find.text('0 tasks'), findsOneWidget);
+ expect(summary(tester), (working: 0, review: 0, shipped: 0));
});
group('closed tasks the app does not hold', () {
@@ -800,7 +996,7 @@ void main() {
tester.getTopLeft(header(SuperTabBacklogGroup.shipped)).dy,
),
);
- expect(find.text('Shipped · 3'), findsOneWidget);
+ expect(summary(tester).shipped, 3);
// The snapshot is built again on every change: these never join it.
expect(c.snapshot!.conversation('recent'), isNull);
});
@@ -1061,6 +1257,8 @@ void main() {
await tester.pumpAndSettle();
expect(find.text('No open tasks of yours'), findsOneWidget);
expect(row('mine-a'), findsNothing);
+ // The cards still count what Mine shipped.
+ expect(summary(tester), (working: 0, review: 0, shipped: 2));
final link = find.byKey(const ValueKey('super-backlog-mine-shipped'));
expect(
find.descendant(
@@ -1077,8 +1275,7 @@ void main() {
expect(row('mine-a'), findsOneWidget);
expect(row('mine-b'), findsOneWidget);
expect(row('theirs'), findsNothing);
- expect(find.text('Shipped · 2'), findsOneWidget);
- expect(find.text('2 tasks'), findsOneWidget);
+ expect(summary(tester), (working: 0, review: 0, shipped: 2));
},
);
diff --git a/desktop/test/super_tab_composer_padding_test.dart b/desktop/test/super_tab_composer_padding_test.dart
new file mode 100644
index 000000000..66c627dd1
--- /dev/null
+++ b/desktop/test/super_tab_composer_padding_test.dart
@@ -0,0 +1,169 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/shared/theme/app_icons.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/workspace_chrome.dart';
+import 'package:harness/super_tabs/view.dart';
+import 'package:harness/super_tabs/voice_recorder.dart';
+
+import 'support/super_tab_fixture.dart';
+
+class _Recorder implements SuperTabVoiceRecorder {
+ @override
+ Future<void> start({required String conversationId, String? root}) async {}
+}
+
+/// Huy, 11-04: the composer was too tight, its hint and its row of actions
+/// against the box's edge. As on the phone and in Slack, the text sits 12 below
+/// the top and 16 in from each side, the + and the arrow's glyphs keep those
+/// edges, the row has a little more air above it, the arrow sits as far up from
+/// the bottom as the text sits down from the top, and the corners are the
+/// phone's (SwarmComposer.cardRadius).
+void main() {
+ const top = 12.0, side = 16.0, rowGap = 12.0, radius = 24.0;
+
+ ConversationServer buddyChat() {
+ final server = ConversationServer()..threads = true;
+ server.state['threadSessions'] = true;
+ server.state['sessionsFromChat'] = true;
+ final chat = (server.state['conversations'] as List)[1] as Map;
+ chat
+ ..['kind'] = 'buddy'
+ ..['buddyOwnerId'] = 'owner'
+ ..['title'] = 'Wren'
+ ..['agentIds'] = ['buddy-main'];
+ (server.state['agents'] as List).add({
+ 'id': 'buddy-main',
+ 'name': 'Wren',
+ 'displayName': 'Wren',
+ 'machineId': 'mac',
+ 'harnessId': 'h-main',
+ 'contributorId': 'owner',
+ 'buddyOf': {'personId': 'owner', 'generation': 'g1'},
+ 'configuration': {'engine': 'claude'},
+ });
+ server.append(
+ 'Measure prod CPU for the last day',
+ conversationId: 'offline',
+ );
+ return server;
+ }
+
+ ConversationServer projectThread() {
+ final server = ConversationServer()..threads = true;
+ server.append('The build fails on the second run.');
+ server.append('Which machine was it on?');
+ server.messages.last
+ ..['thread'] = 'message-1'
+ ..['replyTo'] = 'message-1';
+ return server;
+ }
+
+ Finder key(String value) => find.byKey(ValueKey(value));
+ Rect glyph(WidgetTester tester, Finder button, IconData icon) =>
+ tester.getRect(find.descendant(of: button, matching: find.byIcon(icon)));
+
+ for (final brightness in Brightness.values) {
+ for (final scene in ['chat', 'thread', 'web-phone']) {
+ testWidgets('the $scene composer has room inside its box '
+ '(${brightness.name})', (tester) async {
+ final thread = scene == 'thread', phone = scene == 'web-phone';
+ final c = (thread ? projectThread() : buddyChat()).controller();
+ addTearDown(c.dispose);
+ await c.refresh();
+ grid.AppTheme.brightness.value = brightness;
+ addTearDown(() => grid.AppTheme.brightness.value = Brightness.light);
+ await tester.binding.setSurfaceSize(
+ phone ? const Size(390, 844) : const Size(1280, 720),
+ );
+ addTearDown(() => tester.binding.setSurfaceSize(null));
+ await tester.pumpWidget(
+ MaterialApp(
+ theme: grid.buildAppTheme(brightness: brightness),
+ home: WorkspaceChromeScope(
+ chrome: WorkspaceChrome(compactBelow: phone ? 720 : 0),
+ child: Scaffold(
+ body: SuperTabView(
+ controller: c,
+ onInvite: () {},
+ onAddAgent: (_) {},
+ onOpenTerminal: (_) {},
+ machineName: (_) => 'Mac Studio',
+ voiceRecorder: _Recorder(),
+ ),
+ ),
+ ),
+ ),
+ );
+ if (!thread) await c.select('offline');
+ await tester.pumpAndSettle();
+ if (thread) {
+ c.openThread('message-1');
+ await tester.pumpAndSettle();
+ }
+ final surfaceKey = key(
+ thread
+ ? 'super-thread-composer-surface'
+ : 'super-message-composer-surface',
+ );
+ final surface = tester.getRect(surfaceKey);
+ final field = tester.getRect(
+ key(thread ? 'super-thread-composer' : 'super-message-composer'),
+ );
+ final plus = glyph(
+ tester,
+ find.descendant(of: surfaceKey, matching: key('new-harness-attach')),
+ AppIcons.plus,
+ );
+ final tag = glyph(
+ tester,
+ key(thread ? 'super-thread-tag' : 'super-composer-tag'),
+ AppIcons.atSign,
+ );
+ final mic = glyph(
+ tester,
+ key(thread ? 'super-thread-mic' : 'super-composer-mic'),
+ AppIcons.mic,
+ );
+ final send = glyph(
+ tester,
+ find.byTooltip(thread ? 'Send reply' : 'Send message'),
+ AppIcons.arrowUp,
+ );
+
+ expect(field.top - surface.top, closeTo(top, .5), reason: 'top');
+ expect(field.left - surface.left, closeTo(side, .5), reason: 'left');
+ expect(surface.right - field.right, closeTo(side, .5), reason: 'right');
+ // The + under the text's first letter, the arrow at the text's right
+ // edge, and the mic as far from the arrow as @ is from +.
+ expect(plus.left, closeTo(field.left, .5), reason: '+ edge');
+ expect(surface.right - send.right, closeTo(side, .5), reason: 'send');
+ expect(
+ send.left - mic.right,
+ closeTo(tag.left - plus.right, .5),
+ reason: 'mic and send spacing',
+ );
+ // The row's air over Desktop's 32pt targets, the same over a phone's
+ // 44pt ones, which would otherwise push a short phone's box past the
+ // keyboard.
+ final glyphInTarget =
+ (grid.AppControl.height - AppIcons.inlineSize) / 2;
+ expect(
+ plus.top - field.bottom,
+ closeTo(rowGap + glyphInTarget, .5),
+ reason: 'row gap',
+ );
+ // On Desktop the arrow sits as far up from the bottom as the text sits
+ // down from the top; a phone's finger targets take what they need.
+ if (!phone) expect(surface.bottom - send.bottom, closeTo(top, .5));
+ final box = tester.widget<DecoratedBox>(surfaceKey).decoration;
+ expect(
+ (box as BoxDecoration).borderRadius,
+ BorderRadius.circular(radius),
+ );
+ await tester.pumpWidget(const SizedBox());
+ await c.flush();
+ });
+ }
+ }
+}
diff --git a/desktop/test/super_tab_day_jump_test.dart b/desktop/test/super_tab_day_jump_test.dart
index c43369b8f..8068c63f2 100644
--- a/desktop/test/super_tab_day_jump_test.dart
+++ b/desktop/test/super_tab_day_jump_test.dart
@@ -1,24 +1,14 @@
-import 'dart:io';
-import 'dart:ui' as ui;
-
import 'package:flutter/material.dart';
-import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/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/day_jump.dart';
import 'package:harness/super_tabs/day_pill.dart';
-import 'package:harness/super_tabs/message_row.dart';
import 'package:harness/super_tabs/view.dart';
-import 'box_render_preview_test.dart' show loadPreviewFonts;
import 'support/super_tab_fixture.dart';
-/// Set to a folder to write the PR's screenshots there.
-final shots = Platform.environment['SUPER_TAB_DAY_JUMP_SHOTS'];
-
const _pill = ValueKey('super-day-pill');
/// A list of 40 rows on Oct 20 and 21, 2026 under a sticky day that jumps
@@ -52,10 +42,6 @@ Future<void> _list(WidgetTester tester, ValueChanged<DateTime?> onJump) async {
}
void main() {
- setUpAll(() async {
- if (shots != null) await loadPreviewFonts();
- });
-
group('the time each choice starts at', () {
final wednesday = DateTime(2026, 11, 4, 15, 30);
@@ -231,286 +217,28 @@ void main() {
});
});
- group('the chat lands on the first message from that time', () {
- /// The Lead chat with [said] in order, everything read, [page] messages
- /// to a page.
- Future<SuperTabController> chat(
- WidgetTester tester,
- List<(String, DateTime)> said, {
- int page = 20,
- }) async {
- final server = ConversationServer()..messagePage = page;
- for (final (text, at) in said) {
- server.append(text);
- server.messages.last['createdAt'] = at.toUtc().toIso8601String();
- }
- server.markReadElsewhere('lead', said.length);
- final c = server.controller();
- await c.refresh();
- await tester.pumpWidget(
- MaterialApp(
- theme: grid.buildAppTheme(brightness: Brightness.light),
- home: Scaffold(
- body: SuperTabView(
- controller: c,
- onInvite: () {},
- onAddAgent: (_) {},
- onOpenTerminal: (_) {},
- machineName: (_) => 'Mac Studio',
- ),
- ),
- ),
- );
- await tester.pumpAndSettle();
- addTearDown(c.dispose);
- return c;
- }
-
- final now = DateTime.now();
- final today = DateTime(now.year, now.month, now.day);
- DateTime daysAgo(int days, [int minute = 0]) =>
- DateTime(today.year, today.month, today.day - days, 10, minute);
- List<(String, DateTime)> run(
- String name,
- int count,
- DateTime Function(int) at,
- ) => [for (var i = 1; i <= count; i++) ('$name $i', at(i))];
-
- Finder row(String text) => find
- .ancestor(
- of: find.text(text),
- matching: find.byWidgetPredicate(
- (w) =>
- w.key is ValueKey<String> &&
- (w.key! as ValueKey<String>).value.startsWith(
- 'super-message-message-',
- ),
- ),
- )
- .first;
- bool lit(WidgetTester tester, String text) => tester
- .widget<SuperTabMessageHighlight>(
- find.ancestor(
- of: row(text),
- matching: find.byType(SuperTabMessageHighlight),
- ),
- )
- .on;
- bool onScreen(WidgetTester tester, String text) {
- final list = tester.getRect(
- find.byKey(const PageStorageKey('super-messages-tab-lead')),
- );
- final at = tester.getRect(row(text));
- return at.top >= list.top - 1 && at.top < list.bottom;
- }
-
- Future<void> choose(WidgetTester tester, String label) async {
- await tester.tap(find.byKey(_pill));
- await tester.pumpAndSettle();
- await tester.tap(find.text(label));
- // The highlight lasts 2 seconds: look while it is on.
- for (var i = 0; i < 20; i++) {
- await tester.pump(const Duration(milliseconds: 50));
- }
- }
-
- // Older days first, then yesterday and today: one page holds today alone.
- List<(String, DateTime)> days() => [
- ...run('Old', 40, (i) => daysAgo(20, i)),
- ...run('Week', 20, (i) => daysAgo(7, i)),
- ...run('Yesterday', 20, (i) => daysAgo(1, i)),
- ...run('Today', 20, (i) => now.subtract(Duration(minutes: 40 - i))),
- ];
-
- testWidgets(
- 'Yesterday lands on yesterday\'s first message, and lights it',
- (tester) async {
- await chat(tester, days(), page: 40);
- await choose(tester, 'Yesterday');
- expect(onScreen(tester, 'Yesterday 1'), isTrue);
- expect(lit(tester, 'Yesterday 1'), isTrue);
- await tester.pumpAndSettle(const Duration(seconds: 3));
- },
- );
-
- testWidgets('Last week reads older pages to reach its first message', (
- tester,
- ) async {
- final c = await chat(tester, days());
- expect(c.messages('lead').any((m) => m.text == 'Week 1'), isFalse);
- await choose(tester, 'Last week');
- await tester.pumpAndSettle(const Duration(milliseconds: 100));
- expect(onScreen(tester, 'Week 1'), isTrue);
- expect(lit(tester, 'Week 1'), isTrue);
- await tester.pumpAndSettle(const Duration(seconds: 3));
- });
-
- testWidgets('The very beginning lands on the chat\'s first message', (
- tester,
- ) async {
- await chat(tester, days(), page: 10);
- await choose(tester, 'The very beginning');
- await tester.pumpAndSettle(const Duration(milliseconds: 100));
- expect(onScreen(tester, 'Old 1'), isTrue);
- expect(lit(tester, 'Old 1'), isTrue);
- await tester.pumpAndSettle(const Duration(seconds: 3));
- });
-
- testWidgets('with nothing said since, it lands on the newest message', (
- tester,
- ) async {
- await chat(tester, run('Earlier', 40, (i) => daysAgo(3, i)));
- await choose(tester, 'Yesterday');
- expect(onScreen(tester, 'Earlier 40'), isTrue);
- expect(lit(tester, 'Earlier 40'), isTrue);
- await tester.pumpAndSettle(const Duration(seconds: 3));
- });
-
- testWidgets('a time more than 50 pages back says so, and the list stays', (
- tester,
- ) async {
- await chat(tester, [
- ...run('Old', 2, (i) => daysAgo(40, i)),
- ...run('Recent', 120, (i) => daysAgo(20, i)),
- ...run('Today', 20, (i) => now.subtract(Duration(minutes: 40 - i))),
- ], page: 2);
- expect(onScreen(tester, 'Today 20'), isTrue);
- await choose(tester, 'Last month');
- await tester.pumpAndSettle();
- expect(find.text('That day is too far back to open.'), findsOneWidget);
- expect(find.text('Recent 1'), findsNothing);
- // Where the reader was: at the newest message, none of them lit.
- expect(onScreen(tester, 'Today 20'), isTrue);
- expect(lit(tester, 'Today 20'), isFalse);
- });
- });
-
- group('a read that fails on the way back', () {
- final now = DateTime.now();
- DateTime daysAgo(int days, [int minute = 0]) =>
- DateTime(now.year, now.month, now.day - days, 10, minute);
-
- Future<(SuperTabController, ConversationServer)> open(
- WidgetTester tester,
- ConversationServer server,
- ) async {
- final c = server.controller();
- await c.refresh();
- await tester.pumpWidget(
- MaterialApp(
- theme: grid.buildAppTheme(brightness: Brightness.light),
- home: Scaffold(
- body: SuperTabView(
- controller: c,
- onInvite: () {},
- onAddAgent: (_) {},
- onOpenTerminal: (_) {},
- machineName: (_) => 'Mac Studio',
- ),
- ),
- ),
- );
- await tester.pumpAndSettle();
- addTearDown(c.dispose);
- return (c, server);
- }
-
- Future<void> choose(WidgetTester tester, Key pill, String label) async {
- await tester.tap(find.byKey(pill));
- await tester.pumpAndSettle();
- await tester.tap(find.text(label));
- await tester.pumpAndSettle();
- }
-
- bool anyLit(WidgetTester tester) => tester
- .widgetList<SuperTabMessageHighlight>(
- find.byType(SuperTabMessageHighlight),
- )
- .any((h) => h.on);
-
- testWidgets(
- 'in the chat, it says so after the one read, lighting nothing',
- (tester) async {
- final server = ConversationServer()..messagePage = 20;
- for (var i = 1; i <= 60; i++) {
- server.append('Update $i');
- server.messages.last['createdAt'] = daysAgo(
- i <= 40 ? 20 : 0,
- i,
- ).toUtc().toIso8601String();
- }
- server.markReadElsewhere('lead', 60);
- await open(tester, server);
- server.failReadsOf = 'before=';
- await choose(tester, _pill, 'Last week');
- expect(find.text('Couldn’t load earlier messages.'), findsOneWidget);
- expect(find.text('That day is too far back to open.'), findsNothing);
- expect(anyLit(tester), isFalse);
- },
- );
-
- testWidgets(
- 'in a thread, it says so after the one read, lighting nothing',
- (tester) async {
- final server = ConversationServer()
- ..threads = true
- ..messagePage = 4;
- server.append('Should we cache the reads?');
- server.messages.last['createdAt'] = daysAgo(30)
- .toUtc()
- .toIso8601String();
- for (var i = 1; i <= 40; i++) {
- server.append('Reply $i');
- server.messages.last
- ..['thread'] = 'message-1'
- ..['replyTo'] = 'message-1'
- ..['createdAt'] = daysAgo(
- i <= 20 ? 20 : 1,
- i,
- ).toUtc().toIso8601String();
- }
- server.markReadElsewhere('lead', server.messages.length);
- final (c, _) = await open(tester, server);
- c.openThread('message-1');
- await tester.pumpAndSettle();
- server.failReadsOf = 'before=';
- await choose(
- tester,
- const ValueKey('super-thread-day-pill'),
- 'Last week',
- );
- expect(find.text('Couldn’t load earlier replies.'), findsOneWidget);
- expect(anyLit(tester), isFalse);
- },
- );
- });
-
- group('the thread lands on its first reply from that time', () {
- final now = DateTime.now();
- DateTime daysAgo(int days, [int minute = 0]) =>
- DateTime(now.year, now.month, now.day - days, 10, minute);
- const pill = ValueKey('super-thread-day-pill');
- const root = 'Should we cache the reads?';
-
- /// A thread of 40 replies over three weeks, four to a page: it opens
- /// with the newest 20, yesterday's.
- Future<SuperTabController> thread(WidgetTester tester) async {
+ // The chat and the thread show the day without the menu until the crash
+ // a jump causes is fixed (#2762).
+ group('the chat and the thread offer no Jump to for now', () {
+ Future<void> chat(WidgetTester tester, {bool thread = false}) async {
+ final now = DateTime.now();
final server = ConversationServer()
- ..threads = true
- ..messagePage = 4;
- server.append(root);
- server.messages.last['createdAt'] = daysAgo(30).toUtc().toIso8601String();
- for (final (name, days, count) in [
- ('Old', 20, 10),
- ('Week', 7, 10),
- ('Recent', 1, 20),
- ]) {
- for (var i = 1; i <= count; i++) {
- server.append('$name reply $i');
+ ..threads = thread
+ ..messagePage = 40;
+ if (thread) server.append('Should we cache the reads?');
+ for (var i = 0; i < 40; i++) {
+ server.append('Update $i');
+ server.messages.last['createdAt'] = DateTime(
+ now.year,
+ now.month,
+ now.day - 3 + i ~/ 20,
+ 9,
+ i,
+ ).toUtc().toIso8601String();
+ if (thread) {
server.messages.last
..['thread'] = 'message-1'
- ..['replyTo'] = 'message-1'
- ..['createdAt'] = daysAgo(days, i).toUtc().toIso8601String();
+ ..['replyTo'] = 'message-1';
}
}
server.markReadElsewhere('lead', server.messages.length);
@@ -532,141 +260,41 @@ void main() {
);
await tester.pumpAndSettle();
addTearDown(c.dispose);
- c.openThread('message-1');
- await tester.pumpAndSettle();
- return c;
+ if (thread) {
+ c.openThread('message-1');
+ await tester.pumpAndSettle();
+ }
}
- Finder inThread(String text) => find.descendant(
- of: find.byKey(const ValueKey('super-thread-panel')),
- matching: find.text(text),
- );
- bool lit(WidgetTester tester, String text) => tester
- .widget<SuperTabMessageHighlight>(
- find
- .ancestor(
- of: inThread(text),
- matching: find.byType(SuperTabMessageHighlight),
- )
- .first,
- )
- .on;
- bool onScreen(WidgetTester tester, String text) {
- final list = tester.getRect(
- find
- .descendant(
- of: find.byKey(const ValueKey('super-thread-panel')),
+ for (final (place, pill, thread) in [
+ ('chat', _pill, false),
+ ('thread', const ValueKey('super-thread-day-pill'), true),
+ ]) {
+ testWidgets("the $place's pill shows the day and opens nothing", (
+ tester,
+ ) async {
+ await chat(tester, thread: thread);
+ final scroll = find
+ .ancestor(
+ of: find.text('Update 39').last,
matching: find.byType(Scrollable),
)
- .first,
- );
- final at = tester.getRect(inThread(text));
- return at.top >= list.top - 1 && at.top < list.bottom;
- }
-
- Future<void> choose(WidgetTester tester, String label) async {
- await tester.tap(find.byKey(pill));
- await tester.pumpAndSettle();
- await tester.tap(find.text(label));
- for (var i = 0; i < 20; i++) {
- await tester.pump(const Duration(milliseconds: 50));
- }
- }
-
- testWidgets('Last week reads earlier replies to its first, and lights it', (
- tester,
- ) async {
- await thread(tester);
- expect(inThread('Week reply 1'), findsNothing);
- await choose(tester, 'Last week');
- expect(onScreen(tester, 'Week reply 1'), isTrue);
- expect(lit(tester, 'Week reply 1'), isTrue);
- await tester.pumpAndSettle(const Duration(seconds: 3));
- });
-
- testWidgets('The very beginning lands on the root', (tester) async {
- await thread(tester);
- await choose(tester, 'The very beginning');
- expect(onScreen(tester, root), isTrue);
- expect(lit(tester, root), isTrue);
- await tester.pumpAndSettle(const Duration(seconds: 3));
- });
- });
-
- for (final brightness in Brightness.values) {
- testWidgets('screenshots for review (${brightness.name})', (tester) async {
- if (shots == null) return;
- final before = grid.AppTheme.brightness.value;
- grid.AppTheme.brightness.value = brightness;
- addTearDown(() => grid.AppTheme.brightness.value = before);
- // The menu's lift as the app draws it, not the test's solid outline.
- await tester.binding.setSurfaceSize(const Size(900, 640));
- addTearDown(() => tester.binding.setSurfaceSize(null));
- final now = DateTime.now();
- final server = ConversationServer()..messagePage = 40;
- const updates = [
- 'Reading the offline queue before the reconnect.',
- 'The reconnect keeps every queued edit in order.',
- 'Two devices editing at once settle on the newest edit.',
- 'Pushed the branch; the checks are running.',
- ];
- for (var i = 0; i < 40; i++) {
- server.append(updates[i % updates.length]);
- server.messages.last
- ..['author'] = {'kind': 'agent', 'id': 'lead-agent', 'name': 'Lead'}
- ..['createdAt'] = DateTime(
- now.year,
- now.month,
- now.day - 6 + i ~/ 8,
- 9,
- i,
- ).toUtc().toIso8601String();
- }
- server.markReadElsewhere('lead', 40);
- final c = server.controller();
- await c.refresh();
- final picture = GlobalKey();
- 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',
- ),
- ),
- ),
- );
- await tester.pumpAndSettle();
- addTearDown(c.dispose);
- Future<void> shoot(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/$name.png')
- .writeAsBytes(bytes!.buffer.asUint8List());
- image.dispose();
- });
- debugDisableShadows = false;
- try {
- await tester.tap(find.byKey(_pill));
+ .first;
+ await tester.drag(scroll, const Offset(0, 300));
await tester.pumpAndSettle();
- await shoot('jump-menu-${brightness.name}');
- await tester.tap(find.text('Jump to a specific date'));
+ expect(find.byKey(pill), findsOneWidget);
+ expect(
+ find.descendant(
+ of: find.byKey(pill),
+ matching: find.byIcon(AppIcons.chevronDown),
+ ),
+ findsNothing,
+ );
+ await tester.tap(find.byKey(pill), warnIfMissed: false);
await tester.pumpAndSettle();
- await shoot('jump-calendar-${brightness.name}');
- } finally {
- // Back before the test ends, which checks it was.
- debugDisableShadows = true;
- }
- });
- }
+ expect(find.text('Jump to…'), findsNothing);
+ expect(find.text('The very beginning'), findsNothing);
+ });
+ }
+ });
}
diff --git a/desktop/test/super_tab_thread_scroll_test.dart b/desktop/test/super_tab_thread_scroll_test.dart
index 37541e598..0a49a3209 100644
--- a/desktop/test/super_tab_thread_scroll_test.dart
+++ b/desktop/test/super_tab_thread_scroll_test.dart
@@ -291,8 +291,8 @@ void main() {
c.openThread('message-1');
await c.loadThread();
// Just tall enough for all of it, Also send's line under the box included
- // (#2662).
- await tester.binding.setSurfaceSize(const Size(500, 592));
+ // (#2662) and the box's inner padding (#2779).
+ await tester.binding.setSurfaceSize(const Size(500, 596));
addTearDown(() => tester.binding.setSurfaceSize(null));
await tester.pumpWidget(
MaterialApp(
diff --git a/docs/plans/2026-11-04-backlog-tab-mockup-plan.md b/docs/plans/2026-11-04-backlog-tab-mockup-plan.md
new file mode 100644
index 000000000..b0c7fbec1
--- /dev/null
+++ b/docs/plans/2026-11-04-backlog-tab-mockup-plan.md
@@ -0,0 +1,47 @@
+# Manage ▸ Backlog to Scholes's mockup — plan
+
+**Goal:** Make the Desktop and web Manage ▸ Backlog tab readable at a glance, as Scholes's mockup draws it (task
+#2774): summary cards, search with Mine/Everyone and a project menu, collapsible groups with one-line meanings, and
+card rows with priority, project, pull request and CI chips.
+
+**Architecture:** One view, `desktop/lib/super_tabs/backlog_view.dart`, redrawn; the grouping in `backlog.dart` is
+unchanged (what counts as each state is out of scope). `backlog.dart` gains one pure helper,
+`superTabTitlePriority`: tasks carry no priority field, so the URGENT/HIGH badge reads the title's own marker (a
+leading `URGENT`, or a trailing `(Name, high)` / `(Name, urgent)`), which the row then drops from the title, as the
+mockup shows. The controller exposes when it last read the Swarm (`syncedAt`) for "Synced just now".
+
+**Tech Stack:** Flutter (Desktop and web share the code), Harness Design Language tokens (`DesktopChrome`,
+`grid.AppPalette`, `grid.AppDesktop`, `AppIcons`), widget tests with the memory-store fixtures.
+
+**Spec:** Task #2774 brief and the mockup attached to Scholes's message in the project chat.
+
+This plan is carried out by the Engineer directly, test first; there is no execution handoff.
+
+## Global Constraints
+
+- All six existing groups stay, Waiting for a machine included, in their order; their rules do not change.
+- No hard-coded colors, insets, radii or font sizes (`scripts/check-ui-style.py`).
+- Mine with nothing open keeps its explanation and its link to what the reader shipped (#2551).
+
+## Review Focus
+
+- Counts on the summary cards and in each heading follow the same filters as the rows.
+- Search matches title, number and agent, together with Mine and the project.
+- The priority marker parse never strips an ordinary parenthetical.
+
+## Task 1: the redesigned tab
+
+**Files:** `desktop/lib/super_tabs/backlog.dart`, `desktop/lib/super_tabs/backlog_view.dart`,
+`desktop/lib/super_tabs/controller.dart` (one getter), `desktop/test/super_tab_backlog_test.dart`,
+`desktop/test/super_tab_backlog_shots_test.dart`.
+
+**Interfaces:** `enum SuperTabTaskPriority { urgent, high }`;
+`({SuperTabTaskPriority? priority, String title}) superTabTitlePriority(String title)`;
+`DateTime? SuperTabController.syncedAt`.
+
+- [ ] Failing tests: the title's priority marker; summary counts follow the filters; search by title, number and
+ agent with Mine and the project menu; each group's meaning and its fold; Shipped's newest 7 and Show N more;
+ the badge on a row; Synced just now. Existing view tests updated to the new rows and headings.
+- [ ] Run them and watch them fail.
+- [ ] Redraw the view; add the helper and the getter.
+- [ ] Run the Backlog tests and the Manage page tests; light and dark screenshots offscreen, to Scholes.
diff --git a/docs/plans/assets/2026-11-04-backlog-all-dark.png b/docs/plans/assets/2026-11-04-backlog-all-dark.png
new file mode 100644
index 000000000..61e3a2394
Binary files /dev/null and b/docs/plans/assets/2026-11-04-backlog-all-dark.png differ
diff --git a/docs/plans/assets/2026-11-04-backlog-all-light.png b/docs/plans/assets/2026-11-04-backlog-all-light.png
new file mode 100644
index 000000000..12c66ba6a
Binary files /dev/null and b/docs/plans/assets/2026-11-04-backlog-all-light.png differ
diff --git a/docs/plans/assets/2026-11-04-backlog-many-shipped-dark.png b/docs/plans/assets/2026-11-04-backlog-many-shipped-dark.png
new file mode 100644
index 000000000..db0b9801f
Binary files /dev/null and b/docs/plans/assets/2026-11-04-backlog-many-shipped-dark.png differ
diff --git a/docs/plans/assets/2026-11-04-backlog-many-shipped-light.png b/docs/plans/assets/2026-11-04-backlog-many-shipped-light.png
new file mode 100644
index 000000000..6483a03a2
Binary files /dev/null and b/docs/plans/assets/2026-11-04-backlog-many-shipped-light.png differ
diff --git a/docs/plans/assets/2026-11-04-backlog-mine-empty-dark.png b/docs/plans/assets/2026-11-04-backlog-mine-empty-dark.png
new file mode 100644
index 000000000..1b10b0750
Binary files /dev/null and b/docs/plans/assets/2026-11-04-backlog-mine-empty-dark.png differ
diff --git a/docs/plans/assets/2026-11-04-backlog-mine-empty-light.png b/docs/plans/assets/2026-11-04-backlog-mine-empty-light.png
new file mode 100644
index 000000000..e4a2fb4f9
Binary files /dev/null and b/docs/plans/assets/2026-11-04-backlog-mine-empty-light.png differ
diff --git a/scripts/ui-style-allowlist/desktop.json b/scripts/ui-style-allowlist/desktop.json
index 19d996e4b..19f83cf6d 100644
--- a/scripts/ui-style-allowlist/desktop.json
+++ b/scripts/ui-style-allowlist/desktop.json
@@ -82,7 +82,7 @@
"edge-insets": 2
},
"desktop/lib/super_tabs/view.dart": {
- "edge-insets": 18,
+ "edge-insets": 17,
"border-radius": 1
}
}