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): show dense cached roadmap details [N26]
Corey Olson0f6c1b54e7c7
diff --git a/src/cockpit.js b/src/cockpit.jsindex b22580f3..c3516c23 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -1408,9 +1408,8 @@ function boardSummary(board, state) {decisions: calls('decision'),// What each item's state reads from, so another repo's roadmap can show it as this board's// Items tab does, sent back included, and open it here.- items: state.items.map((item) => ({ id: item.id, title: item.title, status: item.status, stage: item.stage ?? pipelineStage(item),- lane: item.lane, blockedBy: item.blockedBy, claim: item.claim,- verdict: item.verdict && { decision: item.verdict.decision, note: item.verdict.note } })),+ items: state.items.map((item) => listFields(item)),+ agents: state.agents, events: state.events, milestones: state.milestones,};}@@ -1591,9 +1590,9 @@ function movedSince(project, id, cursor) {}/** Load one opened item's omitted fields, retaining them only while its summary and event cursor stay current. */-function detailOf(project, item, ask) {+function detailOf(project, item, ask, root = view.root) {if (Array.isArray(item.history)) return { item };- const root = view.root, key = root + '\\n' + item.id, summary = JSON.stringify(item);+ const drawnRoot = view.root, key = root + '\\n' + item.id, summary = JSON.stringify(item);const kept = itemDetails.get(key);/** Keep the prior detail visible during a refresh, or return the short initial loading state. */const waiting = (entry) => (entry?.shown ? { item: { ...item, ...entry.shown } } : { loading: true });@@ -1607,7 +1606,7 @@ function detailOf(project, item, ask) {detailRead = api(boardPath(root) + '/items/' + encodeURIComponent(String(item.id))).then((reply) => { entry.detail = reply.item; },(error) => { entry.error = String(error.message || error); }).finally(() => {entry.loading = false;- if (view.root === root && view.item === item.id) render();+ if (view.root === drawnRoot && ((root === view.root && view.item === item.id) || view.tab === 'roadmap')) render();});return waiting(entry);}@@ -2247,6 +2246,10 @@ function milestoneItem(entry, p) {const root = local ? view.root : named.length === 1 && named[0].ok ? named[0].root : null;const id = local ? entry.id : ref ? Number(ref[2]) : null;const item = (root === view.root ? p.items : root ? named[0].items : []).find((i) => i.id === id) || null;+ const source = root === view.root ? p : root ? named[0] : null;+ const label = local ? '#' + entry.id : String(entry.id);+ const expanded = view.tab === 'roadmap' && view.roadmapOpen.get(JSON.stringify([view.root, 'i:' + label])) === true;+ const detail = item && expanded ? detailOf(source, item, true, root) : null;// A status the lifecycle declares; the roadmap says unavailable or missing for an item it could not read.const read = item || (FLOW.states.some((state) => state.id === entry.status) ? { status: entry.status, verdict: null } : null);return {@@ -2256,7 +2259,12 @@ function milestoneItem(entry, p) {titles: new Map((root === view.root ? p.items : root ? named[0].items : []).map((i) => [String(i.id), i.title])),state: read ? stateOf(read) : null,stale: item ? staleChip(item) : '',- block: item ? roadmapBlock(item, { holds: root === view.root ? p.holds : named[0].laneHolds, items: root === view.root ? p.items : named[0].items, name: (id) => agentName(id), address: (id) => itemAddress(id, root), board: root === view.root ? null : root }) : null,+ block: item ? roadmapBlock(detail?.item || item, {+ holds: source.holds || source.laneHolds, items: source.items, name: (id) => agentName(id, source), time: when, state: stateOf,+ address: (id) => itemAddress(id, root), board: root === view.root ? null : root,+ releases: (p.milestones || []).filter((milestone) => milestone.items.some((ref) => ref.id === entry.id)).map((milestone) => milestone.name),+ loading: detail?.loading, error: detail?.error,+ }) : null,stage: item ? pipelineStage(item) : entry.status,word: entry.status,open: item ? { root, id } : null,@@ -2311,8 +2319,9 @@ function milestoneRow(row, titles) {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?.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>');const key = 'i:' + row.label, open = view.roadmapOpen.get(JSON.stringify([view.root, key])) === true;+ const status = (open && row.block?.dot ? '<span class="chip warn roadmap-blocked"><svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="5" y="10" width="14" height="11" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg>blocked</span>' : '') + (row.state ? chip(row.state) : '<span class="chip">' + esc(row.word) + '</span>');+ const inner = '<span class="dot' + (row.state ? ' ' + row.state : '') + '"></span><span class="t">' + text + '</span>' + (row.stale || '') + '<span class="roadmap-status">' + status + '</span>';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.title + (!row.open && row.why ? ' (' + row.why + ')' : '') : row.why) + '"';const detail = row.block ? row.block.detail : '<p>' + esc(row.why || row.word) + '</p>';diff --git a/src/view.css b/src/view.cssindex 4e183fe6..8b72a88f 100644--- a/src/view.css+++ b/src/view.css@@ -917,3 +917,26 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }/* 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; }++/* The approved dense Roadmap detail uses the view's own light/dark tokens [N26]. */+.milestone-item[role="button"] { cursor: pointer; }+.milestone-item[role="button"]:hover { background: var(--surface-2); }+.roadmap-status { display: inline-flex; align-items: center; gap: 6px; }+.roadmap-blocked svg, .roadmap-items svg { width: 12px; height: 12px; flex: none; }+.roadmap-detail { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 5px 12px; margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; }+.roadmap-detail dt { display: flex; align-self: start; align-items: flex-start; gap: 6px; color: var(--ink-muted); white-space: nowrap; }+.roadmap-detail dt svg { flex: none; width: 14px; height: 14px; margin-top: 3px; color: var(--ink-faint); }+.roadmap-detail dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }+.roadmap-detail b { font-weight: 600; }+.roadmap-detail .roadmap-criterion { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.roadmap-ref { display: inline; padding: 1px 5px; border-radius: 4px; font-size: 11px; white-space: nowrap; }+.roadmap-return { padding: 5px 7px; border-radius: 5px; background: var(--reject-soft); color: var(--reject); }+.roadmap-event { display: inline; white-space: nowrap; }+.roadmap-step { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--ink-faint); }+.roadmap-step.busy { background: var(--blue); }+.roadmap-step.warn { background: var(--warn); }+.roadmap-step.ok { background: var(--accent); }+.roadmap-step.no { background: var(--reject); }+.roadmap-step.free { background: var(--violet); }+.roadmap-arrow { color: var(--ink-faint); }+.roadmap-items { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12.5px; }diff --git a/src/view/roadmap-block.js b/src/view/roadmap-block.jsindex 448b1b1f..a87b7f67 100644--- a/src/view/roadmap-block.js+++ b/src/view/roadmap-block.js@@ -1,44 +1,60 @@-/**- * The Roadmap's blocked mark (N26, #605). An item that cannot move on its own, because it waits on an- * item that is not verified or its lane is held, gets a small red dot, and its row unfolds in place to- * say why. Everything here comes from the board summaries the page already holds, so the unfolded row- * needs no detail request.- */--/**- * 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.- *- * @param {{id: number, status: string, lane?: string, blockedBy?: number[], claim?: {by?: string|null}|null, builtBy?: string|null, verdict?: {decision?: string, note?: string}|null}|null} item- * @param {{holds?: {hold_lane: string, hold_reason?: string}[], items?: {id: number, title?: string, status: string}[], name?: (id: string) => string, address?: (id: number) => string, board?: string|null}} context- * @returns {{label: string, dot: string, detail: string}|null} The dot, its accessible label and the unfolded detail.- */+/** Compact Roadmap detail, using the same item read and local display words as Items [N26]. */export function roadmapBlock(item, context = {}) {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;+ const escape = text => String(text ?? '').replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''})[c]);+ const items = context.items || [], name = context.name || (id => id), time = context.time || (at => at);+ const waits = (item.blockedBy || []).map(id => items.find(other => other.id === id) || {id,status:'unavailable'});+ const hold = (context.holds || []).find(h => h.hold_lane === item.lane);const blocked = item.status === 'open' && Boolean(waits.length || hold);- const parts = waits.map((w) => '#' + w.id + ' (' + w.status + ')');- 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;- // A send-back note's first line, the way the Items list shows it.- const sentBack = item.verdict && item.verdict.decision === 'REJECT' && item.verdict.note ? String(item.verdict.note).split('\n')[0].trim() : '';- const address = context.address || ((id) => '#items/' + id);- const rows = [- '<dt>state</dt><dd>' + escape(item.status) + (holder ? ', held by ' + escape(name(holder)) : ', nobody holds it') + '</dd>',- waits.length ? '<dt>waits on</dt><dd>' + waits.map((w) => '#' + w.id + ' <span class="block-state">' + escape(w.status) + '</span>').join(', ') + '</dd>' : '',- hold ? '<dt>lane held</dt><dd>' + escape(item.lane) + (hold.hold_reason ? ': ' + escape(hold.hold_reason) : '') + '</dd>' : '',- sentBack ? '<dt>sent back</dt><dd>' + escape(sentBack) + '</dd>' : '',- ].join('');- return {- label,- 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>',+ const label = blocked ? 'Blocked: ' + [waits.length ? 'waits on ' + waits.map(w => '#' + w.id + ' (' + w.status + ')').join(', ') : '',hold ? 'lane ' + item.lane + ' held' : ''].filter(Boolean).join('; ') : '';+ const paths = {+ Criterion:'<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="4"/><path d="M12 9v6m-3-3h6"/>',+ Agents:'<circle cx="9" cy="7" r="3"/><path d="M3 21v-3a6 6 0 0 1 12 0v3m1-17a3 3 0 0 1 0 6m2 4a5 5 0 0 1 3 4v3"/>',+ 'Waits on':'<path d="M6 3h12M6 21h12M7 3v4l10 10v4M17 3v4L7 17v4"/>',+ Blocks:'<path d="M5 4v8a5 5 0 0 0 5 5h9m-5-5 5 5-5 5"/>',+ 'Sent back':'<path d="m9 4-5 5 5 5M4 9h10a6 6 0 0 1 0 12h-3"/>',+ History:'<path d="M4 6h16M4 12h16M4 18h16"/><circle cx="8" cy="6" r="2"/><circle cx="16" cy="12" r="2"/><circle cx="10" cy="18" r="2"/>',+ Release:'<path d="M3 3h8l10 10-8 8L3 11z"/><circle cx="7" cy="7" r="1"/>',};+ const icon = field => '<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">' + paths[field] + '</svg>';+ const state = other => context.state ? context.state(other) : other.status === 'claimed' ? 'building' : other.status === 'submitted' ? 'verify' : other.status === 'verified' ? 'verified' : other.verdict?.decision === 'REJECT' ? 'back' : 'open';+ const words = {building:['building','busy'],verify:['to verify','warn'],verified:[null,'ok'],back:['sent back','no'],open:['unclaimed','free'],withdrawn:['withdrawn','']};+ const ref = other => {const [word,color] = words[state(other)] || [other.status,''];return '<span class="chip roadmap-ref '+color+'">#'+escape(other.id)+' '+escape(word || (other.merged || other.stage === 'merged' ? 'landed' : 'verified'))+'</span>';};+ const field = (key,value,extra='') => value ? '<dt>'+icon(key)+escape(key)+'</dt><dd'+(extra?' class="'+extra+'"':'')+'>'+value+'</dd>' : '';+ const first = text => String(text || '').split('\n').find(line => line.trim())?.trim() || '';+ const criterion = first(item.criterion).match(/^.*?[.!?](?:\s|$)|^.*$/u)?.[0]?.trim() || '';+ const agents = [];+ const builder = item.status === 'claimed' ? item.claim?.by || item.owner : item.builtBy;+ const reviewer = item.status === 'submitted' ? item.claim?.by || item.reviewer : item.verifiedBy;+ if (builder) agents.push('<b>'+escape(name(builder))+'</b> '+(item.status === 'claimed'?'building':'built'));+ if (reviewer) agents.push('<b>'+escape(name(reviewer))+'</b> '+(item.status === 'submitted'?'verifying':'verified'));+ const waiting = waits.map(other => {+ const holder = ['claimed','submitted'].includes(other.status) ? other.claim?.by || (other.status==='claimed'?other.owner:other.reviewer) : null;+ return ref(other)+(holder?' <b>'+escape(name(holder))+'</b>':'')+(other.since?' <span class="muted">since '+escape(time(other.since))+'</span>':'');+ });+ if (hold) waiting.push('<span class="chip warn">lane held</span> '+escape(item.lane)+(hold.hold_reason?': '+escape(hold.hold_reason):''));+ const downstream = items.filter(other => other.status === 'open' && (other.blockedBy || []).includes(item.id));+ const reject = (item.verdicts || []).findLast(v => v.decision === 'REJECT') || (item.verdict?.decision === 'REJECT' ? item.verdict : null);+ const reasons = {TEST_FAILURE:'A test failed',BEHAVIOR_MISMATCH:'Behavior differs from the criterion',INSUFFICIENT_EVIDENCE:'More evidence is needed',STALE_HEAD:'The submitted commit is out of date',OTHER:'Sent back'};+ let returned = '';+ if (reject) {+ const note = first(reject.note).replace(new RegExp('^'+String(reject.reason || '')+'(?::|\\s*[-–—])?\\s*','u'),'');+ returned = (reject.at?escape(time(reject.at))+' ':'')+(reject.by?'by <b>'+escape(name(reject.by))+'</b>: ':'')+escape(note || reasons[reject.reason] || 'Sent back');+ }+ let claims = 0;+ const moves = {add:['added','free'],claim:['claimed','busy'],submit:['submitted','warn'],accept:['accepted','ok'],reject:['sent back','no'],merged:['landed','ok']};+ const history = (item.history || []).filter(event => moves[event.kind]).map(event => {+ let [word,color] = moves[event.kind];if(event.kind==='claim' && ++claims>1)word='claimed again';+ return '<span class="roadmap-event"><span class="roadmap-step '+color+'" aria-hidden="true"></span>'+escape(word)+' <time datetime="'+escape(event.at)+'">'+escape(time(event.at))+'</time></span>';+ }).join('<span class="roadmap-arrow" aria-hidden="true"> → </span>');+ const releases = (context.releases || []).map(release => '<b>'+escape(release)+'</b>').join(', ');+ const specs = (item.specs || []).map(escape).join(', ');+ const rows = field('Criterion','<b>'+escape(criterion)+'</b>','roadmap-criterion')+field('Agents',agents.join(' · '))+ +field('Waits on',waiting.join('<br>'))+field('Blocks',downstream.map(ref).join(' '))+ +field('Sent back',returned,'roadmap-return')+field('History',history,'roadmap-history')+ +field('Release',[releases,specs?'spec '+specs:''].filter(Boolean).join(' · '));+ const address = context.address || (id => '#items/'+id);+ return {label,dot:blocked?'<span class="block-dot" role="img" aria-label="'+escape(label)+'" title="'+escape(label)+'"></span>':'',+ detail:context.loading?'<span class="roadmap-loading muted">Loading detail…</span>':context.error?'<p class="muted">'+escape(context.error)+'</p>':+ '<dl class="roadmap-detail">'+rows+'</dl><a class="ref roadmap-items" href="'+escape(address(item.id))+'" data-go="item:'+item.id+'"'+(context.board?' data-board="'+escape(context.board)+'"':'')+'>Open #'+item.id+' in Items <svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M14 3h7v7m0-7L10 14M10 3H3v18h18v-7"/></svg></a>'};}