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
feat(view): briefs render their lists as lists [N26]
Corey Olsoncd9460808810
diff --git a/src/cockpit.js b/src/cockpit.jsindex 4f89c0ec..80487128 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -857,6 +857,26 @@ function renderSide() {* @param {boolean} allowLinks* @returns {string}*/+ /**+ * A run of '- ' lines as one bulleted list, indented lines nested under the bullet above them. A bullet+ * that is a whole command (npm, npx, pnpm, yarn, bun, git, node, python, pytest, pullboard) is one code+ * chip; any other bullet is prose, with its paths, flags and backticks as chips.+ */+ function bullets(lines, titles, allowLinks) {+ const roots = [], open = [];+ for (const line of lines) {+ const [, indent, text] = /^(\\s*)- (.*)$/.exec(line);+ const node = { text, children: [] };+ while (open.length && indent.length <= open.at(-1).indent) open.pop();+ (open.length ? open.at(-1).node.children : roots).push(node);+ open.push({ indent: indent.length, node });+ }+ const list = (nodes) => '<ul class="text-list">' + nodes.map((node) => '<li>'+ + (/^(?:npm|npx|pnpm|yarn|bun|git|node|python(?:\\d+(?:\\.\\d+)?)?|pytest|pullboard)\\s+\\S/.test(node.text) ? codeChip(node.text) : inline(node.text, titles, allowLinks))+ + (node.children.length ? list(node.children) : '') + '</li>').join('') + '</ul>';+ return list(roots);+ }+function rich(text, titles, allowLinks = true) {const lines = String(text ?? '').split('\\n');const output = [];@@ -871,13 +891,18 @@ function renderSide() {const block = [];while (i < lines.length && lines[i].startsWith('$ ')) block.push(lines[i++]);output.push('<code class="code block">' + esc(block.join('\\n')) + '</code>');+ } else if (/^\\s*- /.test(lines[i])) {+ const run = [];+ while (i < lines.length && /^\\s*- /.test(lines[i])) run.push(lines[i++]);+ output.push({ list: bullets(run, titles, allowLinks) });} else {const block = [];- while (i < lines.length && !lines[i].startsWith('\`\`\`') && !lines[i].startsWith('$ ')) block.push(inline(lines[i++], titles, allowLinks));+ while (i < lines.length && !lines[i].startsWith('\`\`\`') && !lines[i].startsWith('$ ') && !/^\\s*- /.test(lines[i])) block.push(inline(lines[i++], titles, allowLinks));output.push(block.join('<br>'));}}- return output.join('<br>');+ // A list ends its own line, so no break goes beside one: a blank line in the text stays one blank line.+ return output.map((part, n) => (n && typeof part === 'string' && typeof output[n - 1] === 'string' ? '<br>' : '') + (typeof part === 'string' ? part : part.list)).join('');}/** Draw a project's cross-repo Needs-you list and one activity feed. */diff --git a/src/view.css b/src/view.cssindex 1da29cf3..aaff6c22 100644--- a/src/view.css+++ b/src/view.css@@ -302,6 +302,9 @@ button.ref { width: auto; min-height: 0; border: 0; border-radius: 0; backgroundbutton.ref[data-code] { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }code.inline { padding: 0 3px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 8%, var(--surface)); font: .92em var(--mono); white-space: nowrap; }code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }+/* A brief's '- ' lines, wherever text is drawn: tight bullets, nested ones indented under their parent. */+.text-list { list-style: disc; margin: 0; padding-left: 1.35em; }+.text-list .text-list { list-style: circle; }.code { display: block; margin: 6px 0 2px; padding: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font: 12px/1.55 var(--mono); white-space: pre; overflow-x: auto; overflow-wrap: normal; }.code > span { display: block; padding-right: 12px; }.code i { display: inline-block; min-width: 3.2em; padding: 0 10px 0 6px; text-align: right; font-style: normal; color: var(--ink-faint); user-select: none; }diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex 63932cd9..d4e963bf 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -771,6 +771,59 @@ test('the tabs fit one row on a phone [N26]', async () => {await view.stop();}});+test('real Chrome renders brief lists with inline paths [N26]', { timeout: 90_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for brief list checks.');++ const box = machine();+ const demo = project(box, 'briefs');+ const brief = ['The person called the old rendering ugly.', '', 'Files:', '- web/index.html', '- web/app.js', '- web/style.css', '- web/api.md', '',+ 'Test:', '- node bin/run-tests.js --test-name-pattern "brief lists" test/cockpit.test.js', '- make test stays prose', '- a parent bullet',+ ' - capture, measurement, `note`', ' - decision, rejection'].join('\n');+ box.run(demo.repo, 'add', 'web', 'A brief with lists', '--specs', 'G1', '--criterion', 'lists', '--brief', brief);+ box.run(demo.repo, 'shout', 'all', 'A fence still reads as code:\n```\nconst greeting = "hello";\n```');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-brief-lists-chrome-'));+ let chrome;+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor("typeof data === 'object' && !!data && !!data.project && !!document.querySelector('#detail .text.muted')");+ 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('#detail .text.muted ul') !== null`);+ const seen = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const text = document.querySelector('#detail .text.muted');+ const lists = [...text.querySelectorAll(':scope > ul.text-list')];+ const label = (list) => { let n = list.previousSibling; while (n && n.nodeType === 3 && !n.textContent.trim()) n = n.previousSibling; return n ? (n.nodeType === 3 ? n.textContent : n.textContent).trim().split('\\n').pop() : ''; };+ const item = (li) => ({ text: li.firstChild ? [...li.childNodes].filter((n) => n.nodeName !== 'UL').map((n) => n.textContent).join('') : '',+ codes: [...li.querySelectorAll(':scope > code')].map((code) => [code.textContent, getComputedStyle(code).display]), nested: [...li.querySelectorAll(':scope > ul > li')].map((child) => child.textContent) });+ const line = parseFloat(getComputedStyle(text).lineHeight);+ const testLabelTop = (() => { const r = document.createRange(); const node = [...text.childNodes].find((n) => n.nodeType === 3 && n.textContent.includes('Test:')); r.selectNode(node); return r.getBoundingClientRect().top; })();+ return { lists: lists.map((list) => ({ label: label(list), items: [...list.querySelectorAll(':scope > li')].map(item) })),+ blocks: text.querySelectorAll('code.block, .code').length, dashes: text.innerText.split('\\n').filter((l) => l.trim().startsWith('-')).length,+ gap: (testLabelTop - lists[0].getBoundingClientRect().bottom) / line, overflow: document.documentElement.scrollWidth > document.documentElement.clientWidth };+ })())`));+ const place = `${width}: ${JSON.stringify(seen)}`;+ assert.deepEqual(seen.lists.map((list) => list.label), ['Files:', 'Test:'], `${width}: each label stays a plain line above its own list`);+ assert.deepEqual(seen.lists[0].items.map((li) => li.codes), [[['web/index.html', 'inline']], [['web/app.js', 'inline']], [['web/style.css', 'inline']], [['web/api.md', 'inline']]],+ `each path is a bullet holding one inline chip at ${place}`);+ const [command, prose, parent] = seen.lists[1].items;+ assert.deepEqual(command.codes, [['node bin/run-tests.js --test-name-pattern "brief lists" test/cockpit.test.js', 'inline']], `${width}: a whole command bullet is one chip`);+ assert.deepEqual([prose.text, prose.codes], ['make test stays prose', []], `${width}: any other command, unmarked, stays prose`);+ assert.deepEqual(parent.nested, ['capture, measurement, note', 'decision, rejection'], `${width}: indented bullets nest under the bullet above them`);+ assert.deepEqual([seen.blocks, seen.dashes], [0, 0], `${width}: no code block and no stray dash in the brief`);+ assert.ok(seen.gap > 0.4 && seen.gap < 1.6, `${width}: one blank line between a list and the next label, as written: ${seen.gap.toFixed(2)} lines`);+ assert.ok(!seen.overflow, `${width}: nothing runs off the screen`);+ }+ await chrome.evaluate("document.querySelector('[data-tab=\"shouts\"]').click()");+ await chrome.waitFor("[...document.querySelectorAll('#feed code.block')].some((code) => code.textContent.includes('const greeting'))");+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});+test('the view has a light and a dark theme to choose [N26]', async () => {const view = await startView(machine());try {