diff --git a/changelog.d/fixed-16552-pushed-head-ci-track.md b/changelog.d/fixed-16552-pushed-head-ci-track.md new file mode 100644 index 0000000000..e5825b5ef8 --- /dev/null +++ b/changelog.d/fixed-16552-pushed-head-ci-track.md @@ -0,0 +1 @@ +- The Activity Monitor keeps the CI track lit on a 071/072 row whose pushed or checking head has checks running, instead of muting it as waiting on the contributor ([#16552](https://github.com/hivecommons/hive/issues/16552)). diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 24e11ebcd1..eb7fb9c78a 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -631,6 +631,17 @@ test('known and original chevrons keep full long text inside a shared one-line c assert.match(css, /\.ham-row > \.ham-strip-row, \.ham-sub > \.ham-strip-row, \.ham-cols > \.ham-strip-row \{ overflow-x: auto; \}/); }); +test('a 071/072 row with a pushed or checking head keeps its running CI track lit (#16552)', () => { + for (const stage of [71, 72]) { + for (const state of ['pushed', 'checking']) { + const cells = physicalTracks(livePR({ stage, display_column: 50, push: { state }, ci_activity: activity('running', 'CI running · 1/2 checks done', true) })); + assert.match(cells.ci, /ham-activity-track active/, stage + '/' + state + ': checks run on the pushed head'); + } + const parked = physicalTracks(livePR({ stage, display_column: 50, ci_activity: activity('running', 'CI running · 1/2 checks done', true) })); + assert.doesNotMatch(parked.ci, /ham-activity-track active/, stage + ': no push in flight stays settled, waiting on the contributor'); + } +}); + test('real source repair can show three concurrent activities without naming a generic worker as reviewer', () => { const row = fs.readFileSync(path.join(root, 'tracker-row.js'), 'utf8'); const definitions = globals + ` diff --git a/src/pkg/dashboard/static-src/js/tracker-row-strip.js b/src/pkg/dashboard/static-src/js/tracker-row-strip.js index e45b818c7b..dd1529cfa5 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -102,7 +102,9 @@ if (!item) return false; if (item.needs_human || item.on_hold || item.hold) return true; const stage = Number(item.stage); - if (stage === 71 || stage === 72) return true; + // A freshly pushed head is in motion: checks run on it, matching + // tracker-row-anchor's column-50 anchor (hivecommons/hive#16552). + if ((stage === 71 || stage === 72) && !(item.push && ['pushed', 'checking'].includes(item.push.state))) return true; const code = item.code_activity; return !!(code && code.head === item.head && code.state === 'waiting_owner'); } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 123c31b131..6a2c4eb941 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -17915,7 +17915,9 @@

Where to get help

if (!item) return false; if (item.needs_human || item.on_hold || item.hold) return true; const stage = Number(item.stage); - if (stage === 71 || stage === 72) return true; + // A freshly pushed head is in motion: checks run on it, matching + // tracker-row-anchor's column-50 anchor (hivecommons/hive#16552). + if ((stage === 71 || stage === 72) && !(item.push && ['pushed', 'checking'].includes(item.push.state))) return true; const code = item.code_activity; return !!(code && code.head === item.head && code.state === 'waiting_owner'); } diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js b/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js index db59ece36e..ab020815a5 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js @@ -271,8 +271,12 @@ assert(Math.abs((text.left + text.right) / 2 - (bounds.left + bounds.right) / 2) <= glyphTolerance, name + 'caption text is horizontally centred within its copy box: ' + JSON.stringify({ text, copy: { left: bounds.left, right: bounds.right } })); } + // A `display: contents` wrapper (.ham-active-ico-wrap) has no box of + // its own: its children are the flex items that take space, so the + // union measures them, not the box-less wrapper. + const boxes = el => getComputedStyle(el).display === 'contents' ? [...el.children].flatMap(boxes) : [el]; const group = copy.parentElement === info - ? [...info.children].filter(child => visible(child) && !child.classList.contains('config-tooltip')).map(rect) + ? [...info.children].flatMap(boxes).filter(child => visible(child) && !child.classList.contains('config-tooltip')).map(rect) : [bounds]; const union = { left: Math.min(...group.map(box => box.left)), right: Math.max(...group.map(box => box.right)), top: Math.min(...group.map(box => box.top)), bottom: Math.max(...group.map(box => box.bottom)) };