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): the roadmap has a panel of releases and shipping [N26]
Corey Olsone1818105b824
diff --git a/src/cockpit.js b/src/cockpit.jsindex f1afc9af..2a901815 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -147,7 +147,7 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ<button class="ghost flow-show" id="flow-show" type="button" hidden>Show the lifecycle</button><div class="card-panel feed" id="activity"></div></section>- <section data-pane="roadmap" class="roadmap" id="roadmap" aria-label="Roadmap"></section>+ <section data-pane="roadmap" class="roadmap-layout" id="roadmap" aria-label="Roadmap"></section></main></div></div>@@ -771,7 +771,7 @@ function boardSummary(board, state) {decisions: state.decisions.length,// 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, verdict: item.verdict && { decision: item.verdict.decision } })),+ items: state.items.map((item) => ({ id: item.id, title: item.title, status: item.status, merged: Boolean(item.merged), verdict: item.verdict && { decision: item.verdict.decision } })),};}@@ -1243,6 +1243,7 @@ function milestoneItem(entry, p) {root,titles: new Map((root === view.root ? p.items : root ? named[0].items : []).map((i) => [String(i.id), i.title])),state: read ? stateOf(read) : null,+ stage: item ? pipelineStage(item) : entry.status,word: entry.status,open: item ? { root, id } : null,// Why an item does not open, short enough to read beside its id on a phone.@@ -1251,6 +1252,42 @@ function milestoneItem(entry, p) {};}+/** Mark the release nearest the top of the Roadmap in its companion panel. */+function updateRoadmapPanel() {+ const panel = $('roadmap-panel');+ if (!panel || view.tab !== 'roadmap') return;+ const entries = [...panel.querySelectorAll('[data-roadmap-jump]')].map((button) => ({+ key: button.dataset.roadmapJump,+ target: $('roadmap-list').querySelector('[data-key="' + CSS.escape(button.dataset.roadmapJump) + '"]'),+ })).filter((entry) => entry.target);+ if (!entries.length) return;+ const threshold = (document.querySelector('.top')?.getBoundingClientRect().bottom ?? 0) + 8;+ const active = entries.find((entry) => entry.target.getBoundingClientRect().bottom > threshold)?.key || entries.at(-1).key;+ for (const entry of entries) {+ const button = panel.querySelector('[data-roadmap-jump="' + CSS.escape(entry.key) + '"]');+ if (button) {+ if (entry.key === active) button.setAttribute('aria-current', 'location');+ else button.removeAttribute('aria-current');+ }+ }+}++/** Open a selected release in the list and briefly mark it after the jump. */+function jumpToRoadmap(key) {+ if (key === 'shipped') {+ view.roadmapOpen.set(JSON.stringify([view.root, 'shipped']), true);+ render();+ }+ const target = $('roadmap-list')?.querySelector('[data-key="' + CSS.escape(key) + '"]');+ if (!target) return;+ target.scrollIntoView({ block: 'start', behavior: matchMedia('(prefers-reduced-motion: reduce)').matches ? 'instant' : 'smooth' });+ target.classList.remove('roadmap-arrival');+ void target.offsetWidth;+ target.classList.add('roadmap-arrival');+ setTimeout(() => target.classList.remove('roadmap-arrival'), 1300);+ updateRoadmapPanel();+}+/*** 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@@ -1295,12 +1332,18 @@ function roadmapCards(p, titles) {const only = view.roadmapOnly && (p.milestones || []).some((m) => m.name === view.roadmapOnly) ? view.roadmapOnly : null;const milestones = (p.milestones || []).filter((m) => !only || m.name === only);const lead = only ? '<div class="roadmap-only"><span>' + esc(only) + '</span><button class="link" data-roadmap-all type="button">show all</button></div>' : '';- if (!milestones.length) return '<div class="card-panel empty">No milestones yet. The coordinator adds one with <code class="inline">pullboard milestone add</code>.</div>';const read = milestones.map((milestone) => readMilestone(milestone, p));const coming = read.filter((m) => !m.shipped && m.rows.length).concat(read.filter((m) => !m.rows.length)), shipped = read.filter((m) => m.shipped).reverse();/** Preserve each board's disclosure choices independently. */const isOpen = (key, first) => view.roadmapOpen.has(JSON.stringify([view.root, key])) ? view.roadmapOpen.get(JSON.stringify([view.root, key])) : first;const caret = '<span class="caret" aria-hidden="true"></span>';+ const next = coming.find((m) => m.rows.length) || null;+ const stages = [['open', 'Open'], ['claimed', 'Building'], ['submitted', 'In review'], ['accepted', 'Accepted'], ['merged', 'Verified']];+ const counts = Object.fromEntries(stages.map(([stage]) => [stage, next ? next.rows.filter((row) => row.stage === stage).length : 0]));+ const shippingCounts = '<dl class="roadmap-stage-counts">' + stages.map(([stage, label]) => '<div data-shipping-stage="' + stage + '"><dt>' + label + '</dt><dd>' + counts[stage] + '</dd></div>').join('') + '</dl>';+ const lastShipped = '<p class="roadmap-last-shipped"><span>Last shipped</span><b>' + esc(shipped[0]?.milestone.name || 'None yet') + '</b>'+ + (shipped[0]?.milestone.note ? '<small>' + esc(firstLine(shipped[0].milestone.note)) + '</small>' : '') + '</p>';+ const mobileShipping = '<section class="roadmap-shipping roadmap-mobile-shipping" aria-label="Shipping counts">' + shippingCounts + lastShipped + '</section>';/** Keep the existing verified-item count beside an upcoming release. */const count = (m) => m.rows.length ? '<span class="milestone-count">' + m.done + '/' + m.rows.length + ' done</span>' : '';/** Render the existing milestone items, progress and complete note when opened. */@@ -1309,16 +1352,28 @@ function roadmapCards(p, titles) {: '<p class="milestone-empty">No items yet.</p>')+ (milestone.note ? '<p class="milestone-note">' + rich(milestone.note, titles) + '</p>' : '');/** Keep folding consistent with the View's other keyboard-accessible disclosure controls. */- const wrap = (tag, classes, key, first, heading, contents) => {+ const wrap = (tag, classes, key, first, heading, contents, afterHead = '') => {const open = isOpen(key, first);- return '<' + tag + ' class="' + classes + '" data-key="' + esc(key) + '"><div class="milestone-head" data-roadmap-key="' + esc(key) + '" role="button" tabindex="0" aria-expanded="' + open + '">' + caret + heading + '</div><div class="milestone-body"' + (open ? '' : ' hidden') + '>' + contents + '</div></' + tag + '>';+ return '<' + tag + ' class="' + classes + '" data-key="' + esc(key) + '"><div class="milestone-head" data-roadmap-key="' + esc(key) + '" role="button" tabindex="0" aria-expanded="' + open + '">' + caret + heading + '</div>' + afterHead + '<div class="milestone-body"' + (open ? '' : ' hidden') + '>' + contents + '</div></' + tag + '>';};/** Open every upcoming milestone by default; the person's current-page fold remains in the view map. */- const card = (m) => wrap('section', 'card-panel milestone', 'm:' + m.milestone.name, true, '<h2>' + linked(m.milestone.name, titles) + '</h2>' + count(m), body(m));+ const card = (m) => wrap('section', 'card-panel milestone', 'm:' + m.milestone.name, true, '<h2>' + linked(m.milestone.name, titles) + '</h2>' + count(m), body(m), m === next ? mobileShipping : '');/** Summarize one shipped milestone with its first note line and total count. */const line = (m) => wrap('div', 'milestone shipped-one', 'm:' + m.milestone.name, false, '<h2>' + esc(m.milestone.name) + '</h2><small>' + esc(firstLine(m.milestone.note)) + '</small><span class="milestone-count">' + m.rows.length + (m.rows.length === 1 ? ' item' : ' items') + '</span>', body(m));- return lead + coming.map(card).join('')- + (shipped.length ? wrap('section', 'card-panel shipped', 'shipped', false, '<h2>Shipped</h2><span class="milestone-count">' + shipped.length + (shipped.length === 1 ? ' release' : ' releases') + '</span>', shipped.map(line).join('')) : '');+ const releaseButtons = coming.map((m) => {+ const key = 'm:' + m.milestone.name;+ return '<button class="roadmap-release" data-roadmap-jump="' + esc(key) + '" type="button"><span>' + esc(m.milestone.name) + '</span><b>' + m.done + '/' + m.rows.length + '</b></button>';+ }).join('');+ const shippedButton = shipped.length+ ? '<button class="roadmap-release" data-roadmap-jump="shipped" type="button"><span>Shipped</span><b>' + shipped.length + '</b></button>' : '';+ const releasePanel = '<aside class="card-panel roadmap-panel" id="roadmap-panel" aria-label="Roadmap releases and shipping">'+ + '<section class="roadmap-release-index"><h2>Releases</h2><nav class="roadmap-releases" id="roadmap-releases" aria-label="Roadmap releases">' + releaseButtons + shippedButton + '</nav></section>'+ + '<section class="roadmap-shipping roadmap-desktop-shipping" aria-label="Shipping counts"><h2>Shipping</h2><h3 class="roadmap-next-release">' + esc(next?.milestone.name || 'No upcoming release') + '</h3>'+ + shippingCounts + lastShipped + '</section></aside>';+ const roadmapList = '<div class="roadmap-list" id="roadmap-list">' + lead + (milestones.length ? coming.map(card).join('') : '<div class="card-panel empty">No milestones yet. The coordinator adds one with <code class="inline">pullboard milestone add</code>.</div>')+ + (shipped.length ? wrap('section', 'card-panel shipped', 'shipped', false, '<h2>Shipped</h2><span class="milestone-count">' + shipped.length + (shipped.length === 1 ? ' release' : ' releases') + '</span>', shipped.map(line).join('')) : '') + '</div>';+ // With no releases there is nothing to jump to, so the Roadmap is its list alone, as before the panel.+ return (milestones.length ? releasePanel : '') + roadmapList;}/** Tags that flow inside a line of text, so a reference's line belongs to the nearest block around it. */@@ -1388,7 +1443,12 @@ function render() {const items = p.items.filter((i) => i.status !== 'withdrawn');const active = items.filter((i) => stateOf(i) !== 'verified');const titles = new Map(p.items.map((i) => [String(i.id), i.title]));+ // Every refresh redraws the Roadmap. Left alone, that would send the phone's release chips back to their start+ // and the panel back to its top under a person mid-scroll, so both keep where they were.+ const chipsAt = $('roadmap-releases')?.scrollLeft ?? 0, panelAt = $('roadmap-panel')?.scrollTop ?? 0;$('roadmap').innerHTML = roadmapCards(p, titles);+ if ($('roadmap-releases')) $('roadmap-releases').scrollLeft = chipsAt;+ if ($('roadmap-panel')) $('roadmap-panel').scrollTop = panelAt;// What needs the person, first, and only the person's calls (B26): the decisions passed up to them,// questions in the spec, held lanes, then draft rows. Work waiting for a verdict or sent back shows@@ -1691,6 +1751,7 @@ function render() {};$('activity').innerHTML = p.events.length ? byDay(p.events, (e) => e.event_at, (e) => '<div><time>' + clock(e.event_at) + '</time><div class="act">' + (e.event_kind === 'shout' || e.event_kind === 'answer' ? spoke(e) : '<b>' + esc(agentName(e.event_by)) + '</b> ' + esc(e.event_kind) + (e.item_id ? ' <button class="ref" data-go="item:' + e.item_id + '" type="button">#' + e.item_id + '</button>' + (titles.has(String(e.item_id)) ? ' <span class="what">' + rich(titles.get(String(e.item_id)), titles) + '</span>' : '') : '')) + '</div></div>') : '<div class="empty">No activity yet.</div>';showTab();+ updateRoadmapPanel();}/**@@ -2242,7 +2303,7 @@ $('shouts-pane').addEventListener('click', (event) => {// Enter shouts; Shift+Enter starts a new line.$('shout-text').addEventListener('keydown', (event) => { if (event.key === 'Enter' && !event.shiftKey && !event.isComposing) { event.preventDefault(); $('shout-form').requestSubmit(); } });document.addEventListener('click', (event) => {- const t = event.target.closest('[data-status],[data-roadmap-key],[data-roadmap-all],[data-root],[data-tab],[data-go],[data-item],[data-items-view],[data-state],[data-rows],[data-row],[data-row-decision],[data-section-approve],[data-release],[data-shout],[data-new],[data-code],[data-code-all],[data-code-less],[data-stats-toggle],#proj-switch,#console');+ const t = event.target.closest('[data-status],[data-roadmap-jump],[data-roadmap-key],[data-roadmap-all],[data-root],[data-tab],[data-go],[data-item],[data-items-view],[data-state],[data-rows],[data-row],[data-row-decision],[data-section-approve],[data-release],[data-shout],[data-new],[data-code],[data-code-all],[data-code-less],[data-stats-toggle],#proj-switch,#console');if (!event.target.closest('.side')) fold(false);if (!t) return;if (t.id === 'proj-switch') { fold(!$('side').classList.contains('open')); return; }@@ -2254,6 +2315,7 @@ document.addEventListener('click', (event) => {return;}if (t.dataset.status) { statusGo(t.dataset.status); return; }+ if (t.dataset.roadmapJump) { jumpToRoadmap(t.dataset.roadmapJump); return; }if (t.dataset.itemsView) { view.itemsView = t.dataset.itemsView; address(); render(); return; }if ('roadmapKey' in t.dataset) {const key = t.dataset.roadmapKey;@@ -2294,6 +2356,7 @@ document.addEventListener('click', (event) => {else if (t.dataset.shout) { answer(null); addressTo(t.dataset.shout); $('shout-text').value = '#' + t.dataset.about + ': '; openTab('shouts'); showTab(); $('shout-text').focus(); }else if (t.dataset.new !== undefined) { view.adding = true; render(); $('add-title').focus(); }});+window.addEventListener('scroll', updateRoadmapPanel, { passive: true });/** Close the expanded stats card and return focus to the list's summary control on Escape. */document.addEventListener('keydown', (event) => {if (event.key !== 'Escape' || !view.statsOpen || view.tab !== 'items' || document.querySelector('[data-pane="items"]')?.hidden) return;diff --git a/src/view.css b/src/view.cssindex 1fcfd681..11c566f7 100644--- a/src/view.css+++ b/src/view.css@@ -136,12 +136,37 @@ main { padding: 16px 18px 56px; }.loading .top, .loading [data-pane], .boardless .top, .boardless [data-pane] { display: none; }.two { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 42%, 600px); gap: 16px; align-items: start; }.two.narrow { grid-template-columns: minmax(0, 1fr) var(--agents-w); }-.roadmap { display: grid; gap: 12px; max-width: 900px; align-content: start; }+.roadmap-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 30%, 360px); gap: 16px; align-items: start; }+.roadmap-layout:not(:has(.roadmap-panel)) { grid-template-columns: minmax(0, 1fr); }+.roadmap-layout:not(:has(.roadmap-panel)) .roadmap-list { grid-row: 1; }+.roadmap-list { grid-column: 1; grid-row: 1; display: grid; gap: 12px; max-width: 900px; min-width: 0; align-content: start; }+.roadmap-panel { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 32px); min-width: 0; overflow-y: auto; padding: 16px; display: grid; gap: 18px; align-content: start; }+.roadmap-panel h2 { margin: 0 0 8px; font-size: 15px; }+.roadmap-mobile-shipping { display: none; }+.roadmap-release-index { min-width: 0; }+.roadmap-releases { display: grid; gap: 4px; min-width: 0; }+.roadmap-release { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; min-height: var(--tap); padding: 5px 8px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink); text-align: left; cursor: pointer; }+.roadmap-release:hover, .roadmap-release[aria-current="location"] { background: var(--surface-2); }+.roadmap-release[aria-current="location"] { border-color: var(--line); font-weight: 600; }+.roadmap-release > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.roadmap-release > b { flex: none; color: var(--ink-muted); font: 11px var(--mono); }+.roadmap-next-release { margin: -2px 0 10px; font-size: 13px; overflow-wrap: anywhere; }+.roadmap-stage-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }+.roadmap-stage-counts > div { display: flex; justify-content: space-between; gap: 6px; padding: 7px 8px; border-radius: 8px; background: var(--surface-2); }+.roadmap-stage-counts dt { color: var(--ink-muted); font-size: 12px; }+.roadmap-stage-counts dd { margin: 0; font: 12px var(--mono); }+.roadmap-last-shipped { display: grid; gap: 3px; margin: 12px 0 0; font-size: 12px; }+.roadmap-last-shipped > span { color: var(--ink-faint); }+.roadmap-last-shipped > b { font-size: 13px; }+.roadmap-last-shipped > small { color: var(--ink-muted); }+.roadmap-list > [data-key] { scroll-margin-top: calc(var(--top) + 16px); }+.roadmap-arrival { animation: roadmap-arrival 1.3s ease-out; }+@keyframes roadmap-arrival { from { box-shadow: 0 0 0 2px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }.milestone { padding: 14px 16px 12px; }.milestone-head { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; border-radius: 8px; }.milestone-head .milestone-count { margin-left: auto; }/* A small triangle that turns down when its part is open. */-.roadmap .caret { flex: none; width: 7px; height: 9px; background: var(--ink-faint); clip-path: polygon(0 0, 100% 50%, 0 100%); transition: transform .15s; }+.roadmap-layout .caret { flex: none; width: 7px; height: 9px; background: var(--ink-faint); clip-path: polygon(0 0, 100% 50%, 0 100%); transition: transform .15s; }.milestone-head[aria-expanded="true"] > .caret { transform: rotate(90deg); }.shipped { padding: 4px 16px; }.shipped > .milestone-head h2 { margin: 0; font-size: 15px; color: var(--ink-muted); }@@ -178,6 +203,14 @@ main { padding: 16px 18px 56px; }.live { display: none; }main { padding: 12px 10px 24px; }.two, .two.narrow { grid-template-columns: minmax(0, 1fr); }+ .roadmap-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }+ .roadmap-panel { grid-column: 1; grid-row: 1; position: static; max-height: none; overflow: visible; padding: 12px; }+ .roadmap-list { grid-column: 1; grid-row: 2; max-width: none; }+ .roadmap-releases { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; gap: 5px; padding-bottom: 3px; }+ .roadmap-release { flex: 0 0 auto; width: auto; max-width: 220px; border-color: var(--line); }+ .roadmap-desktop-shipping { display: none; }+ .roadmap-list .roadmap-mobile-shipping { display: grid; gap: 10px; padding: 0 14px 12px; }+ .roadmap-stage-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }.group-need { grid-template-columns: minmax(80px, auto) auto minmax(0, 1fr); }.group-need > button { grid-column: 3; }}diff --git a/test/cockpit/roadmap.test.js b/test/cockpit/roadmap.test.jsindex 7094d68c..52c1252b 100644--- a/test/cockpit/roadmap.test.js+++ b/test/cockpit/roadmap.test.js@@ -285,7 +285,7 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { treturn {statusRelease: document.querySelector('[data-status=release]')?.textContent.replace(/\\s+/g, ' ').trim() ?? null,page: { width: document.documentElement.clientWidth, scroll: document.documentElement.scrollWidth, body: document.body.scrollWidth },- parts: [...document.querySelectorAll('#roadmap > [data-key]')].map((d) => ({ key: d.dataset.key, open: open(d), summary: words(head(d)), height: box(head(d)).height,+ parts: [...document.querySelectorAll('#roadmap-list > [data-key]')].map((d) => ({ key: d.dataset.key, open: open(d), summary: words(head(d)), height: box(head(d)).height,rows: rows(d), empty: body(d).querySelector('.milestone-empty')?.textContent ?? null, note: body(d).querySelector('.milestone-note')?.textContent ?? null,shipped: [...body(d).querySelectorAll(':scope > .shipped-one[data-key]')].map((one) => ({ key: one.dataset.key, open: open(one), summary: words(head(one)), height: box(head(one)).height,rows: rows(one) })) })),@@ -297,7 +297,7 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { tchrome = await openSnapshotChrome(executable, view.link.href, profile);await chrome.waitFor("typeof data === 'object' && data?.project?.milestones?.length === 5");await press(chrome, "document.querySelector('[data-tab=roadmap]')");- await chrome.waitFor("!document.querySelector('[data-pane=roadmap]').hidden && document.querySelectorAll('#roadmap > [data-key]').length > 0");+ await chrome.waitFor("!document.querySelector('[data-pane=roadmap]').hidden && document.querySelectorAll('#roadmap-list > [data-key]').length > 0");for (const scheme of ['light', 'dark']) {for (const width of [1280, 375]) {await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });@@ -318,7 +318,7 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { tassert.deepEqual(r.parts[0].rows, ['#3', '#4'], `${at}: the next release shows its items`);assert.deepEqual([r.parts[2].empty, r.parts[2].note], ['No items yet.', 'Work not filed yet.'], `${at}: the open empty milestone shows its note and empty state`);assert.ok(r.parts.every((part) => part.height >= 44), `${at}: each part opens from a 44px target`);- await click('#roadmap > [data-key="shipped"] > .milestone-head');+ await click('#roadmap-list > [data-key="shipped"] > .milestone-head');const expanded = await read();const history = expanded.parts.find((part) => part.key === 'shipped');assert.deepEqual(history.shipped.map((one) => [one.key, one.open, one.summary]), [@@ -331,7 +331,7 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { tassert.deepEqual((await read()).parts.find((part) => part.key === 'shipped').shipped[0].rows, ['#2', '#6'], at + ': verified and withdrawn items remain readable');await proofShot(chrome, 'releases', width);await click('#roadmap .shipped-one[data-key="m:0.2"] > .milestone-head');- await click('#roadmap > [data-key="shipped"] > .milestone-head');+ await click('#roadmap-list > [data-key="shipped"] > .milestone-head');}}@@ -343,7 +343,7 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { tassert.deepEqual((await read()).parts.map(part => part.key), ['m:0.3'], 'the status-bar release link opens only the same next release');await press(chrome, "document.querySelector('[data-roadmap-all]')");assert.deepEqual((await read()).parts.map(part => part.key), ['m:0.3', 'm:0.4', 'm:Later', 'shipped'], 'show all restores upcoming and shipped history');- await click('#roadmap > [data-key="shipped"] > .milestone-head');+ await click('#roadmap-list > [data-key="shipped"] > .milestone-head');let r = await read();const shipped = r.parts.find((part) => part.key === 'shipped');assert.deepEqual(shipped.shipped.map((one) => [one.key, one.open, one.summary]), [@@ -360,7 +360,7 @@ test('the roadmap leads with the next release and folds shipped ones [N26]', { t// The parts stay as the person left them when the board redraws: close the next release, then change the board.await press(chrome, "document.querySelector('[data-tab=roadmap]')");await chrome.waitFor("!document.querySelector('[data-pane=roadmap]').hidden");- await click('#roadmap > [data-key="m:0.3"] > .milestone-head');+ await click('#roadmap-list > [data-key="m:0.3"] > .milestone-head');box.run(alpha.web, 'claim', '3');await chrome.waitFor("data.project.items.find((i) => i.id === 3)?.status === 'claimed'", 15_000);r = await read();@@ -401,7 +401,7 @@ test('the roadmap keeps every upcoming release open [N26]', {let chrome;/** Read default disclosures, their visible content, status label, and viewport overflow. */const read = async () => JSON.parse(await chrome.stable(`JSON.stringify((() => {- const parts=[...document.querySelectorAll('#roadmap > [data-key]')];+ const parts=[...document.querySelectorAll('#roadmap-list > [data-key]')];const readPart=part=>{const head=part.querySelector(':scope > .milestone-head'),body=part.querySelector(':scope > .milestone-body');const rows=[...body.querySelectorAll(':scope > ul .milestone-item')];return {key:part.dataset.key,open:head.getAttribute('aria-expanded')==='true',rows:rows.map(row=>row.querySelector('.id').textContent),visibleRows:rows.filter(row=>row.getBoundingClientRect().height>0).length,@@ -441,3 +441,166 @@ test('the roadmap keeps every upcoming release open [N26]', {await view.stop();}});++test('the roadmap panel jumps to each release [N26]', {+ timeout: 150_000, //budget: hang ceiling for real Chrome startup, fourteen jumps at two widths, and panel scrolling.+}, async (t) => {+ const executable = chromeExecutable();+ assert.ok(executable, 'Chrome is required for Roadmap panel navigation.');+ const box = machine();+ const alpha = project(box, 'roadmap-panel-jumps');+ for (const title of ['Shipped release item', 'Next release item']) box.run(alpha.repo, 'add', 'web', title, '--specs', 'G1', '--criterion', 'renders');+ build(box, alpha, 1, 'shipped.html');+ accept(box, alpha, 1);+ const shippedBranch = alpha.itemBranches.get(`${alpha.baseBranch}:1`);+ box.git(alpha.repo, 'merge', '--no-ff', '--no-edit', shippedBranch);+ box.run(alpha.repo, 'merged', '1', box.git(alpha.repo, 'rev-parse', 'HEAD'));+ box.run(alpha.repo, 'milestone', 'add', '0.8.6', '--note', 'Shipped first line.\nThis line stays in the expanded history.', '--items', '1');+ box.run(alpha.repo, 'milestone', 'add', '0.8.7', '--note', 'The next release.', '--items', '2');+ for (const name of ['0.8.8', '0.8.9', '0.8.10', '0.8.11', '0.8.12', '0.8.13', '0.8.14', '0.8.15', '0.8.16', '0.8.17', '0.8.18', '0.8.19']) {+ box.run(alpha.repo, 'milestone', 'add', name, '--note', 'Queued after the next release.');+ }+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-roadmap-panel-jumps-'));+ let chrome;+ /** Read panel selection, list targets, and page overflow after the shared Chrome wait. */+ const read = async () => JSON.parse(await chrome.stable(`JSON.stringify((() => {+ const panel = document.querySelector('#roadmap-panel'), list = document.querySelector('#roadmap-list');+ const buttons = [...panel.querySelectorAll('[data-roadmap-jump]')];+ const targets = [...list.querySelectorAll(':scope > [data-key]')];+ const rect = element => { const r = element.getBoundingClientRect(); return {top:r.top,bottom:r.bottom,height:r.height}; };+ const bar = document.querySelector('.top').getBoundingClientRect();+ return {buttons:buttons.map(b=>({key:b.dataset.roadmapJump,name:b.querySelector('span').textContent,count:b.querySelector('b').textContent,current:b.getAttribute('aria-current'),height:rect(b).height})),+ targets:targets.map(e=>({key:e.dataset.key,rect:rect(e),arrival:e.classList.contains('roadmap-arrival'),expanded:e.querySelector(':scope > .milestone-head')?.getAttribute('aria-expanded')})),+ panel:rect(panel),bar:{top:bar.top,bottom:bar.bottom},strip:rect(panel.querySelector('.roadmap-releases')),+ stripWidth:panel.querySelector('.roadmap-releases').scrollWidth,stripClient:panel.querySelector('.roadmap-releases').clientWidth,+ viewport:document.documentElement.clientWidth,scrollY:window.scrollY,pageWidth:Math.max(document.documentElement.scrollWidth,document.body.scrollWidth)};+ })())`));+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor('data?.project?.milestones?.length === 14');+ for (const width of [375, 1280]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor(`innerWidth === ${width}`);+ await press(chrome, "document.querySelector('[data-tab=roadmap]')");+ const initial = await read();+ if (width >= 900) {+ assert.ok(initial.buttons.every((button) => button.height >= tapTarget(width)), 'wide fine-pointer release jumps meet the 32px target');+ await chrome.send('Emulation.setTouchEmulationEnabled', { enabled: true, maxTouchPoints: 5 });+ await chrome.waitFor("matchMedia('(pointer: coarse)').matches");+ const coarse = await read();+ assert.ok(coarse.buttons.every((button) => button.height >= 44), 'wide coarse-pointer release jumps meet the 44px target');+ await chrome.send('Emulation.setTouchEmulationEnabled', { enabled: false });+ await chrome.waitFor("matchMedia('(pointer: fine)').matches");+ }+ const keys = ['m:0.8.7', 'm:0.8.8', 'm:0.8.9', 'm:0.8.10', 'm:0.8.11', 'm:0.8.12', 'm:0.8.13', 'm:0.8.14', 'm:0.8.15', 'm:0.8.16', 'm:0.8.17', 'm:0.8.18', 'm:0.8.19', 'shipped'];+ assert.deepEqual(initial.buttons.map((button) => button.key), keys, `${width}: each upcoming release in order and one Shipped jump`);+ assert.deepEqual(initial.buttons.map(({ name, count }) => [name, count]), [['0.8.7', '0/1'], ...keys.slice(1, -1).map((key) => [key.slice(2), '0/0']), ['Shipped', '1']], `${width}: release names and done counts are visible`);+ assert.ok(initial.buttons.every((button) => button.height >= tapTarget(width)), `${width}: every release jump meets the target size`);+ assert.ok(initial.pageWidth <= initial.viewport, `${width}: the page never scrolls sideways`);+ if (width < 900) {+ assert.ok(initial.stripWidth > initial.stripClient, 'phone release chips scroll inside their own row');+ assert.ok(initial.panel.bottom <= initial.targets[0].rect.top, 'the phone panel sits above the release list');+ // A board refresh redraws the Roadmap; the chips stay where the person scrolled them.+ const kept = JSON.parse(await chrome.stable("(() => { const row = document.querySelector('#roadmap-releases'); row.scrollLeft = row.scrollWidth; const before = row.scrollLeft; render(); return JSON.stringify([before, document.querySelector('#roadmap-releases').scrollLeft]); })()"));+ assert.ok(kept[0] > 0 && kept[1] === kept[0], `375: a redraw keeps the chips where they were scrolled: ${JSON.stringify(kept)}`);+ await chrome.stable("(() => { document.querySelector('#roadmap-releases').scrollLeft = 0; return true; })()");+ }+ await proofShot(chrome, 'roadmap-panel-jumps', width);+ // The page marks a release it jumps to for a moment, then clears the mark. Record each mark as it is set,+ // so a busy machine that reads late still sees it (a fixed window is the #400 class of red). The list is redrawn+ // when the board refreshes, so the watch is on the document.+ await chrome.stable("(() => { window.__arrivals = []; if (!window.__arrivalWatch) { window.__arrivalWatch = new MutationObserver((changes) => { for (const change of changes) if (change.target.classList?.contains('roadmap-arrival') && change.target.closest('#roadmap-list')) window.__arrivals.push(change.target.dataset.key); }); window.__arrivalWatch.observe(document.body, { subtree: true, attributes: true, attributeFilter: ['class'] }); } return true; })()");+ for (const key of keys.slice(0, -1)) {+ await press(chrome, `document.querySelector('#roadmap-panel [data-roadmap-jump="${key}"]')`);+ const moved = await read();+ const target = moved.targets.find((entry) => entry.key === key);+ const marked = JSON.parse(await chrome.stable('JSON.stringify(window.__arrivals)')).includes(key);+ assert.ok(marked && target.rect.bottom > moved.bar.bottom && target.rect.top < 900, `${width}: selecting ${key} scrolls it into view and marks it: ${JSON.stringify({ ...target, marked })}`);+ const atTop = moved.targets.find((entry) => entry.rect.bottom > moved.bar.bottom + 8)?.key || moved.targets.at(-1).key;+ assert.equal(moved.buttons.find((button) => button.key === atTop).current, 'location', `${width}: the panel marks the release actually at the top of the list`);+ }+ await press(chrome, "document.querySelector('#roadmap-panel [data-roadmap-jump=shipped]')");+ assert.equal((await read()).targets.at(-1).expanded, 'true', `${width}: selecting Shipped opens it`);+ const beforeListScroll = await read();+ await chrome.stable("document.querySelector('#roadmap-list [data-key=\"m:0.8.12\"]').scrollIntoView({block:'start',behavior:'instant'})");+ const scrolled = await read();+ const atTop = scrolled.targets.find((entry) => entry.rect.bottom > scrolled.bar.bottom + 8)?.key || scrolled.targets.at(-1).key;+ assert.notEqual(scrolled.scrollY, beforeListScroll.scrollY, `${width}: scrolling to a middle release moves the list`);+ assert.notEqual(scrolled.buttons.find((button) => button.current === 'location')?.key, beforeListScroll.buttons.find((button) => button.current === 'location')?.key, `${width}: scrolling changes the active release`);+ assert.equal(scrolled.buttons.find((button) => button.key === atTop).current, 'location', `${width}: scrolling the list updates the marker for the release actually at the top`);+ assert.ok(scrolled.pageWidth <= scrolled.viewport, `${width}: navigation keeps the page within its width`);+ if (width >= 900) assert.ok(scrolled.panel.top >= scrolled.bar.bottom + 8 && scrolled.panel.top <= scrolled.bar.bottom + 24, `desktop panel stays beside the list while scrolling: ${JSON.stringify(scrolled.panel)}`);+ }+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});++test('the roadmap panel counts the next release by stage [N26]', {+ timeout: 180_000, //budget: hang ceiling for six real item lifecycles and merged receipts before four viewport/theme checks.+}, async (t) => {+ const executable = chromeExecutable();+ assert.ok(executable, 'Chrome is required for Roadmap shipping counts.');+ const box = machine();+ const alpha = project(box, 'roadmap-panel-counts');+ for (const title of ['Open', 'Building', 'In review', 'Accepted', 'Verified', 'Shipped']) box.run(alpha.repo, 'add', 'web', title, '--specs', 'G1', '--criterion', 'renders');+ build(box, alpha, 3, 'submitted.html');+ build(box, alpha, 4, 'accepted.html');+ accept(box, alpha, 4);+ build(box, alpha, 5, 'verified.html');+ accept(box, alpha, 5);+ const mergedBranch = alpha.itemBranches.get(`${alpha.baseBranch}:5`);+ box.git(alpha.repo, 'merge', '--no-ff', '--no-edit', mergedBranch);+ box.run(alpha.repo, 'merged', '5', box.git(alpha.repo, 'rev-parse', 'HEAD'));+ build(box, alpha, 6, 'last-shipped.html');+ accept(box, alpha, 6);+ const shippedBranch = alpha.itemBranches.get(`${alpha.baseBranch}:6`);+ box.git(alpha.repo, 'merge', '--no-ff', '--no-edit', shippedBranch);+ box.run(alpha.repo, 'merged', '6', box.git(alpha.repo, 'rev-parse', 'HEAD'));+ box.run(alpha.web, 'claim', '2');+ box.run(alpha.repo, 'milestone', 'add', '0.8.6', '--note', 'The last shipped note.\nA second detail line.', '--items', '6');+ box.run(alpha.repo, 'milestone', 'add', '0.8.7', '--note', 'Shipping next.', '--items', '1,2,3,4,5');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-roadmap-panel-counts-'));+ let chrome;+ /** Read the visible stage counts and the bounded last-shipped summary. */+ const read = async () => JSON.parse(await chrome.stable(`JSON.stringify((() => {+ const card=document.querySelector('#roadmap-panel'), rect=e=>{const r=e.getBoundingClientRect();return {top:r.top,bottom:r.bottom,height:r.height};};+ const last=[...document.querySelectorAll('#roadmap .roadmap-last-shipped')].find(e=>e.getBoundingClientRect().height>0);+ return {next:document.querySelector('#roadmap-list > .milestone > .milestone-head h2').textContent,+ counts:[...document.querySelectorAll('#roadmap [data-shipping-stage]')].filter(e=>e.getBoundingClientRect().height>0).map(e=>[e.dataset.shippingStage,e.querySelector('dd').textContent]),+ shipped:last ? [...last.children].map(e=>e.textContent) : null,+ panel:rect(card),desktop:rect(card.querySelector('.roadmap-desktop-shipping')),mobile:rect(document.querySelector('.roadmap-list .roadmap-mobile-shipping')),+ heading:rect(document.querySelector('#roadmap-list > .milestone > .milestone-head h2')),+ mobileCounts:rect(document.querySelector('#roadmap-list > .milestone > .roadmap-mobile-shipping .roadmap-stage-counts')),+ documentWidth:Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),viewport:document.documentElement.clientWidth,viewportHeight:document.documentElement.clientHeight};+ })())`));+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor('data?.project?.milestones?.length === 2');+ await press(chrome, "document.querySelector('[data-tab=roadmap]')");+ for (const width of [375, 1280]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor(`innerWidth === ${width}`);+ for (const scheme of ['light', 'dark']) {+ await chrome.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: scheme }] });+ await chrome.waitFor(`matchMedia('(prefers-color-scheme: ${scheme})').matches`);+ const counts = await read();+ assert.equal(counts.next, '0.8.7', `${width}/${scheme}: the panel names the next release`);+ assert.deepEqual(counts.counts, [['open', '1'], ['claimed', '1'], ['submitted', '1'], ['accepted', '1'], ['merged', '1']], `${width}/${scheme}: each state uses the board's held item data`);+ assert.deepEqual(counts.shipped, ['Last shipped', '0.8.6', 'The last shipped note.'], `${width}/${scheme}: the last shipped row includes only the note's first line`);+ assert.ok(counts.documentWidth <= counts.viewport, `${width}/${scheme}: the page never scrolls sideways`);+ if (width < 900) assert.ok(counts.heading.top < counts.mobileCounts.top && counts.mobile.height > 0 && counts.desktop.height === 0, `${width}/${scheme}: counts sit under the actual next release heading on the phone`);+ else assert.ok(counts.desktop.height > 0 && counts.mobile.height === 0, `${width}/${scheme}: desktop shipping counts stay in the right panel`);+ }+ await proofShot(chrome, 'roadmap-panel-counts', width);+ }+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});