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): a compact agents panel; the composer says who heard [N26]
Corey Olson3ca169995c27
diff --git a/src/cockpit.js b/src/cockpit.jsindex 21d2d8b6..df5827eb 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -127,7 +127,7 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ<section data-pane="shouts" class="two narrow" id="shouts-pane"><div class="primary"><section class="needs-you" id="decisions" aria-label="Decisions needed" hidden></section>- <form id="shout-form" class="card-panel shout-form"><p class="answering" id="answering" hidden><span>Answering <b id="answering-who"></b>: <span id="answering-q"></span></span><button class="ghost" id="answer-cancel" type="button">Cancel</button></p><div class="composer"><label class="to"><span>to</span><input id="shout-to" list="shout-targets" required placeholder="all" aria-label="To: all, a lane or an agent"></label><datalist id="shout-targets"></datalist><textarea id="shout-text" required rows="1" placeholder="Shout to the board" aria-label="Message"></textarea><button class="send" id="shout-send" type="submit" aria-label="Shout" title="Shout (Enter; Shift+Enter for a new line)"><svg viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" d="M8 13V3M3.5 7.5 8 3l4.5 4.5"/></svg></button></div></form>+ <form id="shout-form" class="card-panel shout-form"><p class="answering" id="answering" hidden><span>Answering <b id="answering-who"></b>: <span id="answering-q"></span></span><button class="ghost" id="answer-cancel" type="button">Cancel</button></p><div class="composer"><input id="shout-to" type="hidden" value="coordinator"><span class="to-chip" id="shout-to-chip" hidden></span><textarea id="shout-text" required rows="1" placeholder="Shout to the coordinator" aria-label="Message"></textarea><button class="send" id="shout-send" type="submit" aria-label="Shout" title="Shout (Enter; Shift+Enter for a new line)"><svg viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" d="M8 13V3M3.5 7.5 8 3l4.5 4.5"/></svg></button></div></form><div class="card-panel feed" id="feed"></div></div><aside class="card-panel detail" aria-label="Agents and lanes">@@ -1163,12 +1163,24 @@ function render() {const bar = '<div class="feed-bar">' + (view.agent ? '<span>Shouts with <b>' + esc(view.agent) + '</b> <button class="link" data-agent="" type="button">show all</button></span>' : '<span></span>')+ '<button class="link" data-agents-toggle type="button">' + (view.agentsHidden ? 'Show agents' : 'Hide agents') + '</button></div>';$('shouts-pane').classList.toggle('bare', view.agentsHidden);+ // Who has heard a shout of the person's: the agents it reached whose inbox has read past it. Each agent's read+ // cursor is already on the board, so this is presentation only; reading is all it says, not acting on it.+ const reached = (x, a) => a.agent_id !== x.shout_from && ['all', a.agent_id, a.agent_lane].includes(x.shout_to);+ const dot = (a) => '<span class="heard-face h' + hue(a.agent_id) + (lead(a.agent_id) ? ' lead' : '') + '">' + (lead(a.agent_id) ? LEAD : esc(initials(a.agent_id))) + '</span>';+ const heardBy = (x) => {+ if (x.shout_from !== 'person') return '';+ const to = p.agents.filter((a) => reached(x, a)), by = to.filter((a) => (a.agent_last_shout_id ?? 0) >= x.shout_id);+ if (!to.length) return '';+ if (!by.length) return '<div class="heard not">Not heard yet</div>';+ const first = by.find((a) => lead(a.agent_id)) || by[0], rest = by.length - 1;+ return '<div class="heard" title="Heard by ' + esc(by.map((a) => a.agent_id).join(', ')) + '"><span class="heard-faces">' + [first, ...by.filter((a) => a !== first)].slice(0, 4).map(dot).join('') + '</span>Heard by ' + esc(first.agent_id) + (rest ? ' and ' + rest + (rest === 1 ? ' agent' : ' agents') : '') + '</div>';+ };// One card for a shout, in the feed and among the asks; tail adds what the place needs, such as Answer. Only the// feed's copy carries the band and the id an answer's link lands on, so an ask shown twice never repeats an id.const card = (x, tail = '', inFeed = true) => '<article class="shout h' + hue(x.shout_from) + (lead(x.shout_from) ? ' lead' : '') + (openShouts.has(x.shout_id) ? ' open' : '') + '"' + (inFeed ? ' id="shout-' + x.shout_id + '"' : '') + ' data-shout-id="' + x.shout_id + '">'+ (lead(x.shout_from) ? '<span class="avatar">' + LEAD + '</span>' : '<span class="avatar' + (initials(x.shout_from).length > 3 ? ' wide' : '') + '" aria-hidden="true">' + esc(initials(x.shout_from)) + '</span>') + '<div class="shout-main"><header><b class="who">' + esc(x.shout_from) + '</b><span class="to">→ ' + esc(x.shout_to) + '</span>'+ (itemOf(x) ? '<span class="item">#' + esc(itemOf(x)) + '</span>' : '') + mark(x) + '<time class="long" data-ago="' + esc(x.shout_at) + '" title="' + esc(when(x.shout_at)) + '">' + agoLong(x.shout_at) + '</time></header>'- + '<div class="text">' + rich(x.shout_text, titles) + '</div><button class="more" data-more type="button">' + (openShouts.has(x.shout_id) ? 'less' : 'more') + '</button>' + (inFeed ? band(x) : '') + evidence(x) + tail + '</div></article>';+ + '<div class="text">' + rich(x.shout_text, titles) + '</div><button class="more" data-more type="button">' + (openShouts.has(x.shout_id) ? 'less' : 'more') + '</button>' + (inFeed ? band(x) + heardBy(x) : '') + evidence(x) + tail + '</div></article>';$('feed').innerHTML = bar + (heard.length ? dayRules(heard, (x) => x.shout_at, card) : '<div class="empty">' + (view.agent ? 'No shouts with ' + esc(view.agent) + ' among the last forty.' : 'No shouts yet.') + '</div>');foldShouts();// Each ask waits here until it is answered (B21); the answer itself is typed in the form below. The@@ -1178,7 +1190,6 @@ function render() {$('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('') : '');foldShouts();- $('shout-targets').innerHTML = ['all', ...lanes, ...p.agents.map((a) => a.agent_id)].map((t) => '<option value="' + esc(t) + '">').join('');// 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.// A review an agent holds (V15) comes right after its claim.@@ -1189,11 +1200,24 @@ function render() {const recent = (a) => p.items.some((i) => (i.status === 'claimed' && i.owner === a.agent_id) || (i.status === 'submitted' && i.reviewer === a.agent_id))|| (a.lastMoveAt && Date.now() - Date.parse(a.lastMoveAt) < 36e5);const listed = view.allAgents ? p.agents : p.agents.filter(recent);- $('agents').innerHTML = (listed.length ? listed.map((a) => {- const mine = holding(a);- return '<div class="agent' + (view.agent === a.agent_id ? ' on' : '') + '"><div><button class="agent-name" data-agent="' + esc(a.agent_id) + '" title="Shouts with ' + esc(a.agent_id) + ' (' + esc(a.agent_path) + ')" type="button">' + esc(a.agent_id) + '</button><span class="muted">' + esc(a.agent_lane) + ' · ' + esc(a.agent_route) + '</span>' + (a.lastMoveAt ? '<time data-ago="' + esc(a.lastMoveAt) + '" title="last moved ' + when(a.lastMoveAt) + '">' + ago(a.lastMoveAt) + '</time>' : '') + '</div>'- + (mine.length ? mine.map((i) => '<div class="agent-work" data-item="' + i.id + '"><span>#' + i.id + ' ' + rich(i.title, titles) + '</span>' + (i.reviewer === a.agent_id ? '<span class="chip warn">reviewing</span>' : chip(stateOf(i))) + '</div>').join('') : '<small>idle</small>') + '</div>';- }).join('') : '<div class="empty">' + (p.agents.length ? 'No agent has moved today.' : 'No agents yet.') + '</div>')+ // As little room as the panel can take: an agent holding work is one row, with its avatar and colour from the feed,+ // the age of its latest move and what it holds; an agent holding nothing is a pill. A row or a pill filters the feed+ // to that agent's shouts, its lane and route on hover, and the picked agent's row opens out to each thing it holds.+ const busy = listed.filter((a) => holding(a).length), idle = listed.filter((a) => !holding(a).length);+ const face = (a) => lead(a.agent_id) ? '<span class="avatar">' + LEAD + '</span>' : '<span class="avatar' + (initials(a.agent_id).length > 3 ? ' wide' : '') + '" aria-hidden="true">' + esc(initials(a.agent_id)) + '</span>';+ const tip = (a) => 'Shouts with ' + a.agent_id + ' · ' + a.agent_lane + ' · ' + a.agent_route + ' (' + a.agent_path + ')';+ const state = (a, i) => i.reviewer === a.agent_id ? '<span class="chip warn">reviewing</span>' : chip(stateOf(i));+ const marks = (a) => ' h' + hue(a.agent_id) + (lead(a.agent_id) ? ' lead' : '') + (view.agent === a.agent_id ? ' on' : '');+ const row = (a) => {+ const mine = holding(a), first = mine[0];+ return '<div class="agent-card' + marks(a) + '"><button class="agent-row" data-agent="' + esc(a.agent_id) + '" title="' + esc(tip(a)) + '" type="button">' + face(a)+ + '<span class="agent-who"><b>' + esc(a.agent_id) + '</b>' + (a.lastMoveAt ? '<time data-ago="' + esc(a.lastMoveAt) + '">' + ago(a.lastMoveAt) + '</time>' : '') + '</span>'+ + '<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>';+ };+ 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>' : '');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('');@@ -1348,18 +1372,30 @@ function countUnseen() {* 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.+ */+function addressTo(to) {+ const who = to || 'coordinator';+ $('shout-to').value = who;+ $('shout-to-chip').hidden = who === 'coordinator';+ $('shout-to-chip').innerHTML = who === 'coordinator' ? '' : 'to <b>' + esc(who) + '</b><button class="to-clear" data-to-clear type="button" aria-label="Shout to the coordinator instead">×</button>';+ $('shout-text').placeholder = 'Shout to ' + (who === 'coordinator' ? 'the coordinator' : who);+}+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;- if (!ask && view.answering) $('shout-to').value = view.to || '';+ if (!ask && view.answering) addressTo(view.to);view.answering = ask ? { root: view.root, id: ask.shout_id } : null;$('answering').hidden = !ask;$('answering-who').textContent = ask ? ask.shout_from : '';const question = ask ? linked(ask.shout_text, new Map(data.project.items.map((i) => [String(i.id), i.title]))) : '';if (question.includes('<button class="ref"')) $('answering-q').innerHTML = question;else $('answering-q').textContent = ask ? ask.shout_text : '';- if (ask) $('shout-to').value = ask.shout_from;+ if (ask) addressTo(ask.shout_from);$('shout-to').disabled = Boolean(ask);+ $('shout-to-chip').hidden = Boolean(ask) || $('shout-to').value === 'coordinator';const verb = ask ? 'Answer' : 'Shout';$('shout-send').setAttribute('aria-label', verb);$('shout-send').title = verb + ' (Enter; Shift+Enter for a new line)';@@ -1528,13 +1564,17 @@ async function act(command, args, anchor) {out.textContent = requests ? 'Request waiting…' : 'running…';out.scrollIntoView({ block: 'nearest' });try {- const move = pageMove(command, args);- const result = requests ? await sendPersonRequest(root, move.body) : await api(boardPath(root) + '/moves', move.body);+ // On the local view the person's word to the coordinator is the person's own request, not a shout the+ // coordinator sends itself; through the relay every action is already a sealed request.+ const asked = command === 'request' && !requests;+ const move = asked ? null : pageMove(command === 'request' ? 'shout' : command, command === 'request' ? { to: 'coordinator', text: args.text } : args);+ const result = asked ? await api(boardPath(root) + '/requests', { text: String(args.text || '').trim() })+ : requests ? await sendPersonRequest(root, move.body) : await api(boardPath(root) + '/moves', move.body);const request = requests && result?.result?.request;if (requests && (!request?.id || !['waiting', 'done', 'refused'].includes(request.status))) throw new Error('The request did not include its status; refresh the board to check it.');if (latest()) {out.className = 'console' + (requests ? request.status === 'done' ? ' ok' : request.status === 'refused' ? ' no' : '' : ' ok');- out.textContent = requests ? requestNotice(request) : '$ pullboard ' + move.label + '\\n' + moveMessage(move.body, result.result);+ out.textContent = requests ? requestNotice(request) : asked ? 'Sent to the coordinator.' : '$ pullboard ' + move.label + '\\n' + moveMessage(move.body, result.result);if (requests) view.request = { root, id: request.id, run };out.scrollIntoView({ block: 'center' });// What went through says so and then steps aside; a refusal stays until the person closes it.@@ -1613,11 +1653,12 @@ $('shouts-pane').addEventListener('click', (event) => {more.textContent = openShouts.has(id) ? 'less' : 'more';return;}+ if (event.target.closest('[data-to-clear]')) { addressTo('coordinator'); $('shout-text').focus(); 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;view.agent = pick.dataset.agent && pick.dataset.agent !== view.agent ? pick.dataset.agent : null;- if (view.agent && !view.answering) $('shout-to').value = view.agent;+ if (!view.answering) addressTo(view.agent);render();});// Enter shouts; Shift+Enter starts a new line.@@ -1654,7 +1695,7 @@ document.addEventListener('click', (event) => {else if (t.dataset.row) { const [kind, id] = t.dataset.row.split(':'); view.row[kind] = id; render(); }else if (t.dataset.code) code(t.dataset.code, t.dataset.before || '');else if (t.dataset.release) act('release', { lane: t.dataset.release }, t);- else if (t.dataset.shout) { answer(null); $('shout-to').value = t.dataset.shout; $('shout-text').value = '#' + t.dataset.about + ': '; openTab('shouts'); showTab(); $('shout-text').focus(); }+ else if (t.dataset.shout) { answer(null); addressTo(t.dataset.shout); $('shout-text').value = '#' + t.dataset.about + ': '; openTab('shouts'); showTab(); $('shout-text').focus(); }else if (t.dataset.new !== undefined) { view.adding = true; render(); $('add-title').focus(); }});/** Let a Roadmap row with independent inline links keep its keyboard button behavior. */@@ -1713,7 +1754,7 @@ $('shout-form').addEventListener('submit', async (event) => {const text = $('shout-text').value;const ask = view.answering;if (ask && ask.root !== view.root) return answer(null);- if (!(await (ask ? act('answer', { id: ask.id, text }, event.currentTarget) : act('shout', { to: $('shout-to').value, text }, event.currentTarget)))) return;+ if (!(await (ask ? act('answer', { id: ask.id, text }, event.currentTarget) : ($('shout-to').value === 'coordinator' ? act('request', { text }, event.currentTarget) : act('shout', { to: $('shout-to').value, text }, event.currentTarget))))) return;$('shout-text').value = '';answer(null);});diff --git a/src/view.css b/src/view.cssindex fabc1e88..29e9338c 100644--- a/src/view.css+++ b/src/view.css@@ -293,8 +293,6 @@ form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; paddin.shout-form > .composer { flex: 1 1 100%; min-width: 0; }.composer { display: flex; align-items: flex-end; gap: 6px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }.composer:focus-within { border-color: var(--accent); }-.composer .to { display: flex; flex: none; align-items: center; gap: 4px; padding: 0 4px 0 10px; border-right: 1px solid var(--line); color: var(--ink-faint); font-size: 12px; }-.composer .to input { width: 7.5em; min-height: 44px; border: 0; padding: 0 4px; background: none; color: var(--ink); font-weight: 600; }.composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 12em; padding: 11px 8px; border: 0; background: none; resize: none; field-sizing: content; line-height: 1.5; }.composer input:focus-visible, .composer textarea:focus-visible { outline: 0; }.composer .send { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 9px; background: var(--ink); color: var(--surface); cursor: pointer; }@@ -312,24 +310,21 @@ form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; paddin#decisions .shout.clamp:not(.open) .text { -webkit-line-clamp: 3; }#decisions .answer { margin-top: 6px; }.all-agents { margin-top: 2px; font-size: 13px; }-.agent-name { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }-.agent-name:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }-.agent.on .agent-name { color: var(--accent-strong); }/* 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);--hue-4: light-dark(#b45309, #fcd34d); --hue-5: light-dark(#15803d, #86efac); --hue-6: light-dark(#b91c1c, #fca5a5); --hue-7: light-dark(#475569, #cbd5e1); }-.shout.h0 { --h: var(--hue-0); } .shout.h1 { --h: var(--hue-1); } .shout.h2 { --h: var(--hue-2); } .shout.h3 { --h: var(--hue-3); }-.shout.h4 { --h: var(--hue-4); } .shout.h5 { --h: var(--hue-5); } .shout.h6 { --h: var(--hue-6); } .shout.h7 { --h: var(--hue-7); }+.shout.h0, .agent-card.h0, .agent-pill.h0, .heard-face.h0 { --h: var(--hue-0); } .shout.h1, .agent-card.h1, .agent-pill.h1, .heard-face.h1 { --h: var(--hue-1); } .shout.h2, .agent-card.h2, .agent-pill.h2, .heard-face.h2 { --h: var(--hue-2); } .shout.h3, .agent-card.h3, .agent-pill.h3, .heard-face.h3 { --h: var(--hue-3); }+.shout.h4, .agent-card.h4, .agent-pill.h4, .heard-face.h4 { --h: var(--hue-4); } .shout.h5, .agent-card.h5, .agent-pill.h5, .heard-face.h5 { --h: var(--hue-5); } .shout.h6, .agent-card.h6, .agent-pill.h6, .heard-face.h6 { --h: var(--hue-6); } .shout.h7, .agent-card.h7, .agent-pill.h7, .heard-face.h7 { --h: var(--hue-7); }#feed > .shout { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 12px; align-items: start; padding: 14px 4px; border-top: 1px solid var(--line); }#feed > .shout:first-child, #feed > .day-rule + .shout { border-top: 0; }#feed > .day-rule { display: flex; align-items: center; gap: 12px; margin: 10px 0 2px; color: var(--ink-faint); font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }#feed > .day-rule::before, #feed > .day-rule::after { content: ""; flex: 1; border-top: 1px solid var(--line); }#feed > .day-rule:first-child { margin-top: 2px; }-.shout.lead .avatar { border-radius: 9px; background: var(--ink); color: var(--surface); }+.shout.lead .avatar, .agent-card.lead .avatar, .agent-pill.lead .avatar { border-radius: 9px; background: var(--ink); color: var(--surface); }.shout.lead .avatar svg { width: 18px; height: 18px; }.shout.lead .who { color: var(--ink); }-.shout .avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--h) 16%, var(--surface)); color: var(--h); font: 700 11px var(--mono); }+.shout .avatar, .agent-card .avatar, .agent-pill .avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--h) 16%, var(--surface)); color: var(--h); font: 700 11px var(--mono); }.shout .avatar.wide { font-size: 9px; letter-spacing: -.02em; }.shout-main { min-width: 0; }.shout header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }@@ -376,12 +371,6 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }.feed .act .what { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; color: var(--ink-muted); }.feed .act .said { flex: 1 1 0; min-width: 0; margin-left: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-muted); }.feed .act .said code { white-space: nowrap; }-.agent { display: grid; gap: 2px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }-.agent:first-child { border-top: 0; }-.agent small { color: var(--ink-faint); font: 11.5px var(--mono); overflow-wrap: anywhere; }-.agent > div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }-.agent > div > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }-.agent time { margin-left: auto; color: var(--ink-faint); font: 12px var(--mono); }.agent-work { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; }.agent-work > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.agent-work:hover > span:first-child { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }@@ -464,3 +453,43 @@ button, input, select, textarea, [data-item], [data-row] { min-height: 44px; }.spec-feedback { margin: 8px 0; padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; overflow-wrap: anywhere; font-size: 13px; }.spec-feedback.ok { color: var(--accent-strong); }.spec-feedback.no { color: var(--reject); }++/* The agents panel: a row for each agent holding work, a pill for each holding none. */+.agent-card { border-radius: 10px; }+.agent-card.on { background: color-mix(in srgb, var(--h) 9%, transparent); }+.agent-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 1px 10px; align-items: center; width: 100%; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }+.agent-row:hover { background: var(--surface-2); }+.agent-row .avatar { grid-row: 1 / span 2; width: 28px; height: 28px; font-size: 10px; }+.agent-row .avatar.wide { font-size: 8px; }+.agent-card.lead .avatar svg, .agent-pill.lead .avatar svg { width: 60%; height: 60%; }+.agent-who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }+.agent-who b { color: var(--h); font-size: 13.5px; }+.agent-card.lead .agent-who b, .agent-pill.lead > span { color: var(--ink); }+.agent-who time { margin-left: auto; color: var(--ink-faint); font: 11.5px var(--mono); }+.agent-doing { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--ink-muted); }+.agent-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.agent-what i { font: normal 11.5px var(--mono); color: var(--ink-faint); }+.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; }+.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; }++/* The composer's address, when it is not the coordinator: a chip the person can clear. */+.composer .to-chip { display: inline-flex; flex: none; align-items: center; align-self: center; gap: 2px; margin-left: 6px; padding-left: 10px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); font-size: 12.5px; white-space: nowrap; }+.composer .to-chip[hidden] { display: none; }+.to-clear { width: 36px; min-height: 44px; margin: -8px 0; padding: 0; border: 0; background: none; color: inherit; font-size: 16px; cursor: pointer; }+/* Heard: which agents a shout of the person's has reached. */+.shout .heard { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--ink-muted); font-size: 12px; }+.shout .heard::before { content: "✓"; color: var(--accent-strong); font-weight: 700; }+.shout .heard.not { color: var(--ink-faint); }+.shout .heard.not::before { content: "…"; color: var(--ink-faint); }+.heard-faces { display: inline-flex; padding-right: 5px; }+.heard-face { display: grid; place-items: center; width: 18px; height: 18px; margin-right: -5px; border: 1.5px solid var(--surface); border-radius: 50%; background: color-mix(in srgb, var(--h) 16%, var(--surface)); color: var(--h); font: 700 7px var(--mono); }+.heard-face.lead { border-radius: 5px; background: var(--ink); color: var(--surface); }+.heard-face svg { width: 11px; height: 11px; }diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex 9e3cbc58..fba1b0f9 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -1094,18 +1094,27 @@ test("the history is a timeline of the item's states [N26]", async () => {}});/**- * The agents the panel shows: id, the path on hover, its last move, what it holds and whether it- * reads idle, and its entry's text with the tags taken out.+ * The agents the panel shows: id, the path on hover, its last move, what it holds and how many more,+ * whether it reads idle, and its entry's text with the tags taken out. An agent holding work is a row+ * showing its first thing, or every thing once picked; an agent holding nothing is a pill.*/function agentEntries(html) {- return html.split(/<div class="agent(?: on)?">/).slice(1).map((entry) => ({- id: /data-agent="([^"]*)"/.exec(entry)?.[1],- path: /title="Shouts with [^"(]* \(([^"]*)\)"/.exec(entry)?.[1],- age: /<time[^>]*>([^<]*)<\/time>/.exec(entry)?.[1],- holds: [...entry.matchAll(/data-item="(\d+)"[^>]*><span>([^]*?)<\/span><span class="chip[^"]*">([^<]*)</g)].map((match) => `${match[2]}: ${match[3]}`),- idle: entry.includes('<small>idle</small>'),- text: entry.replace(/<[^>]*>/g, ' '),- }));+ const rows = html.split(/<div class="agent-card[^"]*">/).slice(1).map((entry) => {+ const opened = [...entry.matchAll(/data-item="(\d+)"[^>]*><span>([^]*?)<\/span><span class="chip[^"]*">([^<]*)</g)].map((match) => `${match[2]}: ${match[3]}`);+ const first = /<span class="agent-what"><i>(#\d+)<\/i> ([^]*?)<\/span><span class="chip[^"]*">([^<]*)</.exec(entry);+ return {+ id: /data-agent="([^"]*)"/.exec(entry)?.[1],+ path: /title="Shouts with [^"(]* \(([^"]*)\)"/.exec(entry)?.[1],+ age: /<time[^>]*>([^<]*)<\/time>/.exec(entry)?.[1],+ holds: opened.length ? opened : first ? [`${first[1]} ${first[2]}: ${first[3]}`] : [],+ more: Number(/<span class="agent-more">\+(\d+)<\/span>/.exec(entry)?.[1] ?? 0),+ idle: false,+ text: entry.replace(/<[^>]*>/g, ' '),+ };+ });+ const pills = [...html.matchAll(/<button class="agent-pill[^"]*" data-agent="([^"]*)" title="[^"(]* \(([^"]*)\)"[^>]*>([^]*?)<\/button>/g)]+ .map((match) => ({ id: match[1], path: match[2], age: undefined, holds: [], more: 0, idle: true, text: match[3].replace(/<[^>]*>/g, ' ') }));+ return [...rows, ...pills];}test('the agents panel says what each agent holds [N26]', async () => {@@ -1126,14 +1135,20 @@ test('the agents panel says what each agent holds [N26]', async () => {try {const page = await openPage(view);const agents = agentEntries(page.show('agents'));- assert.deepEqual(agents.map((agent) => [agent.id, agent.holds, agent.idle]), [- ['coordinator', [], true],- // The claim first, then work sent back, then work waiting for a verdict.- ['web-1', ['#1 Header: building', '#3 Greeting <b>bold</b>: to verify'], false],- ['web-2', ['#2 Farewell: sent back', '#4 Footer: to verify'], false],+ 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.+ ['web-1', ['#1 Header: building'], 1, false],+ ['web-2', ['#2 Farewell: sent back'], 1, false],+ // One holding nothing is a pill.+ ['coordinator', [], 0, true],]);- for (const agent of agents) assert.match(agent.age, /^(now|\d+[mhd])$/, `${agent.id} shows when it last moved`);- assert.deepEqual(agents.map((agent) => agent.path), [alpha.repo, alpha.web, second], 'each path is on hover');+ for (const agent of agents.filter((entry) => !entry.idle)) assert.match(agent.age, /^(now|\d+[mhd])$/, `${agent.id} shows when it last moved`);+ assert.deepEqual(agents.map((agent) => agent.path), [alpha.web, second, alpha.repo], 'each path is on hover');+ // Picked, an agent's row opens to every thing it holds, in that order.+ const opened = (id) => { page.run(`view.agent = ${JSON.stringify(id)}; render();`); return agentEntries(page.show('agents')).find((agent) => agent.id === id).holds; };+ assert.deepEqual(opened('web-1'), ['#1 Header: building', '#3 Greeting <b>bold</b>: to verify']);+ assert.deepEqual(opened('web-2'), ['#2 Farewell: sent back', '#4 Footer: to verify']);+ page.run('view.agent = null; render();');for (const agent of agents) assert.ok(!agent.text.includes(agent.path), `${agent.id}'s path is not in the text`);await page.click({ go: 'item:1' });@@ -1952,7 +1967,9 @@ test("needs-you holds only the person's calls; the rest show on the board with wassert.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");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');+ 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();');assert.match(page.show('lanes'), /<b>web<\/b> <span class="chip no">held by coordinator<\/span> <span class="muted">G3 is open<\/span>/, 'a held lane names who holds it');// The sidebar counts exactly the person's calls; its line still says what the agents are doing.@@ -4311,7 +4328,7 @@ test('real Chrome styles shout code and item text without growing linked lines [const titleNode = document.querySelector('#chain .row .t');const outside = [...document.querySelectorAll('#feed > .shout')].find((row) => row.textContent.includes('alert(2)'));const itemDetail = document.querySelector('#detail');- const agentItem = document.querySelector('#agents .agent [data-item="1"]');+ const agentItem = document.querySelector('#agents .agent-row');/** Measure the complete rendered content line box, including its item link. */const lineMetrics = (message) => {const row = [...document.querySelectorAll('#feed > .shout')].find((entry) => {@@ -4334,7 +4351,7 @@ test('real Chrome styles shout code and item text without growing linked lines [outsideHtml: outside.innerHTML, askNestedButtons: [...ask.querySelectorAll('button')].filter(link => link.parentElement.closest('button')).length,criterionHtml: itemDetail.querySelector('.text')?.innerHTML, briefHtml: itemDetail.querySelector('.text.muted')?.innerHTML,needsNestedButtons: [...document.querySelectorAll('#needs button.ref')].filter(link => link.parentElement.closest('button')).length,- agentNestedButtons: [...document.querySelectorAll('#agents .agent button.ref')].filter(link => link.parentElement.closest('button')).length,+ agentNestedButtons: [...document.querySelectorAll('#agents button.ref')].filter(link => link.parentElement.closest('button')).length,agentItemHeight: agentItem?.getBoundingClientRect().height,};})())`));@@ -4696,12 +4713,13 @@ test('the shout composer, agent filter and agents panel [N26]', { timeout: 120_0const pane = document.querySelector('[data-pane=shouts]'), list = document.querySelector('#agents');return {page: { width: document.documentElement.clientWidth, scroll: document.documentElement.scrollWidth, body: document.body.scrollWidth },- listed: [...list.querySelectorAll('.agent-name')].map((e) => e.dataset.agent), on: [...list.querySelectorAll('.agent.on .agent-name')].map((e) => e.dataset.agent),+ listed: [...list.querySelectorAll('[data-agent]')].map((e) => e.dataset.agent), on: [...list.querySelectorAll('.agent-card.on [data-agent], .agent-pill.on')].map((e) => e.dataset.agent),all: list.querySelector('.all-agents')?.textContent ?? null, panel: list.offsetParent !== null, bare: pane.classList.contains('bare'),toggle: document.querySelector('#feed [data-agents-toggle]')?.textContent, bar: document.querySelector('#feed .feed-bar span')?.textContent ?? '',cards: [...document.querySelectorAll('#feed .shout')].map((c) => [c.querySelector('.who').textContent, c.querySelector('.to').textContent.replace('→ ', '')]),to: document.querySelector('#shout-to').value, feed: box(document.querySelector('#feed')),- composer: box(document.querySelector('.composer')), label: box(document.querySelector('.composer label.to')), message: box(document.querySelector('#shout-text')), send: box(document.querySelector('#shout-send')),+ composer: box(document.querySelector('.composer')), message: box(document.querySelector('#shout-text')), send: box(document.querySelector('#shout-send')),+ pickers: [...document.querySelectorAll('.composer select, .composer datalist, .composer input')].filter((e) => e.type !== 'hidden').length,kept: (() => { try { return localStorage.getItem('pb.agents'); } catch { return 'unreadable'; } })(),};})())`));@@ -4716,9 +4734,9 @@ test('the shout composer, agent filter and agents panel [N26]', { timeout: 120_0const at = `${width}px ${scheme}`;const s = await state();assert.ok(s.page.scroll <= s.page.width && s.page.body <= s.page.width, `${at}: no sideways scroll: ${JSON.stringify(s.page)}`);- // One bar: to on the left, the message, the send button on the right, all in one row.- for (const part of ['label', '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.label.right <= s.message.left + 0.5 && s.message.right <= s.send.left + 0.5 && s.composer.right - s.send.right < 12, `${at}: to, message, send from left to right: ${JSON.stringify(s)}`);+ // One bar: the message, the send button on the right, in one row; no recipient picker.+ for (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.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}`);@@ -4738,11 +4756,11 @@ test('the shout composer, agent filter and agents panel [N26]', { timeout: 120_0assert.deepEqual([s.bar, s.to, s.on], ['Shouts with web-2 show all', 'web-2', ['web-2']], 'the bar says whose, the composer is addressed to them, and the agent is marked');await click('#feed .feed-bar [data-agent=""]');s = await state();- assert.deepEqual([s.cards.length, s.bar, s.on], [total, '', []], 'show all undoes the filter');+ assert.deepEqual([s.cards.length, s.bar, s.on, s.to], [total, '', [], 'coordinator'], 'show all undoes the filter, and the composer goes back to the coordinator');await click('#agents .all-agents');// The message grows as it is typed; Shift+Enter starts a line, Enter sends.- await chrome.evaluate("document.querySelector('#shout-to').value = 'all'; document.querySelector('#shout-text').focus()");+ await chrome.evaluate("document.querySelector('#shout-text').focus()");const height = () => chrome.evaluate("document.querySelector('#shout-text').getBoundingClientRect().height");const one = await height();await chrome.send('Input.insertText', { text: 'First line' });@@ -4754,7 +4772,7 @@ test('the shout composer, agent filter and agents panel [N26]', { timeout: 120_0assert.ok(await height() > one + 20, 'the message grows as it is typed');assert.equal(await chrome.evaluate('data.project.shouts.length'), total, 'and sends nothing');await key(0);- await chrome.waitFor("data.project.shouts.some((s) => s.shout_text === 'First line\\nsecond line\\nthird line' && s.shout_to === 'all')", 15_000);+ await chrome.waitFor("data.project.shouts.some((s) => s.shout_text === 'First line\\nsecond line\\nthird line' && s.shout_to === 'coordinator')", 15_000);await chrome.waitFor("document.querySelector('#shout-text').value === ''");assert.ok(Math.abs(await height() - one) < 1, 'Enter sends, and the bar shrinks back to one line');assert.ok(await chrome.evaluate("!document.querySelector('#console').hidden && !document.querySelector('.composer #console') && document.querySelector('#console').getBoundingClientRect().bottom <= document.querySelector('.composer').getBoundingClientRect().top"),@@ -4787,6 +4805,189 @@ test('the shout composer, agent filter and agents panel [N26]', { timeout: 120_0await view.stop();}});+test('the agents panel is rows for work and pills for idle [N26]', { timeout: 120_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for rendered agent checks.');++ const box = machine();+ const alpha = project(box, 'roster');+ for (const title of ['Header', 'Footer']) box.run(alpha.repo, 'add', 'web', title, '--specs', 'G1', '--criterion', 'renders');+ // web-1 waits on a verdict for #2 and builds #1: two things, the claim first.+ build(box, alpha, 2, 'footer.html');+ box.run(alpha.web, 'claim', '1');+ const second = join(box.dir, 'roster-web-2'), gone = join(box.dir, 'roster-web-3');+ box.git(alpha.repo, 'worktree', 'add', '-q', second, '-b', 'web/roster2');+ box.run(second, 'join', 'web');+ box.git(alpha.repo, 'worktree', 'add', '-q', gone, '-b', 'web/roster3');+ // web-3 joined three hours ago and has not moved since: not at work, so behind show all.+ earlier(alpha.repo, Date.now() - 3 * 36e5, (board) => assert.equal(register(board, { lane: 'web', path: gone }), 'web-3'));+ box.run(alpha.web, 'shout', 'coordinator', 'Header is under way.');+ box.run(second, 'shout', 'coordinator', 'Free when you need me.');++ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-roster-chrome-'));+ let chrome;+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await 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]")');+ 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((() => {+ const box = (e) => { const r = e.getBoundingClientRect(); return { height: r.height, width: r.width }; };+ const list = document.querySelector('#agents');+ return {+ page: { width: document.documentElement.clientWidth, scroll: document.documentElement.scrollWidth, body: document.body.scrollWidth },+ rows: [...list.querySelectorAll('.agent-card')].map((card) => {+ const row = card.querySelector('.agent-row');+ return { id: row.dataset.agent, text: row.innerText.replace(/\\s+/g, ' ').trim(), title: row.title, height: box(row).height, on: card.classList.contains('on'),+ face: getComputedStyle(row.querySelector('.avatar')).color, name: getComputedStyle(row.querySelector('.agent-who b')).color,+ work: [...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,+ 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('→ ', '')]),+ };+ })())`));++ for (const scheme of ['light', 'dark']) {+ for (const width of [1280, 375]) {+ await shoutsAt(chrome, width, scheme);+ const at = `${width}px ${scheme}`;+ const p = await panel();+ assert.ok(p.page.scroll <= p.page.width && p.page.body <= p.page.width, `${at}: no sideways scroll: ${JSON.stringify(p.page)}`);+ // The agent holding work is one row: avatar, name, age, its first thing with that item's state, and how many more.+ assert.deepEqual(p.rows.map((row) => row.id), ['web-1'], `${at}: only an agent holding work takes a row`);+ const [row] = p.rows;+ assert.match(row.text, /^W1 web-1 (?:now|\d+[mhd]) #1 Header building \+1$/, `${at}: what the row says: ${row.text}`);+ assert.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`);+ 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`);+ }+ }++ // A row filters the feed to that agent and addresses the composer to it, and opens to each thing it holds.+ await shoutsAt(chrome, 1280, 'light');+ await chrome.evaluate(`document.querySelector('#agents .agent-row[data-agent="web-1"]').click()`);+ let p = await panel();+ assert.deepEqual([p.rows[0].on, p.rows[0].work.map(([id]) => id), p.chip, p.to, p.cards], [true, ['1', '2'], 'to web-1×', 'web-1', [['web-1', 'coordinator']]],+ `the picked row opens to what it holds, the feed shows its shouts and the composer is addressed to it: ${JSON.stringify(p)}`);+ assert.ok(p.rows[0].work.every(([, height]) => height >= 44), 'each thing it holds is a 44px target');+ // A pill does the same.+ await chrome.evaluate(`document.querySelector('#agents .agent-pill[data-agent="web-2"]').click()`);+ p = await panel();+ assert.deepEqual([p.pills.find((pill) => pill.id === 'web-2').on, p.chip, p.cards], [true, 'to web-2×', [['web-2', 'coordinator']]], 'a pill filters and addresses too');+ // And a thing an agent holds opens its item.+ await chrome.evaluate(`document.querySelector('#agents .agent-row[data-agent="web-1"]').click()`);+ await chrome.evaluate(`document.querySelector('#agents .agent-work[data-item="2"]').click()`);+ await chrome.waitFor(`!document.querySelector('[data-pane=items]').hidden && document.querySelector('#detail h2')?.textContent.includes('Footer')`);+ 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();+ }+});++test('the composer goes to the coordinator and says who heard [N26]', { timeout: 120_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for rendered composer checks.');++ const box = machine();+ const alpha = project(box, 'heard');+ box.run(alpha.repo, 'add', 'web', 'Greeting', '--specs', 'G1', '--criterion', 'greets');+ box.run(alpha.web, 'shout', 'coordinator', 'Starting on the greeting.');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-heard-chrome-'));+ let chrome;+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ 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")');+ /** 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]');+ return {+ page: { width: document.documentElement.clientWidth, scroll: document.documentElement.scrollWidth, body: document.body.scrollWidth },+ pickers: [...document.querySelectorAll('.composer select, .composer datalist, .composer input')].filter((e) => e.type !== 'hidden').length,+ to: document.querySelector('#shout-to').value, placeholder: document.querySelector('#shout-text').placeholder,+ chip: chip.hidden ? null : chip.textContent, clear: clear ? clear.getBoundingClientRect().height : null,+ heard: [...document.querySelectorAll('#feed .shout')].filter((card) => card.querySelector('.heard')).map((card) => {+ const line = card.querySelector('.heard');+ return [card.querySelector('.text').textContent, line.lastChild.textContent, line.querySelectorAll('.heard-face').length, line.title];+ }),+ };+ })())`));+ const key = async () => {+ for (const type of ['keyDown', 'keyUp']) await chrome.send('Input.dispatchKeyEvent', { type, key: 'Enter', code: 'Enter', windowsVirtualKeyCode: 13, nativeVirtualKeyCode: 13, ...(type === 'keyDown' ? { text: '\r', unmodifiedText: '\r' } : {}) });+ };+ const heardOf = (text) => `[...document.querySelectorAll('#feed .shout')].find((card) => card.querySelector('.text').textContent === ${JSON.stringify(text)})?.querySelector('.heard')?.lastChild.textContent`;++ for (const scheme of ['light', 'dark']) {+ for (const width of [1280, 375]) {+ await shoutsAt(chrome, width, scheme);+ 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`);+ assert.deepEqual([r.pickers, r.to, r.placeholder, r.chip], [0, 'coordinator', 'Shout to the coordinator', null], `${at}: no recipient picker; a shout goes to the coordinator, and says so`);+ }+ }++ // The person shouts with Enter: it goes to the coordinator, and says it is not heard until the coordinator reads it.+ await shoutsAt(chrome, 1280, 'light');+ await chrome.evaluate("document.querySelector('#shout-text').focus()");+ await chrome.send('Input.insertText', { text: 'Ship the greeting?' });+ await key();+ await chrome.waitFor("data.project.shouts.some((s) => s.shout_from === 'person' && s.shout_to === 'coordinator' && s.shout_text === 'Ship the greeting?')", 15_000);+ await chrome.waitFor(`${heardOf('Ship the greeting?')} === 'Not heard yet'`, 15_000);+ box.run(alpha.repo, 'inbox');+ await chrome.waitFor(`${heardOf('Ship the greeting?')} === 'Heard by coordinator'`, 15_000);+ // A shout that reaches everyone says who of them has read it: the coordinator first, then how many agents.+ // (The person reaches every agent through the relay's requests; here the board records one directly.)+ earlier(alpha.repo, Date.now(), (board) => shoutOnBoard(board, { from: 'person', to: 'all', text: 'Hold the merge, please.', lanes: ['web'] }));+ await chrome.waitFor("data.project.shouts.some((s) => s.shout_from === 'person' && s.shout_to === 'all')", 15_000);+ box.run(alpha.repo, 'inbox');+ box.run(alpha.web, 'inbox');+ await chrome.waitFor(`${heardOf('Hold the merge, please.')} === 'Heard by coordinator and 1 agent'`, 15_000);+ const all = (await read()).heard.find(([text]) => text === 'Hold the merge, please.');+ assert.deepEqual(all.slice(2), [2, 'Heard by coordinator, web-1'], 'with their avatars, and every name on hover');++ // Picking an agent addresses the composer to it; the chip's x returns it to the coordinator.+ await chrome.evaluate(`document.querySelector('#agents [data-agent="web-1"]').click()`);+ let r = await read();+ assert.deepEqual([r.chip, r.to, r.placeholder], ['to web-1×', 'web-1', 'Shout to web-1'], 'a picked agent shows as a chip');+ assert.ok(r.clear >= 44, 'whose x is a 44px target');+ await chrome.evaluate(`document.querySelector('#shout-to-chip [data-to-clear]').click()`);+ r = await read();+ assert.deepEqual([r.chip, r.to, r.placeholder], [null, 'coordinator', 'Shout to the coordinator'], 'the x returns it to the coordinator');+ // An item's Shout button addresses its lane the same way.+ await chrome.evaluate("document.querySelector('[data-tab=items]').click()");+ await chrome.waitFor('!!document.querySelector("#chain [data-item=\\"1\\"]")');+ await chrome.evaluate(`document.querySelector('#chain [data-item="1"]').click()`);+ await chrome.waitFor('!!document.querySelector("#detail [data-shout]")');+ await chrome.evaluate(`document.querySelector('#detail [data-shout]').click()`);+ await chrome.waitFor("!document.querySelector('[data-pane=shouts]').hidden");+ for (const width of [375, 1280]) {+ await shoutsAt(chrome, width, 'dark');+ r = await read();+ assert.deepEqual([r.chip, r.to], ['to web×', 'web'], `${width}px dark: an item's Shout button names its lane on the chip`);+ assert.ok(r.page.scroll <= r.page.width && r.page.body <= r.page.width, `${width}px dark: no sideways scroll with the chip`);+ }+ 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();+ }+});test("item detail merges API facts and moves in one responsive timeline [B33,B29]", { timeout: 120_000 }, async (t) => {const executable = chromeExecutable();if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for item-thread rendering checks.');@@ -4954,6 +5155,7 @@ test('in-text item references stay inline and open their target at phone and desfor (const section of ['agents', 'spec', 'doctrine']) {if (section === 'agents') {await chrome.evaluate(`document.querySelector('[data-tab="shouts"]').click()`);+ await chrome.evaluate("(() => { const item = data.project.items.find((i) => i.id === 2); const who = item.owner || item.reviewer || item.builtBy; if (!document.querySelector('#agents .agent-card.on [data-agent=\"' + who + '\"]')) document.querySelector('#agents [data-agent=\"' + who + '\"]').click(); })()");await chrome.waitFor('document.querySelector("#agents [data-item=\\"2\\"]")');} else {await chrome.evaluate(`document.querySelector('[data-tab="${section}"]').click()`);