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
fix(view): list rows hold their shape [N26]
Corey Olson823e456d37f4
diff --git a/src/cockpit.js b/src/cockpit.jsindex b05f9ed0..b407c2f1 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -212,7 +212,7 @@ const rejected = (i) => i.status !== 'verified' && !!i.verdict && i.verdict.deci/** Render a review note with escaped text and references bound to the selected board. */const verdictHtml = (v, titles) => '<div class="verdict ' + (v.decision === 'ACCEPT' ? 'yes' : 'no') + '"><b>' + esc(v.decision) + ' ' + esc(v.reason) + '</b><span class="by">' + esc(v.by) + ' · ' + when(v.at) + ' · at ' + esc(String(v.commit || '').slice(0, 12)) + '</span><div class="note">' + linked(v.note, titles) + '</div></div>';const stateOf = (i) => i.status === 'claimed' ? 'building' : i.status === 'submitted' ? 'verify' : i.status === 'verified' ? 'verified' : i.status === 'withdrawn' ? 'withdrawn' : i.verdict && i.verdict.decision === 'REJECT' ? 'back' : 'open';-const STATES = { building: ['building', 'busy'], verify: ['to verify', 'warn'], back: ['sent back', 'no'], verified: ['verified', 'ok'], open: ['open', ''], withdrawn: ['withdrawn', ''] };+const STATES = { building: ['building', 'busy'], verify: ['to verify', 'warn'], back: ['sent back', 'no'], verified: ['verified', 'ok'], open: ['unclaimed', 'free'], withdrawn: ['withdrawn', ''] };const chip = (s) => '<span class="chip ' + STATES[s][1] + '">' + STATES[s][0] + '</span>';// A shout's path:lines@commit reference (B23): a button, and under it, once opened, that code as it// was at that commit, with its line numbers. The text before it on its line goes with it, so the view@@ -1012,6 +1012,8 @@ function render() {// 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(' → ');@@ -1022,8 +1024,8 @@ function render() {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' ? (gated ? '<span class="chip gate">' + (waits.length ? 'gated' : 'lane held') + '</span>' : '<span class="chip free">unclaimed</span>') : chip(s);- return '<li class="row' + (view.item === i.id ? ' on' : '') + (gated ? ' gated' : '') + '" data-item="' + i.id + '"><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>' + 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>';+ : 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>';}).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);@@ -1039,7 +1041,7 @@ function render() {// Why it came back is the first thing the person reads; the verdicts before it stay below.const back = rejected(item);const earlier = back ? item.verdicts.slice(0, -1) : item.verdicts;- $('detail').innerHTML = '<div class="stack"><div><h2><span>#' + item.id + '</span>' + rich(item.title, titles) + '</h2><div class="meta spaced">' + chip(s) + '<span class="chip">' + esc(item.lane) + '</span><span class="chip">' + esc(item.route) + '</span></div></div>'+ $('detail').innerHTML = '<div class="stack"><div><h2><span>#' + item.id + '</span>' + rich(item.title, titles) + '</h2><div class="meta spaced">' + (s === 'open' ? openChip(item) : chip(s)) + '<span class="chip">' + esc(item.lane) + '</span><span class="chip">' + esc(item.route) + '</span></div></div>'+ (back ? '<div class="sentback"><h3>Sent back' + (s === 'building' ? ', being reworked' : s === 'verify' ? ', resubmitted' : s === 'withdrawn' ? ', then withdrawn' : '') + '</h3>' + verdictHtml(item.verdict, titles) + '</div>' : '')+ (item.criterion ? '<div><h3>Criterion</h3><div class="text">' + rich(item.criterion, titles) + '</div></div>' : '')+ (cited.length ? '<div><h3>Spec rows it serves</h3>' + cited.map((r) => '<div class="rowref"><code>' + esc(r.id) + '</code><div>' + linked(r.text, titles) + ' <span class="chip ' + tone(r.status) + '">' + esc(r.status) + '</span></div></div>').join('') + '</div>' : '')diff --git a/src/view.css b/src/view.cssindex 9334cb7a..e38bef25 100644--- a/src/view.css+++ b/src/view.css@@ -181,9 +181,21 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }.row.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }.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); }-.row .t { font-weight: 600; overflow-wrap: anywhere; }+/* 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; }+.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; }+.row .t code { white-space: nowrap; }.row .t span { color: var(--ink-faint); font: 500 12px var(--mono); margin-right: 5px; }.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; }+.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; }.chip.ok { background: var(--accent-soft); color: var(--accent-strong); }.chip.warn { background: var(--warn-soft); color: var(--warn); }diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex f84b71cc..419f14f3 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -3987,6 +3987,92 @@ test('in-text item references stay inline and open their target at phone and des}});+test('list rows hold their shape: one-line titles end in an ellipsis, every row as tall as the next [N26]', { timeout: 90_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for list row checks.');++ const box = machine();+ const demo = project(box, 'row-shape');+ const long = 'A title far too long for one line of the list: it names `pullboard land` and #1, then keeps on going past every width a phone or a laptop gives a row, so only an ellipsis can end it';+ const titles = { 1: 'Short title', 2: long, 3: 'Waits on the short one', 4: 'Built, then sent back with a long reason', 5: 'Being built right now' };+ box.run(demo.repo, 'add', 'web', titles[1], '--specs', 'G1', '--criterion', 'short');+ box.run(demo.repo, 'add', 'web', titles[2], '--specs', 'G1', '--criterion', 'long');+ box.run(demo.repo, 'add', 'web', titles[3], '--specs', 'G1', '--criterion', 'gated', '--after', '1');+ box.run(demo.repo, 'add', 'web', titles[4], '--specs', 'G1', '--criterion', 'back');+ box.run(demo.repo, 'add', 'web', titles[5], '--specs', 'G1', '--criterion', 'busy');+ build(box, demo, 4, 'four.txt');+ sendBack(box, demo, 4, `It misses the edge: ${'the criterion names a blank name and the page still greets it, '.repeat(4)}`);+ box.run(demo.web, 'claim', '5');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-row-shape-chrome-'));+ let chrome;+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor('document.querySelectorAll("#chain .row").length === 5');+ for (const width of [375, 1280]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor(`innerWidth === ${width}`);+ const rows = JSON.parse(await chrome.evaluate(`JSON.stringify([...document.querySelectorAll('#chain .row')].map((row) => {+ const box = (node) => node.getBoundingClientRect();+ const lines = (node) => Math.round(box(node).height / parseFloat(getComputedStyle(node).lineHeight));+ const apart = (a, b) => a.right <= b.left + 0.5 || b.right <= a.left + 0.5 || a.bottom <= b.top + 0.5 || b.bottom <= a.top + 0.5;+ const title = row.querySelector('.t'), meta = row.querySelector('.meta'), chip = row.querySelector(':scope > .chip');+ return { id: row.dataset.item, tip: row.title, height: Math.round(box(row).height),+ titleLines: lines(title), ellipsis: getComputedStyle(title).textOverflow === 'ellipsis' && getComputedStyle(title).whiteSpace === 'nowrap',+ cut: title.scrollWidth > title.clientWidth, metaLines: lines(meta), chip: chip.className + ': ' + chip.textContent,+ chipHeight: Math.round(box(chip).height), chipClear: apart(box(chip), box(meta)) && apart(box(chip), box(title)),+ code: [...title.querySelectorAll('code')].map((code) => getComputedStyle(code).display) };+ }))`));+ const place = (row) => `${width}, #${row.id}: ${JSON.stringify(row)}`;+ assert.deepEqual(rows.map((row) => row.id).sort(), ['1', '2', '3', '4', '5'], `${width}: every item has a row`);+ for (const row of rows) {+ assert.equal(row.tip, titles[row.id], `${width}: the row's tooltip is its whole title`);+ assert.ok(row.titleLines === 1 && row.ellipsis, `title is one line, set to end in an ellipsis at ${place(row)}`);+ assert.equal(row.metaLines, 1, `the meta line never wraps, a long verdict reason included, at ${place(row)}`);+ assert.ok(row.chipHeight < 24 && row.chipClear, `the chip is one line and nothing runs over it at ${place(row)}`);+ }+ assert.ok(rows.find((row) => row.id === '2').cut, `${width}: the long title is cut, so its ellipsis shows`);+ assert.deepEqual(rows.find((row) => row.id === '2').code, ['inline'], `${width}: inline code in a title stays a word in the line, not a block`);+ assert.equal(new Set(rows.map((row) => row.height)).size, 1, `${width}: every row is as tall as the next: ${JSON.stringify(rows.map((row) => [row.id, row.height]))}`);+ assert.equal(new Set(rows.map((row) => row.chipHeight)).size, 1, `${width}: every chip is the same size`);+ const chips = Object.fromEntries(rows.map((row) => [row.id, row.chip]));+ assert.deepEqual([chips[1], chips[2], chips[3], chips[4]], ['chip free: unclaimed', 'chip free: unclaimed', 'chip gate: gated', 'chip no: sent back'], `${width}: each state's chip in the list`);+ assert.match(chips[5], /^chip busy: web-\d+$/, `${width}: a claimed item names who builds it, in the building colour`);+ // The same state wears the same chip in the item's detail as in its row.+ for (const row of rows) {+ await chrome.evaluate(`document.querySelector('#chain .row[data-item="${row.id}"]').click()`);+ await chrome.waitFor(`document.querySelector('#detail h2')?.textContent.startsWith('#${row.id}')`);+ const detail = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const chip = document.querySelector('#detail .meta.spaced .chip'), listed = document.querySelector('#chain .row[data-item="${row.id}"] > .chip');+ const paint = (node) => [getComputedStyle(node).backgroundColor, getComputedStyle(node).color, getComputedStyle(node).outlineStyle];+ return { chip: chip.className + ': ' + chip.textContent, samePaint: JSON.stringify(paint(chip)) === JSON.stringify(paint(listed)) };+ })())`));+ assert.ok(detail.samePaint, `${width}: #${row.id}'s chip has its row's colours in the detail: ${JSON.stringify(detail)} vs ${row.chip}`);+ if (row.id !== '5') assert.equal(detail.chip, row.chip, `${width}: #${row.id}'s detail says what its row says`);+ else assert.equal(detail.chip, 'chip busy: building', `${width}: the detail says building, in the colour of its row's builder chip`);+ }+ }+ // A builder's name can be long; its chip stops at its cap and ends in an ellipsis, leaving the title its line.+ await chrome.evaluate("data.project.items.find((item) => item.id === 5).owner = 'claude-opus-designer-on-the-studio-7'; render();");+ for (const width of [375, 1280]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor(`innerWidth === ${width} && document.querySelector('#chain .row[data-item="5"] > .chip')?.textContent.startsWith('claude-opus')`);+ const named = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const row = document.querySelector('#chain .row[data-item="5"]'), chip = row.querySelector(':scope > .chip'), meta = row.querySelector('.meta');+ const a = chip.getBoundingClientRect(), b = meta.getBoundingClientRect();+ return { chipWidth: a.width, cap: 10 * parseFloat(getComputedStyle(document.documentElement).fontSize), cut: chip.scrollWidth > chip.clientWidth,+ ellipsis: getComputedStyle(chip).textOverflow === 'ellipsis', clear: b.right <= a.left + 0.5, heights: [...new Set([...document.querySelectorAll('#chain .row')].map((r) => Math.round(r.getBoundingClientRect().height)))] };+ })())`));+ assert.ok(named.chipWidth <= named.cap + 0.5 && named.cut && named.ellipsis, `${width}: a long builder name stops at the chip's cap, cut with an ellipsis: ${JSON.stringify(named)}`);+ assert.ok(named.clear && named.heights.length === 1, `${width}: and the row keeps its meta clear and its height: ${JSON.stringify(named)}`);+ }+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});+test('Roadmap and rule prose references stay inline and open the item on their own board [N26,N38]', { timeout: 90_000 }, async (t) => {const executable = chromeExecutable();if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for prose-reference checks.');@@ -4357,7 +4443,7 @@ test('the roadmap reads every item as the Items tab does, opens each one, anothe{ id: '#4', label: 'to verify', tone: 'warn' },{ id: 'beacon#1', label: 'sent back', tone: 'no' },{ id: '#5', label: 'building', tone: 'busy' },- { id: '#6', label: 'open', tone: '' },+ { id: '#6', label: 'unclaimed', tone: 'free' },{ id: '#7', label: 'withdrawn', tone: '' },];const view = await startView(box);@@ -4507,8 +4593,8 @@ test('an exported roadmap has its own address under a folder, and Back and Forwaconst seen = await readRoadmap(chrome);assert.deepEqual(seen.cards[0].rows.map(({ id, label, tone, button }) => ({ id, label, tone, button })), [{ id: '#1', label: 'verified', tone: 'ok', button: true },- { id: '#2', label: 'open', tone: '', button: true },- { id: 'beacon#1', label: 'open', tone: '', button: false },+ { id: '#2', label: 'unclaimed', tone: 'free', button: true },+ { id: 'beacon#1', label: 'unclaimed', tone: 'free', button: false },], "the snapshot's rows read as its Items tab does; another repo's item, not in the snapshot, opens nothing");assert.equal(seen.cards[0].rows[2].tip, 'Billing webhook retries (not in this snapshot)', 'and says why');assert.deepEqual([seen.cards[1].name, seen.cards[1].empty], ['Later', 'No items yet.']);