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(roadmap): expand every row before opening Items [N26,N38]
Corey Olson0e3ec3955fa3
diff --git a/src/cockpit.js b/src/cockpit.jsindex e9b44c53..98c62890 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -2114,18 +2114,19 @@ function renderSide() {/** Escape plain text while preserving safe item and code-preview links.* @param {string} text* @param {Map<string, string>} titles- * @param {boolean} allowLinks+ * @param {boolean|'in-place'} allowLinks* @returns {string}*/function linked(text, titles, allowLinks = true, root = view.root) { return String(text ?? '').split(/(#\\d+|(?<![^\\s([{"'\`])[^\\s:@()[\\]{}"'\`]+:\\d+(?:-\\d+)?@[0-9a-f]{7,40}(?![^\\s)\\]}"'\`.,;:!?]))/).map((part, n, parts) => {- if (n % 2 && part[0] !== '#') return allowLinks ? codeRef(part, parts.slice(0, n).join('').split('\\n').pop().slice(-2000)) : codeChip(part);+ if (n % 2 && part[0] !== '#') return allowLinks === true ? codeRef(part, parts.slice(0, n).join('').split('\\n').pop().slice(-2000)) : codeChip(part);const id = /^#\\d+$/.test(part) ? String(Number(part.slice(1))) : '';+ if (id && allowLinks === 'in-place') return '<span class="ref"' + (titles.has(id) ? ' title="' + esc(titles.get(id)) + '"' : '') + '>' + esc(part) + '</span>';return id && allowLinks ? '<a class="ref" href="' + esc(itemAddress(id, root)) + '" data-go="item:' + id + '"' + (root === view.root ? '' : ' data-board="' + esc(root) + '"') + (titles.has(id) ? ' title="' + esc(titles.get(id)) + '"' : '') + '>' + esc(part) + '</a>' : esc(part);}).join(''); }/** Format inline code and recognized command tokens without interpreting markup.* @param {string} text* @param {Map<string, string>} titles- * @param {boolean} allowLinks+ * @param {boolean|'in-place'} allowLinks* @returns {string}*/function inline(text, titles, allowLinks = true, root = view.root) { return String(text ?? '').split(/(\`[^\`]*\`|(?:[^\\s:@()[\\]{}"'\`]+)?:\\d+(?:-\\d+)?@[0-9a-f]{0,40}|${COMMAND_SOURCE}|--[\\w-]+|(?:\\/|\\.\\.?\\/|[\\w.-]+\\/)\\w[\\w./-]*\\.[A-Za-z0-9]+|\\b[0-9a-fA-F]{7,40}\\b|#\\d+)/g).map((part, n, parts) => {@@ -2142,7 +2143,7 @@ function renderSide() {const reason = !partial[1] ? 'missing the repository path' : 'missing a usable commit SHA';return '<span class="code no ref-missing" role="status">Code reference unavailable: ' + reason + '.</span>';}- if (allowLinks && validRef) return codeRef(part, textBefore.slice(-2000));+ if (allowLinks === true && validRef) return codeRef(part, textBefore.slice(-2000));return codeChip(part);}if (/^(?:${COMMAND_SOURCE}|--[\\w-]+)$/.test(part)) return codeChip(part, 'cmd');@@ -2304,26 +2305,20 @@ function jumpToRoadmap(key) {/*** One item's row on the Roadmap, laid out as the Items list lays one out: the dot of its state, its* id and title on one line that ends in an ellipsis when cut, and the Items tab's chip. The whole- * title is the row's tooltip. An item that opens is a button; one that cannot says why instead.+ * title is the row's tooltip. Every row expands in place; its compact detail alone links over to Items.*/function milestoneRow(row, titles) {- const title = row.title ? inline(String(row.title).replace(/\\s+/g, ' '), row.titles || titles, true, row.root) : '<span class="muted">' + esc(row.why) + '</span>';+ const title = row.title ? inline(String(row.title).replace(/\\s+/g, ' '), row.titles || titles, 'in-place', row.root) : '<span class="muted">' + esc(row.why) + '</span>';const label = '<span class="id">' + esc(row.label) + '</span>' + title;- const text = row.block ? '<span class="milestone-title">' + label + '</span>' + row.block.dot : label;+ const text = row.block?.dot ? '<span class="milestone-title">' + label + '</span>' + row.block.dot : label;const inner = '<span class="dot' + (row.state ? ' ' + row.state : '') + '"></span><span class="t">' + text + '</span>' + (row.stale || '') + (row.state ? chip(row.state) : '<span class="chip">' + esc(row.word) + '</span>');- if (row.block && row.open) {- // A blocked row unfolds in place to say why (#605); its detail links over to Items.- const key = 'i:' + row.label, open = view.roadmapOpen.get(JSON.stringify([view.root, key])) === true;- const toggle = 'class="milestone-item blocked" data-roadmap-key="' + esc(key) + '" aria-expanded="' + open + '" title="' + esc(row.title) + '"';- return '<li>' + (title.includes('class="ref"') ? '<div ' + toggle + ' role="button" tabindex="0">' + inner + '</div>' : '<button ' + toggle + ' type="button">' + inner + '</button>')- + '<div class="milestone-why"' + (open ? '' : ' hidden') + '>' + row.block.detail + '</div></li>';- }- if (!row.open) return '<li><div class="milestone-item" title="' + esc(row.title ? row.title + ' (' + row.why + ')' : row.why) + '">' + inner + '</div></li>';- const attributes = 'class="milestone-item" data-go="item:' + row.open.id + '"' + (row.open.root === view.root ? '' : ' data-board="' + esc(row.open.root) + '"') + ' title="' + esc(row.title) + '"';- // A title with its own links needs a separate containing control, never a nested button.- return title.includes('class="ref"')- ? '<li><div ' + attributes + ' role="button" tabindex="0">' + inner + '</div></li>'- : '<li><button ' + attributes + ' type="button">' + inner + '</button></li>';+ const key = 'i:' + row.label, open = view.roadmapOpen.get(JSON.stringify([view.root, key])) === true;+ const board = row.open && row.open.root !== view.root ? ' data-board="' + esc(row.open.root) + '"' : '';+ const toggle = 'class="milestone-item' + (row.block?.dot ? ' blocked' : '') + '" data-roadmap-key="' + esc(key) + '" aria-expanded="' + open + '"' + board + ' title="' + esc(row.title || row.why) + '"';+ const detail = row.block ? row.block.detail : '<p>' + esc(row.why || row.word) + '</p>';+ // Every row stays on the Roadmap; only its explicit Open in Items link navigates (#605).+ return '<li><div ' + toggle + ' role="button" tabindex="0">' + inner + '</div>'+ + '<div class="milestone-why"' + (open ? '' : ' hidden') + '>' + detail + '</div></li>';}/** Read the work still to ship before verified items, excluding withdrawn work from every count. */diff --git a/src/view.css b/src/view.cssindex 3dfd0273..4e183fe6 100644--- a/src/view.css+++ b/src/view.css@@ -914,3 +914,6 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }.star-dismiss:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }.star-dismiss:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }@media (pointer: coarse) { .star-dismiss { width: 44px; height: 44px; } }++/* Roadmap title references keep their colour and tooltip while the whole row expands in place. */+.milestone-item span.ref { color: var(--accent-strong); display: inline-block; line-height: inherit; font: inherit; }diff --git a/src/view/roadmap-block.js b/src/view/roadmap-block.jsindex 73b6684e..448b1b1f 100644--- a/src/view/roadmap-block.js+++ b/src/view/roadmap-block.js@@ -6,7 +6,7 @@*//**- * Why a roadmap item cannot move on its own, or null when nothing blocks it.+ * A compact detail for every roadmap item, with an optional mark when it cannot move on its own.** The page embeds this function's source, so it reads nothing outside itself, its own escaping* included; the page passes in the item lookup, agent names and item addresses it already uses.@@ -16,14 +16,14 @@* @returns {{label: string, dot: string, detail: string}|null} The dot, its accessible label and the unfolded detail.*/export function roadmapBlock(item, context = {}) {- if (!item || item.status !== 'open') return null;+ if (!item) return null;const escape = (text) => String(text).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);const statusOf = (id) => (context.items || []).find((other) => other.id === id)?.status || 'not on this board';const waits = (item.blockedBy || []).map((id) => ({ id, status: statusOf(id) }));const hold = (context.holds || []).find((h) => h.hold_lane === item.lane) || null;- if (!waits.length && !hold) return null;+ const blocked = item.status === 'open' && Boolean(waits.length || hold);const parts = waits.map((w) => '#' + w.id + ' (' + w.status + ')');- const label = 'Blocked: ' + [parts.length ? 'waits on ' + parts.join(', ') : '', hold ? 'lane ' + item.lane + ' held' : ''].filter(Boolean).join('; ');+ const label = !blocked ? '' : 'Blocked: ' + [parts.length ? 'waits on ' + parts.join(', ') : '', hold ? 'lane ' + item.lane + ' held' : ''].filter(Boolean).join('; ');const name = context.name || ((id) => id);// Only a live claim holds an item; a sent-back item's past builder holds nothing (#605 review).const holder = item.claim?.by || null;@@ -38,7 +38,7 @@ export function roadmapBlock(item, context = {}) {].join('');return {label,- dot: '<span class="block-dot" role="img" aria-label="' + escape(label) + '" title="' + escape(label) + '"></span>',+ dot: !blocked ? '' : '<span class="block-dot" role="img" aria-label="' + escape(label) + '" title="' + escape(label) + '"></span>',detail: '<dl class="kv">' + rows + '</dl><a class="ref" href="' + escape(address(item.id)) + '" data-go="item:' + item.id + '"' + (context.board ? ' data-board="' + escape(context.board) + '"' : '') + '>Open #' + item.id + ' in Items</a>',};}diff --git a/test/cockpit/fixture.js b/test/cockpit/fixture.jsindex b4d1b957..28039b07 100644--- a/test/cockpit/fixture.js+++ b/test/cockpit/fixture.js@@ -1127,7 +1127,7 @@ async function readRoadmap(chrome) {id: row.querySelector('.id').innerText, label: chip.innerText, tone: [...chip.classList].filter((name) => name !== 'chip').join(' '),seen: box.width > 0 && box.height > 0 && getComputedStyle(chip).visibility === 'visible',chip: paint(chip), dot: getComputedStyle(row.querySelector('.dot')).backgroundColor,- button: row.tagName === 'BUTTON', tip: row.title, title: [...title.childNodes].slice(1).map((node) => node.textContent).join(''),+ button: row.matches('button,[role="button"]'), tip: row.title, title: [...title.childNodes].slice(1).map((node) => node.textContent).join(''),lines: Math.round(title.getBoundingClientRect().height / parseFloat(style.lineHeight)),cut: title.scrollWidth > title.clientWidth, ellipsis: style.textOverflow === 'ellipsis' && style.whiteSpace === 'nowrap' && style.overflow === 'hidden',};diff --git a/test/cockpit/roadmap.test.js b/test/cockpit/roadmap.test.jsindex 13e6427a..5f4844f0 100644--- a/test/cockpit/roadmap.test.js+++ b/test/cockpit/roadmap.test.js@@ -7,7 +7,15 @@ import { test } from 'node:test';import { tapTarget, SPEC, machine, project, build, sendBack, fetchLive, startView, target, accept, chromeExecutable, openSnapshotChrome, closeSnapshotChrome, press, travel, pressedInto, settled, roadmapRow, showing, readRoadmap, openRoadmapParts, tabBar, proofShot, pickProject, chooseFilter } from './fixture.js';-test('Roadmap and rule prose references stay inline and open the item on their own board [N26,N38]', { timeout: 90_000 }, async (t) => {+/** Expand a real roadmap row, then use its explicit link to leave for Items. */+async function openRoadmapItem(chrome, id) {+ const row = roadmapRow(id);+ if (await chrome.stable(row + ".getAttribute('aria-expanded')") !== 'true') await press(chrome, row);+ await chrome.waitFor(row + ".getAttribute('aria-expanded') === 'true'");+ await press(chrome, row + ".parentElement.querySelector('.milestone-why a[data-go]')");+}++test('Roadmap references stay inline and rows expand before opening Items [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.');const box = machine();@@ -33,12 +41,12 @@ test('Roadmap and rule prose references stay inline and open the item on their oconst contexts = [['roadmap', '#roadmap .milestone h2 .ref', 'Local target'],['roadmap', '#roadmap .milestone-note .ref', 'Local target'],- ['roadmap', '#roadmap .milestone-item[data-go="item:2"]:not([data-board]) .t .ref', 'Local target'],- ['roadmap', '#roadmap .milestone-item[data-board] .t .ref', 'Remote target'],+ ['roadmap', '#roadmap .milestone-item[data-roadmap-key="i:#2"]:not([data-board]) .t .ref', 'Local target', true],+ ['roadmap', '#roadmap .milestone-item[data-board] .t .ref', 'Remote target', true],['spec', '#spec-list [data-row="spec:G3"] .ref', 'Local target'],['doctrine', '#doctrine-list [data-row="doctrine:R1"] .ref', 'Local target'],];- for (const [tab, selector, target] of contexts) {+ for (const [tab, selector, target, expands] of contexts) {await pickProject(chrome, `document.querySelector('[data-root=${JSON.stringify(demo.repo)}]')`);await chrome.waitFor("data?.project?.root === view.root && !document.body.classList.contains('switching') && document.querySelector('#proj-name').textContent === 'a-inline-prose'");await chrome.click(`document.querySelector('[data-tab="${tab}"]')`);@@ -57,6 +65,20 @@ test('Roadmap and rule prose references stay inline and open the item on their oassert.ok(Math.abs(metrics.height - metrics.line) < 1, `${width}: ${selector} keeps the text line height`);assert.equal(metrics.nested, false, `${width}: ${selector} never nests buttons`);if (metrics.rowHeight !== undefined) assert.ok(metrics.rowHeight >= tapTarget(width), `${width}: the containing Roadmap control keeps its target`);+ if (expands) {+ const ref = `document.querySelector(${JSON.stringify(selector)})`;+ const row = ref + ".closest('.milestone-item')";+ if (await chrome.stable(row + ".getAttribute('aria-expanded')") === 'true') await chrome.click(ref);+ const address = await chrome.stable('location.href');+ await chrome.click(ref);+ await chrome.waitFor(row + ".getAttribute('aria-expanded') === 'true'");+ assert.equal(await chrome.stable('location.href'), address, 'inline title text expands without leaving Roadmap');+ assert.equal(await chrome.stable('view.tab'), 'roadmap');+ await chrome.click(row + ".parentElement.querySelector('.milestone-why a[data-go]')");+ await chrome.waitFor("document.querySelector('[data-tab=items].on') && document.querySelector('#detail h2 > span')?.textContent === '#2'");+ assert.equal(await chrome.stable('view.root'), target === 'Remote target' ? other.repo : demo.repo);+ continue;+ }await chrome.click(`document.querySelector(${JSON.stringify(selector)})`);await chrome.waitFor("!document.body.classList.contains('switching') && document.querySelector('[data-tab=items].on') && document.querySelector('#detail h2 > span')?.textContent === '#1'");assert.ok((await chrome.stable("document.querySelector('#detail h2').textContent")).includes(target), 'the reference opens its target title');@@ -72,7 +94,12 @@ test('Roadmap and rule prose references stay inline and open the item on their oassert.equal(await chrome.stable("document.querySelectorAll('#answering-q .ref').length"), 1, 'the answering question keeps its inline item reference');await chrome.click("document.querySelector('#answering-q .ref')");await chrome.waitFor("document.querySelector('#detail h2')?.textContent.includes('Local target') && document.querySelector('[data-tab=items].on')");- await chrome.click("document.querySelector('[data-tab=roadmap]')"); await chrome.stable("document.querySelector('#roadmap .milestone-item[role=button]:not([data-board])').dispatchEvent(new KeyboardEvent('keydown', {key:'Enter',bubbles:true}))");+ await chrome.click("document.querySelector('[data-tab=roadmap]')");+ const keyboardRow = "document.querySelector('#roadmap .milestone-item[role=button]:not([data-board])')";+ if (await chrome.stable(keyboardRow + ".getAttribute('aria-expanded')") === 'true') await chrome.click(keyboardRow);+ await chrome.stable(keyboardRow + ".dispatchEvent(new KeyboardEvent('keydown', {key:'Enter',bubbles:true}))");+ await chrome.waitFor(keyboardRow + ".getAttribute('aria-expanded') === 'true' && view.tab === 'roadmap'");+ await openRoadmapItem(chrome, '#2');await chrome.waitFor("document.querySelector('#detail h2')?.textContent.includes('Local title links to #1') && document.querySelector('[data-tab=items].on')");}} finally {@@ -175,7 +202,7 @@ test('the roadmap reads every item as the Items tab does, opens each one, anotheawait proofShot(chrome, 'roadmap', width);// An item opens on the Items tab; Back shows the Roadmap at its address again, Forward the item.- await press(chrome, roadmapRow('#3'));+ await openRoadmapItem(chrome, '#3');await pressedInto(chrome, `${showing('items', '/roadmap-demo/items/3')} && document.querySelector('#detail h2')?.innerText.includes('Session timeout banner')`);assert.equal(await chrome.stable('location.search'), view.link.search, `${width}: the address keeps the rest of itself`);await travel(chrome, -1);@@ -187,7 +214,7 @@ test('the roadmap reads every item as the Items tab does, opens each one, anothe}// Another repo's item opens on its own board, and Back and Forward move between the two boards.- await press(chrome, roadmapRow('beacon#1'));+ await openRoadmapItem(chrome, 'beacon#1');await chrome.waitFor(`document.querySelector('#proj-name').textContent === 'beacon' && ${showing('items', '/beacon/items/1')} && document.querySelector('#detail h2')?.innerText.includes('Billing webhook retries')`);const there = JSON.parse(await chrome.stable(`JSON.stringify((() => { const chip = document.querySelector('#detail .meta .chip'); return {id: document.querySelector('#detail h2 span').innerText, label: chip.innerText, chip: getComputedStyle(chip).color + ' on ' + getComputedStyle(chip).backgroundColor,@@ -204,7 +231,7 @@ test('the roadmap reads every item as the Items tab does, opens each one, anothe// Each of this board's rows opens its item on the Items tab, which gives it the same word and// colours, its list dot included; a withdrawn item is left out of the list while browsing.for (const row of seen.cards.flatMap((card) => card.rows).filter((each) => each.id.startsWith('#'))) {- await press(chrome, roadmapRow(row.id));+ await openRoadmapItem(chrome, row.id);await chrome.waitFor(`${showing('items', '/roadmap-demo/items/' + row.id.slice(1))} && document.querySelector('#detail h2 span')?.innerText === ${JSON.stringify(row.id)}`);const here = JSON.parse(await chrome.stable(`JSON.stringify((() => {const chip = document.querySelector('#detail .meta .chip'), dot = document.querySelector('#chain [data-item="${row.id.slice(1)}"] .dot');@@ -418,7 +445,8 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { tawait click('#roadmap .shipped-one[data-key="m:0.2"] > .milestone-head');r = await read();assert.deepEqual(r.parts.find((part) => part.key === 'shipped').shipped.find((one) => one.key === 'm:0.2').rows, ['#2'], 'a shipped release opens to its verified items');- await click('#roadmap .shipped-one[data-key="m:0.2"] .milestone-item[data-go="item:2"]');+ await click('#roadmap .shipped-one[data-key="m:0.2"] .milestone-item');+ await click('#roadmap .shipped-one[data-key="m:0.2"] .milestone-why a[data-go="item:2"]');await chrome.waitFor("view.tab === 'items' && document.querySelector('#detail h2')?.textContent.includes('Second page')");// The parts stay as the person left them when the board redraws: close the next release, then change the board.