Skip to content

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.

fix(view): the release and agents parts open what they count [N26]

Corey Olson7825c9c1610b
diff --git a/src/cockpit.js b/src/cockpit.js
index 2d208f59..50cde04c 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -1096,9 +1096,12 @@ function milestoneRow(row, titles) {
* highlighted line. A milestone with no items says so, rather than draw an empty bar.
*/
function roadmapCards(p, titles) {
- const milestones = p.milestones || [];
+ // Opened from the status bar's release, the Roadmap is that release alone, with a way back to all of them.
+ const only = view.roadmapOnly && (p.milestones || []).some((m) => m.name === view.roadmapOnly) ? view.roadmapOnly : null;
+ const milestones = (p.milestones || []).filter((m) => !only || m.name === only);
+ const lead = only ? '<div class="roadmap-only"><span>' + esc(only) + '</span><button class="link" data-roadmap-all type="button">show all</button></div>' : '';
if (!milestones.length) return '<div class="card-panel empty">No milestones yet. The coordinator adds one with <code class="inline">pullboard milestone add</code>.</div>';
- return milestones.map((milestone) => {
+ return lead + milestones.map((milestone) => {
const rows = milestone.items.map((entry) => milestoneItem(entry, p));
const done = rows.filter((row) => row.state === 'verified').length;
const name = esc(milestone.name);
@@ -1362,10 +1365,10 @@ function render() {
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="unread" title="Show the shouts you have not read" hidden></button>'
- + part('shouts', busy.length, busy.length === 1 ? 'agent' : 'agents', 'Agents holding work: ' + busy.map((a) => a.agent_id).join(', '))
+ + part('agents', busy.length, busy.length === 1 ? 'agent' : 'agents', 'Show the 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>' : '')
+ + (release ? '<button type="button" data-status="release" title="' + esc('Show this release on 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('');
@@ -1563,6 +1566,7 @@ function answer(id) {
/** Open what a status-bar part counts: its tab, narrowed to exactly those. */
function statusGo(to) {
view.unread = null;
+ view.roadmapOnly = null;
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'); }
@@ -1573,6 +1577,10 @@ function statusGo(to) {
view.agent = null;
openTab('shouts');
}
+ // The agents it counts are the panel's rows, so it opens the panel even where the person hid it.
+ else if (to === 'agents') { view.agentsHidden = false; keep('pb.agents', 'shown'); view.agent = null; openTab('shouts'); }
+ // The release it counts is one milestone, so the Roadmap opens on that one alone.
+ else if (to === 'release') { view.roadmapOnly = (data.project.milestones || []).find((m) => m.done < m.total)?.name ?? null; openTab('roadmap'); }
else openTab(to);
showTab();
render();
@@ -1910,14 +1918,15 @@ $('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-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');
+ const t = event.target.closest('[data-status],[data-roadmap-all],[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 ('roadmapAll' in t.dataset) { view.roadmapOnly = null; render(); return; }
if (t.dataset.root) switchTo(t.dataset.root, t.dataset.go || '');
- else if (t.dataset.tab) { view.unread = null; openTab(t.dataset.tab); showTab(); }
+ else if (t.dataset.tab) { view.unread = null; view.roadmapOnly = null; openTab(t.dataset.tab); showTab(); }
else if (t.dataset.go) go(t.dataset.go, t.dataset.board);
else if (t.dataset.item) pick(Number(t.dataset.item));
else if (t.dataset.state) { view.state = t.dataset.state; render(); }
diff --git a/src/view.css b/src/view.css
index eae62432..fd8209fe 100644
--- a/src/view.css
+++ b/src/view.css
@@ -574,3 +574,4 @@ button, input, select, textarea, [data-item], [data-row] { min-height: 44px; }
.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; }
+.roadmap-only { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; color: var(--ink-muted); font-size: 13px; }
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index d229d10c..d706e73a 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -6370,6 +6370,7 @@ test('the board reads at a glance from the status bar [N26]', { timeout: 180_000
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');
+ box.run(alpha.repo, 'milestone', 'add', '2.0: the rest', '--note', 'After the first cut', '--items', '2,3,4');
const second = join(box.dir, 'glance-web-2');
box.git(alpha.repo, 'worktree', 'add', '-q', second, '-b', 'web/glance2');
box.run(second, 'join', 'web');
@@ -6411,7 +6412,7 @@ test('the board reads at a glance from the status bar [N26]', { timeout: 180_000
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,
+ agentRows: [...document.querySelectorAll('#agents .agent-card')].filter((card) => card.getBoundingClientRect().height > 0).length,
};
})())`));
const part = (r, to) => r.bar.find((p) => p.to === to);
@@ -6443,8 +6444,8 @@ test('the board reads at a glance from the status bar [N26]', { timeout: 180_000
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`);
+ assert.deepEqual(r.bar.map((p) => p.to).filter((to) => !to.startsWith('item:') && to !== 'activity'), ['items', 'agents', 'verify', 'gated', 'release'], `${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, 'release').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]));
@@ -6510,12 +6511,26 @@ test('the board reads at a glance from the status bar [N26]', { timeout: 180_000
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 click('.status [data-status="agents"]');
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"]');
+ assert.ok(r.agentRows > 0 && number(part(r, 'agents')) === r.agentRows, `the agents part counts the ${r.agentRows} rows of the agents panel it opens`);
+ // Hidden by the person, the panel comes back when the part that counts its rows is opened.
+ await click('#feed [data-agents-toggle]');
+ await chrome.waitFor('view.agentsHidden === true');
+ await click('[data-tab=items]');
+ await click('.status [data-status="agents"]');
+ await chrome.waitFor("view.tab === 'shouts' && view.agentsHidden === false");
+ r = await read();
+ assert.ok(r.agentRows > 0 && number(part(r, 'agents')) === r.agentRows, `hidden, the panel comes back with the ${r.agentRows} agents the part counts`);
+ // The release part opens the Roadmap on that release alone: its rows are the ones it counts.
+ await click('.status [data-status="release"]');
await chrome.waitFor("view.tab === 'roadmap'");
+ const roadmapRows = () => chrome.evaluate("document.querySelectorAll('#roadmap .milestone-item').length");
+ assert.deepEqual([await chrome.evaluate("[...document.querySelectorAll('#roadmap .milestone h2')].map((h) => h.textContent).join()"), await roadmapRows()], ['1.0: first cut', 3],
+ 'the release the part counts, and only its three items');
+ await click('#roadmap [data-roadmap-all]');
+ assert.equal(await roadmapRows(), 6, 'show all brings back every release');
const last = r.bar.find((p) => p.to.startsWith('item:'));
if (last) {
await click(`.status [data-status="${last.to}"]`);