From e09ff8aee9651b3bcbdbe29e587ec196bfd0e4ee Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Sat, 31 Oct 2026 07:48:02 -0400 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=90=9B=20fix:=20connect=20adjacent=20?= =?UTF-8?q?preparation=20members=20through=20full=20row=20height?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- .../fixed-preparation-continuous-connector.md | 1 + .../dashboard-sections/activity-monitor.md | 8 ++ .../stage_tracker_preparation_visual.test.js | 34 +++++++-- src/pkg/dashboard/static-src/css/tracker.css | 1 + .../static-src/js/tracker-preparation.js | 9 ++- src/pkg/dashboard/static/index.html | 10 ++- src/scripts/dashboard-mobile-shots.mjs | 11 +++ .../fixtures/dashboard-preparation-rail.mjs | 74 +++++++++++++++++++ 8 files changed, 135 insertions(+), 13 deletions(-) create mode 100644 changelog.d/fixed-preparation-continuous-connector.md create mode 100644 src/scripts/fixtures/dashboard-preparation-rail.mjs diff --git a/changelog.d/fixed-preparation-continuous-connector.md b/changelog.d/fixed-preparation-continuous-connector.md new file mode 100644 index 0000000000..b0373ed4d3 --- /dev/null +++ b/changelog.d/fixed-preparation-continuous-connector.md @@ -0,0 +1 @@ +- Keep adjacent preparation-train members connected through full row captions and nested PR spacing under one compact header, even when the selected display order runs opposite to preparation FIFO; preserve row order and stop the rail before unrelated work. diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index 74c6931d6c..846ec460db 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -201,6 +201,14 @@ It counts under **Needs attention**. Before the merge gate only the held-workflo #### Merge train +**Preparation is a separate, not-yet-ready train.** Its compact gold header and +original thin rail annotate actual preparation members without changing their +CI/review stages. Adjacent members share one header and a continuous connector +through expanded captions, row padding and nested PR spacing, even when the +selected display order is opposite to the durable FIFO. Ticket positions remain +the FIFO authority; row sorting, pagination and issue/PR association do not change. +An unrelated row or child ends the run rather than acquiring a misleading rail. + When several approved PRs to the same base touch the same files, the automerge lanes merge them one at a time ([#15117](https://github.com/hivecommons/hive/issues/15117)). The tracker renders every train contiguously, in merge order, with a thin left rail linking the rows and a header chip `🚆 merge train · 4 PRs · 1st: #15074` — the glyph is an inline-SVG railcar (14px, currentColor, hover *Merge queue*), the same icon the **Merge queue** column header and its chevrons wear; overlapping files are listed beside it. Pill wording per state is the PR's place in the queue (the owner's words — `front` and `queued-behind` appear nowhere a person reads): the head reads "Merge queued · 1st of 4 · ~13m" (its own soak left plus the next pass); the others "Merge queued · 2nd of 4 · ~4m", "Merge queued · 3rd of 4", … (`1st 2nd 3rd 4th … 11th 12th 13th 21st`, always with the queue length, countdown to its turn); when the page draws more than one train each queue word ends with its train's tag — "Merge queued · 1st of 2 · train main.go" (the first overlapping file's basename, else the head `#N`) — and the hover leads *Train of 2 PRs overlapping main.go; merges after #15567.*, so two "1st"s on one page tell apart (one train → no tag); the header and every member row of a train share one rail accent (`.ham-train-k0…k3`, cycling in page order); once the front merged and the hive is rebasing a conflicting sibling, "Rebasing · attempt 1/2"; when the loop guard (`auto_merge.merge_train.max_rebase_attempts`) is spent, "Needs human decision · rebase failed twice" at stage/085 with the decision option "Rebase, then merge as maintainer". The tooltip lists the PRs ahead and the overlapping files. Waiting siblings are never red, never `needs human`; a `needs-rebase` label on one is reported under `stale_labels`, the train repairs it. Each item carries `merge_gate.state` (`queued-behind` / `rebasing` / `rebase-exhausted` / `front`, with an honest `reason` such as `behind #15074 in merge train (3rd of 4, overlapping files: stage_tracker.go, index.html)`) and `merge_train{id, state, front, position, size, attempt, max_attempts, overlap_files, ahead, members}`; the id is `#` and `members` is the whole roster in merge order. diff --git a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js index ccd03b6a3e..41ea0811e8 100644 --- a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js +++ b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js @@ -110,16 +110,18 @@ test('original compact pill and connector decorate actual rows with FIFO help an assert.deepEqual(plain(f.data), before); }); -test('actual custom sorts, pagination and stage ranges are unchanged; backwards order starts separate runs', () => { +test('custom sort and pagination stay unchanged; adjacent reverse-FIFO members share one uninterrupted train', () => { const { ctx } = load(), f = fixture(); const ordered = ctx.stageTrackerSort(f.data.items, [], { sort: 'number', dir: 'asc' }); const page = ctx.stageTrackerPage(ordered, { size: 25, page: 1 }); const before = plain(page), rows = render(ctx, f, page.rows, ordered); assert.deepEqual(plain(page), before); assert.deepEqual(rootKeys(rows), page.rows.map(it => ctx.stageTrackerItemKey(it))); - assert.equal(rows.filter(row => row.key.startsWith('preparation:')).length, 3); - assert.match(content(rows), /continuation/); - for (const row of rows.filter(row => !row.key.startsWith('preparation:'))) assert.match(row.html, /ham-train-last/); + assert.equal(rows.filter(row => row.key.startsWith('preparation:')).length, 1); + assert.doesNotMatch(content(rows), /continuation/); + const members = rows.filter(row => !row.key.startsWith('preparation:')); + for (const row of members.slice(0, -1)) assert.doesNotMatch(row.html, /ham-train-last|ham-preparation-gap/); + assert.match(members.at(-1).html, /ham-train-last/); assert.deepEqual(plain(model(ctx, f)[0].waiting.map(e => [e.ticket.number, e.position])), [[9, 1], [2, 2]]); }); @@ -220,7 +222,7 @@ test('multiple/shared issue trees keep their actual nested rows and PR stages wi assert.match(html, /data-ham-stage="70" data-ham-sub-key="hivecommons\/hive\/pr#2"/); assert.match(html, /shown under issue #500/); assert.deepEqual(plain(f.data), before); - assert.match(rootRow(rows, 500, 'issue').html, /ham-preparation-gap/); + assert.doesNotMatch(rootRow(rows, 500, 'issue').html, /ham-preparation-gap/); }); test('mixed linked trees mark only preparation children and stop before an unrelated child', () => { @@ -361,3 +363,25 @@ test('gold summary stays ready-only without the removed external region', () => assert.equal(count.textContent, '1'); assert.doesNotMatch(chip.title, /preparation|owner|waiting/); }); + +test('expanded captions and adjacent nested members share a full-height connector without moving unrelated children', () => { + const { ctx } = load(), f = fixture(); + f.owner.stage = 50; f.first.stage = 70; + f.first.caption = 'Expanded current-head CI and review detail. '.repeat(24); + f.q.waiting = [f.first.preparation]; + const unrelated = { ...f.second, number: 80, stage: 90, preparation: null, head: 'other' }; + const issue = { kind: 'issue', repo: REPO, number: 500, stage: 40, linked_prs: [f.owner, unrelated, f.first] }; + f.data.items = [issue]; + const before = plain(f.data), html = content(render(ctx, f)); + assert.deepEqual(plain(f.data), before); + assert.equal((html.match(/ham-preparation-head/g) || []).length, 1); + assert.equal((html.match(/ham-train-last/g) || []).length, 1); + assert.doesNotMatch(html, /continuation/); + assert.match(html, /class="ham-sub" data-ham-kind="pr" data-ham-stage="90"/); + assert.match(html, /ham-preparation-member" data-ham-kind="pr" data-ham-stage="70"/); + assert.match(html, /ham-preparation-member ham-train-front ham-train-last" data-ham-kind="pr" data-ham-stage="50"/); + assert.match(html, /Expanded current-head CI and review detail\./); + assert.ok(html.indexOf('/pr#80') < html.indexOf('/pr#9')); + const css = fs.readFileSync(path.join(__dirname, 'static-src/css/tracker.css'), 'utf8'); + assert.match(css, /\.ham-row\.ham-preparation-member::before \{ top: calc\(-1 \* var\(--line-width\)\)/); +}); diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 384d320a11..67b1326b93 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -206,6 +206,7 @@ .ham-row.ham-train-front::after { background: var(--text); } .ham-train-head + .ham-row.ham-train { border-top: 0; } .ham-preparation-head { flex-wrap: wrap; } + .ham-row.ham-preparation-member::before { top: calc(-1 * var(--line-width)); } .ham-preparation-head .ham-train-chip { white-space: normal; } .ham-preparation-head .ham-preparation-help { background: none; border-color: var(--ham-train-accent); color: var(--muted); } .ham-preparation-help::before { content: '?'; } diff --git a/src/pkg/dashboard/static-src/js/tracker-preparation.js b/src/pkg/dashboard/static-src/js/tracker-preparation.js index d75227f867..d360e07c43 100644 --- a/src/pkg/dashboard/static-src/js/tracker-preparation.js +++ b/src/pkg/dashboard/static-src/js/tracker-preparation.js @@ -107,13 +107,13 @@ return { groupIndex: members[0].groupIndex, members, ordered }; } function stageTrackerPreparationAdjacent(a, b) { - return !!(a && b && a.ordered && b.ordered && a.groupIndex === b.groupIndex - && a.members[a.members.length - 1].sequence < b.members[0].sequence); + return !!(a && b && a.groupIndex === b.groupIndex); } function stageTrackerPreparationHelp(group) { const q = group.queue; const details = [`${q.repo || 'Repository unknown'} → ${q.base_ref || 'base unknown'}`, q.message || 'FIFO follows first qualifying admission, not PR age or guaranteed merge order.', + 'The connector joins adjacent preparation members in the selected display order; ticket positions still follow preparation FIFO.', 'Preparation is not CI, review approval, a ready train seat, or native queue membership.']; if (q.observed_at) details.push('Snapshot ' + q.observed_at); for (const e of group.members) { @@ -169,8 +169,9 @@ if (!info || ctx && ctx.preparationParent) return ''; const prev = ctx && ctx.preparationPrev !== undefined ? ctx.preparationPrev : stageTrackerPreparationRowInfo(ctx && ctx.prevRow, stages); const next = ctx && ctx.preparationNext !== undefined ? ctx.preparationNext : stageTrackerPreparationRowInfo(ctx && ctx.nextRow, stages); - const gap = !info.ordered || info.members.some((e, i) => i && e.sequence !== info.members[i - 1].sequence + 1) - || stageTrackerPreparationAdjacent(prev, info) && info.members[0].sequence !== prev.members[prev.members.length - 1].sequence + 1; + const trail = stageTrackerPreparationAdjacent(prev, info) + ? [prev.members[prev.members.length - 1]].concat(info.members) : info.members; + const gap = trail.some((e, i) => i && Math.abs(e.sequence - trail[i - 1].sequence) > 1); return ' ham-train' + stageTrackerTrainAccentClass(STAGE_TRACKER_PREPARATION_ACCENT) + ' ham-preparation-member' + (info.members.some(e => e.role === 'owner' && e.state === 'current') ? ' ham-train-front' : '') + (!stageTrackerPreparationAdjacent(info, next) ? ' ham-train-last' : '') diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 9f59abe610..e515fe4b61 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1543,6 +1543,7 @@ .ham-row.ham-train-front::after { background: var(--text); } .ham-train-head + .ham-row.ham-train { border-top: 0; } .ham-preparation-head { flex-wrap: wrap; } + .ham-row.ham-preparation-member::before { top: calc(-1 * var(--line-width)); } .ham-preparation-head .ham-train-chip { white-space: normal; } .ham-preparation-head .ham-preparation-help { background: none; border-color: var(--ham-train-accent); color: var(--muted); } .ham-preparation-help::before { content: '?'; } @@ -19811,13 +19812,13 @@

