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): compact waits-on metadata [N26]

Corey Olson18c66d239fbe
diff --git a/src/cockpit.js b/src/cockpit.js
index c11fdc2c..482d0197 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -750,7 +750,7 @@ function render() {
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 pills = (waits.length ? '<span class="gate">waits on ' + waits.map((id) => '<button class="ref" data-go="item:' + id + '" type="button">#' + id + '</button>').join(', ') + '</span>' : '') + (hold ? '<span class="gate">lane held: ' + esc(hold.hold_reason) + '</span>' : '');
+ 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: ' + esc(hold.hold_reason) + '</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);
@@ -775,7 +775,7 @@ function render() {
+ (item.criterion ? '<div><h3>Criterion</h3><div class="text">' + esc(item.criterion) + '</div></div>' : '')
+ (cited.length ? '<div><h3>Spec rows it serves</h3>' + cited.map((r) => '<div class="rowref"><code>' + esc(r.id) + '</code><div>' + esc(r.text) + ' <span class="chip ' + tone(r.status) + '">' + esc(r.status) + '</span></div></div>').join('') + '</div>' : '')
+ (item.brief ? '<div><h3>Brief</h3><div class="text muted">' + esc(item.brief) + '</div></div>' : '')
- + '<div><h3>People and commits</h3><dl class="kv">' + (item.owner && s === 'building' ? '<dt>holding</dt><dd>' + esc(item.owner) + '</dd>' : '') + (item.builtBy ? '<dt>built by</dt><dd>' + esc(item.builtBy) + '</dd>' : '') + (item.verifiedBy ? '<dt>verified by</dt><dd>' + esc(item.verifiedBy) + '</dd>' : '') + (item.commit ? '<dt>commit</dt><dd><code>' + esc(item.commit.slice(0, 12)) + '</code></dd>' : '') + (item.merged ? '<dt>merged</dt><dd><code>' + esc(item.merged.slice(0, 12)) + '</code></dd>' : '') + (item.blockedBy.length ? '<dt>waits on</dt><dd>' + item.blockedBy.map((id) => '#' + id).join(', ') + '</dd>' : '') + '</dl></div>'
+ + '<div><h3>People and commits</h3><dl class="kv">' + (item.owner && s === 'building' ? '<dt>holding</dt><dd>' + esc(item.owner) + '</dd>' : '') + (item.builtBy ? '<dt>built by</dt><dd>' + esc(item.builtBy) + '</dd>' : '') + (item.verifiedBy ? '<dt>verified by</dt><dd>' + esc(item.verifiedBy) + '</dd>' : '') + (item.commit ? '<dt>commit</dt><dd><code>' + esc(item.commit.slice(0, 12)) + '</code></dd>' : '') + (item.merged ? '<dt>merged</dt><dd><code>' + esc(item.merged.slice(0, 12)) + '</code></dd>' : '') + (item.blockedBy.length ? '<dt>waits on</dt><dd class="waits-on">' + item.blockedBy.map((id) => '<span class="wait-unit"><button class="ref" data-go="item:' + id + '" type="button">#' + id + '</button></span>').join(', ') + '</dd>' : '') + '</dl></div>'
+ (back && !earlier.length ? '' : '<div><h3>' + (back ? 'Earlier verdicts' : 'Verdicts') + '</h3>' + (earlier.length ? earlier.map(verdictHtml).join('') : '<div class="muted">None yet.</div>') + '</div>')
+ '<div><h3>History</h3>' + timeline(item) + '</div>'
+ '<div class="links"><button data-shout="' + esc(item.lane) + '" data-about="' + item.id + '" type="button">Shout the ' + esc(item.lane) + ' lane about #' + item.id + '</button><button data-new type="button">New item</button></div></div>';
diff --git a/src/view.css b/src/view.css
index 432f6153..e2545b7e 100644
--- a/src/view.css
+++ b/src/view.css
@@ -175,6 +175,8 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }
.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 .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; }
.empty { color: var(--ink-faint); padding: 14px 10px; }
@@ -190,6 +192,8 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }
.detail .muted, .muted { color: var(--ink-muted); }
.kv { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-faint); } .kv dd { margin: 0; overflow-wrap: anywhere; }
+.kv dd.waits-on button.ref { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
+.kv dd.waits-on button.ref { min-height: 0; }
.kv code, .detail code { font: 12px var(--mono); }
.verdict { display: grid; gap: 3px; margin-bottom: 10px; }
.verdict.yes b { color: var(--accent-strong); } .verdict.no b { color: var(--reject); }
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index 7628dd9a..cab86bbf 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -2595,7 +2595,7 @@ test('real Chrome keeps the demo board usable at phone and desktop widths [N26,N
const snapshot = async () => 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),width:r.width,height:r.height}});
+ 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),inlineReference:!!e.closest('#chain .meta .gate, #detail .kv dd.waits-on'),width:r.width,height:r.height}});
return {width:innerWidth,clientWidth:document.documentElement.clientWidth,documentWidth:document.documentElement.scrollWidth,bodyWidth:document.body.scrollWidth,
projectList:visible(document.querySelector('#proj-list')),needs:visible(document.querySelector('#needs')),
detail:visible(document.querySelector('#detail')),controls};
@@ -2607,7 +2607,7 @@ test('real Chrome keeps the demo board usable at phone and desktop widths [N26,N
const layout = await snapshot();
assert.ok(fitsViewport(layout),
`${width} ${place}: no horizontal overflow: ${JSON.stringify(layout)}`);
- const short = layout.controls.filter((control) => control.height < 44);
+ const short = layout.controls.filter((control) => !control.inlineReference && control.height < 44);
assert.deepEqual(short, [], `${width} ${place}: visible enabled actions are at least 44px high: ${JSON.stringify(short)}`);
};
@@ -2800,3 +2800,73 @@ test('static export redacts structured checkout paths but preserves paths people
await live.stop();
}
});
+
+test('wait references stay on one line and link to every prerequisite at phone and desktop widths [N26]', { timeout: 90_000 }, async (t) => {
+ const executable = chromeExecutable();
+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for prerequisite layout checks.');
+ const box = machine();
+ const demo = project(box, 'waits-demo');
+ box.run(demo.repo, 'add', 'web', 'Prerequisite one', '--specs', 'G1', '--criterion', 'finish first');
+ box.run(demo.repo, 'add', 'web', 'Prerequisite two', '--specs', 'G1', '--criterion', 'finish second');
+ box.run(demo.repo, 'add', 'web', 'Blocked item', '--specs', 'G1', '--criterion', 'wait on both', '--after', '1,2');
+ const view = await startView(box);
+ let chrome;
+ try {
+ chrome = await openSnapshotChrome(executable, view.link.href, join(box.dir, 'waits-chrome'));
+ /** Click a rendered prerequisite link through the same Chrome input path as a person. */
+ const click = async (selector) => {
+ const point = JSON.parse(await chrome.evaluate(`(() => {
+ const element=document.querySelector(${JSON.stringify(selector)});
+ element.scrollIntoView({block:'center'});
+ const rect=element.getBoundingClientRect();
+ return JSON.stringify({x:rect.x+rect.width/2,y:rect.y+rect.height/2});
+ })()`));
+ await chrome.send('Input.dispatchMouseEvent', { type: 'mouseMoved', ...point });
+ await chrome.send('Input.dispatchMouseEvent', { type: 'mousePressed', ...point, button: 'left', clickCount: 1 });
+ await chrome.send('Input.dispatchMouseEvent', { type: 'mouseReleased', ...point, button: 'left', clickCount: 1 });
+ };
+ 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')`);
+ const itemIds = await chrome.evaluate('data.project.items.map(item => item.id + ":" + item.title + ":" + item.blockedBy.join(","))');
+ assert.ok(await chrome.evaluate('!!document.querySelector(\'#chain [data-item="3"]\')'), `${width}: blocked item appears among ${itemIds.join('; ')}`);
+ const list = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {
+ const gate=document.querySelector('#chain [data-item="3"] .meta .gate');
+ const lineHeight=e=>parseFloat(getComputedStyle(e).lineHeight);
+ const neighbors=[...gate.parentElement.children].filter(e=>e!==gate).map(lineHeight).filter(Number.isFinite);
+ const units=[...gate.querySelectorAll('.wait-unit')];
+ return {height:gate.getBoundingClientRect().height,neighborHeight:Math.max(...neighbors),unitWhiteSpaces:units.map(unit=>getComputedStyle(unit).whiteSpace),unitY:units.map(unit=>unit.getBoundingClientRect().y),links:[...gate.querySelectorAll('button.ref')].map(link=>link.dataset.go)};
+ })())`));
+ t.diagnostic(`${width}px list wait marker: ${list.height}px tall, neighboring metadata line ${list.neighborHeight}px`);
+ assert.ok(list.height <= list.neighborHeight + 1, `${width}: list reference matches neighboring metadata height: ${JSON.stringify(list)}`);
+ assert.deepEqual(list.unitWhiteSpaces, ['nowrap', 'nowrap'], `${width}: each list prerequisite stays intact`);
+ assert.equal(new Set(list.unitY).size, 1, `${width}: both list prerequisites fit on one line: ${JSON.stringify(list)}`);
+ assert.deepEqual(list.links, ['item:1', 'item:2'], `${width}: every prerequisite is a link`);
+
+ await click('#chain [data-item="3"] .t');
+ await chrome.waitFor("!!document.querySelector('#detail .kv dd.waits-on')");
+ const detail = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {
+ const waits=document.querySelector('#detail .kv dd.waits-on');
+ const units=[...waits.querySelectorAll('.wait-unit')];
+ return {height:waits.getBoundingClientRect().height,lineHeight:parseFloat(getComputedStyle(waits).lineHeight),unitWhiteSpaces:units.map(unit=>getComputedStyle(unit).whiteSpace),unitY:units.map(unit=>unit.getBoundingClientRect().y),
+ links:[...waits.querySelectorAll('button.ref')].map(link=>link.dataset.go)};
+ })())`));
+ t.diagnostic(`${width}px detail wait marker: ${detail.height}px tall, neighboring metadata line ${detail.lineHeight}px`);
+ assert.ok(detail.height <= detail.lineHeight + 1, `${width}: detail prerequisite line matches its metadata: ${JSON.stringify(detail)}`);
+ assert.deepEqual(detail.unitWhiteSpaces, ['nowrap', 'nowrap'], `${width}: each detail prerequisite stays intact`);
+ assert.deepEqual(detail.links, ['item:1', 'item:2'], `${width}: detail links every prerequisite`);
+ assert.equal(new Set(detail.unitY).size, 1, `${width}: detail links share one line: ${JSON.stringify(detail)}`);
+ t.diagnostic(`${width}px detail wait links share y=${detail.unitY[0]}`);
+ for (const [id, title] of [['1', 'Prerequisite one'], ['2', 'Prerequisite two']]) {
+ await click('#chain [data-item="3"] .t');
+ await chrome.waitFor("!!document.querySelector('#detail .kv dd.waits-on')");
+ await click(`#detail .waits-on [data-go="item:${id}"]`);
+ await chrome.waitFor(`document.querySelector('#detail h2').textContent.includes(${JSON.stringify(title)})`);
+ }
+ }
+ assert.deepEqual(chrome.exceptions, [], 'Chrome reports no uncaught page exceptions');
+ } finally {
+ if (chrome) await closeSnapshotChrome(chrome);
+ await view.stop();
+ }
+});