diff --git a/changelog.d/fixed-one-lit-stage.md b/changelog.d/fixed-one-lit-stage.md new file mode 100644 index 0000000000..1ea83744c0 --- /dev/null +++ b/changelog.d/fixed-one-lit-stage.md @@ -0,0 +1 @@ +- Activity Monitor: a row lights exactly one stage chevron. When a push lands during review, CI is the lit chevron and Review is dim with a muted "re-review queued" note instead of a second amber chevron; the base-refresh detail line reads in plain words (no "preparation"/"unverified" jargon, each signal said once); the muted `stage ↓` pill now reads "stage reset" / "stage reset by push" (#17335). diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index a2f36fe588..04eec71e8a 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -144,7 +144,7 @@ An Open issue waiting on a maintainer's triage reads **Triage needed · since 28 At most one health chip sits over the strip's cap, with `+N` for the rest: `stalled`, `regressed`, `hold`, `needs-human`, `needs-decision` (“needs human decision”), `needs-triage` (“triage needed”), `needs-rebase`, `blocked` or `draft`. At 015 the chevron already names triage; before claim, a lingering `needs-triage` can be a chip (010/017/045). At 020+ it is stale and omitted from chip/stage text: `stale_labels` supplies a muted *Stale label* tooltip until the sweep removes it ([#14586](https://github.com/hivecommons/hive/issues/14586)). -A genuine backward hop sets `regressed`; the first forward hop clears it. Lapsed claims 020→010, 030↔020 flicker and 040→010 after a partial merge are not regressions. A regression parked on a person is red. Otherwise it is a muted dashed **stage ↓**, yields to other modifiers and does not enter **Needs attention**: “the hive is handling it — no action needed; clears on the next forward step.” See [The regressed marker](../labels-and-control-signals.md#the-regressed-marker-when-it-is-set-when-it-clears). +A genuine backward hop sets `regressed`; the first forward hop clears it. Lapsed claims 020→010, 030↔020 flicker and 040→010 after a partial merge are not regressions. A regression parked on a person is red. Otherwise it is a muted dashed **stage reset** — **stage reset by push** when a new head caused the fall ([#17335](https://github.com/hivecommons/hive/issues/17335)) — yields to other modifiers and does not enter **Needs attention**: “the hive is handling it — no action needed; clears on the next forward step.” See [The regressed marker](../labels-and-control-signals.md#the-regressed-marker-when-it-is-set-when-it-clears). The reason, actor, nudges, repository, flags and recent stage hops live on the `#N` tooltip (the PR link for a nested row). Titles wrap before their column edges and show full text on hover. Hairlines and whole-row hover keep the chip and age attached to the right row ([#14640](https://github.com/hivecommons/hive/issues/14640)). Passed/upcoming chevrons, kind/author icons, chips and `since` have no separate hover text. @@ -270,8 +270,10 @@ A lone ticket draws no header: one owner (or one waiter) is the base-refresh loc holder, not a train, so its row comment carries the role and verification state and the header's count and front only appear once two recorded tickets share the base. A refreshed owner is the usual lone ticket — `update-branch` moves its head, so the -ticket reads *Recorded preparation owner · unverified · Head changed* until it merges -or is released; that is expected, not a dropped batch. +ticket reads *Recorded first for the base refresh · ticket issued for an earlier head · +re-checked on * until it merges or is released; that is expected, not a dropped +batch. The row never says *preparation* or *unverified* — those are the scheduler's +words, kept in the data ([#17335](https://github.com/hivecommons/hive/issues/17335)). 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 "Queued for merge · 1st of 4 · ~13m" (its own soak left plus the next pass); the others "Queued for merge · 2nd of 4 · ~4m", "Queued for merge · 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 — "Queued for merge · 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". @@ -309,7 +311,7 @@ Issues on their own stages (Open, 010, 020, 045) keep every pill: a `needs-human | `hold` | actionable now | always, whether set by a person or Hive; release rules still depend on provenance | | `draft` | actionable now | always (the author's move) | | `stalled` | actionable now | always | -| `regressed` | actionable now | always; muted `stage ↓` unless the row is parked on a person (see above) | +| `regressed` | actionable now | always; muted `stage reset` (`stage reset by push` after a new head) unless the row is parked on a person (see above) | | `needs-rebase`, `blocked`, `triage needed`, `possible dupe` | actionable now | always | | `unauthorized` — `unauthorized:approve-workflow-runs` | actionable now | always — the carve-out: held workflow runs mean CI cannot even start, and waiting for the gate would waste the whole CI / review cycle (rationguard#397 at 072) | | `unauthorized` — any other step (merge, branch update, no step named) | merge gate | PR at stage/080 or later | @@ -442,7 +444,7 @@ E.g. `At Merge queue — waiting on CI.` / `You chose Approve · 15:55 (5 min ag #### Legend — the three cues a row may carry -The *state pill* says where the item is and what it is waiting on (`hold`, `needs human`, `stage ↓` …). The *working* cue on the lit chevron says Hive is doing something in that stage now; its tooltip explains the work. The *decision badge* (history mark with count) says a person acted here and what followed. These are separate signals: a recorded decision does not mean the requested effect happened. +The *state pill* says where the item is and what it is waiting on (`hold`, `needs human`, `stage reset` …). The *working* cue on the lit chevron says Hive is doing something in that stage now; its tooltip explains the work. The *decision badge* (history mark with count) says a person acted here and what followed. These are separate signals: a recorded decision does not mean the requested effect happened. Plain words throughout — working / waiting on X / set back by Y / merged — nothing else blinks. @@ -450,9 +452,9 @@ Plain words throughout — working / waiting on X / set back by Y / merged — n An *active* chevron is filled amber and carries words; an inactive one is its icon alone (CI / Review: the ring, green when the last run on this head passed, red when it failed, neutral when not yet run), with the counts in its tooltip. On every strip: -1. **1 ≤ active ≤ 2.** At least one chevron is active — the column where the item is or where it is stuck. +1. **Exactly one lit stage per row.** One chevron is active — the column where the item is or where it is stuck; later stages are shown dim, with a muted queued note when they are next ([#17335](https://github.com/hivecommons/hive/issues/17335): a push during review lit *CI 7/11 · 4 running* and *Review 5/5 · adjudicating* amber together). 2. **CI and Review resolve first.** A track is active only while it genuinely runs on the current head (a check-run in progress or queued, a ring not yet full; a reviewer running or queued). If either runs, the PR is waiting on it: the stage chevron (PR in progress, Merge queue …) renders settled-current — filled but still, icon only, its words in the tooltip — and nothing else is active. -3. **CI + Review is the only pair.** Two chevrons are active together only when both tracks run at once; every other combination is exactly one active chevron. The stage chevron is the ≥ 1 fallback: active only when no track is in motion. +3. **CI leads Review.** When both tracks would light at once — CI running while the review is queued, in progress or being re-adjudicated — CI is the lit chevron and Review is dim with a small note (*re-review queued* after a push, *review in progress*, *review queued*); its words stay in the tooltip, ending *… behind CI*. The stage chevron is the fallback: active only when no track is in motion. 4. **The PR in progress chevron speaks the PR's lifecycle** — draft, pushed, rebasing, *Unassigned · next: scanner*, *Waiting for @author · fix owed* — never a CI or review verdict. *CI failing*, *CI 4/11 · 1 failing* and *changes requested* are the CI and Review chevrons' words; the PR in progress tooltip keeps the red reason as detail. 5. **The CI and Review tooltips state what the track waits on — never "activity unknown".** With no verdict and no reviewer in flight the spoke derives the Review statement from what it already knows, in this order: the PR is merged or closed (*Review · n/a (closed)*), it is a draft (*Review · draft, not requested*), CI on the head has not finished (*Review · waiting for CI*), CI is done and nobody started (*Review · not started · hive reviewer next*, or *· needs reviewer* when the repo has no hive reviewer lane). A settled verdict explains itself — *Changes requested by the hive reviewer: 1 perspective posted findings … · 12m ago · quality ✓ · security ✗: token logged* — and stays known as its observation ages. The one no-data wording, *Review · no data for head f269349 yet · refreshing* (CI: *CI · no checks observed for head … yet · refreshing*), appears only when the spoke has fetched nothing for the head, and names the next step. diff --git a/src/docs/labels-and-control-signals/stage-labels.md b/src/docs/labels-and-control-signals/stage-labels.md index 3f140be71f..f96db06211 100644 --- a/src/docs/labels-and-control-signals/stage-labels.md +++ b/src/docs/labels-and-control-signals/stage-labels.md @@ -247,7 +247,8 @@ How the chip renders depends on whether a person is in the loop. On a hive-driven stage with no human-gate modifier (`hold`, `needs-human`, `needs-decision`, `needs-rebase`, `blocked`, `stalled`) and off the human-gated stages (045 / 071 / 072 / 085 / 090), it draws as a muted, -dashed `stage ↓` pill whose hover text names the fall and ends "the hive is +dashed `stage reset` pill (`stage reset by push` when a new head caused the +fall) whose hover text names the fall and ends "the hive is handling it — no action needed; clears on the next forward step", and the row stays out of **Needs attention** and keeps its ordinary headline. Only a regression on a human-gated row keeps the red `regressed` pill and the diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index c5885c0a85..9038051cff 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -28,7 +28,7 @@ function constLine(source, name) { return match[0]; } const trackConsts = ['STAGE_TRACKER_WORKFLOW_APPROVAL_BLOCKER', 'STAGE_TRACKER_PENDING_CHECKS_NAMED', 'STAGE_TRACKER_WORKFLOW_APPROVAL_TIP', 'STAGE_TRACKER_RING_SEGMENT_GAP_MAX', 'STAGE_TRACKER_RING_RADIUS', 'STAGE_TRACKER_RING_GAP_DEG'].map(name => constLine(strip, name)).join('\n'); -const trackFns = ['stageTrackerHiveOwesReReview', 'stageTrackerTrackLead', 'stageTrackerWaitingOnPerson', 'stageTrackerTrackRunning', 'stageTrackerWorkflowApprovalPending', 'stageTrackerRingSvg', 'stageTrackerStalledTrack', 'stageTrackerQueueAheadWord', 'stageTrackerStageTrack', 'stageTrackerHiveOwnsRepair', 'stageTrackerTrackWord', 'stageTrackerAgoWord', 'stageTrackerActivityTrackHtml'].map(name => fn(strip, name)).join('\n'); +const trackFns = ['stageTrackerHiveOwesReReview', 'stageTrackerTrackLead', 'stageTrackerWaitingOnPerson', 'stageTrackerTrackRunning', 'stageTrackerWorkflowApprovalPending', 'stageTrackerRingSvg', 'stageTrackerStalledTrack', 'stageTrackerQueueAheadWord', 'stageTrackerStageTrack', 'stageTrackerHiveOwnsRepair', 'stageTrackerTrackWord', 'stageTrackerAgoWord', 'stageTrackerQueuedTrackNote', 'stageTrackerActivityTrackHtml'].map(name => fn(strip, name)).join('\n'); const track = new Function('esc', 'stageTrackerIcon', trackConsts + '\n' + trackFns + ';return stageTrackerActivityTrackHtml;')(esc, (n, cls) => ``); const getAnchor = new Function(globals + anchor + ';return stageTrackerAnchor;')(); const header = new Function('esc', 'stageTrackerIcon', globals + fn(strip, 'stageTrackerHeaderHtml') + ';return stageTrackerHeaderHtml;')(esc, () => ''); @@ -123,7 +123,7 @@ function stageTrackerActorKind() { return ''; } function stageTrackerActorTip() { return ''; } function stageTrackerMotion() { return STAGE_TRACKER_MOTION_STATIC; } function stageTrackerIcon(n) { return ''; } -` + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerStageTrack') + fn(strip, 'stageTrackerStalledTrack') + fn(strip, 'stageTrackerStripItems') + ';return stageTrackerStripItems;')(esc, segments, track, ...Object.values(helpers)); +` + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerStageTrack') + fn(strip, 'stageTrackerStalledTrack') + fn(strip, 'stageTrackerTrackWouldLight') + fn(strip, 'stageTrackerLeadTrack') + fn(strip, 'stageTrackerQueuedTrackNote') + fn(strip, 'stageTrackerStripItems') + ';return stageTrackerStripItems;')(esc, segments, track, ...Object.values(helpers)); const renderStrip = makeStripRenderer(); function physicalTracks(item) { @@ -531,8 +531,11 @@ test('current phase, running activity, failure and successful completion are ind const cells = physicalTracks(livePR({ ci_activity: activity(state, caption, running) })); assert.ok(cells.ci.includes('ham-activity-track ' + cls + ' ham-current'), state + ' → ' + cls + ': ' + cells.ci); assert.equal(cells.ci.includes('data-motion="active"'), running); - // The stage's own track (review, 050) is active with words (#16599). - assert.match(cells.review, /active ham-current[^]*data-activity-state="unknown"/); + // The stage's own track (review, 050) is active with words (#16599) — + // unless CI runs, when CI leads and Review is dim with a queued note + // (exactly one lit chevron, hivecommons/hive#17335). + if (running) assert.match(cells.review, /todo ham-track-queued ham-current[^]*data-activity-state="unknown"[^]*review queued<\/span>/); + else assert.match(cells.review, /active ham-current[^]*data-activity-state="unknown"/); } const admitted = physicalTracks(livePR({ stage: 80, ci_activity: activity('passing', 'CI green · all 2 required checks passed'), review_activity: activity('approved', 'Review approved') })); assert.doesNotMatch(admitted.ci + admitted.review, /ham-current|aria-current/); @@ -905,7 +908,7 @@ test('#16484: count grammar — CI passed/total and Review done/total across eve assert.equal(word({ head: 'h' }, 'review', false), ''); }); -test('#16484: the three screenshot rows — both tracks lit with counts, swarm requested, red CI beside a done review', () => { +test('#16484: the three screenshot rows — CI leads with counts, swarm requested dim behind it, red CI beside a done review', () => { const head = 'd3c0824304d4c97b8ee76a267fb1e91f6d4c79a4'; const fresh = (state, extra = {}) => ({ head, state, caption: state, source: 'cache', observed_at: new Date(now).toISOString(), ...extra }); const text = cell => cell.match(/aria-describedby="[^"]+">([^]*?)]*>/g, ''); @@ -925,11 +928,14 @@ test('#16484: the three screenshot rows — both tracks lit with counts, swarm r // #16491: review swarm requested, no bundle yet; CI shows its count. cells = physicalTracks(livePR({ head, stage: 50, display_column: 50, ci_activity: fresh('running', { checks_passed: 2, checks_total: 14 }), review_activity: fresh('unassigned', { perspectives_done: 0, perspectives_total: 5, blocker: 'no reviewer free' }) })); - // #16599: at 050 the Review column is the stage's own track → active with - // words even while only queued; CI runs beside it (two lit). - assert.equal(cls(cells.review), 'active'); assert.equal(text(cells.review), 'Review 0/5 · queued'); - assert.doesNotMatch(cells.review, /data-motion/, 'queued is lit but still'); + // #16599: at 050 the Review column is the stage's own track, but CI runs + // beside it and leads — exactly one lit chevron (hivecommons/hive#17335): + // Review is dim with a muted "review queued" note, its words in the tooltip. assert.equal(cls(cells.ci), 'active'); assert.equal(text(cells.ci), 'CI 2/14 · 12 running'); + assert.equal(cls(cells.review), 'todo'); assert.match(cells.review, /ham-track-queued/); + assert.match(cells.review, /ham-track-verdict"><\/span>review queued<\/span>/, 'no words on the dim track, only the muted note'); + assert.match(cells.review, /aria-label="[^"]*Review: Review 0\/5 · queued · [^"]*· review queued behind CI"/); + assert.doesNotMatch(cells.review, /data-motion/, 'a demoted track is still'); // #16268: CI failed native-queue-policy, review approved, held. cells = physicalTracks(livePR({ head, stage: 70, display_column: 50, modifiers: ['hold'], hold: { by: 'hanthor', pill: 'Held by @hanthor' }, ci_activity: fresh('failing', { checks_passed: 13, checks_total: 14, checks_failed: 1, checks_failing: ['native-queue-policy'], blocker: 'native-queue-policy' }), diff --git a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js index 0cbdcd91b5..8cfcdb8ad4 100644 --- a/src/pkg/dashboard/stage_tracker_preparation_visual.test.js +++ b/src/pkg/dashboard/stage_tracker_preparation_visual.test.js @@ -105,7 +105,7 @@ test('original compact pill and connector decorate actual rows with FIFO help an assert.match(rows[3].html, /ham-train-last/); assert.match(rows[1].html, /data-ham-stage="70"/); assert.match(rows[2].html, /data-ham-stage="50"/); - assert.match(rows[2].html, /CI · checks pending · queued for base refresh behind PR #45 · ticket age 30m/); + assert.match(rows[2].html, /CI · checks pending · queued for base refresh behind PR #45 · ticket issued 30m ago/); assert.match(rows[1].html, /Review swarm requested; waiting for a verdict on the current head · preparing base/); assert.match(rows[3].html, /Waiting 2nd for preparation/); assert.doesNotMatch(html, /
  • { + const { ctx } = load(), f = fixture(); + f.owner.head = 'c15a343f00d'; + f.owner.caption = 'push seen 3m ago → CI/re-review queued'; + f.owner.push = { state: 'pushed', login: 'Karibhou', sha: 'c15a343f00d', since: new Date(NOW - 3 * 60000).toISOString(), next: 're-review' }; + f.owner.ci_activity = { head: f.owner.head, state: 'running', active: true, checks_passed: 7, checks_total: 11 }; + f.q.owner.state = 'unverified'; f.q.owner.current_head = f.owner.head; + f.q.owner.detail = 'Head changed; current preparation unverified'; + f.q.owner.since = new Date(NOW - 4 * 60000).toISOString(); + const html = render(ctx, f, [f.owner, f.first, f.second])[1].html; + const comment = html.match(/
    (.*?)<\/span><\/div>/)[1]; + assert.equal(comment, 'New push c15a343 by @Karibhou 3m ago → CI running, review will rerun · previous review no longer applies · Recorded first for the base refresh · ticket issued for an earlier head · re-checked on c15a343 · ticket issued 4m ago'); + assert.doesNotMatch(comment, /preparation|unverified|ticket age|Head changed/i); + assert.equal((comment.match(/no longer applies|not yet confirmed|earlier head/g) || []).length, 2, 'each signal said once'); + // The popover / help keep the same words. + assert.doesNotMatch(ctx.stageTrackerPreparationHelp(model(ctx, f)[0]), /\bunverified\b|ticket age|current preparation/); +}); + test('unknown predecessor and exact repo/base/head mismatches never fabricate confirmed positions', () => { for (const change of [ f => { f.first.head = 'new-head'; }, f => { f.first.base_ref = 'other'; }, @@ -267,7 +289,7 @@ test('unknown predecessor and exact repo/base/head mismatches never fabricate co const group = model(ctx, f)[0]; assert.ok(group.unverified.some(e => e.ticket.number === 9)); assert.equal(group.waiting[0].position, 0); - assert.match(content(render(ctx, f)), /Waiting for preparation · position unverified/); + assert.match(content(render(ctx, f)), /Waiting for preparation · position not yet confirmed/); } }); @@ -360,7 +382,7 @@ test('comments dedupe current captions, retain current event detail, and use no const comment = html.match(/
    .*?<\/div>/)[0]; assert.doesNotMatch(comment, /CI · checks pending/); assert.equal((html.match(/CI · checks pending<\/p>/g) || []).length, 1); - assert.match(comment, /ticket age 30m/); + assert.match(comment, /ticket issued 30m ago/); assert.doesNotMatch(comment, /data-at=|data-cue-key=/); assert.deepEqual(events, before); f.first.caption = 'CI · failing current check'; @@ -381,7 +403,7 @@ test('a lone ticket draws no train header: the owner row keeps its comment and r assert.deepEqual(rootKeys(rows), [REPO + '/pr#45']); assert.doesNotMatch(html, /ham-preparation-head|Preparation train|0 confirmed PRs/); assert.match(html, /ham-preparation-member/); - assert.match(html, /Recorded preparation owner · unverified/); + assert.match(html, /Recorded first for the base refresh · ticket matches the current open PR snapshot/i); rows = render(ctx, f, [], []); assert.doesNotMatch(content(rows), /ham-preparation-head/); f.q.waiting = [f.first.preparation]; diff --git a/src/pkg/dashboard/stage_tracker_regressed_test.go b/src/pkg/dashboard/stage_tracker_regressed_test.go index 7d98469c08..2a400f99cc 100644 --- a/src/pkg/dashboard/stage_tracker_regressed_test.go +++ b/src/pkg/dashboard/stage_tracker_regressed_test.go @@ -101,9 +101,12 @@ const pill = stageTrackerChipsHtml(item); assert.ok(pill.includes('title="regressed: 040 Covered by PR → 020 Claimed at T'), pill); assert.ok(pill.includes('because live issue claim'), pill); assert.ok(!stageTrackerChipsHtml({ stage: 10, modifiers: ['stalled'] }).includes('title=')); -// Hive-handled: muted "stage ↓" pill, never the red regressed look, and it says so on hover. +// Hive-handled: muted "stage reset" pill, never the red regressed look, and it says so on hover. const handledCases = [ { name: 'actionable', item: item }, + // hivecommons/hive#17335: a fall caused by a new push names its cause. + { name: 'pushed', item: { kind: 'pr', stage: 50, modifiers: ['regressed'], regressed_from: 80, push: { state: 'pushed', sha: 'c15a343', login: 'Karibhou' } }, text: STAGE_TRACKER_HANDLED_PUSH_TEXT }, + { name: 'reason names the push', item: { kind: 'pr', stage: 50, modifiers: ['regressed'], regressed_from: 80, regressed_reason: 'new head pushed' }, text: STAGE_TRACKER_HANDLED_PUSH_TEXT }, { name: 'claimed', item: { stage: 20, modifiers: ['regressed'], regressed_from: 30 } }, { name: 'pr in progress', item: { stage: 30, modifiers: ['regressed'], regressed_from: 40 } }, { name: 'draft folds in', item: { kind: 'pr', stage: 50, modifiers: ['regressed', 'draft'], regressed_from: 100 } }, @@ -113,7 +116,8 @@ for (const c of handledCases) { const h = stageTrackerChipsHtml(c.item); assert.ok(h.includes(STAGE_TRACKER_HANDLED_NOTE), c.name + ': ' + h); if (c.item.modifiers.length === 1) { - assert.ok(h.includes('ham-mod-regressed ham-mod-handled') && h.includes('>' + STAGE_TRACKER_HANDLED_TEXT + '<'), c.name + ': ' + h); + assert.ok(h.includes('ham-mod-regressed ham-mod-handled') && h.includes('>' + (c.text || STAGE_TRACKER_HANDLED_TEXT) + '<'), c.name + ': ' + h); + assert.ok(!h.includes('stage ↓'), c.name + ': the pill is words, not a glyph: ' + h); } else { assert.ok(!h.includes('ham-mod-regressed') && h.includes('ham-mod-draft') && h.includes(' +1<'), c.name + ' yields the lead pill: ' + h); } diff --git a/src/pkg/dashboard/stage_tracker_ui_prelude_test.go b/src/pkg/dashboard/stage_tracker_ui_prelude_test.go index 9e38f56b48..cef38b281f 100644 --- a/src/pkg/dashboard/stage_tracker_ui_prelude_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_prelude_test.go @@ -111,6 +111,9 @@ func stageTrackerRowsPreludeJS(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerStalledTrack"), jsFunc(t, html, "stageTrackerQueueAheadWord"), jsFunc(t, html, "stageTrackerStageTrack"), + jsFunc(t, html, "stageTrackerTrackWouldLight"), + jsFunc(t, html, "stageTrackerLeadTrack"), + jsFunc(t, html, "stageTrackerQueuedTrackNote"), jsFunc(t, html, "stageTrackerTrackWord"), jsFunc(t, html, "stageTrackerAgoWord"), jsFunc(t, html, "stageTrackerActivityTrackHtml"), @@ -223,27 +226,32 @@ var _stageTracker = { stages }; // needs-rebase always lands a PR in 070/071/072 (automerge_stage_labels.go), so a // fixture pairing it with 050/060 would draw a contradictory row. const rebaseCoherent = (it) => { if ((it.modifiers || []).includes('needs-rebase')) assert.ok(![50, 60].includes(Number(it.stage)), 'fixture #' + it.number + ' pairs needs-rebase with stage ' + it.stage); (it.linked_prs || []).forEach(rebaseCoherent); }; -// hivecommons/hive#16540: no strip ever lights more than two chevrons. Lit = -// the stage chevron's active fill (a settled-current one is not amber) or a -// CI / Review track in the active class. Checked on every fixture rendered. +// hivecommons/hive#16540 / #17335: no strip ever lights more than ONE chevron. +// Lit = the stage chevron's active fill (a settled-current one is not amber) +// or a CI / Review track in the active class. Checked on every fixture rendered. const litChevrons = (html) => (html.match(/class="ham-seg active(?! [^"]*ham-settled-current)|class="ham-seg ham-activity-track active\b/g) || []).length; -// hivecommons/hive#16599 (canonical): 1 ≤ active ≤ 2 — the stage column is -// always active (a settled-current one counts as filled), a track only while -// it runs or is the stage's own / stalled track; and words ride ONLY active -// chevrons — an inactive CI / Review track is its icon alone. +// hivecommons/hive#16599 (canonical) as tightened by #17335: exactly one +// active chevron — the stage column is always filled (a settled-current one +// counts as filled), a track only while it is the row's lead track (running, +// or the stage's own / stalled track); and words ride ONLY active chevrons — +// an inactive CI / Review track is its icon alone, plus a muted queued note +// (ham-track-note) when it would have lit behind the lead. const filledChevrons = (html) => litChevrons(html) + (html.match(/class="ham-seg active [^"]*ham-settled-current/g) || []).length; -const trackCopyText = (li) => ((/([\s\S]*?)<\/span>(?:/g, '').replace(/<[^>]+>/g, '').trim(); +const trackCopyText = (li) => ((/([\s\S]*?)<\/span>(?:/g, '').replace(/<[^>]+>/g, '').trim(); const wordsOnlyWhenActive = (item, s) => Array.from(s.matchAll(/
  • /g)).forEach(m => { const words = trackCopyText(m[0]); if (/\bactive\b/.test(m[1])) assert.ok(words, 'fixture #' + item.number + ' active track without words: ' + m[0]); else assert.strictEqual(words, '', 'fixture #' + item.number + ' inactive track carries words: ' + m[0]); + // A demoted track is dim, still, and says it is queued; an active one never wears the note. + if (/ham-track-queued/.test(m[1])) assert.ok(!/\bactive\b/.test(m[1]) && !/data-motion=/.test(m[0]) && /[^<]+<\/span>/.test(m[0]), 'fixture #' + item.number + ' queued track is not dim-with-note: ' + m[0]); + else assert.ok(!/ham-track-note/.test(m[0]), 'fixture #' + item.number + ' non-queued track wears a queued note: ' + m[0]); // hivecommons/hive#16643: a text-bearing track is active and nothing // else — no muted / pending / settled class may dim its one amber fill. if (words) assert.ok(/\bactive\b/.test(m[1]) && !/\b(?:pending|todo|done|failing|ham-settled-current)\b/.test(m[1]), 'fixture #' + item.number + ' text-bearing track is not plainly active: ' + m[1]); }); -// hivecommons/hive#16643: CI + Review is the only pair that may be active -// together; a lit stage chevron (PR in progress, Merge queue …) is the row's -// one active chevron, and it carries no CI / review verdict in its words. +// hivecommons/hive#16643 / #17335: a lit stage chevron (PR in progress, +// Merge queue …) is the row's one active chevron, never beside a running +// track, and it carries no CI / review verdict in its words. const stageLitChevrons = (html) => (html.match(/class="ham-seg active(?! [^"]*ham-settled-current)/g) || []).length; const onlyTracksPair = (item, s, i) => { const lit = litChevrons(s); @@ -260,7 +268,8 @@ const neverActivityUnknown = (item, s, i) => Array.from(s.matchAll(/
  • { - assert.ok(litChevrons(s) <= 2, 'fixture ' + (item.repo || '') + '#' + item.number + ' strip ' + i + ' lights ' + litChevrons(s) + ' chevrons: ' + s); + // Exactly one lit stage per row (hivecommons/hive#17335). + assert.ok(litChevrons(s) <= 1, 'fixture ' + (item.repo || '') + '#' + item.number + ' strip ' + i + ' lights ' + litChevrons(s) + ' chevrons: ' + s); onlyTracksPair(item, s, i); if (s.includes('aria-current="step"')) assert.ok(filledChevrons(s) >= 1, 'fixture ' + (item.repo || '') + '#' + item.number + ' strip ' + i + ' has no filled chevron: ' + s); wordsOnlyWhenActive(item, s); diff --git a/src/pkg/dashboard/stage_tracker_ui_rows_test.go b/src/pkg/dashboard/stage_tracker_ui_rows_test.go index 18d5ebb399..451e71cd42 100644 --- a/src/pkg/dashboard/stage_tracker_ui_rows_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_rows_test.go @@ -703,7 +703,8 @@ assert.ok(/[^<]*<\/span>/.test(row) && !/ // decided → one lit chevron. #16268: waiting for the contributor, CI 7/11 // unreported, review approved → exactly one. Three qualifying (fix running, // CI running, review running) → the tracks win and the stage chevron is -// settled-current. The ≤2 invariant itself runs on every fixture above. +// settled-current; CI leads and Review is dim with a queued note +// (hivecommons/hive#17335). The one-lit invariant itself runs on every fixture above. { const seen = new Date(now - 60000).toISOString(); const unreported = { head: 'f269349', state: 'missing', caption: "CI waiting · required check 'test' hasn't reported for this head yet", checks_passed: 7, checks_total: 11, blocker: 'test', source: 'checks', observed_at: seen }; @@ -723,7 +724,8 @@ assert.ok(/[^<]*<\/span>/.test(row) && !/ code_activity: { head: 'f269349', state: 'remediating', caption: 'Remediating · scanner · 4m', actor: 'scanner', active: true, source: 'fix-dispatch', observed_at: seen }, ci_activity: { head: 'f269349', state: 'running', active: true, caption: 'CI running', checks_passed: 4, checks_total: 11, source: 'checks', observed_at: seen }, review_activity: { head: 'f269349', state: 'reviewing', active: true, actor: 'reviewer-2', caption: 'Review working', perspectives_done: 2, perspectives_total: 5, source: 'dispatch', observed_at: seen } }, stages, ctx); - assert.strictEqual(lit(busy), 2, 'three qualify, two light: ' + strip(busy)); + assert.strictEqual(lit(busy), 1, 'three qualify, one lights: ' + strip(busy)); + assert.ok(/
  • ]*>[\s\S]*?CI 4\/11 · 7 running<\/span>/.test(busy) && /
  • ]*data-motion)[^>]*>[\s\S]*?review in progress<\/span>/.test(busy), 'CI leads, Review is dim with its note: ' + strip(busy)); // #16456: back in PR in progress with changes requested — one filled // chevron; CI 11/11 is green words (done), the review finding red words // (failing), neither a fill. @@ -779,7 +781,10 @@ assert.ok(/[^<]*<\/span>/.test(row) && !/ // waiting on workflow approval"; Review is the green ring alone. #427 (050, // swarm queued, CI passed): Review is the stage's own track, active even // while queued; CI is the green icon only. CI running + swarm adjudicating -// lights both tracks with words, never a third. +// lights CI alone — exactly one lit stage per row (hivecommons/hive#17335): +// Review is dim with a muted "review in progress" note, and after a push +// (issue #17292 / PR #17308: "CI 7/11 · 4 running" AND "Review 5/5 · adjudicating" +// both amber) the note reads "re-review queued". { const seen = new Date(now - 60000).toISOString(); const lit = (html) => litChevrons(strip(html)); @@ -811,8 +816,22 @@ assert.ok(/[^<]*<\/span>/.test(row) && !/ const both = stageTrackerRowHtml({ repo: 'acme/promptargs', number: 427, kind: 'pr', stage: 50, display_column: 50, head: '9bdf058', author: 'hive[bot]', author_kind: 'hive', ci_activity: { head: '9bdf058', state: 'running', active: true, caption: 'CI running', checks_passed: 4, checks_total: 11, source: 'checks', observed_at: seen }, review_activity: { head: '9bdf058', state: 'adjudicating', active: true, caption: 'Review 5/5 · verdicts in · aggregating', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen } }, stages, ctx); - assert.strictEqual(lit(both), 2, 'CI running + adjudicating: both tracks, no third: ' + strip(both)); - assert.ok(both.includes('CI 4/11 · 7 running') && both.includes('Review 5/5 · adjudicating'), both); + assert.strictEqual(lit(both), 1, 'CI running + adjudicating: CI alone is lit: ' + strip(both)); + assert.ok(both.includes('CI 4/11 · 7 running') && !both.includes('Review 5/5 · adjudicating'), both); + assert.ok(/
  • ]*data-motion)[^>]*>[\s\S]*?review in progress<\/span>/.test(both) && both.includes('Review 5/5 · adjudicating · ') && both.includes(' · review in progress behind CI'), 'Review is dim, its words in the tooltip with the queued note: ' + both); + // hivecommons/hive#17335: @Karibhou pushed c15a343 to PR #17308 while the + // previous review was being re-adjudicated — the row lit CI 7/11 AND + // Review 5/5 amber at once. Now CI is the one lit chevron; Review is dim + // and reads "re-review queued". + const pushedAt = new Date(now - 3 * 60000).toISOString(); + const pushed = stageTrackerRowHtml({ repo: 'hivecommons/hive', number: 17308, kind: 'pr', stage: 50, display_column: 50, head: 'c15a343', author: 'Karibhou', author_kind: 'human', + push: { state: 'pushed', login: 'Karibhou', sha: 'c15a343', since: pushedAt, next: 're-review' }, + ci_activity: { head: 'c15a343', state: 'running', active: true, caption: 'CI running', checks_passed: 7, checks_total: 11, source: 'checks', observed_at: seen }, + review_activity: { head: 'c15a343', state: 'adjudicating', active: true, caption: 'Review 5/5 · verdicts in · aggregating', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen } }, stages, ctx); + assert.strictEqual(lit(pushed), 1, 'a push during review lights exactly one chevron: ' + strip(pushed)); + assert.ok(/
  • ]*>[\s\S]*?CI 7\/11 · 4 running<\/span>/.test(pushed), 'CI is the lit chevron: ' + strip(pushed)); + assert.ok(/
  • ]*data-motion)[^>]*>[\s\S]*?re-review queued<\/span>/.test(pushed), 'Review is dim with the re-review note, no second amber: ' + strip(pushed)); + assert.ok(pushed.includes(' · re-review queued behind CI'), 'the Review tooltip explains the demotion: ' + pushed); } // Merged: the lit cap is the only chevron with hover text. row = stageTrackerRowHtml({ repo: 'acme/console', number: 106, kind: 'pr', stage: 110 }, stages, ctx); diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index a3090109ea..4109e4a99b 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -429,6 +429,12 @@ .ham-seg.ham-activity-track.active.ham-stalled { animation: none; } .ham-seg.ham-activity-track.active.ham-stalled::before { display: none; } .ham-seg.ham-activity-track.ham-stalled .ham-actor-ico { margin-left: var(--sp-1); flex: 0 0 auto; } + /* A track that would light but is not the row's lead (Review while CI + runs on a freshly pushed head, hivecommons/hive#17335) stays dim — + the muted field, the ring alone — with a small queued note; never a + second amber chevron. Exactly one lit stage per row. */ + .ham-seg.ham-activity-track.ham-track-queued { background: var(--panel-strong); color: var(--muted); box-shadow: none; opacity: 1; animation: none; } + .ham-seg.ham-activity-track .ham-track-note { margin-left: var(--sp-1); font-size: var(--fs-2xs); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* The CI / Review glyph is a ring of steps (checks / perspectives, hivecommons/hive#16599): filled clockwise from twelve — done in the track's colour, failed red, the rest the muted track. While the diff --git a/src/pkg/dashboard/static-src/js/tracker-preparation.js b/src/pkg/dashboard/static-src/js/tracker-preparation.js index 167deb6022..5e2ca52a49 100644 --- a/src/pkg/dashboard/static-src/js/tracker-preparation.js +++ b/src/pkg/dashboard/static-src/js/tracker-preparation.js @@ -111,10 +111,45 @@ return out; }); } + // Operator-readable words for a ticket's place: the scheduler's + // "unverified"/"preparation" vocabulary stays in the data, not the row + // (hivecommons/hive#17335: "Recorded preparation owner · unverified · + // Head changed; current preparation unverified" read as jargon). function stageTrackerPreparationPlace(entry) { - if (entry.state === 'unverified') return 'Recorded preparation ' + (entry.role === 'owner' ? 'owner' : 'ticket') + ' · unverified'; + if (entry.state === 'unverified') return entry.role === 'owner' ? 'Recorded first for the base refresh' : 'Recorded base-refresh ticket'; if (entry.role === 'owner') return 'Preparing'; - return entry.position > 0 ? 'Waiting ' + stageTrackerOrdinal(entry.position) + ' for preparation' : 'Waiting for preparation · position unverified'; + return entry.position > 0 ? 'Waiting ' + stageTrackerOrdinal(entry.position) + ' for preparation' : 'Waiting for preparation · position not yet confirmed'; + } + // Why a recorded ticket is not (yet) confirmed, in plain language. The + // server's Detail strings are the signal; this is their wording. + function stageTrackerPreparationPlainDetail(entry) { + const d = String(entry.ticket && entry.ticket.detail || '').trim(); + const head7 = entry.head ? String(entry.head).slice(0, 7) : ''; + if (/^Head changed/i.test(d)) return 'ticket issued for an earlier head' + (head7 ? ' · re-checked on ' + head7 : ''); + if (/absent from current open snapshot/i.test(d)) return 'PR missing from the latest snapshot'; + if (/^Current head unknown/i.test(d)) return 'current head not known yet'; + if (/^Ticket age unknown/i.test(d)) return 'ticket time unknown'; + if (!d) return 'not yet confirmed for the current head'; + return d.replace(/\bunverified\b/gi, 'not yet confirmed').replace(/\bpreparation\b/gi, 'base refresh'); + } + function stageTrackerPreparationIssued(ticket) { + const age = stageTrackerPreparationAge(ticket, _stageTrackerPreparationNow); + return age === 'age unknown' ? 'ticket time unknown' : 'ticket issued ' + age + ' ago'; + } + // The pushed row's caption in operator words: who pushed what, and what + // runs next on it. Anything that is not the server's push caption passes through. + function stageTrackerPreparationCaption(item) { + const caption = item.caption || item.reason || ''; + const push = item && item.push; + if (!push || push.state !== 'pushed' || !/^(push seen|new head observed)\b/i.test(caption)) return caption; + const sha7 = push.sha ? String(push.sha).slice(0, 7) : ''; + const ago = /^push seen (.+?) ago → /.exec(caption); + const when = ago ? ago[1] + ' ago' : /just now/.test(caption) ? 'just now' : ''; + const ci = item.ci_activity && item.ci_activity.state === 'running' && (!item.head || !item.ci_activity.head || item.ci_activity.head === item.head); + const rereview = push.next === 're-review' || /re-review/.test(caption); + return ['New push' + (sha7 ? ' ' + sha7 : '') + (push.login ? ' by @' + push.login : '') + (when ? ' ' + when : '') + + ' → ' + (ci ? 'CI running' : 'CI queued') + (rereview ? ', review will rerun' : '')] + .concat(rereview ? ['previous review no longer applies'] : []).join(' · '); } function stageTrackerPreparationVisualSync(data, listedRows, pageRows, stages, nowMs) { _stageTrackerPreparationShown = new Map(); @@ -158,8 +193,8 @@ for (const e of group.members) { details.push('#' + e.ticket.number + ' · ' + stageTrackerPreparationPlace(e) + (e.location === 'page' ? '' : e.location === 'offpage' ? ' · another page or collapsed repo' : ' · hidden by filters or absent from snapshot') - + (e.state === 'unverified' ? ' · ' + (e.ticket.detail || 'current identity or eligibility unknown') : '') - + ' · ticket age ' + stageTrackerPreparationAge(e.ticket, _stageTrackerPreparationNow) + + (e.state === 'unverified' ? ' · ' + stageTrackerPreparationPlainDetail(e) : '') + + ' · ' + stageTrackerPreparationIssued(e.ticket) + ' · ticket head ' + (e.ticketHead || 'unknown') + ' · current head ' + (e.head || 'unknown')); } @@ -241,16 +276,17 @@ stageTrackerPreparationMark(item); const event = ctx && ctx.events && ctx.events[key]; const eventHtml = typeof stageTrackerEventHtml === 'function' ? stageTrackerEventHtml(key, ctx) : ''; - const caption = item.caption || item.reason || (e.state === 'current' ? e.ticket.pipeline : '') || ''; - const captionVisible = caption && event && event.text && event.text.includes(caption) + const rawCaption = item.caption || item.reason || (e.state === 'current' ? e.ticket.pipeline : '') || ''; + const caption = stageTrackerPreparationCaption(item) || rawCaption; + const captionVisible = rawCaption && event && event.text && event.text.includes(rawCaption) && eventHtml && !eventHtml.includes('cue-event-tucked'); const parts = caption && !captionVisible ? [caption] : []; if (!caption) parts.push('Current pipeline blocker unknown'); const preparation = e.state === 'unverified' - ? stageTrackerPreparationPlace(e) + ' · ' + (e.ticket.detail || 'current identity or eligibility unknown') + ? stageTrackerPreparationPlace(e) + ' · ' + stageTrackerPreparationPlainDetail(e) : 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)); + parts.push(stageTrackerPreparationIssued(e.ticket)); 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-src/js/tracker-queue.js b/src/pkg/dashboard/static-src/js/tracker-queue.js index 8f3544437c..2143f5680c 100644 --- a/src/pkg/dashboard/static-src/js/tracker-queue.js +++ b/src/pkg/dashboard/static-src/js/tracker-queue.js @@ -36,7 +36,7 @@ function stageTrackerPreparationWord(p) { if (!p) return ''; if (p.state === 'inactive') return 'Inactive preparation ticket · ' + (p.detail || 'not currently eligible'); - if (p.state !== 'current') return (p.role === 'owner' ? 'Recorded preparation owner' : 'Recorded waiting ticket') + ' · ' + (p.detail || 'current state unknown'); + if (p.state !== 'current') return (p.role === 'owner' ? 'Recorded first for the base refresh' : 'Recorded base-refresh ticket') + ' · ' + (p.detail || 'current state unknown').replace(/\bunverified\b/gi, 'not yet confirmed').replace(/\bpreparation\b/gi, 'base refresh'); return p.role === 'owner' ? 'Preparing base' : (Number(p.behind) > 0 ? 'Waiting for preparation behind #' + Number(p.behind) : 'Waiting for preparation; owner not confirmed'); } function stageTrackerPreparationAge(p, nowMs) { @@ -50,7 +50,7 @@ if (!p || p.state === 'inactive') return ''; if (typeof stageTrackerPreparationRepresented === 'function' && stageTrackerPreparationRepresented(item)) return ''; const word = stageTrackerPreparationWord(p); - const label = p.state === 'current' ? word : 'Preparation owner · unverified'; + const label = p.state === 'current' ? word : 'Base refresh · not yet confirmed'; return `${esc(label)}`; } function stageTrackerPreparationPopHtml(queues, nowMs) { 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 3e4683ef20..3266e1d924 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -273,6 +273,41 @@ return total > 0 && done < total && !settledWords.includes(a.state); } + // Whether a CI / Review track would light on its own: it runs on the + // current head, it is the stage's own track (column 50), or it is the + // stalled blocker of a row with nothing in motion. + function stageTrackerTrackWouldLight(item, kind, current, stalledTrack) { + if (stageTrackerTrackRunning(item, kind)) return true; + if (current && typeof stageTrackerStageTrack === 'function' && stageTrackerStageTrack(item) === kind) return true; + return stalledTrack === kind; + } + + // Pure: the ONE lit track of column 50 — exactly one chevron per row is + // the current stage. When both tracks would light (a push lands while + // the previous review is still being re-adjudicated: CI running AND + // Review adjudicating, hivecommons/hive#17335 under PR #17308), the + // earliest wins — CI — and Review is drawn dim with a "re-review + // queued" note instead of a second amber chevron. '' when neither + // track lights (the stage chevron is the row's one active chevron). + function stageTrackerLeadTrack(item, current, stalledTrack) { + return ['ci', 'review'].find(kind => stageTrackerTrackWouldLight(item, kind, current, stalledTrack)) || ''; + } + + // The muted note a demoted (would-light but not lead) track wears: + // "re-review queued" for a Review whose head was just pushed, "review + // in progress" while a reviewer genuinely runs beside CI, "review + // queued" / "CI queued" otherwise. + function stageTrackerQueuedTrackNote(item, kind) { + if (kind === 'ci') return 'CI queued'; + const push = item && item.push; + const code = item && item.code_activity; + const newHead = !!((code && code.head === item.head && code.state === 'pushed') || (push && push.state === 'pushed' && push.sha === item.head) || (typeof stageTrackerHiveOwesReReview === 'function' && stageTrackerHiveOwesReReview(item))); + if (newHead) return 're-review queued'; + const a = item && item.review_activity; + const st = a && a.head === item.head ? a.state : ''; + return st === 'reviewing' || st === 'adjudicating' ? 'review in progress' : 'review queued'; + } + // Pure: "12m ago" beside a timestamp; "just now" under a minute. function stageTrackerAgoWord(atMs, nowMs) { const mins = Math.floor((nowMs - atMs) / 60000); return !Number.isFinite(mins) || mins < 1 ? 'just now' : mins < 60 ? mins + 'm ago' : mins < 1440 ? Math.floor(mins / 60) + 'h ago' : Math.floor(mins / 1440) + 'd ago'; } // Evidence is supplied independently by the backend. A native 050 label @@ -307,7 +342,7 @@ const settledState = ['approved', 'changes_requested', 'human_decision', 'passing', 'failing', 'skipped', 'missing', 'waiting_ci', 'not_started', 'not_requested', 'closed', 'unverified'].includes(state); const fresh = Number.isFinite(observed) && !stale; const known = matches && state !== 'unknown' && (settledState || fresh); - const active = known && fresh && a.active; + let active = known && fresh && a.active; const perspectives = matches && kind === 'review' && Array.isArray(a.perspectives) ? a.perspectives : []; const perspectiveMark = v => v === 'approve' ? '✓' : ['changes_requested', 'reject'].includes(v) ? '✗' : v === 'requires_human' ? 'requires human' : String(v || '?'); const perspectiveLine = p => String(p.name || 'perspective') + ' ' + perspectiveMark(p.verdict) + (p.summary ? ': ' + p.summary : ''); @@ -317,18 +352,29 @@ const finding = matches && (state === 'failing' || state === 'changes_requested'); // A complete verdict parked on a person is settled (muted icon). const settled = matches && state === 'human_decision' && (!known || !a.active); - // ACTIVE = filled amber with its words; 1 ≤ active ≤ 2 on a row. A - // track is active while it genuinely runs on the current head, when - // it is the stage's own track (stageTrackerStageTrack), or when it is - // the stalled blocker of a row with nothing in motion (opts.stalled, - // still amber-muted). Everything else is the icon alone — green for - // a pass, red for a finding, neutral when not run or decided — with - // its count words in the tooltip (hivecommons/hive#16599). + // ACTIVE = filled amber with its words; exactly ONE active chevron on + // a row. A track would light while it genuinely runs on the current + // head, when it is the stage's own track (stageTrackerStageTrack), or + // when it is the stalled blocker of a row with nothing in motion + // (opts.stalled, still amber-muted) — but only the row's lead track + // (opts.lead, the earliest that would light; stageTrackerLeadTrack) + // is active. A demoted track is dim with a muted queued note + // (hivecommons/hive#17335: CI 7/11 and Review 5/5 both amber after a + // push). Everything else is the icon alone — green for a pass, red + // for a finding, neutral when not run or decided — with its count + // words in the tooltip (hivecommons/hive#16599). const running = stageTrackerTrackRunning(item, kind); const stageTrack = current && typeof stageTrackerStageTrack === 'function' && stageTrackerStageTrack(item) === kind; const stalled = !!(opts && opts.stalled) && current && !running; - const lit = running || stageTrack || stalled; - const cls = lit ? 'active' + (stalled ? ' ham-stalled' : '') : finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : 'todo'; + const wouldLight = running || stageTrack || stalled; + // No lead named (harnesses lifting this function alone): this track leads itself. + const lead = opts && opts.lead ? opts.lead : (wouldLight ? kind : ''); + const lit = wouldLight && lead === kind; + const queued = wouldLight && !lit; + const queuedNote = queued && typeof stageTrackerQueuedTrackNote === 'function' ? stageTrackerQueuedTrackNote(item, kind) : ''; + // A demoted track is still: no pulse beside the lead. + if (queued) active = false; + const cls = lit ? 'active' + (stalled ? ' ham-stalled' : '') : (finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : 'todo') + (queued ? ' ham-track-queued' : ''); const approvalPending = kind === 'ci' && matches ? stageTrackerWorkflowApprovalPending(a) : 0; const humanAction = approvalPending > 0 ? STAGE_TRACKER_WORKFLOW_APPROVAL_TIP : kind === 'review' && state === 'human_decision' ? 'Needs a person\'s decision' : ''; const personIco = stalled && humanAction ? stageTrackerIcon('human', 'ham-ico ham-actor-ico', humanAction) : ''; @@ -366,7 +412,7 @@ const codeFresh = code && code.head === item.head && code.source === 'fix-dispatch+successful-edit+verified-git-worktree' && code.active && code.state === 'fixing' && Number.isFinite(codeObserved) && codeObserved <= clock && clock - codeObserved <= activityFreshMS; if (!codeFresh) decided = decided.replace(/>(?:Fixing|Remediating)(?=\s|<)/g, '>Fix requested'); const sha7 = item.head ? String(item.head).slice(0, 7) : ''; - const lead = current && ownsPR && typeof stageTrackerTrackLead === 'function' ? stageTrackerTrackLead(item) : null; + const waitLead = current && ownsPR && typeof stageTrackerTrackLead === 'function' ? stageTrackerTrackLead(item) : null; // Only an active track carries words; an inactive one is its icon // (ring) in the pass / fail / neutral colour, words in the tooltip. const verdict = finished ? 'pass' : finding ? 'fail' : ''; @@ -386,10 +432,14 @@ (matches && a.actor ? ' · actor ' + a.actor : '') + (codeNote || contextWord ? ' · ' + (codeNote || contextWord) : '') + (hold ? ' · ' + (hold.pill || 'Held by @' + hold.by) + (hold.reason ? ' · ' + hold.reason : '') : '') + - (lead ? ' · hive is waiting on ' + lead.waitingOn + (lead.newHead && sha7 ? ' for new head ' + sha7 : '') : ''); + (waitLead ? ' · hive is waiting on ' + waitLead.waitingOn + (waitLead.newHead && sha7 ? ' for new head ' + sha7 : '') : '') + + (queuedNote ? ' · ' + queuedNote + ' behind ' + (lead === 'ci' ? 'CI' : 'Review') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); - const copy = `${evidenceLink}${personIco}`; - return `
  • ${copy}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; + // The demoted track's note sits outside the copy span: inactive + // chevrons carry no words, only this muted queued note. + const queuedHtml = queuedNote ? `${esc(queuedNote)}` : ''; + const copy = `${evidenceLink}${queuedHtml}${personIco}`; + return `
  • ${copy}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; } // Chevrons for one item. range bounds the columns the item owns (an @@ -463,8 +513,12 @@ // Column 50 is the row's phase and no track moves: one track is // filled stalled so the row always shows where it is (#16599). const stalledTrack = tracksRunning === 0 && segs.some(sg => sg.number === 50 && sg.state === 'active') && typeof stageTrackerStalledTrack === 'function' ? stageTrackerStalledTrack(item) : ''; + // Exactly one lit track (hivecommons/hive#17335): the earliest that + // would light leads; the other is dim with a queued note. + const col50 = segs.find(sg => sg.number === 50); + const leadTrack = col50 && typeof stageTrackerLeadTrack === 'function' ? stageTrackerLeadTrack(item, col50.state === 'active', stalledTrack) : ''; return segs.map(sg => { - if (sg.number === 50) return ['ci', 'review'].map(kind => stageTrackerActivityTrackHtml(item, kind, sg, sg.number < from || sg.number > to, nowMs, { stalled: stalledTrack === kind })).join(''); + if (sg.number === 50) return ['ci', 'review'].map(kind => stageTrackerActivityTrackHtml(item, kind, sg, sg.number < from || sg.number > to, nowMs, { stalled: stalledTrack === kind, lead: leadTrack })).join(''); if (sg.number < from || sg.number > to) return ``; const sentinel = !!(sg.detour && sg.detour.sentinel); const sentinelSuffix = !!(sg.detour && sg.detour.sentinelSuffix); @@ -702,12 +756,14 @@ // carries none of these and sits on a hive-driven stage is the hive's // to work through, so the dashboard must not dress it as a human call. const STAGE_TRACKER_HUMAN_MODS = ['hold', 'unauthorized', 'needs-human', 'needs-decision', 'needs-rebase', 'blocked', 'stalled']; - const STAGE_TRACKER_HANDLED_TEXT = 'stage ↓'; + // The pill says what happened in words ("stage ↓" read as a sort glyph, + // hivecommons/hive#17335); after a push it says what caused the fall. + const STAGE_TRACKER_HANDLED_TEXT = 'stage reset', STAGE_TRACKER_HANDLED_PUSH_TEXT = 'stage reset by push'; const STAGE_TRACKER_HANDLED_NOTE = 'the hive is handling it — no action needed; clears on the next forward step'; // True when the item is regressed but nothing about it waits on a // person: no human-gate modifier and not on a human-gated stage. Such a - // row gets a muted "stage ↓" pill and stays out of "Needs attention". + // row gets a muted "stage reset" pill and stays out of "Needs attention". function stageTrackerRegressionHandled(item) { const mods = Array.isArray(item.modifiers) ? item.modifiers : []; if (mods.indexOf('regressed') < 0) return false; @@ -887,10 +943,11 @@ .sort((x, y) => STAGE_TRACKER_MOD_PRIORITY.indexOf(x) - STAGE_TRACKER_MOD_PRIORITY.indexOf(y)); if (!mods.length) return sentinel; // A regression the hive is working through yields the lead pill to any - // other modifier and, alone, draws muted as "stage ↓" rather than red. + // other modifier and, alone, draws muted as "stage reset" rather than red. const handled = stageTrackerRegressionHandled(item); if (handled && mods.length > 1) mods.push(mods.shift()); - let text = handled && mods[0] === 'regressed' ? STAGE_TRACKER_HANDLED_TEXT : (STAGE_TRACKER_MOD_TEXT[mods[0]] || mods[0].replace(/-/g, ' ')); + const pushReset = !!(item.push && item.push.state === 'pushed') || /\b(push|new head|head changed)\b/i.test(String(item.regressed_reason || '')); + let text = handled && mods[0] === 'regressed' ? (pushReset ? STAGE_TRACKER_HANDLED_PUSH_TEXT : STAGE_TRACKER_HANDLED_TEXT) : (STAGE_TRACKER_MOD_TEXT[mods[0]] || mods[0].replace(/-/g, ' ')); // A hold the stage-label pass could attribute names who set it and why // ("Held by hive · reporter trust (issue #N by @X, contributor)"), so the // operator is not left reading "hold +1" (hivecommons/hive#15020). diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index c2e2f4bd2f..dcebded5c4 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1772,6 +1772,12 @@ .ham-seg.ham-activity-track.active.ham-stalled { animation: none; } .ham-seg.ham-activity-track.active.ham-stalled::before { display: none; } .ham-seg.ham-activity-track.ham-stalled .ham-actor-ico { margin-left: var(--sp-1); flex: 0 0 auto; } + /* A track that would light but is not the row's lead (Review while CI + runs on a freshly pushed head, hivecommons/hive#17335) stays dim — + the muted field, the ring alone — with a small queued note; never a + second amber chevron. Exactly one lit stage per row. */ + .ham-seg.ham-activity-track.ham-track-queued { background: var(--panel-strong); color: var(--muted); box-shadow: none; opacity: 1; animation: none; } + .ham-seg.ham-activity-track .ham-track-note { margin-left: var(--sp-1); font-size: var(--fs-2xs); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* The CI / Review glyph is a ring of steps (checks / perspectives, hivecommons/hive#16599): filled clockwise from twelve — done in the track's colour, failed red, the rest the muted track. While the @@ -18689,6 +18695,41 @@

    Where to get help

    return total > 0 && done < total && !settledWords.includes(a.state); } + // Whether a CI / Review track would light on its own: it runs on the + // current head, it is the stage's own track (column 50), or it is the + // stalled blocker of a row with nothing in motion. + function stageTrackerTrackWouldLight(item, kind, current, stalledTrack) { + if (stageTrackerTrackRunning(item, kind)) return true; + if (current && typeof stageTrackerStageTrack === 'function' && stageTrackerStageTrack(item) === kind) return true; + return stalledTrack === kind; + } + + // Pure: the ONE lit track of column 50 — exactly one chevron per row is + // the current stage. When both tracks would light (a push lands while + // the previous review is still being re-adjudicated: CI running AND + // Review adjudicating, hivecommons/hive#17335 under PR #17308), the + // earliest wins — CI — and Review is drawn dim with a "re-review + // queued" note instead of a second amber chevron. '' when neither + // track lights (the stage chevron is the row's one active chevron). + function stageTrackerLeadTrack(item, current, stalledTrack) { + return ['ci', 'review'].find(kind => stageTrackerTrackWouldLight(item, kind, current, stalledTrack)) || ''; + } + + // The muted note a demoted (would-light but not lead) track wears: + // "re-review queued" for a Review whose head was just pushed, "review + // in progress" while a reviewer genuinely runs beside CI, "review + // queued" / "CI queued" otherwise. + function stageTrackerQueuedTrackNote(item, kind) { + if (kind === 'ci') return 'CI queued'; + const push = item && item.push; + const code = item && item.code_activity; + const newHead = !!((code && code.head === item.head && code.state === 'pushed') || (push && push.state === 'pushed' && push.sha === item.head) || (typeof stageTrackerHiveOwesReReview === 'function' && stageTrackerHiveOwesReReview(item))); + if (newHead) return 're-review queued'; + const a = item && item.review_activity; + const st = a && a.head === item.head ? a.state : ''; + return st === 'reviewing' || st === 'adjudicating' ? 'review in progress' : 'review queued'; + } + // Pure: "12m ago" beside a timestamp; "just now" under a minute. function stageTrackerAgoWord(atMs, nowMs) { const mins = Math.floor((nowMs - atMs) / 60000); return !Number.isFinite(mins) || mins < 1 ? 'just now' : mins < 60 ? mins + 'm ago' : mins < 1440 ? Math.floor(mins / 60) + 'h ago' : Math.floor(mins / 1440) + 'd ago'; } // Evidence is supplied independently by the backend. A native 050 label @@ -18723,7 +18764,7 @@

    Where to get help

    const settledState = ['approved', 'changes_requested', 'human_decision', 'passing', 'failing', 'skipped', 'missing', 'waiting_ci', 'not_started', 'not_requested', 'closed', 'unverified'].includes(state); const fresh = Number.isFinite(observed) && !stale; const known = matches && state !== 'unknown' && (settledState || fresh); - const active = known && fresh && a.active; + let active = known && fresh && a.active; const perspectives = matches && kind === 'review' && Array.isArray(a.perspectives) ? a.perspectives : []; const perspectiveMark = v => v === 'approve' ? '✓' : ['changes_requested', 'reject'].includes(v) ? '✗' : v === 'requires_human' ? 'requires human' : String(v || '?'); const perspectiveLine = p => String(p.name || 'perspective') + ' ' + perspectiveMark(p.verdict) + (p.summary ? ': ' + p.summary : ''); @@ -18733,18 +18774,29 @@

    Where to get help

    const finding = matches && (state === 'failing' || state === 'changes_requested'); // A complete verdict parked on a person is settled (muted icon). const settled = matches && state === 'human_decision' && (!known || !a.active); - // ACTIVE = filled amber with its words; 1 ≤ active ≤ 2 on a row. A - // track is active while it genuinely runs on the current head, when - // it is the stage's own track (stageTrackerStageTrack), or when it is - // the stalled blocker of a row with nothing in motion (opts.stalled, - // still amber-muted). Everything else is the icon alone — green for - // a pass, red for a finding, neutral when not run or decided — with - // its count words in the tooltip (hivecommons/hive#16599). + // ACTIVE = filled amber with its words; exactly ONE active chevron on + // a row. A track would light while it genuinely runs on the current + // head, when it is the stage's own track (stageTrackerStageTrack), or + // when it is the stalled blocker of a row with nothing in motion + // (opts.stalled, still amber-muted) — but only the row's lead track + // (opts.lead, the earliest that would light; stageTrackerLeadTrack) + // is active. A demoted track is dim with a muted queued note + // (hivecommons/hive#17335: CI 7/11 and Review 5/5 both amber after a + // push). Everything else is the icon alone — green for a pass, red + // for a finding, neutral when not run or decided — with its count + // words in the tooltip (hivecommons/hive#16599). const running = stageTrackerTrackRunning(item, kind); const stageTrack = current && typeof stageTrackerStageTrack === 'function' && stageTrackerStageTrack(item) === kind; const stalled = !!(opts && opts.stalled) && current && !running; - const lit = running || stageTrack || stalled; - const cls = lit ? 'active' + (stalled ? ' ham-stalled' : '') : finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : 'todo'; + const wouldLight = running || stageTrack || stalled; + // No lead named (harnesses lifting this function alone): this track leads itself. + const lead = opts && opts.lead ? opts.lead : (wouldLight ? kind : ''); + const lit = wouldLight && lead === kind; + const queued = wouldLight && !lit; + const queuedNote = queued && typeof stageTrackerQueuedTrackNote === 'function' ? stageTrackerQueuedTrackNote(item, kind) : ''; + // A demoted track is still: no pulse beside the lead. + if (queued) active = false; + const cls = lit ? 'active' + (stalled ? ' ham-stalled' : '') : (finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : 'todo') + (queued ? ' ham-track-queued' : ''); const approvalPending = kind === 'ci' && matches ? stageTrackerWorkflowApprovalPending(a) : 0; const humanAction = approvalPending > 0 ? STAGE_TRACKER_WORKFLOW_APPROVAL_TIP : kind === 'review' && state === 'human_decision' ? 'Needs a person\'s decision' : ''; const personIco = stalled && humanAction ? stageTrackerIcon('human', 'ham-ico ham-actor-ico', humanAction) : ''; @@ -18782,7 +18834,7 @@

    Where to get help

    const codeFresh = code && code.head === item.head && code.source === 'fix-dispatch+successful-edit+verified-git-worktree' && code.active && code.state === 'fixing' && Number.isFinite(codeObserved) && codeObserved <= clock && clock - codeObserved <= activityFreshMS; if (!codeFresh) decided = decided.replace(/>(?:Fixing|Remediating)(?=\s|<)/g, '>Fix requested'); const sha7 = item.head ? String(item.head).slice(0, 7) : ''; - const lead = current && ownsPR && typeof stageTrackerTrackLead === 'function' ? stageTrackerTrackLead(item) : null; + const waitLead = current && ownsPR && typeof stageTrackerTrackLead === 'function' ? stageTrackerTrackLead(item) : null; // Only an active track carries words; an inactive one is its icon // (ring) in the pass / fail / neutral colour, words in the tooltip. const verdict = finished ? 'pass' : finding ? 'fail' : ''; @@ -18802,10 +18854,14 @@

    Where to get help

    (matches && a.actor ? ' · actor ' + a.actor : '') + (codeNote || contextWord ? ' · ' + (codeNote || contextWord) : '') + (hold ? ' · ' + (hold.pill || 'Held by @' + hold.by) + (hold.reason ? ' · ' + hold.reason : '') : '') + - (lead ? ' · hive is waiting on ' + lead.waitingOn + (lead.newHead && sha7 ? ' for new head ' + sha7 : '') : ''); + (waitLead ? ' · hive is waiting on ' + waitLead.waitingOn + (waitLead.newHead && sha7 ? ' for new head ' + sha7 : '') : '') + + (queuedNote ? ' · ' + queuedNote + ' behind ' + (lead === 'ci' ? 'CI' : 'Review') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); - const copy = `${evidenceLink}${personIco}`; - return `
  • ${copy}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; + // The demoted track's note sits outside the copy span: inactive + // chevrons carry no words, only this muted queued note. + const queuedHtml = queuedNote ? `${esc(queuedNote)}` : ''; + const copy = `${evidenceLink}${queuedHtml}${personIco}`; + return `
  • ${copy}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; } // Chevrons for one item. range bounds the columns the item owns (an @@ -18879,8 +18935,12 @@

    Where to get help

    // Column 50 is the row's phase and no track moves: one track is // filled stalled so the row always shows where it is (#16599). const stalledTrack = tracksRunning === 0 && segs.some(sg => sg.number === 50 && sg.state === 'active') && typeof stageTrackerStalledTrack === 'function' ? stageTrackerStalledTrack(item) : ''; + // Exactly one lit track (hivecommons/hive#17335): the earliest that + // would light leads; the other is dim with a queued note. + const col50 = segs.find(sg => sg.number === 50); + const leadTrack = col50 && typeof stageTrackerLeadTrack === 'function' ? stageTrackerLeadTrack(item, col50.state === 'active', stalledTrack) : ''; return segs.map(sg => { - if (sg.number === 50) return ['ci', 'review'].map(kind => stageTrackerActivityTrackHtml(item, kind, sg, sg.number < from || sg.number > to, nowMs, { stalled: stalledTrack === kind })).join(''); + if (sg.number === 50) return ['ci', 'review'].map(kind => stageTrackerActivityTrackHtml(item, kind, sg, sg.number < from || sg.number > to, nowMs, { stalled: stalledTrack === kind, lead: leadTrack })).join(''); if (sg.number < from || sg.number > to) return ``; const sentinel = !!(sg.detour && sg.detour.sentinel); const sentinelSuffix = !!(sg.detour && sg.detour.sentinelSuffix); @@ -19118,12 +19178,14 @@

    Where to get help

    // carries none of these and sits on a hive-driven stage is the hive's // to work through, so the dashboard must not dress it as a human call. const STAGE_TRACKER_HUMAN_MODS = ['hold', 'unauthorized', 'needs-human', 'needs-decision', 'needs-rebase', 'blocked', 'stalled']; - const STAGE_TRACKER_HANDLED_TEXT = 'stage ↓'; + // The pill says what happened in words ("stage ↓" read as a sort glyph, + // hivecommons/hive#17335); after a push it says what caused the fall. + const STAGE_TRACKER_HANDLED_TEXT = 'stage reset', STAGE_TRACKER_HANDLED_PUSH_TEXT = 'stage reset by push'; const STAGE_TRACKER_HANDLED_NOTE = 'the hive is handling it — no action needed; clears on the next forward step'; // True when the item is regressed but nothing about it waits on a // person: no human-gate modifier and not on a human-gated stage. Such a - // row gets a muted "stage ↓" pill and stays out of "Needs attention". + // row gets a muted "stage reset" pill and stays out of "Needs attention". function stageTrackerRegressionHandled(item) { const mods = Array.isArray(item.modifiers) ? item.modifiers : []; if (mods.indexOf('regressed') < 0) return false; @@ -19303,10 +19365,11 @@

    Where to get help

    .sort((x, y) => STAGE_TRACKER_MOD_PRIORITY.indexOf(x) - STAGE_TRACKER_MOD_PRIORITY.indexOf(y)); if (!mods.length) return sentinel; // A regression the hive is working through yields the lead pill to any - // other modifier and, alone, draws muted as "stage ↓" rather than red. + // other modifier and, alone, draws muted as "stage reset" rather than red. const handled = stageTrackerRegressionHandled(item); if (handled && mods.length > 1) mods.push(mods.shift()); - let text = handled && mods[0] === 'regressed' ? STAGE_TRACKER_HANDLED_TEXT : (STAGE_TRACKER_MOD_TEXT[mods[0]] || mods[0].replace(/-/g, ' ')); + const pushReset = !!(item.push && item.push.state === 'pushed') || /\b(push|new head|head changed)\b/i.test(String(item.regressed_reason || '')); + let text = handled && mods[0] === 'regressed' ? (pushReset ? STAGE_TRACKER_HANDLED_PUSH_TEXT : STAGE_TRACKER_HANDLED_TEXT) : (STAGE_TRACKER_MOD_TEXT[mods[0]] || mods[0].replace(/-/g, ' ')); // A hold the stage-label pass could attribute names who set it and why // ("Held by hive · reporter trust (issue #N by @X, contributor)"), so the // operator is not left reading "hold +1" (hivecommons/hive#15020). @@ -22544,10 +22607,45 @@

    All labels

    return out; }); } + // Operator-readable words for a ticket's place: the scheduler's + // "unverified"/"preparation" vocabulary stays in the data, not the row + // (hivecommons/hive#17335: "Recorded preparation owner · unverified · + // Head changed; current preparation unverified" read as jargon). function stageTrackerPreparationPlace(entry) { - if (entry.state === 'unverified') return 'Recorded preparation ' + (entry.role === 'owner' ? 'owner' : 'ticket') + ' · unverified'; + if (entry.state === 'unverified') return entry.role === 'owner' ? 'Recorded first for the base refresh' : 'Recorded base-refresh ticket'; if (entry.role === 'owner') return 'Preparing'; - return entry.position > 0 ? 'Waiting ' + stageTrackerOrdinal(entry.position) + ' for preparation' : 'Waiting for preparation · position unverified'; + return entry.position > 0 ? 'Waiting ' + stageTrackerOrdinal(entry.position) + ' for preparation' : 'Waiting for preparation · position not yet confirmed'; + } + // Why a recorded ticket is not (yet) confirmed, in plain language. The + // server's Detail strings are the signal; this is their wording. + function stageTrackerPreparationPlainDetail(entry) { + const d = String(entry.ticket && entry.ticket.detail || '').trim(); + const head7 = entry.head ? String(entry.head).slice(0, 7) : ''; + if (/^Head changed/i.test(d)) return 'ticket issued for an earlier head' + (head7 ? ' · re-checked on ' + head7 : ''); + if (/absent from current open snapshot/i.test(d)) return 'PR missing from the latest snapshot'; + if (/^Current head unknown/i.test(d)) return 'current head not known yet'; + if (/^Ticket age unknown/i.test(d)) return 'ticket time unknown'; + if (!d) return 'not yet confirmed for the current head'; + return d.replace(/\bunverified\b/gi, 'not yet confirmed').replace(/\bpreparation\b/gi, 'base refresh'); + } + function stageTrackerPreparationIssued(ticket) { + const age = stageTrackerPreparationAge(ticket, _stageTrackerPreparationNow); + return age === 'age unknown' ? 'ticket time unknown' : 'ticket issued ' + age + ' ago'; + } + // The pushed row's caption in operator words: who pushed what, and what + // runs next on it. Anything that is not the server's push caption passes through. + function stageTrackerPreparationCaption(item) { + const caption = item.caption || item.reason || ''; + const push = item && item.push; + if (!push || push.state !== 'pushed' || !/^(push seen|new head observed)\b/i.test(caption)) return caption; + const sha7 = push.sha ? String(push.sha).slice(0, 7) : ''; + const ago = /^push seen (.+?) ago → /.exec(caption); + const when = ago ? ago[1] + ' ago' : /just now/.test(caption) ? 'just now' : ''; + const ci = item.ci_activity && item.ci_activity.state === 'running' && (!item.head || !item.ci_activity.head || item.ci_activity.head === item.head); + const rereview = push.next === 're-review' || /re-review/.test(caption); + return ['New push' + (sha7 ? ' ' + sha7 : '') + (push.login ? ' by @' + push.login : '') + (when ? ' ' + when : '') + + ' → ' + (ci ? 'CI running' : 'CI queued') + (rereview ? ', review will rerun' : '')] + .concat(rereview ? ['previous review no longer applies'] : []).join(' · '); } function stageTrackerPreparationVisualSync(data, listedRows, pageRows, stages, nowMs) { _stageTrackerPreparationShown = new Map(); @@ -22591,8 +22689,8 @@

    All labels

    for (const e of group.members) { details.push('#' + e.ticket.number + ' · ' + stageTrackerPreparationPlace(e) + (e.location === 'page' ? '' : e.location === 'offpage' ? ' · another page or collapsed repo' : ' · hidden by filters or absent from snapshot') - + (e.state === 'unverified' ? ' · ' + (e.ticket.detail || 'current identity or eligibility unknown') : '') - + ' · ticket age ' + stageTrackerPreparationAge(e.ticket, _stageTrackerPreparationNow) + + (e.state === 'unverified' ? ' · ' + stageTrackerPreparationPlainDetail(e) : '') + + ' · ' + stageTrackerPreparationIssued(e.ticket) + ' · ticket head ' + (e.ticketHead || 'unknown') + ' · current head ' + (e.head || 'unknown')); } @@ -22674,16 +22772,17 @@

    All labels

    stageTrackerPreparationMark(item); const event = ctx && ctx.events && ctx.events[key]; const eventHtml = typeof stageTrackerEventHtml === 'function' ? stageTrackerEventHtml(key, ctx) : ''; - const caption = item.caption || item.reason || (e.state === 'current' ? e.ticket.pipeline : '') || ''; - const captionVisible = caption && event && event.text && event.text.includes(caption) + const rawCaption = item.caption || item.reason || (e.state === 'current' ? e.ticket.pipeline : '') || ''; + const caption = stageTrackerPreparationCaption(item) || rawCaption; + const captionVisible = rawCaption && event && event.text && event.text.includes(rawCaption) && eventHtml && !eventHtml.includes('cue-event-tucked'); const parts = caption && !captionVisible ? [caption] : []; if (!caption) parts.push('Current pipeline blocker unknown'); const preparation = e.state === 'unverified' - ? stageTrackerPreparationPlace(e) + ' · ' + (e.ticket.detail || 'current identity or eligibility unknown') + ? stageTrackerPreparationPlace(e) + ' · ' + stageTrackerPreparationPlainDetail(e) : 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)); + parts.push(stageTrackerPreparationIssued(e.ticket)); if (e.row.nested) parts.push('shown under issue #' + e.row.host.number); return eventHtml + `
    ${esc(parts.join(' · '))}
    `; } @@ -27446,7 +27545,7 @@

    All labels

    function stageTrackerPreparationWord(p) { if (!p) return ''; if (p.state === 'inactive') return 'Inactive preparation ticket · ' + (p.detail || 'not currently eligible'); - if (p.state !== 'current') return (p.role === 'owner' ? 'Recorded preparation owner' : 'Recorded waiting ticket') + ' · ' + (p.detail || 'current state unknown'); + if (p.state !== 'current') return (p.role === 'owner' ? 'Recorded first for the base refresh' : 'Recorded base-refresh ticket') + ' · ' + (p.detail || 'current state unknown').replace(/\bunverified\b/gi, 'not yet confirmed').replace(/\bpreparation\b/gi, 'base refresh'); return p.role === 'owner' ? 'Preparing base' : (Number(p.behind) > 0 ? 'Waiting for preparation behind #' + Number(p.behind) : 'Waiting for preparation; owner not confirmed'); } function stageTrackerPreparationAge(p, nowMs) { @@ -27460,7 +27559,7 @@

    All labels

    if (!p || p.state === 'inactive') return ''; if (typeof stageTrackerPreparationRepresented === 'function' && stageTrackerPreparationRepresented(item)) return ''; const word = stageTrackerPreparationWord(p); - const label = p.state === 'current' ? word : 'Preparation owner · unverified'; + const label = p.state === 'current' ? word : 'Base refresh · not yet confirmed'; return `${esc(label)}`; } function stageTrackerPreparationPopHtml(queues, nowMs) {