All labels

return { groupIndex: members[0].groupIndex, members, ordered }; } function stageTrackerPreparationAdjacent(a, b) { - return !!(a && b && a.ordered && b.ordered && a.groupIndex === b.groupIndex - && a.members[a.members.length - 1].sequence < b.members[0].sequence); + return !!(a && b && a.groupIndex === b.groupIndex); } function stageTrackerPreparationHelp(group) { const q = group.queue; const details = [`${q.repo || 'Repository unknown'} → ${q.base_ref || 'base unknown'}`, q.message || 'FIFO follows first qualifying admission, not PR age or guaranteed merge order.', + 'The connector joins adjacent preparation members in the selected display order; ticket positions still follow preparation FIFO.', 'Preparation is not CI, review approval, a ready train seat, or native queue membership.']; if (q.observed_at) details.push('Snapshot ' + q.observed_at); for (const e of group.members) { @@ -19873,8 +19874,9 @@

All labels

if (!info || ctx && ctx.preparationParent) return ''; const prev = ctx && ctx.preparationPrev !== undefined ? ctx.preparationPrev : stageTrackerPreparationRowInfo(ctx && ctx.prevRow, stages); const next = ctx && ctx.preparationNext !== undefined ? ctx.preparationNext : stageTrackerPreparationRowInfo(ctx && ctx.nextRow, stages); - const gap = !info.ordered || info.members.some((e, i) => i && e.sequence !== info.members[i - 1].sequence + 1) - || stageTrackerPreparationAdjacent(prev, info) && info.members[0].sequence !== prev.members[prev.members.length - 1].sequence + 1; + const trail = stageTrackerPreparationAdjacent(prev, info) + ? [prev.members[prev.members.length - 1]].concat(info.members) : info.members; + const gap = trail.some((e, i) => i && Math.abs(e.sequence - trail[i - 1].sequence) > 1); return ' ham-train' + stageTrackerTrainAccentClass(STAGE_TRACKER_PREPARATION_ACCENT) + ' ham-preparation-member' + (info.members.some(e => e.role === 'owner' && e.state === 'current') ? ' ham-train-front' : '') + (!stageTrackerPreparationAdjacent(info, next) ? ' ham-train-last' : '') diff --git a/src/scripts/dashboard-mobile-shots.mjs b/src/scripts/dashboard-mobile-shots.mjs index 07575795da..d9b93b2944 100644 --- a/src/scripts/dashboard-mobile-shots.mjs +++ b/src/scripts/dashboard-mobile-shots.mjs @@ -27,6 +27,7 @@ import { spawn } from 'node:child_process'; import fs from 'node:fs'; import http from 'node:http'; import path from 'node:path'; +import { preparationRailLayoutFixture } from './fixtures/dashboard-preparation-rail.mjs'; const CHROME_CANDIDATES = [ process.env.CHROME_BIN, @@ -246,6 +247,7 @@ async function main() { } const report = []; + const preparationRailReport = []; let socket; try { const tabs = await waitForTabs(); @@ -279,6 +281,7 @@ async function main() { // Each state callback is best-effort: a missing helper yields a skipped shot, not a harness error. const setThemeJS = (theme) => `document.body.classList.toggle('light-mode', ${theme === 'light'}); document.documentElement.style.colorScheme = '${theme}'; true`; const resetJS = `(() => { + document.getElementById('preparation-rail-layout-fixture')?.remove(); document.querySelectorAll('.config-overlay, .modal-overlay').forEach((el) => { el.classList.add('hidden'); }); document.documentElement.classList.remove('modal-open'); document.body.classList.remove('modal-open'); return true; @@ -324,6 +327,13 @@ async function main() { states.push({ name: 'settings', run: async () => { await evaluate(collapseAllJS); return evaluate(settingsJS); } }); states.push({ name: 'knowledge-sources', run: async () => { await evaluate(collapseAllJS); return evaluate(knowledgeJS); } }); states.push({ name: 'terminal', run: async () => { await evaluate(collapseAllJS); return evaluate(terminalJS); } }); + states.push({ name: 'preparation-rail', run: async () => { + await evaluate(collapseAllJS); + const result = await evaluate('(' + preparationRailLayoutFixture.toString() + ')()'); + preparationRailReport.push({ viewport: vp.name, theme, ...result }); + if (result.failures.length) throw new Error('Preparation rail layout: ' + result.failures.join('; ')); + return true; + } }); for (const state of states) { await evaluate(resetJS); @@ -347,6 +357,7 @@ async function main() { if (socket) socket.close(); await cleanup(); fs.writeFileSync(path.join(opts.out, 'overflow-report.json'), JSON.stringify(report, null, 2) + '\n'); + fs.writeFileSync(path.join(opts.out, 'preparation-rail-layout.json'), JSON.stringify(preparationRailReport, null, 2) + '\n'); } console.log(`wrote ${report.length} finding(s) to ${path.join(opts.out, 'overflow-report.json')}`); } diff --git a/src/scripts/fixtures/dashboard-preparation-rail.mjs b/src/scripts/fixtures/dashboard-preparation-rail.mjs new file mode 100644 index 0000000000..8fe3885236 --- /dev/null +++ b/src/scripts/fixtures/dashboard-preparation-rail.mjs @@ -0,0 +1,74 @@ +// Runs against the generated SPA in the existing Chrome screenshot harness. +export function preparationRailLayoutFixture() { + const nowMs = Date.parse('2026-10-31T12:00:00Z'); + const repo = 'fixture/preparation'; + const failures = [], geometry = []; + const check = (ok, message) => { if (!ok) failures.push(message); }; + const host = document.createElement('div'); + host.id = 'preparation-rail-layout-fixture'; + const saved = [_stageTrackerPreparationShown, _stageTrackerPreparationRendered, _stageTrackerPreparationInline, _stageTrackerPreparationNow]; + const pr = (number, stage) => ({ kind: 'pr', repo, number, stage, state: 'open', + head: 'head-' + number, base_ref: 'v5', title: 'Preparation connector layout fixture', + url: 'https://github.com/' + repo + '/pull/' + number, + caption: ('Current-head CI and review remain pending; this expanded caption must stay inside the preparation connector. ').repeat(12) }); + const ticket = (item, role) => ({ number: item.number, role, state: 'current', head_sha: item.head, + current_head: item.head, since: '2026-10-31T11:00:00Z', pipeline: item.caption }); + const append = (items, owner, waiting) => { + const queue = { repo, base_ref: 'v5', state: 'observed', owner: ticket(owner, 'owner'), waiting: waiting.map(p => ticket(p, 'waiting')) }; + const data = { items, base_preparation: [queue] }; + stageTrackerPreparationVisualSync(data, items, items, [], nowMs); + const ctx = { nowMs, items, events: {}, noteTuck: false, sharedPRs: {}, workers: {} }; + const rows = items.map((item, i) => ({ key: stageTrackerItemKey(item), + html: stageTrackerRowHtml(item, [], { ...ctx, prevRow: items[i - 1], nextRow: items[i + 1] }) })); + const block = document.createElement('div'); + block.innerHTML = stageTrackerPreparationInlineRows(rows, items, []).map(row => row.html).join(''); + host.appendChild(block); + return block; + }; + const rail = el => { + const rect = el.getBoundingClientRect(), style = getComputedStyle(el), pseudo = getComputedStyle(el, '::before'); + const num = value => Number.parseFloat(value) || 0; + return { top: rect.top + num(style.borderTopWidth) + num(pseudo.top), + bottom: rect.bottom - num(style.borderBottomWidth) - num(pseudo.bottom), + x: rect.left + num(style.borderLeftWidth) + num(pseudo.left), + border: pseudo.borderLeftStyle, rowHeight: rect.height, content: pseudo.content }; + }; + const inspect = (block, selector, name, count) => { + const members = [...block.querySelectorAll(selector)]; + check(members.length === count, name + ': exact member count'); + check(block.querySelectorAll('.ham-preparation-head').length === 1, name + ': one header'); + check(!block.textContent.includes('continuation'), name + ': no repeated continuation'); + const lines = members.map(rail); + geometry.push({ name, lines }); + for (let i = 0; i < members.length; i++) { + check(lines[i].content !== 'none' && lines[i].border === 'solid', name + ': original solid connector ' + i); + check(members[i].classList.contains('ham-train-last') === (i === members.length - 1), name + ': only final member ends rail'); + if (i === members.length - 1) continue; + check(lines[i].bottom >= lines[i + 1].top, name + ': rail crosses caption, padding and inter-row gap'); + check(Math.abs(lines[i].x - lines[i + 1].x) < 1, name + ': aligned rail gutter'); + const caption = members[i].querySelector('.ham-preparation-comment'); + check(caption && caption.getBoundingClientRect().height > 0, name + ': real expanded caption'); + if (caption) check(lines[i].bottom >= caption.getBoundingClientRect().bottom, name + ': rail spans full caption'); + } + }; + try { + document.getElementById(host.id)?.remove(); + const owner = pr(45, 70), first = pr(9, 50), second = pr(2, 70); + const roots = append([second, first, owner], owner, [first, second]); + const nestedOwner = pr(145, 70), nestedWaiter = pr(109, 50), unrelated = pr(180, 90); + const issue = { kind: 'issue', repo, number: 500, stage: 40, title: 'Preserved mixed issue tree', + linked_prs: [unrelated, nestedOwner, nestedWaiter] }; + const nested = append([issue], nestedOwner, [nestedWaiter]); + document.body.appendChild(host); + inspect(roots, '.ham-row.ham-preparation-member', 'root reverse-FIFO rows', 3); + inspect(nested, '.ham-sub.ham-preparation-member', 'nested PRs with expanded captions', 2); + const nonmember = nested.querySelector('[data-ham-sub-key="' + stageTrackerItemKey(unrelated) + '"]'); + check(nonmember && !nonmember.classList.contains('ham-preparation-member'), 'unrelated child has no preparation membership'); + host.scrollIntoView(); + } catch (error) { + failures.push(String(error.stack || error)); + } finally { + [_stageTrackerPreparationShown, _stageTrackerPreparationRendered, _stageTrackerPreparationInline, _stageTrackerPreparationNow] = saved; + } + return { failures, geometry }; +} From a065e4c040a719178b9fb85c5783914c3c910c24 Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Sat, 31 Oct 2026 07:52:02 -0400 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=90=9B=20ci:=20install=20Chrome=20run?= =?UTF-8?q?time=20dependencies=20for=20preparation=20rail=20geometry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- .github/workflows/dashboard-mobile-shots.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dashboard-mobile-shots.yml b/.github/workflows/dashboard-mobile-shots.yml index 9461a16d64..0d6a6a0105 100644 --- a/.github/workflows/dashboard-mobile-shots.yml +++ b/.github/workflows/dashboard-mobile-shots.yml @@ -8,6 +8,7 @@ on: paths: - 'src/pkg/dashboard/**' - 'src/scripts/dashboard-mobile-shots.mjs' + - 'src/scripts/fixtures/dashboard-preparation-rail.mjs' - '.github/workflows/dashboard-mobile-shots.yml' concurrency: @@ -30,18 +31,18 @@ jobs: node-version: '22' # The self-hosted fleet ships no browser (#11810): fetch Chrome for Testing - # into RUNNER_TEMP and hand it to the harness via CHROME_BIN. Best-effort — - # if the download fails the harness prints SKIP instead of crashing. + # with its Linux runtime dependencies and hand the working executable + # to the harness via CHROME_BIN. The minimal fleet lacks libnspr4. - name: Install Chrome for Testing id: chrome continue-on-error: true run: | set -euo pipefail - out="$(npx --yes @puppeteer/browsers@2 install chrome@stable --path "$RUNNER_TEMP/chrome-for-testing" | tail -n 1)" + out="$(sudo env "PATH=$PATH" npx --yes @puppeteer/browsers@2 install chrome@stable --install-deps --path "$RUNNER_TEMP/chrome-for-testing" | tail -n 1)" bin="${out#* }" test -x "$bin" - echo "CHROME_BIN=$bin" >> "$GITHUB_ENV" "$bin" --version + echo "CHROME_BIN=$bin" >> "$GITHUB_ENV" - name: Capture mobile screenshots and overflow report run: node src/scripts/dashboard-mobile-shots.mjs --out dashboard-mobile-shots-out From ff9ec98833c13aef4ca113355edcd86576eaec39 Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Sat, 31 Oct 2026 07:58:55 -0400 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=90=9B=20fix:=20order=20preparation?= =?UTF-8?q?=20units=20front-first=20and=20cover=20final=20commentary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- .../fixed-preparation-continuous-connector.md | 2 +- .../dashboard-sections/activity-monitor.md | 15 ++-- .../stage_tracker_preparation_visual.test.js | 69 ++++++++++++++++++- src/pkg/dashboard/static-src/css/tracker.css | 13 ++-- .../static-src/js/tracker-filter-render.js | 3 +- .../static-src/js/tracker-preparation.js | 48 +++++++++++-- .../static-src/js/tracker-row-layout.js | 4 +- src/pkg/dashboard/static/index.html | 68 +++++++++++++++--- .../fixtures/dashboard-preparation-rail.mjs | 37 ++++++++-- 9 files changed, 224 insertions(+), 35 deletions(-) diff --git a/changelog.d/fixed-preparation-continuous-connector.md b/changelog.d/fixed-preparation-continuous-connector.md index b0373ed4d3..18d8da9226 100644 --- a/changelog.d/fixed-preparation-continuous-connector.md +++ b/changelog.d/fixed-preparation-continuous-connector.md @@ -1 +1 @@ -- Keep adjacent preparation-train members connected through full row captions and nested PR spacing under one compact header, even when the selected display order runs opposite to preparation FIFO; preserve row order and stop the rail before unrelated work. +- Group complete preparation issue/PR row units into a front-first FIFO block with an uninterrupted connector through captions and nested spacing; preserve unrelated rows and child associations, distinguish unverified recorded fronts, and validate geometry in Chrome with its required runtime dependencies. diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index 846ec460db..85e6abce8a 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -203,11 +203,16 @@ It counts under **Needs attention**. Before the merge gate only the held-workflo **Preparation is a separate, not-yet-ready train.** Its compact gold header and original thin rail annotate actual preparation members without changing their -CI/review stages. Adjacent members share one header and a continuous connector -through expanded captions, row padding and nested PR spacing, even when the -selected display order is opposite to the durable FIFO. Ticket positions remain -the FIFO authority; row sorting, pagination and issue/PR association do not change. -An unrelated row or child ends the run rather than acquiring a misleading rail. +CI/review stages. Before pagination, complete issue/PR row units form a contiguous +block at the first preparation unit's position: the recorded front is first, +then waiters in durable ticket FIFO. Nonmember units retain their relative order. +Related PRs stay with their issue; nested preparation children follow FIFO while +nonmember siblings retain their relative order. Explicit ticket positions remain +the authority when one issue contains non-adjacent tickets. Adjacent members share +one header and a continuous connector through expanded captions, row padding and +nested PR spacing. An unrelated row or child ends the rail rather than acquiring +misleading membership. A missing, closed or stale front is never synthesized as a +verified owner; recorded/unverified metadata remains explicit. When several approved PRs to the same base touch the same files, the automerge lanes merge them one at a time ([#15117](https://github.com/hivecommons/hive/issues/15117)). The tracker renders every train contiguously, in merge order, with a thin left rail linking the rows and a header chip `🚆 merge train · 4 PRs · 1st: #15074` — the glyph is an inline-SVG railcar (14px, currentColor, hover *Merge queue*), the same icon the **Merge queue** column header and its chevrons wear; overlapping files are listed beside it. Pill wording per state is the PR's place in the queue (the owner's words — `front` and `queued-behind` appear nowhere a person reads): the head reads "Merge queued · 1st of 4 · ~13m" (its own soak left plus the next pass); the others "Merge queued · 2nd of 4 · ~4m", "Merge queued · 3rd of 4", … (`1st 2nd 3rd 4th … 11th 12th 13th 21st`, always with the queue length, countdown to its turn); when the page draws more than one train each queue word ends with its train's tag — "Merge queued · 1st of 2 · train main.go" (the first overlapping file's basename, else the head `#N`) — and the hover leads *Train of 2 PRs overlapping main.go; merges after #15567.*, so two "1st"s on one page tell apart (one train → no tag); the header and every member row of a train share one rail accent (`.ham-train-k0…k3`, cycling in page order); once the front merged and the hive is rebasing a conflicting sibling, "Rebasing · attempt 1/2"; when the loop guard (`auto_merge.merge_train.max_rebase_attempts`) is spent, "Needs human decision · rebase failed twice" at stage/085 with the decision option "Rebase, then merge as maintainer". diff --git a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js index 41ea0811e8..e8a834991d 100644 --- a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js +++ b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js @@ -110,13 +110,16 @@ test('original compact pill and connector decorate actual rows with FIFO help an assert.deepEqual(plain(f.data), before); }); -test('custom sort and pagination stay unchanged; adjacent reverse-FIFO members share one uninterrupted train', () => { +test('preparation FIFO overrides custom row sort before pagination without mutating its input', () => { const { ctx } = load(), f = fixture(); const ordered = ctx.stageTrackerSort(f.data.items, [], { sort: 'number', dir: 'asc' }); - const page = ctx.stageTrackerPage(ordered, { size: 25, page: 1 }); + const original = plain(ordered); + const prepared = ctx.stageTrackerPreparationOrderRows(f.data, ordered, []); + const page = ctx.stageTrackerPage(prepared, { size: 25, page: 1 }); const before = plain(page), rows = render(ctx, f, page.rows, ordered); + assert.deepEqual(plain(ordered), original); assert.deepEqual(plain(page), before); - assert.deepEqual(rootKeys(rows), page.rows.map(it => ctx.stageTrackerItemKey(it))); + assert.deepEqual(rootKeys(rows), [45, 9, 2].map(n => REPO + '/pr#' + n)); assert.equal(rows.filter(row => row.key.startsWith('preparation:')).length, 1); assert.doesNotMatch(content(rows), /continuation/); const members = rows.filter(row => !row.key.startsWith('preparation:')); @@ -125,6 +128,66 @@ test('custom sort and pagination stay unchanged; adjacent reverse-FIFO members s assert.deepEqual(plain(model(ctx, f)[0].waiting.map(e => [e.ticket.number, e.position])), [[9, 1], [2, 2]]); }); +test('scrambled preparation units form one front-first block while nonmembers retain their relative order', () => { + const { ctx } = load(), f = fixture(); + const others = [81, 82, 83].map(number => ({ ...f.first, number, preparation: null, head: 'other-' + number })); + const source = [others[0], f.second, others[1], f.owner, others[2], f.first]; + f.data.items = source; + const before = plain(source); + const ordered = ctx.stageTrackerPreparationOrderRows(f.data, source, []); + assert.deepEqual(plain(ordered.map(it => it.number)), [81, 45, 9, 2, 82, 83]); + assert.equal(new Set(ordered).size, source.length); + assert.deepEqual(plain(source), before); + const rows = render(ctx, f, ordered); + assert.equal(rows.filter(row => row.key.startsWith('preparation:')).length, 1); + for (const other of others) assert.doesNotMatch(rootRow(rows, other.number).html, /ham-preparation-member|ham-preparation-node/); +}); + +test('a nested front moves its complete issue unit and preserves unrelated children without duplicate PR rows', () => { + const { ctx } = load(), f = fixture(); + const unrelated = { ...f.first, number: 84, head: 'unrelated', preparation: null }; + const issue = { kind: 'issue', repo: REPO, number: 500, stage: 40, linked_prs: [unrelated, f.owner] }; + f.data.items = [f.second, issue, f.first]; + const before = plain(f.data); + const ordered = ctx.stageTrackerPreparationOrderRows(f.data, f.data.items, []); + assert.deepEqual(plain(ordered.map(it => [it.kind, it.number])), [['issue', 500], ['pr', 9], ['pr', 2]]); + assert.deepEqual(plain(issue.linked_prs.map(it => it.number)), [84, 45]); + assert.deepEqual(plain(f.data), before); + const rows = render(ctx, f, ordered), html = content(rows); + assert.deepEqual(rootKeys(rows), [REPO + '/issue#500', REPO + '/pr#9', REPO + '/pr#2']); + assert.equal((html.match(/data-ham-sub-key="hivecommons\/hive\/pr#45"/g) || []).length, 1); + assert.doesNotMatch(html, /data-ham-key="hivecommons\/hive\/pr#45"/); +}); + +test('nested preparation children follow FIFO as one block while nonmember siblings keep their original order', () => { + const { ctx } = load(), f = fixture(); + const others = [85, 86].map(number => ({ ...f.first, number, preparation: null, head: 'other-' + number })); + const issue = { kind: 'issue', repo: REPO, number: 501, stage: 40, + linked_prs: [others[0], f.second, others[1], f.owner, f.first] }; + f.data.items = [issue]; + ctx.stageTrackerPreparationVisualSync(f.data, f.data.items, f.data.items, [], NOW); + const ordered = ctx.stageTrackerPreparationOrderLinked(issue.linked_prs, issue); + assert.deepEqual(plain(ordered.map(lp => lp.number)), [85, 45, 9, 2, 86]); + assert.deepEqual(plain(issue.linked_prs.map(lp => lp.number)), [85, 2, 86, 45, 9]); +}); + +test('missing, closed and stale recorded fronts never become verified owners or fabricated rows when ordering', () => { + for (const state of ['missing', 'closed', 'stale']) { + const { ctx } = load(), f = fixture(); + if (state === 'missing') f.data.items = [f.second, f.first]; + if (state === 'closed') f.owner.state = 'closed'; + if (state === 'stale') f.owner.head = 'new-owner-head'; + const ordered = ctx.stageTrackerPreparationOrderRows(f.data, f.data.items, []); + assert.equal(new Set(ordered).size, f.data.items.length, state); + if (state === 'missing') assert.deepEqual(plain(ordered.map(it => it.number)), [9, 2]); + const rows = render(ctx, f, ordered), html = content(rows); + assert.doesNotMatch(html, /ham-train-front/); + assert.match(rows.find(row => row.key.startsWith('preparation:')).html, /recorded front: #45/); + if (state === 'missing') assert.doesNotMatch(html, /data-ham-key="hivecommons\/hive\/pr#45"/); + if (state === 'stale') assert.match(rootRow(rows, 45).html, /ham-preparation-unverified/); + } +}); + test('unrelated rows terminate rails; filtered FIFO gaps use dashed continuation without inventing adjacency', () => { const { ctx } = load(), f = fixture(); const other = { ...f.first, number: 80, head: 'other', preparation: null }; diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 67b1326b93..761a6cad38 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -207,23 +207,28 @@ .ham-train-head + .ham-row.ham-train { border-top: 0; } .ham-preparation-head { flex-wrap: wrap; } .ham-row.ham-preparation-member::before { top: calc(-1 * var(--line-width)); } + .ham-row.ham-preparation-member.ham-train-last::before { bottom: 0; } + .ham-row.ham-preparation-member::after { display: none; } .ham-preparation-head .ham-train-chip { white-space: normal; } .ham-preparation-head .ham-preparation-help { background: none; border-color: var(--ham-train-accent); color: var(--muted); } .ham-preparation-help::before { content: '?'; } .config-info.ham-preparation-node { position: absolute; left: calc(var(--sp-2) - 2px); top: calc(50% - var(--sp-2)); width: calc(var(--sp-2) * 2); height: calc(var(--sp-2) * 2); margin: 0; padding: 0; border: 0; background: transparent; z-index: 1; } + .ham-row.ham-preparation-member > .ham-strip-row > .ham-preparation-node { left: calc(var(--sp-2) - var(--sp-5) - 2px); } + .ham-preparation-node::before { content: none; } + .ham-preparation-node::after { content: ''; position: absolute; left: 1px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ham-train-accent); } + .ham-train-front > .ham-strip-row > .ham-preparation-node::after { background: var(--text); } .ham-preparation-node:focus-visible { outline: var(--focus-ring-width) solid var(--ham-train-accent); outline-offset: var(--sp-1); } .ham-row.ham-preparation-gap::before, .ham-sub.ham-preparation-member.ham-preparation-gap::before { border-left-style: dashed; } - .ham-row.ham-preparation-unverified::after, .ham-sub.ham-preparation-member.ham-preparation-unverified::after { background: var(--bg); box-shadow: 0 0 0 var(--line-width) var(--ham-train-accent); } + .ham-preparation-unverified > .ham-strip-row > .ham-preparation-node::after { background: var(--bg); box-shadow: 0 0 0 var(--line-width) var(--ham-train-accent); } .ham-preparation-comment { animation: none; } /* Mixed issue trees keep their existing children; only actual prep PRs receive a rail, at the original gutter offset minus the parent inset. */ .ham-row > .ham-preparation-head { margin-left: calc(-1 * var(--sp-2)); } .ham-sub.ham-preparation-member { position: relative; --ham-train-accent: var(--amber); } .ham-sub.ham-preparation-member::before { content: ''; position: absolute; left: 2px; top: calc(-1 * var(--sp-3) - var(--sp-2)); bottom: 0; border-left: var(--line-width) solid var(--ham-train-accent); } - .ham-sub.ham-preparation-member.ham-train-last::before { bottom: 50%; } - .ham-sub.ham-preparation-member::after { content: ''; position: absolute; left: -1px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ham-train-accent); } - .ham-sub.ham-preparation-member.ham-train-front::after { background: var(--text); } + .ham-sub.ham-preparation-member.ham-train-last::before { bottom: 0; } .ham-sub .config-info.ham-preparation-node { left: calc(-1 * var(--sp-1)); } + .ham-sub .ham-preparation-node::after { left: 3px; } .ham-group-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; cursor: pointer; } .ham-group-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); } .ham-group-toggle:focus-visible { outline: var(--focus-ring-width) solid var(--line-strong); outline-offset: 1px; } diff --git a/src/pkg/dashboard/static-src/js/tracker-filter-render.js b/src/pkg/dashboard/static-src/js/tracker-filter-render.js index 82691100c3..b71dc217f3 100644 --- a/src/pkg/dashboard/static-src/js/tracker-filter-render.js +++ b/src/pkg/dashboard/static-src/js/tracker-filter-render.js @@ -87,7 +87,8 @@ // Repo chips ride the setting against how many repos the payload spans. if (stageTrackerRepoChipOn(stageTrackerRepoChipSetting(), repos.length)) ctx.repoChips = { primary: stageTrackerPrimaryRepo(), active: f.repo }; const visible = stageTrackerVisible(d.items, f, ctx); - const ordered = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f)); + const sorted = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f)); + const ordered = typeof stageTrackerPreparationOrderRows === 'function' ? stageTrackerPreparationOrderRows(d, sorted, stages) : sorted; // A TV display (display=1&density=tv) shows the rows that fit the // screen, ungrouped, with "+N more" in place of the pager. const tv = typeof stageTrackerDisplayTv === 'function' && stageTrackerDisplayTv(); diff --git a/src/pkg/dashboard/static-src/js/tracker-preparation.js b/src/pkg/dashboard/static-src/js/tracker-preparation.js index d360e07c43..263b63a8e7 100644 --- a/src/pkg/dashboard/static-src/js/tracker-preparation.js +++ b/src/pkg/dashboard/static-src/js/tracker-preparation.js @@ -1,4 +1,5 @@ - // Preparation decorates the existing rows; it never sorts or admits them. + // Keep complete issue/PR row units together in recorded preparation order. + // This changes display order only, never admission or pipeline stage. var _stageTrackerPreparationShown = new Map(); var _stageTrackerPreparationRendered = new Map(); var _stageTrackerPreparationInline = []; @@ -14,7 +15,7 @@ for (const it of adopted) { if (!it) continue; const put = pr => { - const key = stageTrackerPreparationKey(it.repo, pr.number); + const key = stageTrackerPreparationKey(pr.repo || it.repo, pr.number); if (it.kind === 'pr' || !byKey.has(key)) byKey.set(key, { item: pr, host: it, nested: it.kind === 'issue' }); }; if (it.kind === 'pr') put(it); @@ -26,6 +27,44 @@ } return byKey; } + function stageTrackerPreparationContiguous(items, entryOf) { + const groups = new Map(), membership = new Map(); + items.forEach((item, index) => { + const entry = item && entryOf(item); + if (!entry) return; + if (!groups.has(entry.groupIndex)) groups.set(entry.groupIndex, []); + groups.get(entry.groupIndex).push({ item, index, sequence: entry.sequence }); + membership.set(index, entry.groupIndex); + }); + for (const members of groups.values()) members.sort((a, b) => a.sequence - b.sequence || a.index - b.index); + const emitted = new Set(), out = []; + items.forEach((item, index) => { + if (!membership.has(index)) { out.push(item); return; } + const group = membership.get(index); + if (emitted.has(group)) return; + emitted.add(group); + out.push(...groups.get(group).map(member => member.item)); + }); + return out; + } + function stageTrackerPreparationOrderRows(data, items, stages) { + const byHost = new Map(); + stageTrackerPreparationVisualModel(data, items, items, stages).forEach((group, groupIndex) => { + for (const entry of group.members) { + if (!entry.row || entry.location !== 'page') continue; + const host = entry.row.host; + if (typeof stageTrackerTrainKey === 'function' && stageTrackerTrainKey(host)) continue; + const key = stageTrackerItemKey(host), prior = byHost.get(key); + if (!prior || (prior.groupIndex === groupIndex && entry.sequence < prior.sequence)) { + byHost.set(key, { groupIndex, sequence: entry.sequence }); + } + } + }); + return stageTrackerPreparationContiguous(items, item => byHost.get(stageTrackerItemKey(item))); + } + function stageTrackerPreparationOrderLinked(linked, issue) { + return stageTrackerPreparationContiguous(linked, lp => stageTrackerPreparationEntry(stageTrackerLinkedPRItem(issue, lp))); + } function stageTrackerPreparationVisualModel(data, listedRows, pageRows, stages) { const known = stageTrackerPreparationRows(data && data.items, stages); const listed = stageTrackerPreparationRows(listedRows, stages); @@ -100,7 +139,7 @@ function stageTrackerPreparationRowInfo(item, stages) { if (!item || (typeof stageTrackerTrainKey === 'function' && stageTrackerTrainKey(item))) return null; const prs = item.kind === 'pr' ? [item] : item.kind === 'issue' - ? stageTrackerLinkedSorted(item, stages).map(lp => stageTrackerLinkedPRItem(item, lp)) : []; + ? stageTrackerPreparationOrderLinked(stageTrackerLinkedSorted(item, stages), item).map(lp => stageTrackerLinkedPRItem(item, lp)) : []; const members = prs.map(pr => stageTrackerPreparationEntry(pr)); if (!members.length || members.some(e => !e) || members.some(e => e.groupIndex !== members[0].groupIndex)) return null; const ordered = members.every((e, i) => !i || e.sequence > members[i - 1].sequence); @@ -113,7 +152,7 @@ const q = group.queue; const details = [`${q.repo || 'Repository unknown'} → ${q.base_ref || 'base unknown'}`, q.message || 'FIFO follows first qualifying admission, not PR age or guaranteed merge order.', - 'The connector joins adjacent preparation members in the selected display order; ticket positions still follow preparation FIFO.', + 'The recorded front is first, then waiting tickets in preparation FIFO. Complete issue/PR row units stay together; ticket positions remain explicit when related PRs share one issue.', 'Preparation is not CI, review approval, a ready train seat, or native queue membership.']; if (q.observed_at) details.push('Snapshot ' + q.observed_at); for (const e of group.members) { @@ -209,6 +248,7 @@ return eventHtml + `
${esc(parts.join(' · '))}
`; } function stageTrackerPreparationSubRows(linked, issue, stages, nowMs, ctx) { + linked = stageTrackerPreparationOrderLinked(linked, issue); const parent = stageTrackerPreparationRowInfo(issue, stages); const infos = linked.map(lp => stageTrackerPreparationRowInfo(stageTrackerLinkedPRItem(issue, lp), stages)); const seen = new Set(); diff --git a/src/pkg/dashboard/static-src/js/tracker-row-layout.js b/src/pkg/dashboard/static-src/js/tracker-row-layout.js index 3d5eec71ed..915ad6f341 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-layout.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-layout.js @@ -235,12 +235,12 @@ `; } return `
- ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(pr, stages, ctx) : ''} ${typeof stageTrackerRowToolsHtml === 'function' ? stageTrackerRowToolsHtml(pr) : ''}
${stageTrackerHeadColsHtml([ref], '', stageTrackerActedBadgeHtml(pr, nowMs) + stageTrackerChipsHtml(pr) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(pr, nowMs) : ''))}
+ ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(pr, stages, ctx) : ''}
    ${stageTrackerStripItems(pr, stages, { from: STAGE_TRACKER_PR_COLUMN }, nowMs, ctx)}
${stageTrackerSinceHtml(pr, nowMs)}
@@ -537,12 +537,12 @@ const trainKey = typeof stageTrackerTrainKey === 'function' ? stageTrackerTrainKey(item) : ''; if (typeof stageTrackerPreparationMark === 'function') stageTrackerPreparationMark(shown); return `
- ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(item, stages, ctx) : ''} ${stageTrackerRowToolsHtml(item)}
${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs, subRows) : ''))}
+ ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(item, stages, ctx) : ''}
    ${stageTrackerStripItems(shown, stages, range, nowMs, ctx)}
