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.

feat(view): spec rows read across a phone [N26]

Corey Olson37ba0dc80008
diff --git a/src/cockpit.js b/src/cockpit.js
index dd986ab9..6b9a89d7 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -213,6 +213,7 @@ input, select { border: 1px solid var(--line-strong); background: var(--surface)
.srow:hover { background: var(--surface-2); }
.srow.on { background: var(--accent-soft); }
.srow code { font: 600 12px var(--mono); }
+@media (max-width: 480px) { .srow { grid-template-columns: auto minmax(0, 1fr); } .srow > span:last-child { grid-column: 1 / -1; } }
.flow { margin: 0 0 12px; padding: 10px 12px 8px; overflow-x: auto; }
.flow svg { display: block; width: 100%; min-width: 680px; max-width: 900px; height: auto; margin: 0 auto; }
.flow figcaption { color: var(--ink-faint); font-size: 12px; padding: 2px 2px 0; }
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index b1502df3..b6ab83e6 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -820,3 +820,25 @@ test('times say which day they were [N26]', async () => {
await view.stop();
}
});
+
+test('spec rows read across a phone [N26]', async () => {
+ const box = machine();
+ project(box, 'alpha');
+ const view = await startView(box);
+ try {
+ const page = await openPage(view, { width: 375 });
+ const style = page.html.slice(page.html.indexOf('<style>'), page.html.indexOf('</style>'));
+ assert.match(style, /\n\.srow \{ display: grid; grid-template-columns: 4\.4em 6\.2em minmax\(0, 1fr\);/, 'wider, a row keeps its three columns');
+ assert.match(style, /\n@media \(max-width: 480px\) \{ \.srow \{ grid-template-columns: auto minmax\(0, 1fr\); \} \.srow > span:last-child \{ grid-column: 1 \/ -1; \} \}\n/, 'under 480px, the text takes the full width below the id and status');
+
+ // The rule holds because every row is the id, then the status, then the text.
+ await page.click({ rows: 'spec:all' });
+ const rows = (html) => html.split('<div class="srow').slice(1);
+ const shape = /^[^>]*><code>[^<]+<\/code><span><span class="chip[^"]*">[^<]+<\/span><\/span><span>[^<]+<\/span><\/div>/;
+ assert.deepEqual(rows(page.show('spec-list')).map((row) => /data-row="spec:([^"]+)"/.exec(row)[1]), ['G1', 'G2']);
+ for (const row of [...rows(page.show('spec-list')), ...rows(page.show('doctrine-list'))]) assert.match(row, shape);
+ assert.ok(rows(page.show('doctrine-list')).length > 0, 'doctrine rows are drawn the same way');
+ } finally {
+ await view.stop();
+ }
+});