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): an item's meta line keeps its own spacing [N26]

Corey Olsonef243c9833d1
diff --git a/src/cockpit.js b/src/cockpit.js
index 7285a4b1..d4f16a38 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -468,7 +468,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>' + esc(item.title) + '</h2><div class="meta">' + 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>' + esc(item.title) + '</h2><div class="meta spaced">' + 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) + '</div>' : '')
+ (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>' : '')
diff --git a/src/view.css b/src/view.css
index d7e111b0..7a8ec69f 100644
--- a/src/view.css
+++ b/src/view.css
@@ -158,7 +158,7 @@ input:disabled { background: var(--surface-2); color: var(--ink-muted); }
.stack { display: grid; gap: 14px; }
.stack.tight { gap: 12px; }
-.stack h2 + .meta { margin-top: 6px; }
+.meta.spaced { margin-top: 6px; }
.detail { position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 32px); overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
@media (max-width: 900px) { .detail { position: static; max-height: none; } #detail { scroll-margin-top: 60px; } }
.detail h2 { margin: 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index 36363c40..9469e80a 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -914,6 +914,13 @@ test("the view's styles live in their own file [N26]", async () => {
await page.click({ go: 'item:1' });
await page.click({ row: 'spec:G1' });
assert.match(page.show('prod-list'), /<svg class="bar" viewBox="0 0 100 1" preserveAspectRatio="none" aria-hidden="true"><rect width="50" height="1"\/><\/svg>/, 'a product bar is drawn, half full');
+ // Each layout keeps its own spacing: an item's meta line sits 6px under its title, a spec row's 2px.
+ const style = await styleOf(view);
+ assert.match(page.show('detail'), /<\/h2><div class="meta spaced">/);
+ assert.match(page.show('spec-detail'), /<\/h2><div class="meta">/);
+ assert.match(style, /\n\.meta \{ [^}]*margin-top: 2px; \}\n/);
+ assert.match(style, /\n\.meta\.spaced \{ margin-top: 6px; \}\n/);
+ assert.doesNotMatch(style, /h2 \+ \.meta/, 'no rule reaches past the item into a spec row');
for (const id of [...page.html.matchAll(/\bid="([^"]+)"/g)].map((match) => match[1])) {
assert.doesNotMatch(page.show(id), /style=/, `#${id} holds no style`);
}