${stageTrackerSinceHtml(shown, nowMs)}
${stageTrackerCurrentStageHtml(shown, stages, range, nowMs)}${typeof stageTrackerPreparationCommentHtml === 'function' ? stageTrackerPreparationCommentHtml(shown, ctx, stageTrackerItemKey(item)) : typeof stageTrackerEventHtml === 'function' ? stageTrackerEventHtml(stageTrackerItemKey(item), ctx) : ''}${typeof stageTrackerExecutionHtml === 'function' ? stageTrackerExecutionHtml(shown) : ''}${typeof stageTrackerReviewNotesHtml === 'function' ? stageTrackerReviewNotesHtml(item, ctx) : ''}${subs} diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index e515fe4b61..cc2d6383f5 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1544,23 +1544,28 @@ .ham-train-head + .ham-row.ham-train { border-top: 0; } .ham-preparation-head { flex-wrap: wrap; } .ham-row.ham-preparation-member::before { top: calc(-1 * var(--line-width)); } + .ham-row.ham-preparation-member.ham-train-last::before { bottom: 0; } + .ham-row.ham-preparation-member::after { display: none; } .ham-preparation-head .ham-train-chip { white-space: normal; } .ham-preparation-head .ham-preparation-help { background: none; border-color: var(--ham-train-accent); color: var(--muted); } .ham-preparation-help::before { content: '?'; } .config-info.ham-preparation-node { position: absolute; left: calc(var(--sp-2) - 2px); top: calc(50% - var(--sp-2)); width: calc(var(--sp-2) * 2); height: calc(var(--sp-2) * 2); margin: 0; padding: 0; border: 0; background: transparent; z-index: 1; } + .ham-row.ham-preparation-member > .ham-strip-row > .ham-preparation-node { left: calc(var(--sp-2) - var(--sp-5) - 2px); } + .ham-preparation-node::before { content: none; } + .ham-preparation-node::after { content: ''; position: absolute; left: 1px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ham-train-accent); } + .ham-train-front > .ham-strip-row > .ham-preparation-node::after { background: var(--text); } .ham-preparation-node:focus-visible { outline: var(--focus-ring-width) solid var(--ham-train-accent); outline-offset: var(--sp-1); } .ham-row.ham-preparation-gap::before, .ham-sub.ham-preparation-member.ham-preparation-gap::before { border-left-style: dashed; } - .ham-row.ham-preparation-unverified::after, .ham-sub.ham-preparation-member.ham-preparation-unverified::after { background: var(--bg); box-shadow: 0 0 0 var(--line-width) var(--ham-train-accent); } + .ham-preparation-unverified > .ham-strip-row > .ham-preparation-node::after { background: var(--bg); box-shadow: 0 0 0 var(--line-width) var(--ham-train-accent); } .ham-preparation-comment { animation: none; } /* Mixed issue trees keep their existing children; only actual prep PRs receive a rail, at the original gutter offset minus the parent inset. */ .ham-row > .ham-preparation-head { margin-left: calc(-1 * var(--sp-2)); } .ham-sub.ham-preparation-member { position: relative; --ham-train-accent: var(--amber); } .ham-sub.ham-preparation-member::before { content: ''; position: absolute; left: 2px; top: calc(-1 * var(--sp-3) - var(--sp-2)); bottom: 0; border-left: var(--line-width) solid var(--ham-train-accent); } - .ham-sub.ham-preparation-member.ham-train-last::before { bottom: 50%; } - .ham-sub.ham-preparation-member::after { content: ''; position: absolute; left: -1px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ham-train-accent); } - .ham-sub.ham-preparation-member.ham-train-front::after { background: var(--text); } + .ham-sub.ham-preparation-member.ham-train-last::before { bottom: 0; } .ham-sub .config-info.ham-preparation-node { left: calc(-1 * var(--sp-1)); } + .ham-sub .ham-preparation-node::after { left: 3px; } .ham-group-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; cursor: pointer; } .ham-group-toggle:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); } .ham-group-toggle:focus-visible { outline: var(--focus-ring-width) solid var(--line-strong); outline-offset: 1px; } @@ -17848,12 +17853,12 @@

