m[1].split(' ').includes('active'));
+ assert.ok(active.length <= 2, 'row fixture exceeds two active chevrons: ' + JSON.stringify(item));
+ }
+ return row;
+};
// A row is a title line, its strip, then zero or more nested PR sub-rows.
const strips = (row) => row.split('aria-label="Pipeline progress"').slice(1);
const strip = (row) => strips(row)[0].split(' 0 || Number(a.checks_queued) > 0))) return '';
const n = k => matches ? Number(a[k]) || 0 : 0;
if (kind === 'ci') {
const total = n('checks_total');
@@ -95,14 +95,37 @@
return !!(hive || item.stage === 74 || item.adopted_by);
}
+ // Only observed current-head work earns amber. Ownership waits suppress
+ // both tracks, even if their last observation still says running.
+ function stageTrackerActivityState(item, nowMs) {
+ const code = item.code_activity;
+ const mods = Array.isArray(item.modifiers) ? item.modifiers : [];
+ const ownerWait = !code && [71, 72].includes(Number(item.stage)) &&
+ !(item.push && ['pushed', 'checking'].includes(item.push.state));
+ const waitingOnPerson = !!(item.hold || item.on_hold || item.needs_human ||
+ mods.some(m => ['hold', 'needs-human', 'needs-decision', 'unauthorized'].includes(m)) ||
+ (code && code.head === item.head && code.state === 'waiting_owner') ||
+ ownerWait || [45, 85, 90].includes(Number(item.stage)));
+ const clock = Number(nowMs) || Date.now();
+ const running = kind => {
+ const a = item[kind + '_activity'];
+ const observed = Date.parse(a && a.observed_at || '');
+ if (Number(item.stage) >= 110 || waitingOnPerson || !a || !item.head || a.head !== item.head ||
+ !Number.isFinite(observed) || observed > clock || clock - observed > 2 * 60 * 1000) return false;
+ return kind === 'ci'
+ ? !!(a.active || Number(a.checks_running) > 0 || Number(a.checks_queued) > 0 || ['running', 'queued'].includes(a.state))
+ : ['reviewing', 'adjudicating', 'assigned'].includes(a.state);
+ };
+ return { waitingOnPerson, ci: running('ci'), review: running('review') };
+ }
+
// Evidence is supplied independently by the backend. A native 050 label
// cannot say who reviews, whether checks run, or whether an author codes.
// The chevron wears its glyph plus the count words from
// stageTrackerTrackWord (hivecommons/hive#16484). Style follows the
- // track's own state on the current head: in progress = the full active
- // fill (both tracks may be lit at once; the words disambiguate), done =
- // the passed-stage style, a finding = the failing style, not started =
- // the empty chevron with the glyph alone. Freshness gates only the pulse.
+ // track's own state on the current head: running/queued = active, done =
+ // the passed-stage style, a finding = failing, missing = pending with
+ // its words. Stale work keeps its words without claiming current motion.
function stageTrackerActivityTrackHtml(item, kind, sg, blank, nowMs) {
if (blank) return `
`;
const name = kind === 'ci' ? 'CI' : 'Review';
@@ -116,7 +139,9 @@
const current = sg.state === 'active';
const state = matches ? a.state || 'unknown' : 'unknown';
const known = matches && state !== 'unknown' && Number.isFinite(observed) && !stale;
- const active = known && a.active;
+ const activity = stageTrackerActivityState(item, nowMs);
+ const running = activity[kind];
+ const active = running && known && a.active;
if (matches && !known && state !== 'unknown') caption = name + ' activity unknown · last observed ' + state + ' · ' + caption;
const ownsPR = item.kind === 'pr' || item.via_pr;
const text = typeof stageTrackerTrackWord === 'function' ? stageTrackerTrackWord(item, kind, current) : (matches ? a.caption || name + ' ' + state : '');
@@ -124,8 +149,8 @@
const finding = matches && (state === 'failing' || state === 'changes_requested');
// A complete verdict parked on a person is settled, not in progress:
// done-style, muted, never the amber fill (hivecommons/hive#16509 row).
- const settled = matches && state === 'human_decision' && (!known || !a.active);
- const cls = finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : text ? 'active' : 'todo';
+ const settled = matches && (state === 'human_decision' || activity.waitingOnPerson);
+ const cls = running ? 'active' : finished ? 'done' : settled ? 'done decided' : finding ? 'failing' : text ? 'pending' : 'todo';
const source = matches ? a.source || 'unavailable' : 'unavailable';
const freshness = !Number.isFinite(observed) ? 'observation time unknown' : (stale ? 'stale · ' : 'observed · ') + new Date(observed).toISOString();
const since = matches && a.since && Number.isFinite(Date.parse(a.since)) ? ' · since ' + new Date(a.since).toISOString() : '';
@@ -168,6 +193,18 @@
// whose move it is); passed and upcoming chevrons have none.
function stageTrackerStripItems(item, stages, range, nowMs, ctx) {
const segs = stageTrackerSegments(item, stages, nowMs, ctx);
+ const activity = stageTrackerActivityState(item, nowMs);
+ // A held repair belongs to PR in progress, even if an older payload
+ // projected its wait onto the CI / Review phase.
+ const phase = segs.find(sg => sg.number === 50 && sg.state === 'active');
+ if (activity.waitingOnPerson && phase) {
+ const progress = segs.find(sg => sg.number === 30);
+ Object.assign(progress, { state: 'active', short: 'PR in progress', detour: phase.detour });
+ phase.state = 'todo';
+ phase.detour = null;
+ }
+ const tracksVisible = (!range || range.from == null || range.from <= 50) && (!range || range.to == null || range.to >= 50);
+ const stageSettled = tracksVisible && activity.ci && activity.review;
const trains = ctx && ctx.trains;
const curStage = Number(item.stage) || 0;
const from = range && range.from != null ? range.from : -Infinity;
@@ -222,7 +259,7 @@
const sentinel = !!(sg.detour && sg.detour.sentinel);
const sentinelSuffix = !!(sg.detour && sg.detour.sentinelSuffix);
const fixPushed = sg.number === 30 && sg.state === 'done' && remediation === 'fix_pushed';
- const cls = ['ham-seg', sg.state, sg.cap ? 'cap' : '', fixPushed ? 'ham-fix-pushed' : '', sg.state === 'active' && sg.number === 30 && remediation ? 'ham-remediation-' + remediation : '', sg.cap && sg.terminal ? 'merged' : '', sg.detour ? 'detoured' : '', sg.hold ? 'ham-open-hold' : '', sg.blocked ? 'ham-open-blocked' : '', sg.draft ? 'ham-open-draft' : '', sg.isNew ? 'ham-open-new' : '', sg.advisory ? 'ham-open-advisory' : '', sg.openSince && sg.openSince.stale ? 'ham-open-stale' : '', sentinel || sentinelSuffix ? 'ham-sentinel' : ''].filter(Boolean).join(' ');
+ const cls = ['ham-seg', sg.state === 'active' && stageSettled ? 'settled-current' : sg.state, sg.cap ? 'cap' : '', fixPushed ? 'ham-fix-pushed' : '', sg.state === 'active' && sg.number === 30 && remediation ? 'ham-remediation-' + remediation : '', sg.cap && sg.terminal ? 'merged' : '', sg.detour ? 'detoured' : '', sg.hold ? 'ham-open-hold' : '', sg.blocked ? 'ham-open-blocked' : '', sg.draft ? 'ham-open-draft' : '', sg.isNew ? 'ham-open-new' : '', sg.advisory ? 'ham-open-advisory' : '', sg.openSince && sg.openSince.stale ? 'ham-open-stale' : '', sentinel || sentinelSuffix ? 'ham-sentinel' : ''].filter(Boolean).join(' ');
const active = sg.state === 'active';
let tip = '';
let gateCaption = '';
@@ -308,7 +345,7 @@
const tipID = 'ham-chevron-tip-' + [item.repo || '', item.kind || '', item.number || 0, sg.number].map(x => encodeURIComponent(String(x))).join('-');
inner = `${stageTrackerIcon(sg.number, 'ham-ico')}${esc(code.caption)}${esc(pushedTip)}`;
} else inner = stageTrackerIcon(sg.number, 'ham-ico');
- return `${inner}`;
+ return `${inner}`;
}).join('');
}
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index 58d56b99ef..3810136d8e 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -1705,12 +1705,10 @@
layerize pass of the page every vsync (#13764). ::after is the
movement effects' (flash / ripple / wash). */
.ham-seg.active { background: var(--amber); color: var(--surface-0); }
- /* A CI / Review track wears its own state on the current head
- (hivecommons/hive#16484): in progress = the full .active fill, done =
- .done, a finding (red CI, changes requested) = .failing in the error
- colour, not started = .todo with the glyph alone. No muted
- "current-phase" tint: the operator reads the words, not the shade.
- Only fresh observed work earns the pulse. */
+ /* Amber means observed running/queued work. Pending tracks retain their
+ count words; a stage waiting on both tracks stays bright and still. */
+ .ham-seg.settled-current { background: var(--panel-strong); color: var(--text); opacity: 1; box-shadow: none; }
+ .ham-seg.ham-activity-track.pending { background: var(--surface-3); color: var(--muted); opacity: 1; box-shadow: none; }
.ham-activity-track.ham-current { opacity: 1; box-shadow: none; }
.ham-seg.ham-activity-track.failing { background: var(--status-error); color: var(--surface-0); box-shadow: none; opacity: 1; }
.ham-seg.ham-activity-track.failing .ham-ico { stroke-width: 2; }
@@ -17833,12 +17831,12 @@ Where to get help
// re-review pending (new head)", "Review 2/5 · awaiting human
// decision". '' means the track has not started on this head (the
// chevron shows its glyph alone). current: column 50 is the row's
- // active phase, so even absent evidence is "in progress" there.
+ // current phase, so absent evidence still gets explanatory words there.
function stageTrackerTrackWord(item, kind, current) {
const a = item && item[kind + '_activity'];
const matches = !!(a && item.head && a.head === item.head);
const state = matches ? a.state || 'unknown' : 'unknown';
- if (state === 'unknown' && !current) return '';
+ if (state === 'unknown' && !current && !(kind === 'ci' && matches && (Number(a.checks_running) > 0 || Number(a.checks_queued) > 0))) return '';
const n = k => matches ? Number(a[k]) || 0 : 0;
if (kind === 'ci') {
const total = n('checks_total');
@@ -17885,14 +17883,37 @@ Where to get help
return !!(hive || item.stage === 74 || item.adopted_by);
}
+ // Only observed current-head work earns amber. Ownership waits suppress
+ // both tracks, even if their last observation still says running.
+ function stageTrackerActivityState(item, nowMs) {
+ const code = item.code_activity;
+ const mods = Array.isArray(item.modifiers) ? item.modifiers : [];
+ const ownerWait = !code && [71, 72].includes(Number(item.stage)) &&
+ !(item.push && ['pushed', 'checking'].includes(item.push.state));
+ const waitingOnPerson = !!(item.hold || item.on_hold || item.needs_human ||
+ mods.some(m => ['hold', 'needs-human', 'needs-decision', 'unauthorized'].includes(m)) ||
+ (code && code.head === item.head && code.state === 'waiting_owner') ||
+ ownerWait || [45, 85, 90].includes(Number(item.stage)));
+ const clock = Number(nowMs) || Date.now();
+ const running = kind => {
+ const a = item[kind + '_activity'];
+ const observed = Date.parse(a && a.observed_at || '');
+ if (Number(item.stage) >= 110 || waitingOnPerson || !a || !item.head || a.head !== item.head ||
+ !Number.isFinite(observed) || observed > clock || clock - observed > 2 * 60 * 1000) return false;
+ return kind === 'ci'
+ ? !!(a.active || Number(a.checks_running) > 0 || Number(a.checks_queued) > 0 || ['running', 'queued'].includes(a.state))
+ : ['reviewing', 'adjudicating', 'assigned'].includes(a.state);
+ };
+ return { waitingOnPerson, ci: running('ci'), review: running('review') };
+ }
+
// Evidence is supplied independently by the backend. A native 050 label
// cannot say who reviews, whether checks run, or whether an author codes.
// The chevron wears its glyph plus the count words from
// stageTrackerTrackWord (hivecommons/hive#16484). Style follows the
- // track's own state on the current head: in progress = the full active
- // fill (both tracks may be lit at once; the words disambiguate), done =
- // the passed-stage style, a finding = the failing style, not started =
- // the empty chevron with the glyph alone. Freshness gates only the pulse.
+ // track's own state on the current head: running/queued = active, done =
+ // the passed-stage style, a finding = failing, missing = pending with
+ // its words. Stale work keeps its words without claiming current motion.
function stageTrackerActivityTrackHtml(item, kind, sg, blank, nowMs) {
if (blank) return ``;
const name = kind === 'ci' ? 'CI' : 'Review';
@@ -17906,7 +17927,9 @@ Where to get help
const current = sg.state === 'active';
const state = matches ? a.state || 'unknown' : 'unknown';
const known = matches && state !== 'unknown' && Number.isFinite(observed) && !stale;
- const active = known && a.active;
+ const activity = stageTrackerActivityState(item, nowMs);
+ const running = activity[kind];
+ const active = running && known && a.active;
if (matches && !known && state !== 'unknown') caption = name + ' activity unknown · last observed ' + state + ' · ' + caption;
const ownsPR = item.kind === 'pr' || item.via_pr;
const text = typeof stageTrackerTrackWord === 'function' ? stageTrackerTrackWord(item, kind, current) : (matches ? a.caption || name + ' ' + state : '');
@@ -17914,8 +17937,8 @@ Where to get help
const finding = matches && (state === 'failing' || state === 'changes_requested');
// A complete verdict parked on a person is settled, not in progress:
// done-style, muted, never the amber fill (hivecommons/hive#16509 row).
- const settled = matches && state === 'human_decision' && (!known || !a.active);
- const cls = finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : text ? 'active' : 'todo';
+ const settled = matches && (state === 'human_decision' || activity.waitingOnPerson);
+ const cls = running ? 'active' : finished ? 'done' : settled ? 'done decided' : finding ? 'failing' : text ? 'pending' : 'todo';
const source = matches ? a.source || 'unavailable' : 'unavailable';
const freshness = !Number.isFinite(observed) ? 'observation time unknown' : (stale ? 'stale · ' : 'observed · ') + new Date(observed).toISOString();
const since = matches && a.since && Number.isFinite(Date.parse(a.since)) ? ' · since ' + new Date(a.since).toISOString() : '';
@@ -17958,6 +17981,18 @@ Where to get help
// whose move it is); passed and upcoming chevrons have none.
function stageTrackerStripItems(item, stages, range, nowMs, ctx) {
const segs = stageTrackerSegments(item, stages, nowMs, ctx);
+ const activity = stageTrackerActivityState(item, nowMs);
+ // A held repair belongs to PR in progress, even if an older payload
+ // projected its wait onto the CI / Review phase.
+ const phase = segs.find(sg => sg.number === 50 && sg.state === 'active');
+ if (activity.waitingOnPerson && phase) {
+ const progress = segs.find(sg => sg.number === 30);
+ Object.assign(progress, { state: 'active', short: 'PR in progress', detour: phase.detour });
+ phase.state = 'todo';
+ phase.detour = null;
+ }
+ const tracksVisible = (!range || range.from == null || range.from <= 50) && (!range || range.to == null || range.to >= 50);
+ const stageSettled = tracksVisible && activity.ci && activity.review;
const trains = ctx && ctx.trains;
const curStage = Number(item.stage) || 0;
const from = range && range.from != null ? range.from : -Infinity;
@@ -18012,7 +18047,7 @@ Where to get help
const sentinel = !!(sg.detour && sg.detour.sentinel);
const sentinelSuffix = !!(sg.detour && sg.detour.sentinelSuffix);
const fixPushed = sg.number === 30 && sg.state === 'done' && remediation === 'fix_pushed';
- const cls = ['ham-seg', sg.state, sg.cap ? 'cap' : '', fixPushed ? 'ham-fix-pushed' : '', sg.state === 'active' && sg.number === 30 && remediation ? 'ham-remediation-' + remediation : '', sg.cap && sg.terminal ? 'merged' : '', sg.detour ? 'detoured' : '', sg.hold ? 'ham-open-hold' : '', sg.blocked ? 'ham-open-blocked' : '', sg.draft ? 'ham-open-draft' : '', sg.isNew ? 'ham-open-new' : '', sg.advisory ? 'ham-open-advisory' : '', sg.openSince && sg.openSince.stale ? 'ham-open-stale' : '', sentinel || sentinelSuffix ? 'ham-sentinel' : ''].filter(Boolean).join(' ');
+ const cls = ['ham-seg', sg.state === 'active' && stageSettled ? 'settled-current' : sg.state, sg.cap ? 'cap' : '', fixPushed ? 'ham-fix-pushed' : '', sg.state === 'active' && sg.number === 30 && remediation ? 'ham-remediation-' + remediation : '', sg.cap && sg.terminal ? 'merged' : '', sg.detour ? 'detoured' : '', sg.hold ? 'ham-open-hold' : '', sg.blocked ? 'ham-open-blocked' : '', sg.draft ? 'ham-open-draft' : '', sg.isNew ? 'ham-open-new' : '', sg.advisory ? 'ham-open-advisory' : '', sg.openSince && sg.openSince.stale ? 'ham-open-stale' : '', sentinel || sentinelSuffix ? 'ham-sentinel' : ''].filter(Boolean).join(' ');
const active = sg.state === 'active';
let tip = '';
let gateCaption = '';
@@ -18098,7 +18133,7 @@ Where to get help
const tipID = 'ham-chevron-tip-' + [item.repo || '', item.kind || '', item.number || 0, sg.number].map(x => encodeURIComponent(String(x))).join('-');
inner = `${stageTrackerIcon(sg.number, 'ham-ico')}${esc(code.caption)}${esc(pushedTip)}`;
} else inner = stageTrackerIcon(sg.number, 'ham-ico');
- return `${inner}`;
+ return `${inner}`;
}).join('');
}