Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
feat(view): items, shouts and the header read at a glance [N26]
Corey Olson47dafa6d19c7
diff --git a/src/cockpit.js b/src/cockpit.jsindex 6636dedb..858504f6 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -67,7 +67,7 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ<aside class="side" id="side" aria-label="Projects"><div class="side-top"><button class="brand" id="side-toggle" type="button" aria-pressed="false" aria-controls="side-body" aria-label="Collapse the project list" title="Collapse the project list"><svg viewBox="0 0 64 64" aria-hidden="true"><path fill="currentColor" d="M8 7h35a6 6 0 0 1 6 6v7H8a5 5 0 0 1-5-5v-3a5 5 0 0 1 5-5Z"/><rect width="56" height="14" x="3" y="25" fill="var(--accent)" rx="5"/><path fill="currentColor" d="M8 43h35a6 6 0 0 1 6 6v8H8a5 5 0 0 1-5-5v-4a5 5 0 0 1 5-5Z"/></svg><span>Pullboard</span></button>- <button class="switch-btn" id="proj-switch" type="button" aria-expanded="false" aria-controls="side-body"><span id="proj-name">Projects</span><b class="need" id="proj-elsewhere" title="Needs you in other projects" hidden></b><small>▾</small></button>+ <button class="switch-btn" id="proj-switch" type="button" aria-expanded="false" aria-controls="side-body"><span id="proj-name">Projects</span><small>▾</small></button><button class="theme-btn" id="theme" type="button" title="Theme: system"><svg class="sys" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.5"/><path fill="currentColor" d="M8 2a6 6 0 0 1 0 12Z"/></svg><svg class="sun" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" fill="none" stroke="currentColor" stroke-width="1.5"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v1.2M8 13.3v1.2M1.5 8h1.2M13.3 8h1.2M3.4 3.4l.85.85M11.75 11.75l.85.85M3.4 12.6l.85-.85M11.75 4.25l.85-.85"/></svg><svg class="moon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" d="M13.6 9.6A6 6 0 1 1 6.4 2.4a5.2 5.2 0 0 0 7.2 7.2Z"/></svg></button></div><div class="side-body" id="side-body">@@ -79,14 +79,13 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ<div class="body"><header class="top"><nav class="tabs" id="tabs" aria-label="Board">- <button class="tab" data-tab="items" type="button">Items<b id="count-items"></b></button>- <button class="tab" data-tab="shouts" type="button">Shouts<b id="count-shouts"></b></button>- <button class="tab" data-tab="spec" type="button">Spec<b id="count-spec"></b></button>- <button class="tab" data-tab="doctrine" type="button">Doctrine<b id="count-doctrine"></b></button>+ <button class="tab" data-tab="items" type="button">Items</button>+ <button class="tab" data-tab="shouts" type="button">Shouts</button>+ <button class="tab" data-tab="spec" type="button">Spec</button>+ <button class="tab" data-tab="doctrine" type="button">Doctrine</button><button class="tab" data-tab="activity" type="button">Activity</button><button class="tab" data-tab="roadmap" type="button">Roadmap</button></nav>- <span class="live" id="live"></span></header><main><section class="card-panel first">@@ -107,7 +106,7 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ<section class="card-panel person-requests" id="person-requests" aria-label="Your requests" aria-live="polite" hidden></section><section data-pane="items" class="two"><div class="primary">- <div class="card-panel toolbar"><div class="seg" id="state-chips" role="group" aria-label="Show"></div><input id="q" type="search" placeholder="Search" aria-label="Search titles, lanes or ids"><button class="go" id="new-item" type="button">New item</button></div>+ <div class="card-panel toolbar"><div class="seg" id="state-chips" role="group" aria-label="Show"></div><div class="find"><select id="lane-pick" aria-label="Lane"></select><input id="q" type="search" placeholder="Search" aria-label="Search titles, lanes or ids"></div><button class="go" id="new-item" type="button">New item</button></div><section class="needs-you" id="needs" aria-label="What needs you" hidden></section><ol class="card-panel chain" id="chain" aria-label="Items"></ol></div>@@ -153,6 +152,7 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ</main></div></div>+<footer class="status${snapshot ? ' snap' : ''}" aria-label="Board status"><span class="live" id="live"></span><span class="status-board" id="status-board"></span></footer><div class="spec-reason-backdrop" id="spec-decline-dialog" hidden><form class="spec-reason-dialog" id="spec-decline-form" aria-labelledby="spec-decline-title"><h2 id="spec-decline-title">Decline spec row</h2>@@ -184,7 +184,7 @@ function homeTab() {const kept = keep('pb.tab');return kept && kept !== 'roadmap' ? kept : 'items';}-const view = { root: keep('pb.project'), tab: addressTab() || homeTab(), seen: {}, code: {}, item: null, adding: false, declining: null, state: 'active', rows: { spec: 'decide', doctrine: 'all' }, row: { spec: null, doctrine: null }, agent: null, agentsHidden: keep('pb.agents') === 'hidden', allAgents: false };+const view = { root: keep('pb.project'), tab: addressTab() || homeTab(), seen: {}, code: {}, item: null, adding: false, declining: null, state: 'active', rows: { spec: 'decide', doctrine: 'all' }, row: { spec: null, doctrine: null }, agent: null, allAgents: false, agentsHidden: keep('pb.agents') === 'hidden', open: {} };if (snapshot) view.state = 'all';let data = null;let seen = '';@@ -779,7 +779,7 @@ async function refresh() {snapshotReplay.index = snapshotReplay.events.length;replayControls();}- $('live').textContent = snapshot ? 'read-only snapshot' : 'live · ' + new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit', hourCycle: 'h23' });+ $('live').textContent = snapshot ? 'read-only snapshot' : '';}/** Display the current event and make the replay's play, pause and end states explicit. */@@ -916,11 +916,6 @@ function renderSide() {}).join('');const loose = data.projects.filter((repo) => !groupedRoots.has(repo.root)).map(repoButton).join('');$('proj-list').innerHTML = grouped || loose ? grouped + loose : '<div class="empty">None yet.</div>';- const currentGroup = data.groups.find((group) => group.key === view.root);- const currentRoots = new Set(currentGroup ? currentGroup.repos.map((repo) => repo.root) : [view.root]);- const elsewhere = data.projects.filter((x) => !currentRoots.has(x.root)).reduce((n, x) => n + needCount(x), 0);- $('proj-elsewhere').textContent = elsewhere ? elsewhere + ' elsewhere' : '';- $('proj-elsewhere').hidden = !elsewhere;const p = data.project;const selectedGroup = data.groups.find((group) => group.key === view.root);$('proj-name').textContent = selectedGroup?.name || (p ? (data.projects.find((x) => x.root === view.root) || { name: p.root.split('/').pop() }).name : 'No project');@@ -1140,9 +1135,6 @@ function render() {}).join('');const items = p.items.filter((i) => i.status !== 'withdrawn');const active = items.filter((i) => stateOf(i) !== 'verified');- $('count-items').textContent = active.length || '';- $('count-spec').textContent = p.spec.filter((r) => ['pending', 'draft'].includes(r.status) && !r.decision).length || '';- $('count-doctrine').textContent = p.practice.filter((r) => ['pending', 'draft'].includes(r.status)).length || '';const titles = new Map(p.items.map((i) => [String(i.id), i.title]));$('roadmap').innerHTML = roadmapCards(p, titles);@@ -1181,28 +1173,47 @@ function render() {// state, withdrawn items included; browsing leaves those out.const matching = (q ? p.items : items).filter((i) => !q || ('#' + i.id + ' ' + i.title + ' ' + i.lane + ' ' + i.specs.join(' ') + ' ' + (i.criterion || '')).toLowerCase().includes(q));- const inState = (s) => (i) => s === 'all' || (s === 'active' ? !['verified', 'withdrawn'].includes(stateOf(i)) : stateOf(i) === s);+ // Gated is one test, shared by the rows, the Gated filter and the status bar: open and waiting on an item or a held lane.+ const heldLanes = new Map(p.holds.map((h) => [h.hold_lane, h]));+ const gatedOf = (i) => stateOf(i) === 'open' && (i.blockedBy.length > 0 || heldLanes.has(i.lane));+ const inState = (s) => (i) => s === 'all' || (s === 'active' ? !['verified', 'withdrawn'].includes(stateOf(i)) : s === 'gated' ? gatedOf(i) : stateOf(i) === s);const names = { active: 'Active', verified: 'Verified', all: 'All' };- $('state-chips').innerHTML = Object.keys(names).map((s) => '<button data-state="' + s + '" class="' + (view.state === s ? 'on' : '') + '" type="button">' + names[s] + '<b>' + matching.filter(inState(s)).length + '</b></button>').join('');- const shown = matching.filter(inState(view.state)).sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));+ // The status bar can open a narrower list; it shows as a fourth choice until another is picked.+ if (view.state === 'verify') names.verify = 'To verify';+ if (view.state === 'gated') names.gated = 'Gated';+ // A lane narrows the list as a state does, and each counts within the other's choice.+ const inLane = (lane) => (i) => !lane || i.lane === lane;+ if (view.lane && !matching.some(inLane(view.lane))) view.lane = null;+ $('state-chips').innerHTML = Object.keys(names).map((s) => '<button data-state="' + s + '" class="' + (view.state === s ? 'on' : '') + '" type="button">' + names[s] + '<b>' + matching.filter(inLane(view.lane)).filter(inState(s)).length + '</b></button>').join('');+ const inView = matching.filter(inState(view.state));+ const laneCounts = [...inView.reduce((m, i) => m.set(i.lane, (m.get(i.lane) || 0) + 1), new Map())].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));+ if (view.lane && !laneCounts.some(([lane]) => lane === view.lane)) laneCounts.push([view.lane, 0]);+ const pick = $('lane-pick'), options = [['', 'All lanes'], ...laneCounts.map(([lane, n]) => [lane, lane + ' · ' + n])].map(([lane, label]) => '<option value="' + esc(lane) + '">' + esc(label) + '</option>').join('');+ // Rewriting an open picker closes it, so it is rewritten only when the lanes or their counts change.+ if (pick.dataset.options !== options) { pick.innerHTML = options; pick.dataset.options = options; }+ pick.value = view.lane || '';+ pick.hidden = laneCounts.length < 2 && !view.lane;+ const shown = inView.filter(inLane(view.lane)).sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));// With nothing picked, the detail shows the first row, and keeps it when a refresh reorders the list.// While another project loads, the item picked there waits for its own board.if (data.root === view.root && !view.adding && !p.items.some((i) => i.id === view.item)) view.item = shown.length ? shown[0].id : null;- const heldLanes = new Map(p.holds.map((h) => [h.hold_lane, h]));// An open item's chip, the same in its row and its detail: gated, its lane held, or unclaimed.const openChip = (i) => i.blockedBy.length || heldLanes.has(i.lane) ? '<span class="chip gate">' + (i.blockedBy.length ? 'gated' : 'lane held') + '</span>' : chip('open');$('chain').innerHTML = shown.length ? shown.map((i) => {const s = stateOf(i);- const who = s === 'building' ? i.owner : [i.builtBy, i.verifiedBy].filter(Boolean).join(' → ');// What an open item waits on, if anything: items not yet verified, or a hold on its lane.const hold = s === 'open' ? heldLanes.get(i.lane) : null;const waits = s === 'open' && i.blockedBy.length ? i.blockedBy : [];- const gated = waits.length > 0 || !!hold;+ const gated = gatedOf(i);const pills = (waits.length ? '<span class="gate">' + waits.map((id, index) => '<span class="wait-unit">' + (index ? '' : 'waits on ') + '<button class="ref" data-go="item:' + id + '" type="button">#' + id + '</button></span>').join(', ') + '</span>' : '') + (hold ? '<span class="gate">lane held: ' + linked(hold.hold_reason, titles) + '</span>' : '');const tag = s === 'building' && i.owner ? '<span class="chip busy" title="building, held by ' + esc(i.owner) + '">' + esc(i.owner) + '</span>': s === 'verify' && i.reviewer ? '<span class="chip warn" title="reviewing until ' + esc(when(i.reviewUntil)) + '">' + esc(i.reviewer) + ' reviewing</span>': s === 'open' ? openChip(i) : chip(s);- return '<li class="row' + (view.item === i.id ? ' on' : '') + (gated ? ' gated' : '') + '" data-item="' + i.id + '" title="' + esc(i.title) + '"><span class="dot ' + s + '"></span><div><div class="t"><span>#' + i.id + '</span>' + rich(i.title, titles) + '</div><div class="meta"><span>' + esc(i.lane) + '</span>' + (i.specs.length ? '<span>' + esc(i.specs.join(', ')) + '</span>' : '') + (who ? '<span class="who">' + esc(who) + '</span>' : '') + pills + '<span>' + age(i.updatedAt) + '</span>' + (rejected(i) ? '<span class="why">' + linked(i.verdict.reason + ': ' + firstLine(i.verdict.note), titles) + '</span>' : '') + '</div></div>' + tag + '</li>';+ return '<li class="row s-' + s + (view.item === i.id ? ' on' : '') + (gated ? ' gated' : '') + '" data-item="' + i.id + '" title="' + esc(i.title) + '"><span class="dot ' + s + '"></span><div><div class="t"><span>#' + i.id + '</span>' + rich(i.title, titles) + '</div><span class="row-age">' + age(i.updatedAt) + '</span><div class="meta">'+ // A rejected row's second line is its verdict; any other row's is its lane and the spec ids it serves.+ + (rejected(i) ? '<span class="why"><b>' + esc(i.verdict.reason) + '</b> ' + linked(firstLine(i.verdict.note), titles) + '</span>'+ : '<span>' + esc(i.lane) + '</span>' + (i.specs.length ? '<span class="specs" title="' + esc(i.specs.join(', ')) + '">' + esc(i.specs.slice(0, 3).join(', ') + (i.specs.length > 3 ? ' +' + (i.specs.length - 3) : '')) + '</span>' : ''))+ + pills + '</div></div>' + tag + '</li>';}).join('') : '<li class="empty">' + (items.length ? 'No items match.' : snapshot ? 'No items at this event.' : 'No items yet. Add the first one with New item.') + '</li>';const item = p.items.find((i) => i.id === view.item);@@ -1303,7 +1314,9 @@ function render() {$('decisions').hidden = !p.decisions.length && !p.asked.length;// The asks as the feed's cards, folded to three lines: the person's to answer, then those waiting on others.$('decisions').innerHTML = (p.decisions.length ? '<div class="head"><i></i>Decision needed</div>' + p.decisions.map((d) => card(d, '<button class="ghost answer" data-go="decide:' + d.shout_id + '" type="button">Answer</button>', false)).join('') : '')- + (p.asked.length ? '<div class="head quiet">Waiting on others</div>' + p.asked.map((d) => card(d, '', false)).join('') : '');+ // Asks waiting on someone else are not the person's to answer, so they fold to one line that opens on demand.+ + (p.asked.length ? foldLine('waiting', p.asked.length + (p.asked.length === 1 ? ' ask' : ' asks') + ' waiting on others', p.asked.map((d) => d.shout_from + ' asks ' + d.shout_to).join(', '))+ + (view.open.waiting ? p.asked.map((d) => card(d, '', false)).join('') : '') : '');foldShouts();// Each agent with what it holds: its claim, then its work sent back, then its work waiting for a// verdict. The worktree path is there on hover; what the person reads is who is doing what.@@ -1330,10 +1343,27 @@ function render() {+ '<span class="agent-doing"><span class="agent-what"><i>#' + first.id + '</i> ' + esc(first.title) + '</span>' + state(a, first) + (mine.length > 1 ? '<span class="agent-more">+' + (mine.length - 1) + '</span>' : '') + '</span></button>'+ (view.agent === a.agent_id ? mine.map((i) => '<div class="agent-work" data-item="' + i.id + '" data-go="item:' + i.id + '"><span>#' + i.id + ' ' + rich(i.title, titles) + '</span>' + state(a, i) + '</div>').join('') : '') + '</div>';};+ // The panel is for who is doing what: agents holding nothing fold to one line that opens to each of them, and stays+ // open while one of them is picked.+ if (idle.some((a) => a.agent_id === view.agent)) view.open.idle = true;+ // Show all ends the open fold while some agents have not moved lately, or stands alone when none is idle.+ const allAgents = p.agents.length > p.agents.filter(recent).length ? '<button class="link all-agents" data-all-agents type="button">' + (view.allAgents ? 'show only agents at work' : 'show all ' + p.agents.length) + '</button>' : '';+ const idleBlock = () => !idle.length ? allAgents : '<div class="agents-idle">' + foldLine('idle', idle.length + ' idle', idle.map((a) => a.agent_id).join(', '))+ + (view.open.idle ? '<div class="idle-list">' + idle.map(pill).join('') + '</div>' + allAgents : '') + '</div>';const pill = (a) => '<button class="agent-pill' + marks(a) + '" data-agent="' + esc(a.agent_id) + '" title="' + esc(tip(a)) + '" type="button"><span>' + face(a) + esc(a.agent_id) + '</span></button>';- $('agents').innerHTML = (listed.length ? busy.map(row).join('') + (idle.length ? '<div class="agents-idle"><span class="agents-label">Idle</span>' + idle.map(pill).join('') + '</div>' : '')- : '<div class="empty">' + (p.agents.length ? 'No agent has moved today.' : 'No agents yet.') + '</div>')- + (p.agents.length > p.agents.filter(recent).length ? '<button class="link all-agents" data-all-agents type="button">' + (view.allAgents ? 'show only agents at work' : 'show all ' + p.agents.length) + '</button>' : '');+ $('agents').innerHTML = (listed.length ? busy.map(row).join('') + idleBlock()+ : '<div class="empty">' + (p.agents.length ? 'No agent has moved today.' : 'No agents yet.') + '</div>');+ // The status bar: what the board is doing, along the foot of the window. Each number is the length of the list its+ // click opens (the Active and To verify filters, the gated rows, the agents panel's rows), and a part with none hides.+ // countUnseen fills the unread shouts once the tab is drawn.+ const release = (p.milestones || []).find((m) => m.done < m.total), last = p.events[0];+ const part = (to, n, words, title) => n ? '<button type="button" data-status="' + to + '" title="' + esc(title) + '"><b>' + n + '</b> ' + words + '</button>' : '';+ $('status-board').innerHTML = part('items', active.length, 'items', 'Show the active items') + '<button type="button" id="status-unread" data-status="shouts" title="Open Shouts" hidden></button>'+ + part('shouts', busy.length, busy.length === 1 ? 'agent' : 'agents', 'Agents holding work: ' + busy.map((a) => a.agent_id).join(', '))+ + part('verify', active.filter((i) => stateOf(i) === 'verify').length, 'to verify', 'Show the items waiting on a verdict')+ + part('gated', active.filter(gatedOf).length, 'gated', 'Show the open items waiting on another item or a held lane')+ + (release ? '<button type="button" data-status="roadmap" title="' + esc('Open the Roadmap: ' + (release.note || release.name)) + '">' + esc(release.name) + ' <b>' + release.done + '/' + release.total + '</b></button>' : '')+ + (last ? '<button type="button" class="end" data-status="' + (last.item_id ? 'item:' + last.item_id : 'activity') + '" title="' + esc(last.event_at) + '">' + esc(last.event_by) + ' ' + esc(last.event_kind) + (last.item_id ? ' #' + last.item_id : '') + ' · ' + age(last.event_at) + '</button>' : '');const held = new Map(p.holds.map((h) => [h.hold_lane, h]));$('lanes').innerHTML = working.map((l) => '<div class="lane"><span><b>' + esc(l) + '</b> ' + (held.has(l) ? '<span class="chip no">held by ' + esc(held.get(l).hold_by) + '</span> <span class="muted">' + linked(held.get(l).hold_reason, titles) + '</span>' : '<span class="chip ok">open</span>') + '</span>' + (held.has(l) ? '<button class="ghost" data-release="' + esc(l) + '" type="button">Release</button>' : '') + '</div>').join('');@@ -1481,15 +1511,16 @@ function countUnseen() {const newest = p.shouts.length ? p.shouts[0].shout_id : 0;const seen = view.tab === 'shouts' || kept === null || kept === undefined ? newest : Number(kept);if (String(seen) !== String(kept)) { view.seen[key] = seen; keep(key, String(seen)); }- $('count-shouts').textContent = (p.unseen && p.unseen.since === seen ? p.unseen.count : p.shouts.filter((x) => x.shout_id > seen).length) || '';+ const unread = (p.unseen && p.unseen.since === seen ? p.unseen.count : p.shouts.filter((x) => x.shout_id > seen).length) || 0;+ const slot = $('status-unread');+ if (slot) { slot.innerHTML = '<b>' + unread + '</b> unread'; slot.hidden = !unread; }+}++/** A quiet line that opens what it counts: what it says, everything it holds on hover, and show or hide. */+function foldLine(name, text, names) {+ return '<button class="fold-line" data-fold="' + name + '" type="button" aria-expanded="' + Boolean(view.open[name]) + '" title="' + esc(names) + '"><span>' + esc(text) + '</span><span class="fold-more">' + (view.open[name] ? 'hide' : 'show') + '</span></button>';}-/**- * Put the shout form in answer mode for an open decision (B21), or back to a plain shout with null.- * The form is never redrawn, so what the person types survives every refresh; only its answer line,- * its To and its button change. The To the person had comes back when the answer is done. An answer- * belongs to the project whose question it shows: leaving that project leaves answer mode.- *//*** Address the composer: the coordinator unless someone else is named, who then shows as a chip the person can clear.*/@@ -1501,6 +1532,12 @@ function addressTo(to) {$('shout-text').placeholder = 'Shout to ' + (who === 'coordinator' ? 'the coordinator' : who);}+/**+ * Put the shout form in answer mode for an open decision (B21), or back to a plain shout with null.+ * The form is never redrawn, so what the person types survives every refresh; only its answer line,+ * its To and its button change. The To the person had comes back when the answer is done. An answer+ * belongs to the project whose question it shows: leaving that project leaves answer mode.+ */function answer(id) {const ask = id === null ? null : data.project.decisions.find((d) => d.shout_id === id) || null;if (ask && !view.answering) view.to = $('shout-to').value;@@ -1520,6 +1557,16 @@ function answer(id) {if (ask) $('shout-text').focus();}+/** Open what a status-bar part counts: its tab, narrowed to exactly those. */+function statusGo(to) {+ if (to.startsWith('item:')) return go(to);+ if (to === 'items') { view.state = 'active'; view.lane = null; view.before = null; $('q').value = ''; openTab('items'); }+ else if (to === 'verify' || to === 'gated') { view.state = to; view.lane = null; view.before = null; $('q').value = ''; openTab('items'); }+ else openTab(to);+ showTab();+ render();+}+/*** Follow a link in the page: an item, a spec row, a tab or a decision to answer. An item can live on* another project's board, root, which the page then switches to.@@ -1838,6 +1885,8 @@ $('shouts-pane').addEventListener('click', (event) => {return;}if (event.target.closest('[data-to-clear]')) { addressTo('coordinator'); $('shout-text').focus(); return; }+ const folded = event.target.closest('[data-fold]');+ if (folded) { view.open[folded.dataset.fold] = !view.open[folded.dataset.fold]; render(); return; }if (event.target.closest('[data-all-agents]')) { view.allAgents = !view.allAgents; render(); return; }if (event.target.closest('[data-agents-toggle]')) { view.agentsHidden = !view.agentsHidden; keep('pb.agents', view.agentsHidden ? 'hidden' : 'shown'); render(); return; }if (!pick) return;@@ -1848,11 +1897,12 @@ $('shouts-pane').addEventListener('click', (event) => {// Enter shouts; Shift+Enter starts a new line.$('shout-text').addEventListener('keydown', (event) => { if (event.key === 'Enter' && !event.shiftKey && !event.isComposing) { event.preventDefault(); $('shout-form').requestSubmit(); } });document.addEventListener('click', (event) => {- const t = event.target.closest('[data-root],[data-tab],[data-go],[data-item],[data-state],[data-rows],[data-row],[data-row-decision],[data-section-approve],[data-release],[data-shout],[data-new],[data-code],[data-code-all],[data-code-less],#proj-switch,#console');+ const t = event.target.closest('[data-status],[data-root],[data-tab],[data-go],[data-item],[data-state],[data-rows],[data-row],[data-row-decision],[data-section-approve],[data-release],[data-shout],[data-new],[data-code],[data-code-all],[data-code-less],#proj-switch,#console');if (!event.target.closest('.side')) fold(false);if (!t) return;if (t.id === 'proj-switch') { fold(!$('side').classList.contains('open')); return; }if (t.id === 'console') { t.hidden = true; return; }+ if (t.dataset.status) { statusGo(t.dataset.status); return; }if (t.dataset.root) switchTo(t.dataset.root, t.dataset.go || '');else if (t.dataset.tab) { openTab(t.dataset.tab); showTab(); }else if (t.dataset.go) go(t.dataset.go, t.dataset.board);@@ -1944,6 +1994,7 @@ $('theme').addEventListener('click', () => {theme(next);});$('q').addEventListener('input', search);+$('lane-pick').addEventListener('change', (event) => { view.lane = event.target.value || null; render(); });$('add-form').addEventListener('submit', async (event) => {event.preventDefault();if (await act('add', { lane: $('add-lane').value, title: $('add-title').value, criterion: $('add-criterion').value, specs: $('add-specs').value, brief: $('add-brief').value }, event.currentTarget)) {diff --git a/src/view.css b/src/view.cssindex 455b6c10..a9e697d4 100644--- a/src/view.css+++ b/src/view.css@@ -96,11 +96,30 @@ button, input, select, textarea { font: inherit; color: inherit; }.tab { border: 0; background: none; padding: 6px 10px; border-radius: 6px; align-self: center; cursor: pointer; color: var(--ink-muted); white-space: nowrap; }.tab:hover { color: var(--ink); }.tab.on { color: var(--ink); background: var(--surface-2); font-weight: 600; }-.tab b { font: 600 11px var(--mono); color: var(--ink-faint); margin-left: 4px; }-.live { margin-left: auto; align-self: center; font-size: 12px; color: var(--ink-faint); white-space: nowrap; }+.live { margin-left: auto; align-self: center; font-size: 12px; color: var(--warn); white-space: nowrap; }.switching main, .switching .products { opacity: .45; transition: opacity .12s; }-main { padding: 16px 18px 28px; }+main { padding: 16px 18px 56px; }+/* The status bar: the page's own surface, frosted so the list shows faintly through it; red when the view is cut off, violet on a snapshot. Each part opens what it counts. */+.status { --status-bg: color-mix(in srgb, var(--surface) 68%, transparent); --status-ink: var(--ink-muted); --status-strong: var(--ink); --status-hover: color-mix(in srgb, var(--ink) 7%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: flex; align-items: stretch; height: 28px; padding: 0 6px; background: var(--status-bg); color: var(--status-ink); font-size: 12px; white-space: nowrap; overflow: hidden; }+.status.snap { --status-bg: color-mix(in srgb, var(--violet-soft) 80%, transparent); --status-ink: var(--violet); --status-strong: var(--violet); }+.status:not(.snap):has(.live:not(:empty)) { --status-bg: color-mix(in srgb, var(--reject-soft) 85%, transparent); --status-ink: var(--reject); --status-strong: var(--reject); }+.status b { color: var(--status-strong); font: 600 11.5px var(--mono); }+.status .live { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 8px; color: inherit; }+.status .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--reject); }+.status .live:empty::before { background: var(--accent); }+.status .live:empty::after { content: 'live'; }+.status-board { display: flex; flex: 1; min-width: 0; align-items: stretch; overflow: hidden; }+.status-group { display: inline-flex; align-items: center; padding-left: 8px; }+.status button { display: inline-flex; align-items: center; gap: 5px; min-height: 0; padding: 0 8px; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; cursor: pointer; }+.status button:hover { background: var(--status-hover); color: var(--status-strong); }+.status button:focus-visible { outline: 2px solid var(--status-strong); outline-offset: -2px; }+.status-board .end { margin-left: auto; opacity: .85; }+.status #status-unread[hidden] { display: none; }+/* With touch its parts are 44px targets; a mouse keeps the thin strip. On a phone it shows only when the view is cut off. */+@media (pointer: coarse) { .status { height: 44px; } .status button { min-height: 44px; } main { padding-bottom: 72px; } }+@media (width < 480px) { .status:not(:has(.live:not(:empty))) { display: none; } main { padding-bottom: 28px; } }+.side { padding-bottom: 44px; }.first { display: none; max-width: 520px; margin: 10vh auto 0; padding: 22px 24px; }.first h2 { margin: 0 0 6px; font-size: 18px; }.first p { margin: 0; color: var(--ink-muted); }@@ -151,13 +170,21 @@ main { padding: 16px 18px 28px; }.tabs { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: auto; gap: 0; }/* Six labels share the bar, so they scale with the screen: 13.5px at 375, 11px at the narrowest, where a* classic scrollbar and wide fonts leave about 290px of bar. */- .tab { display: grid; grid-template-rows: auto 13px; justify-items: center; align-content: center; padding: 7px 2px 5px; font-size: clamp(11px, 3.6vw, 13.5px); }- .tab b { margin: 0; line-height: 13px; }+ .tab { display: grid; justify-items: center; align-content: center; padding: 7px 2px; font-size: clamp(11px, 3.6vw, 13.5px); }}.primary { display: grid; gap: 12px; min-width: 0; }.card-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }-.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; }+.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; container-type: inline-size; }+@container (min-width: 380px) and (max-width: 500px) { .toolbar .find { order: 3; flex-basis: 100%; } .toolbar .go { margin-left: auto; } }.toolbar input { flex: 1 1 96px; }+/* Lane and words share one field: the lane picks the list, the words narrow within it. */+.find { flex: 1 1 172px; display: flex; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }+.find:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }+.find select, .find input { border: 0; border-radius: 0; background: transparent; }+.find select:focus-visible, .find input:focus-visible { outline: 0; }+.find select { flex: none; field-sizing: content; max-width: 9.5em; padding: 0 4px 0 9px; border-right: 1px solid var(--line); color: var(--ink-muted); font-size: 13px; cursor: pointer; }+.find select[hidden] { display: none; }+.toolbar .find input { flex: 1 1 64px; }input, select, textarea { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 7px 9px; min-width: 0; }input:disabled { background: var(--surface-2); color: var(--ink-muted); }.go { border: 0; background: var(--ink); color: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; white-space: nowrap; }@@ -194,13 +221,23 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }.chain { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; }.row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 9px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }.row:hover { background: var(--surface-2); }-.row.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }+/* A row's whole shade says where it stands: blocked rows light red, rows waiting on a verdict light yellow. */+.row.gated { border-color: light-dark(#ca9d96, #86403b); }+.row.s-verify { background: light-dark(#fefaea, #262112); }+.row.s-verify:hover { background: light-dark(#fcf3d6, #2e2816); }+.row.s-verify:not(.gated) { border-color: light-dark(transparent, #6e5722); }+.row.on { background: color-mix(in srgb, var(--ink) 7%, transparent); }+/* What a blocked row waits on stands at the right of its line, beside the gated badge. */+.row .meta > .gate { margin-left: auto; }.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }.dot.building { background: var(--blue); } .dot.verify { background: var(--warn); } .dot.back { background: var(--reject); } .dot.verified { background: var(--accent); }/* A row holds its shape: the title takes the whole first line and the meta and chip share the second,* each line cut with an ellipsis, so every row in a list is as tall as the next. The whole title is the* row's tooltip and opens in the detail. */-.row { grid-template-areas: "dot t t" "dot meta chip"; row-gap: 3px; }+/* The second line starts at the row's edge: a rejected row's verdict, or the lane and the spec ids it serves. */+.row { grid-template-areas: "dot t age" "dot meta chip"; row-gap: 3px; }+.row .meta > .specs { min-width: 0; overflow: hidden; text-overflow: ellipsis; }+.row .row-age { grid-area: age; justify-self: end; color: var(--ink-faint); font: 12px var(--mono); }.row > div { display: contents; }.row > .dot { grid-area: dot; }.row .t { grid-area: t; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }@@ -209,7 +246,9 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }.meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--ink-muted); font-size: 12px; margin-top: 2px; }.row .meta { grid-area: meta; min-width: 0; margin-top: 0; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }.row .meta > * { flex: none; }-.row .meta > .who, .row .meta > .gate, .row .meta > .why { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }+/* A row's second line is its lane, then what holds it up; the spec ids it serves are in its detail. */+.row .meta { align-items: center; }+.row .meta > .gate, .row .meta > .why { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }.row .meta > .why { flex-grow: 1; }.row > .chip { grid-area: chip; justify-self: end; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; }.chip { font: 600 10.5px/1 var(--mono); letter-spacing: .03em; padding: 4px 6px; border-radius: 5px; background: var(--surface-2); color: var(--ink-muted); white-space: nowrap; }@@ -219,8 +258,7 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }.chip.busy { background: var(--blue-soft); color: var(--blue); }.chip.free { background: var(--violet-soft); color: var(--violet); }.chip.gate { background: none; color: var(--ink-muted); outline: 1px dashed var(--line-strong); outline-offset: -1px; }-.row.gated { border-color: color-mix(in srgb, var(--reject) 40%, var(--line)); }-.meta .gate { padding: 0 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--reject) 35%, var(--line)); }+.meta .gate { color: var(--ink-muted); }.meta .gate .wait-unit, .kv dd.waits-on .wait-unit { white-space: nowrap; }.meta .gate button.ref { min-height: 0; }.meta button.ref { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }@@ -249,7 +287,9 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }.sentback { border: 1px solid color-mix(in srgb, var(--reject) 40%, var(--line)); background: color-mix(in srgb, var(--reject) 6%, var(--surface)); border-radius: 10px; padding: 10px 12px; }.sentback h3 { color: var(--reject); }.sentback .verdict { margin: 0; }-.meta .why { flex-basis: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--reject); }+/* A rejected row keeps its verdict's code in the warning colour while it is reworked; the note after it stays quiet. */+.meta .why b { color: var(--warn); font-weight: 600; }+.meta .why { flex-basis: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-faint); font-size: 11.5px; }.tl { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }.tl li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; padding: 0 0 12px 20px; --c: var(--line-strong); }.tl li::before { content: ''; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--c); background: var(--c); }@@ -309,7 +349,6 @@ form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; paddin#decisions > .head + .shout { border-top: 0; }#decisions .shout.clamp:not(.open) .text { -webkit-line-clamp: 3; }#decisions .answer { margin-top: 6px; }-.all-agents { margin-top: 2px; font-size: 13px; }/* Shouts as cards (#250): who and when on top, what was said below, each agent in a colour of its own. No* card carries a coloured edge; colour lives in the avatar, the name and the chips. */:root { --hue-0: light-dark(#0f766e, #5eead4); --hue-1: light-dark(#1d4ed8, #93b4f8); --hue-2: light-dark(#6d28d9, #c4b5fd); --hue-3: light-dark(#be185d, #f9a8d4);@@ -468,7 +507,8 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }.request-error { color: var(--reject); }.request-next { color: var(--ink-muted); }-/* Every action keeps a usable touch target at either viewport, including inline controls. */+/* Every action keeps a usable touch target at either viewport, including inline controls; the one exception is the+ * status bar under a mouse, whose parts are as tall as its thin strip. */button, input, select, textarea, [data-item], [data-row] { min-height: 44px; }.theme-btn, .flow-hide { width: 44px; height: 44px; }.seg { flex-wrap: wrap; max-width: 100%; }@@ -499,10 +539,24 @@ button, input, select, textarea, [data-item], [data-row] { min-height: 44px; }.agent-doing .chip { flex: none; font-size: 10.5px; padding-block: 0; }.agent-more { flex: none; font: 11px var(--mono); color: var(--ink-faint); }.agent-card .agent-work { padding: 0 8px 0 46px; font-size: 12.5px; }-.agents-idle { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin-top: 4px; padding: 2px 4px 0; border-top: 1px solid var(--line); }-.agents-label { width: 100%; padding: 8px 4px 0; color: var(--ink-faint); font: 600 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; }-.agent-pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }-.agent-pill > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-muted); font-size: 12.5px; }+.fold-line { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--ink-muted); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }+.fold-line:hover { background: var(--surface-2); }+.fold-more { margin-left: auto; color: var(--accent-strong); font-weight: 600; }+/* The fold line reaches 4px from the card edge on every side, its words in line with the card text. */+#decisions > .fold-line { margin: 2px -8px 0; width: calc(100% + 16px); }+#decisions:has(> .fold-line:first-child) { padding-top: 4px; }+#decisions > .fold-line:first-child { margin-top: 0; }+.agents-quiet { margin: 4px 0 0; padding: 10px 8px 2px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 12.5px; }+.all-agents { margin-top: 2px; font-size: 13px; }+.agents-idle { margin-top: 4px; padding-top: 2px; border-top: 1px solid var(--line); }+.idle-summary { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--ink-muted); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }+.idle-summary:hover { background: var(--surface-2); }+.idle-more { margin-left: auto; color: var(--accent-strong); font-weight: 600; }+.idle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }+.agent-pill { display: flex; align-items: center; min-width: 0; min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; cursor: pointer; }+.agent-pill:hover { background: var(--surface-2); }+.agent-pill.on { background: color-mix(in srgb, var(--h) 9%, transparent); }+.agent-pill > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-muted); font-size: 12.5px; }.agent-pill:hover > span, .agent-pill.on > span { border-color: var(--h); color: var(--h); }.agent-pill .avatar { width: 20px; height: 20px; font-size: 8px; }.agent-pill .avatar.wide { font-size: 6.5px; }diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex 351f1b1a..605851e2 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -566,7 +566,7 @@ test('the sidebar lists every project and what needs the person [N26]', async ()assert.match(page.show('chain'), /Gamma page/, 'the main column shows the project picked');assert.doesNotMatch(page.show('chain'), /Greeting/);assert.equal(page.element('proj-name').textContent, 'gam<i>ma');- assert.equal(page.element('proj-elsewhere').textContent, '2 elsewhere', 'the folded button counts what needs the person elsewhere: beta\'s question and held lane, not alpha\'s agents\' work');+ assert.ok(!page.html.includes('proj-elsewhere'), 'the folded button carries no count: what needs the person in each project is in the list it opens');await page.click({ id: 'proj-switch', classes: 'switch-btn side' });assert.ok(page.element('side').classList.contains('open'), 'the project button opens the list');@@ -815,11 +815,10 @@ test('the tabs fit one row on a phone [N26]', async () => {const phone = /@media \(width < 480px\) \{\n([^@]*?)\n\}/.exec(style)?.[1] ?? '';assert.doesNotMatch(style, /max-width: 480px/, 'at 480px itself the tabs keep their row');assert.match(phone, /\.tabs \{ flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: auto;/, 'under 480px the tabs share the bar: each as wide as its label, plus an even share of the room left');- assert.match(phone, /\.tab \{ display: grid; grid-template-rows: auto 13px; justify-items: center;/, 'each tab stacks its label over its count');- assert.match(phone, /\.tab b \{ margin: 0;/);+ assert.match(phone, /\.tab \{ display: grid; justify-items: center; align-content: center;/, 'each tab centres its label in its share');assert.match(style, /\n\.tabs \{ display: flex; flex-wrap: wrap; gap: 2px; \}\n/, 'wider, the tabs keep the row they have');- const tabs = [...html.matchAll(/<button class="tab" data-tab="([a-z]+)" type="button">([A-Za-z]+)(<b id="count-([a-z]+)"><\/b>)?<\/button>/g)];- assert.deepEqual(tabs.map((match) => [match[2], match[4] === match[1]]), [['Items', true], ['Shouts', true], ['Spec', true], ['Doctrine', true], ['Activity', false], ['Roadmap', false]], 'six tabs: a label, then its count where it has one');+ const tabs = [...html.matchAll(/<button class="tab" data-tab="([a-z]+)" type="button">([A-Za-z]+)<\/button>/g)];+ assert.deepEqual(tabs.map((match) => match[2]), ['Items', 'Shouts', 'Spec', 'Doctrine', 'Activity', 'Roadmap'], 'six tabs, each its label alone: their counts are in the status bar');} finally {await view.stop();}@@ -1137,6 +1136,9 @@ test('the agents panel says what each agent holds [N26]', async () => {const view = await startView(box);try {const page = await openPage(view);+ assert.deepEqual(agentEntries(page.show('agents')).map((agent) => agent.id), ['web-1', 'web-2'], 'an agent holding nothing waits in the idle fold, closed');+ assert.match(page.show('agents'), /<button class="fold-line" data-fold="idle" type="button" aria-expanded="false" title="coordinator"><span>1 idle<\/span>/);+ page.run('view.open.idle = true; render();');const agents = agentEntries(page.show('agents'));assert.deepEqual(agents.map((agent) => [agent.id, agent.holds, agent.more, agent.idle]), [// An agent holding work is a row with its first thing: the claim, then work sent back, then work waiting for a verdict.@@ -1175,6 +1177,7 @@ test('a review in progress names its reviewer [N26]', async () => {const page = await openPage(view);assert.match(itemRow(page.show('chain'), 1), /<span class="chip warn" title="reviewing until [^"]+">web-2 reviewing<\/span><\/li>$/, 'the row names who holds the review');assert.doesNotMatch(page.show('needs'), /Greeting/, "a review is the agents' work, so it stays out of Needs-you");+ page.run('view.open.idle = true; render();');const holds = (id) => agentEntries(page.show('agents')).find((agent) => agent.id === id).holds;assert.deepEqual(holds('web-2'), ['#1 Greeting: reviewing'], 'the reviewer holds it');assert.deepEqual(holds('web-1'), ['#1 Greeting: to verify'], 'the builder waits on it');@@ -1242,7 +1245,6 @@ test('an open decision counts in the sidebar and the tab title [B21, B26, N26]',await page.run('refresh()');assert.deepEqual(rows(), [['alpha', '', 'nothing open'], ['beta', '1', '1 decision']], "passed up, it needs the person, from alpha too");assert.equal(page.run('document.title'), '(1) alpha · Pullboard');- assert.equal(page.element('proj-elsewhere').textContent, '1 elsewhere', 'and on a phone');box.run(beta.repo, 'shout', 'person', 'And the docs?', '--decision');await page.run('refresh()');@@ -1255,7 +1257,6 @@ test('an open decision counts in the sidebar and the tab title [B21, B26, N26]',assert.deepEqual(replies.map((shout) => [shout.shout_from, shout.shout_to, shout.shout_answers, shout.shout_text]),[['person', 'web-1', 1, 'Person answered #2: yes']], "the person's answer reaches the agent that asked");assert.equal(page.run('document.title'), 'alpha · Pullboard');- assert.equal(page.element('proj-elsewhere').hidden, true);} finally {await view.stop();}@@ -1706,9 +1707,9 @@ test('a sent-back item shows why first [N26]', async () => {const needs = page.show('needs');assert.doesNotMatch(needs, /Greeting|Farewell/, "work sent back is the agents' to move, so it stays out of Needs-you; its row says why");const row = itemRow(page.show('chain'), 1);- assert.ok(row.includes('BEHAVIOR_MISMATCH: no <b>greeting</b> on the page'), row);+ assert.ok(row.includes('<b>BEHAVIOR_MISMATCH</b> no <b>greeting</b> on the page'), row);assert.ok(!row.includes('second line'), 'the row shows the first line of the note only');- assert.ok(itemRow(page.show('chain'), 2).includes('BEHAVIOR_MISMATCH: the farewell is missing'));+ assert.ok(itemRow(page.show('chain'), 2).includes('<b>BEHAVIOR_MISMATCH</b> the farewell is missing'));await page.click({ item: '1', classes: 'row' });const detail = page.show('detail');@@ -1728,7 +1729,7 @@ test('a sent-back item shows why first [N26]', async () => {await page.click({ item: '2', classes: 'row' });assert.match(beforeCriterion(), /<h3>Sent back, resubmitted<\/h3>[^]*the farewell is missing/);- assert.ok(itemRow(page.show('chain'), 5).includes('BEHAVIOR_MISMATCH: the footer is empty'), 'a row being reworked still says why');+ assert.ok(itemRow(page.show('chain'), 5).includes('<b>BEHAVIOR_MISMATCH</b> the footer is empty'), 'a row being reworked still says why');await page.click({ item: '5', classes: 'row' });assert.match(beforeCriterion(), /<h3>Sent back, being reworked<\/h3>[^]*<b>REJECT BEHAVIOR_MISMATCH<\/b>[^]*the footer is empty/);@@ -1770,7 +1771,7 @@ test('the list shows active, verified or all [N26]', async () => {assert.deepEqual(rows(), [1]);await page.click({ state: 'all' });assert.deepEqual(rows(), [1, 2]);- assert.match(page.html, /<div class="card-panel toolbar"><div class="seg" id="state-chips" role="group" aria-label="Show"><\/div><input id="q" type="search"/, 'the control sits in the toolbar beside the search');+ assert.match(page.html, /<div class="card-panel toolbar"><div class="seg" id="state-chips" role="group" aria-label="Show"><\/div><div class="find"><select id="lane-pick" aria-label="Lane"><\/select><input id="q" type="search"/, 'the control sits in the toolbar beside the search, whose field holds the lane picker');assert.doesNotMatch(page.html, /id="lane-filter"|class="chips" id="state-chips"/, 'no lane menu and no row of chips');await page.click({ state: 'active' });@@ -1866,7 +1867,9 @@ test('a decision waits in needs-you until the view answers it [B21, B26, N27]',// An agent asks its coordinator (B25): the ask waits on the board with who holds it, never in Needs-you.assert.doesNotMatch(page.show('needs'), /decide:/, "an agent's ask is its coordinator's to answer");assert.equal(page.element('decisions').hidden, false);- assert.match(page.show('decisions'), new RegExp(`^<div class="head quiet">Waiting on others</div><article class="shout h\\d" data-shout-id="1"><span class="avatar" aria-hidden="true">W1</span><div class="shout-main"><header><b class="who">web-1</b><span class="to">→ coordinator</span><span class="mark ask">decision</span> <time class="long" data-ago="[^"]+" title="[^"]+">now</time></header><div class="text">${question}</div><button class="more" data-more type="button">more</button></div></article>$`), 'above the shouts as a card, saying who asked whom, with no Answer button');+ assert.match(page.show('decisions'), /^<button class="fold-line" data-fold="waiting" type="button" aria-expanded="false" title="web-1 asks coordinator"><span>1 ask waiting on others<\/span><span class="fold-more">show<\/span><\/button>$/, 'an ask waiting on others folds to one line');+ page.run('view.open.waiting = true; render();');+ assert.match(page.show('decisions'), new RegExp(`^<button class="fold-line" data-fold="waiting" type="button" aria-expanded="true"[^>]*><span>1 ask waiting on others</span><span class="fold-more">hide</span></button><article class="shout h\\d" data-shout-id="1"><span class="avatar" aria-hidden="true">W1</span><div class="shout-main"><header><b class="who">web-1</b><span class="to">→ coordinator</span><span class="mark ask">decision</span> <time class="long" data-ago="[^"]+" title="[^"]+">now</time></header><div class="text">${question}</div><button class="more" data-more type="button">more</button></div></article>$`), 'above the shouts as a card, saying who asked whom, with no Answer button');assert.doesNotMatch(page.show('feed'), /Greet in/, 'though the feed no longer reaches it');// The coordinator passes it up with its note (B27): now it is the person's call.@@ -1967,9 +1970,10 @@ test("needs-you holds only the person's calls; the rest show on the board with wassert.match(needs, /<code>web<\/code><span class="ny-text">G3 is open<\/span><button class="ny-open" data-go="tab:shouts" type="button"><em>lane held by coordinator, <time data-ago="[^"]+">(?:now|\d+[mhd])<\/time> →<\/em><\/button>/, 'a held lane says who set it and shows the API-provided hold age');// Each of the rest is on the board, with who holds it.- assert.match(page.show('decisions'), /<div class="head quiet">Waiting on others<\/div><article class="shout h\d" data-shout-id="\d+"><span class="avatar" aria-hidden="true">W1<\/span><div class="shout-main"><header><b class="who">web-1<\/b><span class="to">→ coordinator<\/span>/, "the agent's ask waits on its coordinator");+ page.run('view.open.waiting = true; render();');+ assert.match(page.show('decisions'), /<button class="fold-line" data-fold="waiting" type="button" aria-expanded="true"[^>]*><span>1 ask waiting on others<\/span><span class="fold-more">hide<\/span><\/button><article class="shout h\d" data-shout-id="\d+"><span class="avatar" aria-hidden="true">W1<\/span><div class="shout-main"><header><b class="who">web-1<\/b><span class="to">→ coordinator<\/span>/, "the agent's ask waits on its coordinator");assert.match(itemRow(page.show('chain'), 1), /<span class="chip [^"]*">to verify<\/span><\/li>$/, 'work waiting for a verdict');- assert.ok(itemRow(page.show('chain'), 2).includes('BEHAVIOR_MISMATCH: no farewell yet'), 'and work sent back, with why');+ assert.ok(itemRow(page.show('chain'), 2).includes('<b>BEHAVIOR_MISMATCH</b> no farewell yet'), 'and work sent back, with why');page.run("view.agent = 'web-1'; render();");assert.deepEqual(agentEntries(page.show('agents')).find((agent) => agent.id === 'web-1').holds, ['#2 Farewell: sent back', '#1 Greeting: to verify'], 'the agent that built them holds both');page.run('view.agent = null; render();');@@ -2026,7 +2030,7 @@ test('the shouts tab counts shouts you have not seen [N26]', async () => {const view = await startView(box);try {const store = storage();- const count = (page) => page.element('count-shouts').textContent;+ const count = (page) => { const unread = page.element('status-unread'); return unread.hidden ? '' : /<b>(\d+)<\/b> unread/.exec(unread.innerHTML)?.[1] ?? unread.innerHTML; };const page = await openPage(view, { store });assert.equal(count(page), '', 'the shouts there before the first look count as seen, not as 2');@@ -2099,7 +2103,7 @@ test('the detail opens on the top item, not a blank form [N26]', async () => {try {const page = await openPage(view);const shown = () => /<h2><span>#(\d+)<\/span>([^<]*)</.exec(page.show('detail'))?.slice(1).join(' ');- const rows = () => [...page.show('chain').matchAll(/<li class="row( on)?" data-item="(\d+)"/g)].map((match) => match[2] + (match[1] ? '*' : ''));+ const rows = () => [...page.show('chain').matchAll(/<li class="row s-[a-z]+( on)?[^"]*" data-item="(\d+)"/g)].map((match) => match[2] + (match[1] ? '*' : ''));const form = () => [page.element('add-form').hidden, page.element('detail').hidden];assert.equal(shown(), '2 Farewell', 'the first row, the item updated last');@@ -3804,7 +3808,7 @@ test('read-only Needs-you preserves each entry as text while its transport staysconst calls = JSON.parse(await chrome.evaluate('JSON.stringify(window.__transportCalls)'));assert.ok(calls.some((call) => call.path === '/api/v1/boards'));assert.ok(calls.some((call) => call.path.startsWith('/api/v1/boards/') && call.path.endsWith('/state')));- assert.match(await chrome.evaluate("document.querySelector('#live').textContent"), /^live · /, 'read-only transport keeps the page live');+ assert.equal(await chrome.evaluate("document.querySelector('#live').textContent"), '', 'read-only transport keeps the page live, which says nothing');const actionSelectors = ['#new-item', '#add-form', '#shout-form', '#hold-form', '[data-release]', '[data-shout]', '[data-new]', '[data-go^="decide:"]'];const actionMatches = JSON.parse(await chrome.evaluate(`JSON.stringify(${JSON.stringify(actionSelectors)}.map((selector) => ({ selector, count: document.querySelectorAll(selector).length, visible: [...document.querySelectorAll(selector)].some((node) => !node.hidden && getComputedStyle(node).display !== 'none') })))`));assert.ok(actionMatches.every((entry) => entry.count > 0), 'the seeded item, decision and hold exercise every action selector');@@ -4010,7 +4014,7 @@ test('real Chrome keeps the demo board usable at phone and desktop widths [H5,N2return JSON.parse(await chrome.evaluate(`JSON.stringify((() => {const visible=e=>{const s=getComputedStyle(e),r=e.getBoundingClientRect();return !e.disabled&&s.display!=='none'&&s.visibility!=='hidden'&&Number(s.opacity)!==0&&r.width>0&&r.height>0&&!e.closest('[hidden]')};const selector='button,a[href],input:not([type=hidden]),select,textarea,[role=button],[data-root],[data-tab],[data-go],[data-item],[data-state],[data-rows],[data-row],[data-release],[data-shout],[data-new],[data-code]';- const controls=[...new Set(document.querySelectorAll(selector))].filter(visible).map(e=>{const r=e.getBoundingClientRect();return {tag:e.tagName,id:e.id||'',text:(e.innerText||e.getAttribute('aria-label')||'').trim().slice(0,60),x:r.x,y:r.y,right:r.right,bottom:r.bottom,width:r.width,height:r.height,inlineReference:e.matches('.feed button.ref, .shout button.ref, .shout .band a, .detail button.ref')||!!e.closest('#chain .meta .gate, #detail .kv dd.waits-on')}});+ const controls=[...new Set(document.querySelectorAll(selector))].filter(visible).map(e=>{const r=e.getBoundingClientRect();return {tag:e.tagName,id:e.id||'',text:(e.innerText||e.getAttribute('aria-label')||'').trim().slice(0,60),x:r.x,y:r.y,right:r.right,bottom:r.bottom,width:r.width,height:r.height,inlineReference:e.matches('.feed button.ref, .shout button.ref, .shout .band a, .detail button.ref')||!!e.closest('#chain .meta .gate, #detail .kv dd.waits-on'),statusBar:!!e.closest('.status')&&matchMedia('(pointer: fine)').matches}});const notice=document.querySelector('#console');const noticeBox=visible(notice)?notice.getBoundingClientRect():null;const toast=noticeBox?{x:noticeBox.x,y:noticeBox.y,right:noticeBox.right,bottom:noticeBox.bottom,visible:noticeBox.y>=0&¬iceBox.bottom<=innerHeight,@@ -4027,7 +4031,8 @@ test('real Chrome keeps the demo board usable at phone and desktop widths [H5,N2const layout = await snapshot();assert.ok(fitsViewport(layout),`${width} ${place}: no horizontal overflow: ${JSON.stringify(layout)}`);- const short = layout.controls.filter((control) => control.height < 44 && !control.inlineReference);+ // The status bar under a mouse is a thin strip, the one named exception; with touch its parts are 44px too.+ const short = layout.controls.filter((control) => control.height < 44 && !control.inlineReference && !control.statusBar);assert.deepEqual(short, [], `${width} ${place}: visible enabled actions are at least 44px high: ${JSON.stringify(short)}`);if (layout.toast) assert.deepEqual(layout.toast.overlaps, [], `${width} ${place}: the result toast clears every visible control: ${JSON.stringify(layout.toast)}`);if (place === 'successful add toast') assert.equal(layout.toast?.visible, true, `${width}: the successful action toast remains in the viewport: ${JSON.stringify(layout.toast)}`);@@ -4087,6 +4092,7 @@ test('real Chrome keeps the demo board usable at phone and desktop widths [H5,N2assert.ok(wrap.tokenLines > 1, `${width}: only the overflowing unbroken token splits: ${JSON.stringify(wrap)}`);}if (tab === 'shouts') {+ await chrome.evaluate("(() => { const fold = document.querySelector('.fold-line[data-fold=\"waiting\"]'); if (fold && fold.getAttribute('aria-expanded') !== 'true') fold.click(); })()");await waitRendered(['#decisions .shout:not(:has(.answer)) header', '#decisions .shout:not(:has(.answer)) .text', '#decisions .shout .answer']);const asks = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {const waiting = document.querySelector('#decisions .shout:not(:has(.answer))');@@ -4442,7 +4448,7 @@ test('real Chrome records Spec row decisions from the row, detail and confirmedawait chrome.evaluate("document.querySelector('[data-tab=spec]').click()");await chrome.waitFor(`innerWidth === ${width} && !!document.querySelector('#spec-list [data-row="spec:G1"]')`);await chrome.evaluate("document.querySelector('#spec-chips [data-rows=\"spec:all\"]').click()");- await chrome.waitFor("document.querySelector('#spec-list [data-row=\"spec:G2\"]') && document.querySelector('#count-spec').textContent === '31'");+ await chrome.waitFor("document.querySelector('#spec-list [data-row=\"spec:G2\"]') && document.querySelector('#spec-chips [data-rows=\"spec:decide\"] b')?.textContent === '31'");const geometry = JSON.parse(await chrome.evaluate(`JSON.stringify({overflow: document.documentElement.scrollWidth > document.documentElement.clientWidth,@@ -4474,7 +4480,7 @@ test('real Chrome records Spec row decisions from the row, detail and confirmedassert.equal(state.spec.find((row) => row.id === 'G2')?.decision, undefined, `${width}: and nothing else`);await chrome.waitFor("view.row.spec === 'G2' && document.querySelector('#spec-detail h2 span')?.textContent === 'G2'");assert.ok(await chrome.evaluate(`(() => { const e=document.querySelector('#spec-list [data-row="spec:G2"]'); const r=e.getBoundingClientRect(); return r.top >= 0 && r.bottom <= innerHeight; })()`), `${width}: next undecided G2 stays in the viewport after G1 approval`);- assert.equal(await chrome.evaluate("document.querySelector('#count-spec').textContent"), '30', `${width}: Spec badge excludes the decided row`);+ assert.equal(await chrome.evaluate("document.querySelector('#spec-chips [data-rows=\"spec:decide\"] b').textContent"), '30', `${width}: Needs your decision excludes the decided row`);if (width === 1280) assert.ok(await chrome.evaluate(`(() => {const row=document.querySelector('#spec-list [data-row="spec:G1"]');const chip=row.querySelector('.srow-text .chip').getBoundingClientRect();@@ -4938,6 +4944,7 @@ test('shouts read as cards [N26]', { timeout: 120_000 }, async (t) => {await chrome.waitFor('typeof data !== "undefined" && data?.project?.shouts?.length >= 12');await chrome.evaluate("document.querySelector('[data-tab=shouts]').click()");await chrome.waitFor('document.querySelector("[data-pane=shouts]:not([hidden]) #feed .shout")');+ await chrome.evaluate("(() => { const fold = document.querySelector('.fold-line[data-fold=\"waiting\"]'); if (fold && fold.getAttribute('aria-expanded') !== 'true') fold.click(); })()");const ids = JSON.parse(await chrome.evaluate('JSON.stringify(Object.fromEntries(data.project.shouts.map((s) => [s.shout_text, s.shout_id])))'));const answerId = await chrome.evaluate(`data.project.shouts.find((s) => s.shout_answers === ${asked.shout_id}).shout_id`);const stamps = JSON.parse(await chrome.evaluate('JSON.stringify(data.project.shouts.map((s) => [s.shout_id, s.shout_at]))'));@@ -5058,7 +5065,7 @@ test('shouts read as cards [N26]', { timeout: 120_000 }, async (t) => {// A long shout folds at six lines; the asks above the composer are the same cards, folded at three.assert.deepEqual([folded.text.lines, folded.text.clamped, folded.more], [6, true, 'more'], `${at}: a long shout folds at six lines with more`);assert.equal(old.more, null, `${at}: a short shout has no more`);- assert.deepEqual(r.heads, ['Decision needed', 'Waiting on others'], `${at}: the asks above the composer`);+ assert.deepEqual(r.heads, ['Decision needed'], `${at}: the asks above the composer: the person's under their head, the rest opened from their fold line`);assert.deepEqual([r.asks.friday.answer, r.asks.colour.answer], ['Answer', null], `${at}: the person's ask has an Answer button; one waiting on others has none`);assert.deepEqual([r.asks.colour.text.lines, r.asks.colour.text.clamped, r.asks.colour.more], [3, true, 'more'], `${at}: an ask folds at three lines`);assert.ok(r.asks.friday.avatar.svg && r.asks.friday.who.text === 'coordinator', `${at}: the asks are the feed's cards`);@@ -5142,6 +5149,7 @@ test('the shout composer, agent filter and agents panel [N26]', { timeout: 120_0await chrome.waitFor('typeof data !== "undefined" && data?.project?.shouts?.length >= 4');await chrome.evaluate("document.querySelector('[data-tab=shouts]').click()");await chrome.waitFor('document.querySelector("[data-pane=shouts]:not([hidden]) #feed .shout")');+ await chrome.evaluate("(() => { const fold = document.querySelector('.fold-line[data-fold=\"idle\"]'); if (fold && fold.getAttribute('aria-expanded') !== 'true') fold.click(); })()");const agents = JSON.parse(await chrome.evaluate('JSON.stringify(data.project.agents.map((a) => [a.agent_id, a.agent_path]))'));assert.deepEqual(agents.filter(([, path]) => [alpha.web, idle, fresh].includes(path)).map(([id]) => id).sort(), ['web-1', 'web-2', 'web-3'], 'three agents joined the web lane');const total = await chrome.evaluate('data.project.shouts.length');@@ -5175,7 +5183,7 @@ test('the shout composer, agent filter and agents panel [N26]', { timeout: 120_0for (const part of ['message', 'send']) assert.ok(s[part].top >= s.composer.top - 0.5 && s[part].bottom <= s.composer.bottom + 0.5, `${at}: the ${part} sits inside the composer bar: ${JSON.stringify(s)}`);assert.ok(s.pickers === 0 && s.message.right <= s.send.left + 0.5 && s.composer.right - s.send.right < 12, `${at}: the message, then send: ${JSON.stringify(s)}`);assert.ok(s.send.width >= 44 && s.send.height >= 44, `${at}: the send button is a 44px target`);- // Only agents at work are listed, with show all.+ // Only agents at work are listed, the idle ones in their fold, which ends with show all.assert.ok(s.panel && s.listed.includes('web-1') && s.listed.includes('web-3') && !s.listed.includes('web-2'), `${at}: the agents at work, and not the idle one: ${s.listed}`);assert.equal(s.all, `show all ${agents.length}`, `${at}: every agent is one click away`);}@@ -5269,6 +5277,8 @@ test('the agents panel is rows for work and pills for idle [N26]', { timeout: 12await chrome.waitFor('typeof data !== "undefined" && data?.project?.agents?.length >= 4 && data.project.shouts.length >= 2');await chrome.evaluate("document.querySelector('[data-tab=shouts]').click()");await chrome.waitFor('document.querySelector("[data-pane=shouts]:not([hidden]) #agents [data-agent]")');+ assert.equal(await chrome.evaluate("document.querySelectorAll('#agents .agent-pill').length + ':' + document.querySelector('#agents .fold-line[data-fold=\"idle\"]').getAttribute('aria-expanded')"), '0:false', 'the idle agents start folded');+ await chrome.evaluate("(() => { const fold = document.querySelector('.fold-line[data-fold=\"idle\"]'); if (fold && fold.getAttribute('aria-expanded') !== 'true') fold.click(); })()");const agents = await chrome.evaluate('data.project.agents.length');/** The panel as it reads: each row and pill, measured where it stands. */const panel = async () => JSON.parse(await chrome.evaluate(`JSON.stringify((() => {@@ -5283,7 +5293,7 @@ test('the agents panel is rows for work and pills for idle [N26]', { timeout: 12work: [...card.querySelectorAll('.agent-work[data-item]')].map((work) => [work.dataset.item, box(work).height]) };}),pills: [...list.querySelectorAll('.agent-pill')].map((pill) => ({ id: pill.dataset.agent, title: pill.title, height: box(pill).height, on: pill.classList.contains('on') })),- idle: list.querySelector('.agents-label')?.textContent ?? null, all: list.querySelector('.all-agents')?.textContent ?? null, height: box(list).height,+ idle: list.querySelector('.fold-line[data-fold="idle"] span')?.textContent ?? null, all: list.querySelector('.all-agents')?.textContent ?? null, height: box(list).height,chip: document.querySelector('#shout-to-chip').hidden ? null : document.querySelector('#shout-to-chip').textContent, to: document.querySelector('#shout-to').value,cards: [...document.querySelectorAll('#feed .shout')].map((card) => [card.querySelector('.who').textContent, card.querySelector('.to').textContent.replace('→ ', '')]),};@@ -5302,8 +5312,8 @@ test('the agents panel is rows for work and pills for idle [N26]', { timeout: 12assert.equal(row.face, row.name, `${at}: the name is in its avatar's colour, as in the feed`);assert.ok(row.height >= 44, `${at}: the row is a 44px target`);assert.ok(!/strong/.test(row.text) && row.title.includes('web · strong') && row.title.includes(alpha.web), `${at}: lane, route and path are on hover, not in the row: ${row.title}`);- // Agents holding nothing are pills under Idle; one that has not moved in the last hour waits behind show all.- assert.deepEqual([p.idle, p.pills.map((pill) => pill.id)], ['Idle', ['coordinator', 'web-2']], `${at}: the idle agents are pills`);+ // Agents holding nothing are pills in the idle fold; one that has not moved in the last hour waits behind show all.+ assert.deepEqual([p.idle, p.pills.map((pill) => pill.id)], ['2 idle', ['coordinator', 'web-2']], `${at}: the idle agents are pills`);assert.ok(p.pills.every((pill) => pill.height >= 44 && pill.title.includes(' · ')), `${at}: each pill a 44px target with its lane on hover`);assert.equal(p.all, `show all ${agents}`, `${at}: every agent one click away`);assert.ok(p.height < 260, `${at}: four agents take little room: ${p.height}px`);@@ -5351,6 +5361,7 @@ test('the composer goes to the coordinator and says who heard [N26]', { timeout:await chrome.waitFor('typeof data !== "undefined" && data?.project?.shouts?.length >= 1');await chrome.evaluate("document.querySelector('[data-tab=shouts]').click()");await chrome.waitFor('document.querySelector("[data-pane=shouts]:not([hidden]) #feed .shout")');+ await chrome.evaluate("document.querySelector('#agents .fold-line[data-fold=\"idle\"]').click()");/** The composer and every shout of the person's, with what its Heard line says. */const read = async () => JSON.parse(await chrome.evaluate(`JSON.stringify((() => {const chip = document.querySelector('#shout-to-chip'), clear = chip.querySelector('[data-to-clear]');@@ -6334,3 +6345,235 @@ test('an exported roadmap has its own address under a folder, and Back and ForwarmSync(profile, { recursive: true, force: true });}});++test('the board reads at a glance from the status bar [N26]', { timeout: 180_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for status bar checks.');++ const box = machine();+ const lanes = { web: { owns: ['web/'], specs: ['G'] }, api: { owns: ['api/'], specs: ['G'] } };+ const spec = `${SPEC}- G3 [approved, must] The page has a footer. | gate: web test\n- G4 [approved, must] The page has a header. | gate: web test\n`;+ const alpha = project(box, 'glance', spec, { lanes });+ const add = (lane, title, ...more) => box.run(alpha.repo, 'add', lane, title, '--specs', 'G1', '--criterion', 'renders', ...more);+ add('web', 'Free', '--specs', 'G1,G2,G3,G4');+ add('web', 'Base');+ add('web', 'Depends', '--after', '2');+ add('api', 'Api work');+ add('web', 'Shipped');+ add('web', 'Bounced');+ add('web', 'Done');+ build(box, alpha, 5, 'shipped.html');+ build(box, alpha, 6, 'bounced.html');+ build(box, alpha, 7, 'done.html');+ sendBack(box, alpha, 6, 'the footer is missing\nand more on the next line');+ accept(box, alpha, 7);+ box.run(alpha.web, 'claim', '2');+ box.run(alpha.repo, 'hold', 'api', '--reason', 'API freeze');+ box.run(alpha.repo, 'milestone', 'add', '1.0: first cut', '--note', 'The first pages', '--items', '1,5,7');+ const second = join(box.dir, 'glance-web-2');+ box.git(alpha.repo, 'worktree', 'add', '-q', second, '-b', 'web/glance2');+ box.run(second, 'join', 'web');+ box.run(second, 'shout', 'coordinator', 'Free when you need me.');+ box.run(alpha.web, 'shout', 'coordinator', 'Which colour for the button?', '--decision');++ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-glance-chrome-'));+ let chrome;+ /** The page as it reads: the header, the bar's parts, the list's rows and the toolbar, measured where they stand. */+ const read = async () => JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const box = (e) => { if (!e) return null; const r = e.getBoundingClientRect(); return { left: r.left, right: r.right, top: r.top, bottom: r.bottom, width: r.width, height: r.height }; };+ const rgb = (css) => { const n = (css.match(/[\\d.]+/g) || []).map(Number); return css.startsWith('color(srgb') ? [n[0] * 255, n[1] * 255, n[2] * 255, n[3] ?? 1] : [n[0], n[1], n[2], n[3] ?? 1]; };+ const words = (e) => [...e.children].map((child) => child.textContent.replace(/\\s+/g, ' ').trim()).join(' ');+ const probe = document.createElement('i');+ probe.style.color = 'var(--warn)';+ document.body.append(probe);+ const warn = getComputedStyle(probe).color;+ probe.remove();+ const rows = [...document.querySelectorAll('#chain .row')].map((row) => {+ const s = getComputedStyle(row), why = row.querySelector('.meta .why b');+ return { id: row.dataset.item, row: box(row), title: box(row.querySelector('.t')), age: box(row.querySelector('.row-age')),+ meta: words(row.querySelector('.meta')), chip: row.querySelector(':scope > .chip')?.textContent ?? null,+ why: why ? { text: why.textContent, color: getComputedStyle(why).color } : null, gated: row.classList.contains('gated'),+ border: rgb(s.borderTopColor), borderWidth: s.borderTopWidth, edges: [s.borderTopColor, s.borderRightColor, s.borderBottomColor, s.borderLeftColor].every((c) => c === s.borderTopColor),+ tint: rgb(s.backgroundColor) };+ });+ const status = document.querySelector('.status');+ return {+ page: { width: document.documentElement.clientWidth, scroll: document.documentElement.scrollWidth, body: document.body.scrollWidth },+ tabs: [...document.querySelectorAll('#tabs .tab')].map((tab) => tab.textContent),+ header: document.querySelector('.top').innerText.replace(/\\s+/g, ' ').trim(), live: document.querySelector('#live').textContent, liveInBar: !!document.querySelector('.status #live'),+ bar: [...document.querySelectorAll('.status [data-status]')].filter((part) => !part.hidden).map((part) => ({ to: part.dataset.status, text: part.textContent.replace(/\\s+/g, ' ').trim(), height: part.getBoundingClientRect().height })),+ barShown: getComputedStyle(status).display !== 'none', barBox: box(status), barTint: rgb(getComputedStyle(status).backgroundColor), barBlur: getComputedStyle(status).backdropFilter,+ rows, warn, state: view.state, lane: view.lane, tab: view.tab,+ chips: [...document.querySelectorAll('#state-chips button')].map((chip) => [chip.firstChild.textContent, chip.querySelector('b').textContent, chip.classList.contains('on')]),+ lanes: [...document.querySelectorAll('#lane-pick option')].map((option) => option.textContent), pick: box(document.querySelector('#lane-pick')),+ seg: box(document.querySelector('#state-chips')), find: box(document.querySelector('.find')), go: box(document.querySelector('#new-item')), toolbar: box(document.querySelector('.toolbar')),+ waiting: (() => { const fold = document.querySelector('#decisions .fold-line[data-fold="waiting"]'); return fold && { text: words(fold), open: fold.getAttribute('aria-expanded'), height: fold.getBoundingClientRect().height, offset: fold.getBoundingClientRect().top - fold.parentElement.getBoundingClientRect().top, cards: document.querySelectorAll('#decisions .shout').length }; })(),+ idle: (() => { const fold = document.querySelector('#agents .fold-line[data-fold="idle"]'); return fold && { text: words(fold), open: fold.getAttribute('aria-expanded'), height: fold.getBoundingClientRect().height, pills: document.querySelectorAll('#agents .agent-pill').length }; })(),+ agentRows: document.querySelectorAll('#agents .agent-card').length,+ };+ })())`));+ const part = (r, to) => r.bar.find((p) => p.to === to);+ const number = (p) => Number(/^(\d+)/.exec(p?.text ?? '')?.[1] ?? NaN);+ const click = async (selector) => chrome.evaluate(`document.querySelector(${JSON.stringify(selector)}).click()`);+ const settle = () => chrome.evaluate('new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(done)))');+ /** Pick a lane the way the picker does: its value, then its change event. */+ const lane = async (name) => { await chrome.evaluate(`(() => { const pick = document.querySelector('#lane-pick'); pick.value = ${JSON.stringify(name)}; pick.dispatchEvent(new Event('change')); })()`); await settle(); };+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor("typeof data === 'object' && data?.project?.items?.length === 7 && !!document.querySelector('.status [data-status=\"items\"]')");+ for (const scheme of ['light', 'dark']) {+ for (const width of [1280, 375]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: scheme }] });+ await chrome.waitFor(`innerWidth === ${width} && matchMedia('(prefers-color-scheme: ${scheme})').matches`);+ await click('[data-tab=items]');+ await click('[data-state=active]');+ await settle();+ const at = `${width}px ${scheme}`;+ const r = await read();+ assert.ok(r.page.scroll <= r.page.width && r.page.body <= r.page.width, `${at}: no sideways scroll: ${JSON.stringify(r.page)}`);+ // The header carries the tabs and nothing else: no counts, no clock.+ assert.deepEqual(r.tabs, ['Items', 'Shouts', 'Spec', 'Doctrine', 'Activity', 'Roadmap'], `${at}: the tabs carry no counts`);+ assert.ok(r.live === '' && r.liveInBar && !/live|\d\d:\d\d/.test(r.header), `${at}: a live board says nothing in the header: ${r.header}`);+ // On a phone the bar stays out of the way while the board is live.+ if (width === 375) assert.equal(r.barShown, false, `${at}: no status bar on a phone while live`);+ // The bar: a frosted strip along the foot, the counts the tabs used to carry, and a part only where there is one.+ if (width === 1280) {+ assert.ok(Math.abs(r.barBox.bottom - 900) <= 1 && r.barBox.left === 0 && Math.abs(r.barBox.width - r.page.width) <= 1, `${at}: the bar runs along the foot: ${JSON.stringify(r.barBox)}`);+ assert.ok(r.barTint[3] > 0 && r.barTint[3] < 1 && /blur/.test(r.barBlur), `${at}: the bar is see-through and frosted: ${JSON.stringify([r.barTint, r.barBlur])}`);+ assert.deepEqual(r.bar.map((p) => p.to).filter((to) => !to.startsWith('item:') && to !== 'activity'), ['items', 'shouts', 'verify', 'gated', 'roadmap'], `${at}: items, agents, to verify, gated and the release, then the last event: ${JSON.stringify(r.bar)}`);+ assert.deepEqual([part(r, 'items').text, part(r, 'verify').text, part(r, 'gated').text, part(r, 'roadmap').text], ['6 items', '1 to verify', '2 gated', '1.0: first cut 1/3'], `${at}: what the parts say`);+ }+ // Rows: two lines, the age at the top right, the lane and up to three spec ids below, or the verdict instead.+ const row = Object.fromEntries(r.rows.map((x) => [x.id, x]));+ assert.deepEqual(r.rows.map((x) => x.id).sort(), ['1', '2', '3', '4', '5', '6'], `${at}: the active items`);+ const heights = r.rows.map((x) => Math.round(x.row.height));+ assert.ok(Math.max(...heights) - Math.min(...heights) <= 1 && Math.max(...heights) <= 64, `${at}: every row two lines and as tall as the next: ${heights}`);+ for (const x of r.rows) {+ assert.ok(x.row.right - x.age.right <= 14 && x.age.top < x.title.bottom && x.age.bottom > x.title.top, `${at}: #${x.id}'s age stands at the top right: ${JSON.stringify([x.row, x.title, x.age])}`);+ }+ assert.equal(row['1'].meta, 'web G1, G2, G3 +1', `${at}: the lane and the first three spec ids, then how many more`);+ assert.deepEqual([row['6'].why?.text, row['6'].why?.color === r.warn, /\bweb\b/.test(row['6'].meta.replace('BEHAVIOR_MISMATCH', '')), /next line/.test(row['6'].meta)], ['BEHAVIOR_MISMATCH', true, false, false],+ `${at}: a sent-back row says why in the warning colour, first line only, in place of its lane: ${row['6'].meta}`);+ // Blocked: a red outline on every side, and what it waits on beside the gated chip. Waiting on a verdict: shaded gold.+ for (const id of ['3', '4']) {+ const [red, green, blue] = row[id].border;+ assert.ok(row[id].gated && row[id].edges && row[id].borderWidth === '1px' && red > green + 30 && red > blue + 30, `${at}: #${id} has a red outline: ${JSON.stringify(row[id])}`);+ }+ assert.match(row['3'].meta, /waits on #2$/, `${at}: #3 says what it waits on`);+ assert.equal(row['3'].chip, 'gated');+ const [tr, tg, tb] = row['5'].tint;+ assert.ok(tr >= tg && tg > tb && row['5'].tint.join() !== row['1'].tint.join(), `${at}: a row waiting on a verdict is shaded gold: ${JSON.stringify([row['5'].tint, row['1'].tint])}`);+ if (scheme === 'dark') {+ const [gr, gg, gb] = row['5'].border;+ assert.ok(row['5'].edges && gr > gb + 30 && gg > gb + 20, `${at}: in dark it has a gold outline too: ${row['5'].border}`);+ }+ // The lane picker sits in the search field; the toolbar keeps one line while it fits.+ assert.deepEqual(r.lanes, ['All lanes', 'web · 5', 'api · 1'], `${at}: each lane with its count under Active`);+ if (width === 1280) assert.ok(Math.abs(r.seg.top - r.find.top) <= 4 && Math.abs(r.find.top - r.go.top) <= 4, `${at}: one line: ${JSON.stringify([r.seg, r.find, r.go])}`);+ else assert.ok(r.find.top >= r.seg.bottom && Math.abs(r.find.top - r.go.top) <= 4, `${at}: the states take the first line, search and New item the second: ${JSON.stringify([r.seg, r.find, r.go, r.toolbar])}`);+ if (width === 375) assert.ok(r.pick.height >= 44, `${at}: the lane picker is a 44px target`);+ }+ }++ // Between the two, where the list column is narrow, the states and New item share a line and search takes its own.+ // The width that gives the toolbar that room depends on the columns around it, so the test finds one.+ let middle = null;+ for (const width of [900, 940, 980, 1020, 1060, 1100, 1140, 1180]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor(`innerWidth === ${width}`);+ await settle();+ const room = await chrome.evaluate("(() => { const t = document.querySelector('.toolbar'), s = getComputedStyle(t); return t.clientWidth - parseFloat(s.paddingLeft) - parseFloat(s.paddingRight); })()");+ if (room >= 400 && room <= 490) { middle = { width, room, r: await read() }; break; }+ }+ assert.ok(middle, 'some desktop width gives the toolbar between 400 and 490px');+ const r0 = middle.r, centre = (b) => b.top + b.height / 2;+ assert.ok(Math.abs(centre(r0.seg) - centre(r0.go)) <= 4 && r0.find.top >= r0.seg.bottom && r0.find.width >= r0.toolbar.width - 24,+ `${middle.width}px (${middle.room}px of toolbar): the states and New item, then search on its own line: ${JSON.stringify([r0.seg, r0.find, r0.go, r0.toolbar])}`);++ // Each part opens exactly what it counts: its number is the length of the list it opens.+ await chrome.send('Emulation.setDeviceMetricsOverride', { width: 1280, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: 'light' }] });+ await chrome.waitFor('innerWidth === 1280');+ await click('[data-state=all]');+ let r = await read();+ for (const [to, state, label] of [['verify', 'verify', 'To verify'], ['gated', 'gated', 'Gated'], ['items', 'active', 'Active']]) {+ const n = number(part(r, to));+ await click(`.status [data-status="${to}"]`);+ await chrome.waitFor(`view.tab === 'items' && view.state === '${state}'`);+ await settle();+ r = await read();+ const on = r.chips.find(([, , isOn]) => isOn);+ assert.deepEqual([on?.[0], Number(on?.[1]), r.rows.length], [label, n, n], `${to}: the bar's ${n} opens ${label}, which counts and lists the same ${n}: ${JSON.stringify(r.chips)}`);+ if (to === 'gated') assert.ok(r.rows.every((x) => x.gated), 'every row it opens is a gated row');+ }+ await click('[data-state=active]');+ await click('.status [data-status="shouts"]');+ await chrome.waitFor("view.tab === 'shouts' && !document.querySelector('[data-pane=shouts]').hidden");+ r = await read();+ assert.equal(number(part(r, 'shouts')), r.agentRows, 'the agents part counts the rows of the agents panel it opens');+ await click('.status [data-status="roadmap"]');+ await chrome.waitFor("view.tab === 'roadmap'");+ const last = r.bar.find((p) => p.to.startsWith('item:'));+ if (last) {+ await click(`.status [data-status="${last.to}"]`);+ await chrome.waitFor(`view.tab === 'items' && view.item === ${Number(last.to.slice(5))}`);+ }++ // Lanes narrow the list as states do, each counting within the other's choice.+ await click('[data-state=active]');+ await lane('api');+ r = await read();+ assert.deepEqual([r.lane, r.rows.map((x) => x.id), r.chips.find(([name]) => name === 'Active')[1], r.chips.find(([name]) => name === 'Verified')[1]], ['api', ['4'], '1', '0'], 'api narrows the list and the state counts');+ await lane('');+ await click('[data-state=verified]');+ await lane('web');+ r = await read();+ assert.deepEqual([r.lane, r.rows.map((x) => x.id), r.lanes], ['web', ['7'], ['All lanes', 'web · 1']], 'under Verified the lanes count what is verified');+ await lane('');+ await click('[data-state=active]');++ // Shouts: asks waiting on others and idle agents each fold to one line, closed until opened.+ await click('[data-tab=shouts]');+ await chrome.waitFor("!document.querySelector('[data-pane=shouts]').hidden && !!document.querySelector('#decisions .fold-line')");+ r = await read();+ const shut = r.waiting.offset;+ assert.deepEqual([r.waiting.text, r.waiting.open, r.waiting.cards], ['1 ask waiting on others show', 'false', 0], `the ask waiting on others folds to a line: ${JSON.stringify(r.waiting)}`);+ assert.ok(/^\d+ idle show$/.test(r.idle.text) && r.idle.open === 'false' && r.idle.pills === 0, `the idle agents fold to a line: ${JSON.stringify(r.idle)}`);+ await click('#decisions .fold-line[data-fold="waiting"]');+ await click('#agents .fold-line[data-fold="idle"]');+ r = await read();+ assert.deepEqual([r.waiting.open, r.waiting.cards, r.idle.open, r.idle.pills > 0], ['true', 1, 'true', true], 'each opens on a click');+ assert.equal(r.waiting.offset, shut, 'and the line stays where it was as its cards open under it');+ await chrome.send('Emulation.setDeviceMetricsOverride', { width: 375, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor('innerWidth === 375');+ r = await read();+ assert.ok(r.waiting.height >= 44 && r.idle.height >= 44, 'each fold line is a 44px target');+ await chrome.send('Emulation.setDeviceMetricsOverride', { width: 1280, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor('innerWidth === 1280');++ // A shout that lands while Items is open counts as unread in the bar; opening it reads it.+ await click('[data-tab=items]');+ box.run(alpha.web, 'shout', 'coordinator', 'web-1 is on it');+ await chrome.waitFor("!document.querySelector('#status-unread')?.hidden && document.querySelector('#status-unread')?.textContent === '1 unread'", 15_000);+ await click('#status-unread');+ await chrome.waitFor("view.tab === 'shouts' && document.querySelector('#status-unread')?.hidden === true");++ // Cut off from the board, the bar turns red and says why.+ await chrome.evaluate("globalThis.fetch = () => Promise.reject(new TypeError('Failed to fetch'))");+ await chrome.waitFor("document.querySelector('#live').textContent.startsWith('offline')", 15_000);+ r = await read();+ const [red, green, blue] = r.barTint;+ assert.ok(red > green + 10 && red > blue + 10 && r.bar.length > 0, `the bar turns red and keeps its parts: ${JSON.stringify(r.barTint)}`);+ await chrome.send('Emulation.setDeviceMetricsOverride', { width: 375, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor('innerWidth === 375');+ r = await read();+ assert.ok(r.barShown && r.live.startsWith('offline'), 'on a phone too, a view cut off from the board says so');+ assert.deepEqual(chrome.exceptions, [], 'the page raises no uncaught exception');+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});