Where to get help

`; } return `
- ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(pr, stages, ctx) : ''} ${typeof stageTrackerRowToolsHtml === 'function' ? stageTrackerRowToolsHtml(pr) : ''}
${stageTrackerHeadColsHtml([ref], '', stageTrackerActedBadgeHtml(pr, nowMs) + stageTrackerChipsHtml(pr) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(pr, nowMs) : ''))}
+ ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(pr, stages, ctx) : ''}
    ${stageTrackerStripItems(pr, stages, { from: STAGE_TRACKER_PR_COLUMN }, nowMs, ctx)}
${stageTrackerSinceHtml(pr, nowMs)}
@@ -18150,12 +18155,12 @@

Where to get help

const trainKey = typeof stageTrackerTrainKey === 'function' ? stageTrackerTrainKey(item) : ''; if (typeof stageTrackerPreparationMark === 'function') stageTrackerPreparationMark(shown); return `
- ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(item, stages, ctx) : ''} ${stageTrackerRowToolsHtml(item)}
${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs, subRows) : ''))}
+ ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(item, stages, ctx) : ''}
    ${stageTrackerStripItems(shown, stages, range, nowMs, ctx)}
${stageTrackerSinceHtml(shown, nowMs)}
${stageTrackerCurrentStageHtml(shown, stages, range, nowMs)}${typeof stageTrackerPreparationCommentHtml === 'function' ? stageTrackerPreparationCommentHtml(shown, ctx, stageTrackerItemKey(item)) : typeof stageTrackerEventHtml === 'function' ? stageTrackerEventHtml(stageTrackerItemKey(item), ctx) : ''}${typeof stageTrackerExecutionHtml === 'function' ? stageTrackerExecutionHtml(shown) : ''}${typeof stageTrackerReviewNotesHtml === 'function' ? stageTrackerReviewNotesHtml(item, ctx) : ''}${subs} @@ -19703,7 +19708,8 @@

All labels

navCountDelta(document.getElementById(id), null); } } - // Preparation decorates the existing rows; it never sorts or admits them. + // Keep complete issue/PR row units together in recorded preparation order. + // This changes display order only, never admission or pipeline stage. var _stageTrackerPreparationShown = new Map(); var _stageTrackerPreparationRendered = new Map(); var _stageTrackerPreparationInline = []; @@ -19719,7 +19725,7 @@

All labels

for (const it of adopted) { if (!it) continue; const put = pr => { - const key = stageTrackerPreparationKey(it.repo, pr.number); + const key = stageTrackerPreparationKey(pr.repo || it.repo, pr.number); if (it.kind === 'pr' || !byKey.has(key)) byKey.set(key, { item: pr, host: it, nested: it.kind === 'issue' }); }; if (it.kind === 'pr') put(it); @@ -19731,6 +19737,44 @@

All labels

} return byKey; } + function stageTrackerPreparationContiguous(items, entryOf) { + const groups = new Map(), membership = new Map(); + items.forEach((item, index) => { + const entry = item && entryOf(item); + if (!entry) return; + if (!groups.has(entry.groupIndex)) groups.set(entry.groupIndex, []); + groups.get(entry.groupIndex).push({ item, index, sequence: entry.sequence }); + membership.set(index, entry.groupIndex); + }); + for (const members of groups.values()) members.sort((a, b) => a.sequence - b.sequence || a.index - b.index); + const emitted = new Set(), out = []; + items.forEach((item, index) => { + if (!membership.has(index)) { out.push(item); return; } + const group = membership.get(index); + if (emitted.has(group)) return; + emitted.add(group); + out.push(...groups.get(group).map(member => member.item)); + }); + return out; + } + function stageTrackerPreparationOrderRows(data, items, stages) { + const byHost = new Map(); + stageTrackerPreparationVisualModel(data, items, items, stages).forEach((group, groupIndex) => { + for (const entry of group.members) { + if (!entry.row || entry.location !== 'page') continue; + const host = entry.row.host; + if (typeof stageTrackerTrainKey === 'function' && stageTrackerTrainKey(host)) continue; + const key = stageTrackerItemKey(host), prior = byHost.get(key); + if (!prior || (prior.groupIndex === groupIndex && entry.sequence < prior.sequence)) { + byHost.set(key, { groupIndex, sequence: entry.sequence }); + } + } + }); + return stageTrackerPreparationContiguous(items, item => byHost.get(stageTrackerItemKey(item))); + } + function stageTrackerPreparationOrderLinked(linked, issue) { + return stageTrackerPreparationContiguous(linked, lp => stageTrackerPreparationEntry(stageTrackerLinkedPRItem(issue, lp))); + } function stageTrackerPreparationVisualModel(data, listedRows, pageRows, stages) { const known = stageTrackerPreparationRows(data && data.items, stages); const listed = stageTrackerPreparationRows(listedRows, stages); @@ -19805,7 +19849,7 @@

All labels

function stageTrackerPreparationRowInfo(item, stages) { if (!item || (typeof stageTrackerTrainKey === 'function' && stageTrackerTrainKey(item))) return null; const prs = item.kind === 'pr' ? [item] : item.kind === 'issue' - ? stageTrackerLinkedSorted(item, stages).map(lp => stageTrackerLinkedPRItem(item, lp)) : []; + ? stageTrackerPreparationOrderLinked(stageTrackerLinkedSorted(item, stages), item).map(lp => stageTrackerLinkedPRItem(item, lp)) : []; const members = prs.map(pr => stageTrackerPreparationEntry(pr)); if (!members.length || members.some(e => !e) || members.some(e => e.groupIndex !== members[0].groupIndex)) return null; const ordered = members.every((e, i) => !i || e.sequence > members[i - 1].sequence); @@ -19818,7 +19862,7 @@

All labels

const q = group.queue; const details = [`${q.repo || 'Repository unknown'} → ${q.base_ref || 'base unknown'}`, q.message || 'FIFO follows first qualifying admission, not PR age or guaranteed merge order.', - 'The connector joins adjacent preparation members in the selected display order; ticket positions still follow preparation FIFO.', + 'The recorded front is first, then waiting tickets in preparation FIFO. Complete issue/PR row units stay together; ticket positions remain explicit when related PRs share one issue.', 'Preparation is not CI, review approval, a ready train seat, or native queue membership.']; if (q.observed_at) details.push('Snapshot ' + q.observed_at); for (const e of group.members) { @@ -19914,6 +19958,7 @@

All labels

return eventHtml + `
${esc(parts.join(' · '))}
`; } function stageTrackerPreparationSubRows(linked, issue, stages, nowMs, ctx) { + linked = stageTrackerPreparationOrderLinked(linked, issue); const parent = stageTrackerPreparationRowInfo(issue, stages); const infos = linked.map(lp => stageTrackerPreparationRowInfo(stageTrackerLinkedPRItem(issue, lp), stages)); const seen = new Set(); @@ -20139,7 +20184,8 @@

All labels

// Repo chips ride the setting against how many repos the payload spans. if (stageTrackerRepoChipOn(stageTrackerRepoChipSetting(), repos.length)) ctx.repoChips = { primary: stageTrackerPrimaryRepo(), active: f.repo }; const visible = stageTrackerVisible(d.items, f, ctx); - const ordered = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f)); + const sorted = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f)); + const ordered = typeof stageTrackerPreparationOrderRows === 'function' ? stageTrackerPreparationOrderRows(d, sorted, stages) : sorted; // A TV display (display=1&density=tv) shows the rows that fit the // screen, ungrouped, with "+N more" in place of the pager. const tv = typeof stageTrackerDisplayTv === 'function' && stageTrackerDisplayTv(); diff --git a/src/scripts/fixtures/dashboard-preparation-rail.mjs b/src/scripts/fixtures/dashboard-preparation-rail.mjs index 8fe3885236..d62f81d775 100644 --- a/src/scripts/fixtures/dashboard-preparation-rail.mjs +++ b/src/scripts/fixtures/dashboard-preparation-rail.mjs @@ -16,12 +16,16 @@ export function preparationRailLayoutFixture() { const append = (items, owner, waiting) => { const queue = { repo, base_ref: 'v5', state: 'observed', owner: ticket(owner, 'owner'), waiting: waiting.map(p => ticket(p, 'waiting')) }; const data = { items, base_preparation: [queue] }; + items = stageTrackerPreparationOrderRows(data, items, []); stageTrackerPreparationVisualSync(data, items, items, [], nowMs); const ctx = { nowMs, items, events: {}, noteTuck: false, sharedPRs: {}, workers: {} }; const rows = items.map((item, i) => ({ key: stageTrackerItemKey(item), html: stageTrackerRowHtml(item, [], { ...ctx, prevRow: items[i - 1], nextRow: items[i + 1] }) })); const block = document.createElement('div'); - block.innerHTML = stageTrackerPreparationInlineRows(rows, items, []).map(row => row.html).join(''); + const rendered = stageTrackerPreparationInlineRows(rows, items, []); + block.innerHTML = rendered.map(row => row.html).join(''); + // The production reconciler stamps keys separately from the row renderer. + [...block.children].forEach((element, index) => { element.dataset.hamKey = rendered[index].key; }); host.appendChild(block); return block; }; @@ -43,25 +47,50 @@ export function preparationRailLayoutFixture() { for (let i = 0; i < members.length; i++) { check(lines[i].content !== 'none' && lines[i].border === 'solid', name + ': original solid connector ' + i); check(members[i].classList.contains('ham-train-last') === (i === members.length - 1), name + ': only final member ends rail'); - if (i === members.length - 1) continue; - check(lines[i].bottom >= lines[i + 1].top, name + ': rail crosses caption, padding and inter-row gap'); - check(Math.abs(lines[i].x - lines[i + 1].x) < 1, name + ': aligned rail gutter'); + const box = members[i].getBoundingClientRect(); + check(Math.abs(lines[i].bottom - box.bottom) < 1, name + ': full member height including final caption and padding'); + const node = members[i].querySelector(':scope > .ham-strip-row > .ham-preparation-node'); + const strip = members[i].querySelector(':scope > .ham-strip-row'); + if (node && strip) { + const dot = getComputedStyle(node, '::after'), hit = node.getBoundingClientRect(), anchor = strip.getBoundingClientRect(); + const center = hit.top + Number.parseFloat(dot.top) + Number.parseFloat(dot.height) / 2; + check(Math.abs(center - (anchor.top + anchor.height / 2)) < 1, name + ': dot stays on item anchor, not comment midpoint'); + } else check(false, name + ': actual member dot belongs to its strip anchor'); const caption = members[i].querySelector('.ham-preparation-comment'); check(caption && caption.getBoundingClientRect().height > 0, name + ': real expanded caption'); if (caption) check(lines[i].bottom >= caption.getBoundingClientRect().bottom, name + ': rail spans full caption'); + if (i === members.length - 1) continue; + check(lines[i].bottom >= lines[i + 1].top, name + ': rail crosses caption, padding and inter-row gap'); + check(Math.abs(lines[i].x - lines[i + 1].x) < 1, name + ': aligned rail gutter'); } }; try { document.getElementById(host.id)?.remove(); const owner = pr(45, 70), first = pr(9, 50), second = pr(2, 70); const roots = append([second, first, owner], owner, [first, second]); + const singleOwner = pr(245, 50), single = append([singleOwner], singleOwner, []); const nestedOwner = pr(145, 70), nestedWaiter = pr(109, 50), unrelated = pr(180, 90); const issue = { kind: 'issue', repo, number: 500, stage: 40, title: 'Preserved mixed issue tree', linked_prs: [unrelated, nestedOwner, nestedWaiter] }; const nested = append([issue], nestedOwner, [nestedWaiter]); document.body.appendChild(host); inspect(roots, '.ham-row.ham-preparation-member', 'root reverse-FIFO rows', 3); + check(roots.querySelector('.ham-preparation-member')?.dataset.hamKey === stageTrackerItemKey(owner), 'verified front is first despite scrambled source sort'); inspect(nested, '.ham-sub.ham-preparation-member', 'nested PRs with expanded captions', 2); + inspect(single, '.ham-row.ham-preparation-member', 'single-member train with multiline caption', 1); + for (const [block, selector, name, count] of [ + [roots, '.ham-row.ham-preparation-member', 'last root dynamic comment', 3], + [nested, '.ham-sub.ham-preparation-member', 'last nested dynamic comment', 2], + [single, '.ham-row.ham-preparation-member', 'single dynamic comment', 1], + ]) { + const last = [...block.querySelectorAll(selector)].at(-1), before = last.getBoundingClientRect().height; + const comment = document.createElement('div'); + comment.className = 'cue-event ham-preparation-comment'; + comment.textContent = 'New live commentary must extend the final rail without moving the member anchor. '.repeat(24); + last.appendChild(comment); + check(last.getBoundingClientRect().height > before, name + ': layout really grew after commentary update'); + inspect(block, selector, name, count); + } const nonmember = nested.querySelector('[data-ham-sub-key="' + stageTrackerItemKey(unrelated) + '"]'); check(nonmember && !nonmember.classList.contains('ham-preparation-member'), 'unrelated child has no preparation membership'); host.scrollIntoView(); From ebf49d952a8643d06d47e7607f1920b8ae7ae2ba Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Sat, 31 Oct 2026 08:03:16 -0400 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=90=9B=20fix:=20deduplicate=20prepara?= =?UTF-8?q?tion=20captions=20and=20refresh=20Chrome=20package=20metadata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- .github/workflows/dashboard-mobile-shots.yml | 1 + .../stage_tracker_preparation_visual.test.js | 12 ++++++++++++ .../dashboard/static-src/js/tracker-preparation.js | 5 +++-- src/pkg/dashboard/static/index.html | 5 +++-- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dashboard-mobile-shots.yml b/.github/workflows/dashboard-mobile-shots.yml index 0d6a6a0105..f55eb1242c 100644 --- a/.github/workflows/dashboard-mobile-shots.yml +++ b/.github/workflows/dashboard-mobile-shots.yml @@ -38,6 +38,7 @@ jobs: continue-on-error: true run: | set -euo pipefail + sudo apt-get update out="$(sudo env "PATH=$PATH" npx --yes @puppeteer/browsers@2 install chrome@stable --install-deps --path "$RUNNER_TEMP/chrome-for-testing" | tail -n 1)" bin="${out#* }" test -x "$bin" diff --git a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js index e8a834991d..e8fcbdd716 100644 --- a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js +++ b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js @@ -212,6 +212,18 @@ test('off-page owner remains truthful in compact header/help with real waiting o assert.equal(rootKeys(rows).length, 1); }); +test('preparation commentary deduplicates the exact canonical clause, not a different owner-number prefix', () => { + const { ctx } = load(), f = fixture(); + f.first.caption = 'Review swarm requested; waiting for a verdict on the current head — queued for base refresh behind PR #45'; + let html = rootRow(render(ctx, f, [f.owner, f.first, f.second]), 9).html; + let body = html.match(/ham-preparation-comment">([^<]*)/)[1]; + assert.equal((body.match(/queued for base refresh behind PR #45/g) || []).length, 1); + f.first.caption = 'Review pending — queued for base refresh behind PR #4'; + html = rootRow(render(ctx, f, [f.owner, f.first, f.second]), 9).html; + body = html.match(/ham-preparation-comment">([^<]*)/)[1]; + assert.match(body, /behind PR #4 · queued for base refresh behind PR #45/); +}); + test('release/handoff clears former owner decoration and pill suppression; readmission preserves durable FIFO', () => { const { ctx } = load(), f = fixture(); render(ctx, f); diff --git a/src/pkg/dashboard/static-src/js/tracker-preparation.js b/src/pkg/dashboard/static-src/js/tracker-preparation.js index 263b63a8e7..b810e82e40 100644 --- a/src/pkg/dashboard/static-src/js/tracker-preparation.js +++ b/src/pkg/dashboard/static-src/js/tracker-preparation.js @@ -240,9 +240,10 @@ && eventHtml && !eventHtml.includes('cue-event-tucked'); const parts = caption && !captionVisible ? [caption] : []; if (!caption) parts.push('Current pipeline blocker unknown'); - parts.push(e.state === 'unverified' + const preparation = e.state === 'unverified' ? stageTrackerPreparationPlace(e) + ' · ' + (e.ticket.detail || 'current identity or eligibility unknown') - : e.role === 'owner' ? 'preparing base' : 'queued for base refresh' + (e.ticket.behind ? ' behind PR #' + e.ticket.behind : ' · owner unknown')); + : e.role === 'owner' ? 'preparing base' : 'queued for base refresh' + (e.ticket.behind ? ' behind PR #' + e.ticket.behind : ' · owner unknown'); + if (!caption.split(/\s+[·—]\s+/).includes(preparation)) parts.push(preparation); parts.push('ticket age ' + stageTrackerPreparationAge(e.ticket, _stageTrackerPreparationNow)); if (e.row.nested) parts.push('shown under issue #' + e.row.host.number); return eventHtml + `
${esc(parts.join(' · '))}
`; diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 698fce685c..f8f7978e67 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -19957,9 +19957,10 @@

All labels

&& eventHtml && !eventHtml.includes('cue-event-tucked'); const parts = caption && !captionVisible ? [caption] : []; if (!caption) parts.push('Current pipeline blocker unknown'); - parts.push(e.state === 'unverified' + const preparation = e.state === 'unverified' ? stageTrackerPreparationPlace(e) + ' · ' + (e.ticket.detail || 'current identity or eligibility unknown') - : e.role === 'owner' ? 'preparing base' : 'queued for base refresh' + (e.ticket.behind ? ' behind PR #' + e.ticket.behind : ' · owner unknown')); + : e.role === 'owner' ? 'preparing base' : 'queued for base refresh' + (e.ticket.behind ? ' behind PR #' + e.ticket.behind : ' · owner unknown'); + if (!caption.split(/\s+[·—]\s+/).includes(preparation)) parts.push(preparation); parts.push('ticket age ' + stageTrackerPreparationAge(e.ticket, _stageTrackerPreparationNow)); if (e.row.nested) parts.push('shown under issue #' + e.row.host.number); return eventHtml + `
${esc(parts.join(' · '))}
`; From b2d012386230384ae85e3d5a298d10ab8ab774c3 Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Sat, 31 Oct 2026 08:09:20 -0400 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=90=9B=20test:=20load=20production=20?= =?UTF-8?q?theme=20sidecars=20before=20measuring=20preparation=20rails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- src/scripts/dashboard-mobile-shots.mjs | 12 ++++++++++++ src/scripts/fixtures/dashboard-preparation-rail.mjs | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/scripts/dashboard-mobile-shots.mjs b/src/scripts/dashboard-mobile-shots.mjs index d9b93b2944..99ca72b8bc 100644 --- a/src/scripts/dashboard-mobile-shots.mjs +++ b/src/scripts/dashboard-mobile-shots.mjs @@ -317,6 +317,17 @@ async function main() { for (const theme of themes) { await send('Page.navigate', { url: `file://${process.cwd()}/src/pkg/dashboard/static/index.html` }); await sleep(PAGE_SETTLE_MS); + // Absolute production URLs cannot load from file://. Use the same + // checked-in sidecars rather than silently testing without tokens. + await evaluate(`Promise.all(${JSON.stringify(['tokens.css', 'components.css'].map(name => ({ + name, url: `file://${process.cwd()}/src/pkg/dashboard/static/${name}`, + })))}.map(({name, url}) => new Promise((resolve, reject) => { + const link = document.querySelector('link[href="/' + name + '"]'); + if (!link) return reject(new Error('Missing production stylesheet ' + name)); + link.onload = () => resolve(true); + link.onerror = () => reject(new Error('Cannot load production stylesheet ' + name)); + link.href = url; + })))`); await evaluate(setThemeJS(theme)); const sectionIDs = await evaluate(collapseAllJS); @@ -329,6 +340,7 @@ async function main() { states.push({ name: 'terminal', run: async () => { await evaluate(collapseAllJS); return evaluate(terminalJS); } }); states.push({ name: 'preparation-rail', run: async () => { await evaluate(collapseAllJS); + if (!await evaluate(expandOneJS('activity-monitor-section'))) throw new Error('Cannot expand actual Activity Monitor'); const result = await evaluate('(' + preparationRailLayoutFixture.toString() + ')()'); preparationRailReport.push({ viewport: vp.name, theme, ...result }); if (result.failures.length) throw new Error('Preparation rail layout: ' + result.failures.join('; ')); diff --git a/src/scripts/fixtures/dashboard-preparation-rail.mjs b/src/scripts/fixtures/dashboard-preparation-rail.mjs index d62f81d775..2e589b10fe 100644 --- a/src/scripts/fixtures/dashboard-preparation-rail.mjs +++ b/src/scripts/fixtures/dashboard-preparation-rail.mjs @@ -73,7 +73,9 @@ export function preparationRailLayoutFixture() { const issue = { kind: 'issue', repo, number: 500, stage: 40, title: 'Preserved mixed issue tree', linked_prs: [unrelated, nestedOwner, nestedWaiter] }; const nested = append([issue], nestedOwner, [nestedWaiter]); - document.body.appendChild(host); + const panel = document.getElementById('activity-monitor-panel'); + if (!panel) throw new Error('Actual Activity Monitor panel is missing'); + panel.appendChild(host); inspect(roots, '.ham-row.ham-preparation-member', 'root reverse-FIFO rows', 3); check(roots.querySelector('.ham-preparation-member')?.dataset.hamKey === stageTrackerItemKey(owner), 'verified front is first despite scrambled source sort'); inspect(nested, '.ham-sub.ham-preparation-member', 'nested PRs with expanded captions', 2); From a21527dc1943665cc2175e4899590f98236b4d0a Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Sat, 31 Oct 2026 08:13:36 -0400 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=90=9B=20fix:=20center=20preparation?= =?UTF-8?q?=20dots=20within=20real=20mobile=20hit=20targets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- src/pkg/dashboard/static-src/css/tracker.css | 2 +- src/pkg/dashboard/static/index.html | 2 +- src/scripts/fixtures/dashboard-preparation-rail.mjs | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 761a6cad38..424ec809e8 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -212,7 +212,7 @@ .ham-preparation-head .ham-train-chip { white-space: normal; } .ham-preparation-head .ham-preparation-help { background: none; border-color: var(--ham-train-accent); color: var(--muted); } .ham-preparation-help::before { content: '?'; } - .config-info.ham-preparation-node { position: absolute; left: calc(var(--sp-2) - 2px); top: calc(50% - var(--sp-2)); width: calc(var(--sp-2) * 2); height: calc(var(--sp-2) * 2); margin: 0; padding: 0; border: 0; background: transparent; z-index: 1; } + .config-info.ham-preparation-node { position: absolute; left: calc(var(--sp-2) - 2px); top: 50%; transform: translateY(-50%); width: calc(var(--sp-2) * 2); height: calc(var(--sp-2) * 2); margin: 0; padding: 0; border: 0; background: transparent; z-index: 1; } .ham-row.ham-preparation-member > .ham-strip-row > .ham-preparation-node { left: calc(var(--sp-2) - var(--sp-5) - 2px); } .ham-preparation-node::before { content: none; } .ham-preparation-node::after { content: ''; position: absolute; left: 1px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ham-train-accent); } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index f8f7978e67..593ca2bf03 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1549,7 +1549,7 @@ .ham-preparation-head .ham-train-chip { white-space: normal; } .ham-preparation-head .ham-preparation-help { background: none; border-color: var(--ham-train-accent); color: var(--muted); } .ham-preparation-help::before { content: '?'; } - .config-info.ham-preparation-node { position: absolute; left: calc(var(--sp-2) - 2px); top: calc(50% - var(--sp-2)); width: calc(var(--sp-2) * 2); height: calc(var(--sp-2) * 2); margin: 0; padding: 0; border: 0; background: transparent; z-index: 1; } + .config-info.ham-preparation-node { position: absolute; left: calc(var(--sp-2) - 2px); top: 50%; transform: translateY(-50%); width: calc(var(--sp-2) * 2); height: calc(var(--sp-2) * 2); margin: 0; padding: 0; border: 0; background: transparent; z-index: 1; } .ham-row.ham-preparation-member > .ham-strip-row > .ham-preparation-node { left: calc(var(--sp-2) - var(--sp-5) - 2px); } .ham-preparation-node::before { content: none; } .ham-preparation-node::after { content: ''; position: absolute; left: 1px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--ham-train-accent); } diff --git a/src/scripts/fixtures/dashboard-preparation-rail.mjs b/src/scripts/fixtures/dashboard-preparation-rail.mjs index 2e589b10fe..06950a23f4 100644 --- a/src/scripts/fixtures/dashboard-preparation-rail.mjs +++ b/src/scripts/fixtures/dashboard-preparation-rail.mjs @@ -54,7 +54,10 @@ export function preparationRailLayoutFixture() { if (node && strip) { const dot = getComputedStyle(node, '::after'), hit = node.getBoundingClientRect(), anchor = strip.getBoundingClientRect(); const center = hit.top + Number.parseFloat(dot.top) + Number.parseFloat(dot.height) / 2; - check(Math.abs(center - (anchor.top + anchor.height / 2)) < 1, name + ': dot stays on item anchor, not comment midpoint'); + lines[i].dot = { top: dot.top, height: dot.height, hitTop: hit.top, hitHeight: hit.height, + center, anchorTop: anchor.top, anchorHeight: anchor.height, transform: dot.transform }; + check(Math.abs(center - (anchor.top + anchor.height / 2)) < 1, + name + ': dot stays on item anchor, not comment midpoint: ' + JSON.stringify(lines[i].dot)); } else check(false, name + ': actual member dot belongs to its strip anchor'); const caption = members[i].querySelector('.ham-preparation-comment'); check(caption && caption.getBoundingClientRect().height > 0, name + ': real expanded caption'); From e651209d292b7d9a15fa9551ee5bc6f230e25173 Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Sat, 31 Oct 2026 08:37:15 -0400 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=90=9B=20fix:=20align=20nested=20rail?= =?UTF-8?q?=20assertion=20with=20front-first=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- .../dashboard/stage_tracker_preparation_visual.test.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js index e8fcbdd716..033dc74fbd 100644 --- a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js +++ b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js @@ -453,10 +453,12 @@ test('expanded captions and adjacent nested members share a full-height connecto assert.equal((html.match(/ham-train-last/g) || []).length, 1); assert.doesNotMatch(html, /continuation/); assert.match(html, /class="ham-sub" data-ham-kind="pr" data-ham-stage="90"/); - assert.match(html, /ham-preparation-member" data-ham-kind="pr" data-ham-stage="70"/); - assert.match(html, /ham-preparation-member ham-train-front ham-train-last" data-ham-kind="pr" data-ham-stage="50"/); + assert.match(html, /ham-preparation-member ham-train-last" data-ham-kind="pr" data-ham-stage="70"/); + assert.match(html, /ham-preparation-member ham-train-front" data-ham-kind="pr" data-ham-stage="50"/); assert.match(html, /Expanded current-head CI and review detail\./); - assert.ok(html.indexOf('/pr#80') < html.indexOf('/pr#9')); + const childKey = number => html.indexOf('data-ham-sub-key="' + REPO + '/pr#' + number + '"'); + assert.ok(childKey(80) < childKey(45)); + assert.ok(childKey(45) < childKey(9)); const css = fs.readFileSync(path.join(__dirname, 'static-src/css/tracker.css'), 'utf8'); assert.match(css, /\.ham-row\.ham-preparation-member::before \{ top: calc\(-1 \* var\(--line-width\)\)/); });