From 6b8c730ef11d6aee8a4840fd1fa491344fa19876 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 3 Nov 2026 23:18:41 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Activity=20Monitor:=20never?= =?UTF-8?q?=20more=20than=20two=20lit=20chevrons;=20unreported=20CI=20is?= =?UTF-8?q?=20pending,=20not=20amber?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rows lit three chevrons (PR in progress + "CI 7/11 · test not reported" + a decided review), and a row waiting on its contributor lit CI although nothing was running — checks not reported are simply not scheduled. - stageTrackerTrackRunning: a CI / Review track is amber only on motion evidence on the current head (check-run in_progress/queued, reviewer running/queued, or the backend active flag); never while the row waits on a person (071/072 waiting_owner, hold, needs-human). - Words without motion (missing/unknown/skipped, swarm requested, re-review pending) wear the new .pending class: current-phase text, muted field. - Both tracks running: the stage chevron is settled-current (bright words, no amber, no pulse) and its tooltip says it waits on CI and review. - Tests: every rows fixture asserts count(lit) <= 2 (prelude wrapper); cases for #16509 (one lit), #16268 waiting_owner (exactly one lit) and three-qualify (tracks win); node shapes in the remediation chevron test; existing expectations moved from active to pending where nothing runs. Fixes #16540 Signed-off-by: Andrew Anderson --- changelog.d/fixed-two-lit-chevrons.md | 1 + .../dashboard/stage_tracker_activity.test.js | 26 +++++---- .../dashboard/stage_tracker_advisory_test.go | 2 + .../dashboard/stage_tracker_motion_test.go | 4 ++ src/pkg/dashboard/stage_tracker_new_test.go | 2 + .../stage_tracker_remediation_chevron.test.js | 57 ++++++++++++++++++- .../stage_tracker_repo_grouping_test.go | 2 + .../stage_tracker_ui_prelude_test.go | 9 ++- .../dashboard/stage_tracker_ui_rows_test.go | 27 +++++++++ src/pkg/dashboard/static-src/css/tracker.css | 6 ++ .../static-src/js/tracker-row-strip.js | 39 ++++++++++++- src/pkg/dashboard/static/index.html | 45 ++++++++++++++- 12 files changed, 203 insertions(+), 17 deletions(-) create mode 100644 changelog.d/fixed-two-lit-chevrons.md diff --git a/changelog.d/fixed-two-lit-chevrons.md b/changelog.d/fixed-two-lit-chevrons.md new file mode 100644 index 0000000000..959095bfab --- /dev/null +++ b/changelog.d/fixed-two-lit-chevrons.md @@ -0,0 +1 @@ +- Activity Monitor: a row never lights more than two chevrons. CI and Review are amber only while a check-run or a review perspective is actually running on the current head; unreported checks, unknown evidence and rows waiting on a person render as pending words. When both tracks run, the stage chevron is settled-current (words, no amber, no pulse) (#16540). diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 33a005507f..9652679658 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -22,7 +22,7 @@ const STAGE_TRACKER_NEEDS_DECISION = 85, STAGE_TRACKER_ISSUE_NEEDS_DECISION = 45 const STAGE_TRACKER_ISSUE_DECISION_COLUMN = 10, STAGE_TRACKER_TRIAGE_NEEDED = 15, STAGE_TRACKER_POSSIBLY_EXISTS = 17; const STAGE_TRACKER_PRE_MERGE_SOAK = 95; `; -const track = new Function('esc', 'stageTrackerIcon', fn(strip, 'stageTrackerTrackLead') + fn(strip, 'stageTrackerHiveOwnsRepair') + fn(strip, 'stageTrackerTrackWord') + fn(strip, 'stageTrackerActivityTrackHtml') + ';return stageTrackerActivityTrackHtml;')(esc, (n, cls) => ``); +const track = new Function('esc', 'stageTrackerIcon', fn(strip, 'stageTrackerTrackLead') + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerHiveOwnsRepair') + fn(strip, 'stageTrackerTrackWord') + fn(strip, 'stageTrackerActivityTrackHtml') + ';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, () => ''); const now = Date.parse('2026-11-02T21:00:00Z'); @@ -116,7 +116,7 @@ function stageTrackerActorKind() { return ''; } function stageTrackerActorTip() { return ''; } function stageTrackerMotion() { return STAGE_TRACKER_MOTION_STATIC; } function stageTrackerIcon(n) { return ''; } -` + fn(strip, 'stageTrackerStripItems') + ';return stageTrackerStripItems;')(esc, segments, track, ...Object.values(helpers)); +` + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerStripItems') + ';return stageTrackerStripItems;')(esc, segments, track, ...Object.values(helpers)); const renderStrip = makeStripRenderer(); function physicalTracks(item) { @@ -474,7 +474,7 @@ test('Hive #16434 shape: missing current-head CI and review stay unknown but vis review_activity: { head: 'head', state: 'unknown', caption: 'Review unknown · current-head evidence unavailable', source: 'unavailable' }, })); for (const cell of [cells.ci, cells.review]) { - assert.match(cell, /ham-activity-track active ham-current/, 'absent evidence in the current phase is still in progress: lit, with words'); + assert.match(cell, /ham-activity-track pending ham-current/, 'absent evidence in the current phase is pending: words, no amber (#16540)'); assert.match(cell, /data-activity-state="unknown"/); assert.match(cell, /data-display-state="unknown"/); assert.doesNotMatch(cell, /data-motion=|ham-activity-track done/); @@ -492,7 +492,7 @@ test('Hive #16268 shape: held native Fixing waits for a fixer in the CI/Review p review_activity: activity('approved', 'Review approved'), }); const cells = physicalTracks(item); - assert.match(cells.ci, /active ham-current/); + assert.match(cells.ci, /pending ham-current/, 'held: unreported checks are not motion (#16540)'); assert.match(cells.ci, /CI \?\/\? · no checks reported yet'; } ` + anchor + fn(row, 'stageTrackerSegments') + fn(strip, 'stageTrackerActivityTrackHtml') + fn(strip, 'stageTrackerStripItems'); @@ -641,7 +642,12 @@ function stageTrackerIcon(n, cls) { return ''; } }; const html = render(item, [{ number: 30, short: 'PR in progress' }, { number: 50, short: 'CI / Review' }, { number: 70, short: 'Fixing', branch_from: 50 }], null, now, {}); assert.equal((html.match(/
  • ]*data-motion/); + assert.match(html, /Waiting on CI and review, both running — /); assert.match(html, /ham-detour[^>]*>Remediating · fixer/); assert.match(html, /data-track="review"[^]*Review working · reviewer/); item.code_activity.observed_at = new Date(now - 300000).toISOString(); @@ -760,13 +766,13 @@ test('#16484: the three screenshot rows — both tracks lit with counts, swarm r ci_activity: fresh('running', { checks_passed: 9, checks_total: 14, active: true }), review_activity: fresh('unknown', { perspectives_done: 0, perspectives_total: 5 }) })); assert.equal(cls(cells.ci), 'active'); assert.equal(text(cells.ci), 'CI 9/14 · running'); assert.match(cells.ci, /data-motion="active"/); - assert.equal(cls(cells.review), 'active'); assert.equal(text(cells.review), 'Review 0/5 · re-review pending (new head)'); + assert.equal(cls(cells.review), 'pending', 'a pending re-review is words without motion (#16540)'); assert.equal(text(cells.review), 'Review 0/5 · re-review pending (new head)'); assert.doesNotMatch(cells.review, /data-motion/); assert.match(cells.review, /hive is waiting on CI for new head d3c0824/, 'the tooltip still says which track leads'); // #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' }) })); - assert.equal(cls(cells.review), 'active'); assert.equal(text(cells.review), 'Review 0/5 · swarm requested'); + assert.equal(cls(cells.review), 'pending'); assert.equal(text(cells.review), 'Review 0/5 · swarm requested'); assert.equal(cls(cells.ci), 'active'); assert.equal(text(cells.ci), 'CI 2/14 · running'); // #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' }, diff --git a/src/pkg/dashboard/stage_tracker_advisory_test.go b/src/pkg/dashboard/stage_tracker_advisory_test.go index 2b3fc7b1cc..e14873bdf8 100644 --- a/src/pkg/dashboard/stage_tracker_advisory_test.go +++ b/src/pkg/dashboard/stage_tracker_advisory_test.go @@ -233,6 +233,8 @@ func TestStageTrackerAdvisoryChipAndAction(t *testing.T) { jsFunc(t, html, "stageTrackerActorTip"), jsFunc(t, html, "stageTrackerHeadline"), jsFunc(t, html, "stageTrackerSegments"), + jsFunc(t, html, "stageTrackerWaitingOnPerson"), + jsFunc(t, html, "stageTrackerTrackRunning"), jsFunc(t, html, "stageTrackerActivityTrackHtml"), jsFunc(t, html, "stageTrackerStripItems"), jsFunc(t, html, "stageTrackerItemOnHold"), diff --git a/src/pkg/dashboard/stage_tracker_motion_test.go b/src/pkg/dashboard/stage_tracker_motion_test.go index 172e70d097..ebcc249adc 100644 --- a/src/pkg/dashboard/stage_tracker_motion_test.go +++ b/src/pkg/dashboard/stage_tracker_motion_test.go @@ -431,6 +431,8 @@ func TestStageTrackerMotionRowStamp(t *testing.T) { jsConstLine(t, html, "STAGE_TRACKER_MOTION_HUMAN_MODS"), jsFunc(t, html, "stageTrackerMotion"), jsFunc(t, html, "stageTrackerShortAgo"), + jsFunc(t, html, "stageTrackerWaitingOnPerson"), + jsFunc(t, html, "stageTrackerTrackRunning"), jsFunc(t, html, "stageTrackerActivityTrackHtml"), jsFunc(t, html, "stageTrackerStripItems"), jsFunc(t, html, "stageTrackerCurrentStageHtml"), @@ -565,6 +567,8 @@ func TestStageTrackerMotionPreviewSample(t *testing.T) { jsFunc(t, html, "stageTrackerHeaderHtml"), jsFunc(t, html, "stageTrackerHoldLabels"), jsFunc(t, html, "stageTrackerSoakLeft"), + jsFunc(t, html, "stageTrackerWaitingOnPerson"), + jsFunc(t, html, "stageTrackerTrackRunning"), jsFunc(t, html, "stageTrackerActivityTrackHtml"), jsFunc(t, html, "stageTrackerStripItems"), jsFunc(t, html, "stageTrackerCurrentStageHtml"), diff --git a/src/pkg/dashboard/stage_tracker_new_test.go b/src/pkg/dashboard/stage_tracker_new_test.go index f7e97fe328..70e3d96be9 100644 --- a/src/pkg/dashboard/stage_tracker_new_test.go +++ b/src/pkg/dashboard/stage_tracker_new_test.go @@ -297,6 +297,8 @@ func TestStageTrackerNewRowRendering(t *testing.T) { jsFunc(t, html, "stageTrackerHumanReason"), jsFunc(t, html, "stageTrackerHeadline"), jsFunc(t, html, "stageTrackerSegments"), + jsFunc(t, html, "stageTrackerWaitingOnPerson"), + jsFunc(t, html, "stageTrackerTrackRunning"), jsFunc(t, html, "stageTrackerActivityTrackHtml"), jsFunc(t, html, "stageTrackerStripItems"), jsFunc(t, html, "stageTrackerTooltip"), diff --git a/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js b/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js index e1cb24e5c9..74d4c179ac 100644 --- a/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js +++ b/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js @@ -27,7 +27,7 @@ const STAGE_TRACKER_NEEDS_DECISION = 85, STAGE_TRACKER_ISSUE_NEEDS_DECISION = 45 const STAGE_TRACKER_ISSUE_DECISION_COLUMN = 10, STAGE_TRACKER_TRIAGE_NEEDED = 15, STAGE_TRACKER_POSSIBLY_EXISTS = 17; const STAGE_TRACKER_PRE_MERGE_SOAK = 95; `; -const track = new Function('esc', 'stageTrackerIcon', fn(strip, 'stageTrackerTrackLead') + fn(strip, 'stageTrackerHiveOwnsRepair') + fn(strip, 'stageTrackerTrackWord') + fn(strip, 'stageTrackerActivityTrackHtml') + ';return stageTrackerActivityTrackHtml;')(esc, (n, cls) => ``); +const track = new Function('esc', 'stageTrackerIcon', fn(strip, 'stageTrackerTrackLead') + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerHiveOwnsRepair') + fn(strip, 'stageTrackerTrackWord') + fn(strip, 'stageTrackerActivityTrackHtml') + ';return stageTrackerActivityTrackHtml;')(esc, (n, cls) => ``); const getAnchor = new Function(globals + anchor + ';return stageTrackerAnchor;')(); const segments = new Function('stageTrackerAnchor', globals + ` const STAGE_TRACKER_ACTIVE_WORD = {70: 'Fixing'}; @@ -44,7 +44,7 @@ function stageTrackerActorKind() { return ''; } function stageTrackerActorTip() { return ''; } function stageTrackerMotion() { return STAGE_TRACKER_MOTION_STATIC; } function stageTrackerIcon(n) { return ''; } -` + fn(strip, 'stageTrackerStripItems') + ';return stageTrackerStripItems;')(esc, segments, track); +` + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerStripItems') + ';return stageTrackerStripItems;')(esc, segments, track); const stages = [{ number: 70, branch_from: 50 }, { number: 71, branch_from: 50 }, { number: 72, branch_from: 50 }]; const now = Date.parse('2026-11-04T02:45:00Z'); @@ -139,3 +139,56 @@ test('#16494 keeps: review perspectives still running stay amber beside running assert.match(c[5], /ham-activity-track active ham-current/); assert.match(c[5], /Review 2\/5 · reviewer-2 reviewing (html.match(/class="ham-seg active(?! [^"]*ham-settled-current)|class="ham-seg ham-activity-track active\b/g) || []).length; +const seen = '2026-11-04T02:44:00Z'; + +test('#16509 row: adopted, CI 7/11 unreported, review 5/5 decided → one amber chevron', () => { + const item = redPR({ stage: 74, display_column: 30, + code_activity: { head: 'abc1234def', state: 'adopted', caption: 'Adopted by hive · activity', source: 'adoption', observed_at: seen }, + ci_activity: { head: 'abc1234def', 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 }, + review_activity: { head: 'abc1234def', state: 'human_decision', caption: 'Review findings · human decision', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen } }); + const c = cells(item); + assert.match(c[3], /class="ham-seg active detoured"/, 'the stage chevron is the one lit chevron'); + assert.match(c[4], /class="ham-seg ham-activity-track pending"/, 'unreported checks are not motion'); + assert.match(c[4], /CI 7\/11 · test not reported { + const owner = { head: 'abc1234def', state: 'waiting_owner', caption: 'Waiting for @hanthor · not observed coding', actor: 'hanthor', source: 'native-author-wait', observed_at: seen }; + const ci = { head: 'abc1234def', 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 }; + const approved = { head: 'abc1234def', state: 'approved', caption: 'Review approved', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen }; + const c = cells(redPR({ stage: 71, display_column: 30, author: 'hanthor', author_kind: 'human', code_activity: owner, ci_activity: ci, review_activity: approved })); + assert.match(c[3], /class="ham-seg active detoured"/); + assert.match(c[4], /class="ham-seg ham-activity-track pending"[^]*CI 7\/11 · test not reported { + const running = { + code_activity: { head: 'abc1234def', state: 'remediating', caption: 'Remediating · scanner · 4m', actor: 'scanner', active: true, source: 'fix-dispatch', since: '2026-11-04T02:41:00Z', observed_at: seen }, + ci_activity: { head: 'abc1234def', state: 'running', active: true, caption: 'CI running', checks_passed: 4, checks_total: 11, source: 'checks', observed_at: seen }, + review_activity: { head: 'abc1234def', state: 'reviewing', active: true, actor: 'reviewer-2', caption: 'Review working', perspectives_done: 2, perspectives_total: 5, source: 'dispatch', observed_at: seen } }; + const both = cells(redPR({ display_column: 30, ...running })); + assert.match(both[3], /class="ham-seg active ham-settled-current ham-remediation-remediating detoured"/); + assert.doesNotMatch(both[3], /data-motion=/); + assert.match(both[3], /Remediating · scanner · 4m/, 'the words stay'); + assert.match(both[3], /Waiting on CI and review, both running/); + assert.match(both[4], /ham-activity-track active"[^]*data-motion="active"/); + assert.match(both[5], /ham-activity-track active"[^]*data-motion="active"/); + assert.equal(litCount(both.join('')), 2); + // One track running: the stage chevron keeps its own fill and pulse. + const one = cells(redPR({ display_column: 30, ...running, review_activity: { ...running.review_activity, state: 'changes_requested', active: false } })); + assert.match(one[3], /class="ham-seg active ham-remediation-remediating detoured"[^>]*data-motion="active"/); + assert.equal(litCount(one.join('')), 2); +}); diff --git a/src/pkg/dashboard/stage_tracker_repo_grouping_test.go b/src/pkg/dashboard/stage_tracker_repo_grouping_test.go index cbfb593f47..be70f59325 100644 --- a/src/pkg/dashboard/stage_tracker_repo_grouping_test.go +++ b/src/pkg/dashboard/stage_tracker_repo_grouping_test.go @@ -152,6 +152,8 @@ func stageTrackerRepoGroupingHarness(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerMotion"), jsFunc(t, html, "stageTrackerHoldLabels"), jsFunc(t, html, "stageTrackerSoakLeft"), + jsFunc(t, html, "stageTrackerWaitingOnPerson"), + jsFunc(t, html, "stageTrackerTrackRunning"), jsFunc(t, html, "stageTrackerActivityTrackHtml"), jsFunc(t, html, "stageTrackerStripItems"), jsFunc(t, html, "stageTrackerCurrentStageHtml"), diff --git a/src/pkg/dashboard/stage_tracker_ui_prelude_test.go b/src/pkg/dashboard/stage_tracker_ui_prelude_test.go index 8be70f52a6..9d2356f051 100644 --- a/src/pkg/dashboard/stage_tracker_ui_prelude_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_prelude_test.go @@ -94,6 +94,8 @@ func stageTrackerRowsPreludeJS(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerTrainIconHtml"), jsFunc(t, html, "stageTrackerHoldLabels"), jsFunc(t, html, "stageTrackerSoakLeft"), + jsFunc(t, html, "stageTrackerWaitingOnPerson"), + jsFunc(t, html, "stageTrackerTrackRunning"), jsFunc(t, html, "stageTrackerHiveOwnsRepair"), jsFunc(t, html, "stageTrackerTrackWord"), jsFunc(t, html, "stageTrackerActivityTrackHtml"), @@ -196,8 +198,13 @@ 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. +const litChevrons = (html) => (html.match(/class="ham-seg active(?! [^"]*ham-settled-current)|class="ham-seg ham-activity-track active\b/g) || []).length; +const atMostTwoLit = (item, row) => row.split('aria-label="Pipeline progress"').slice(1).forEach((s, i) => assert.ok(litChevrons(s) <= 2, 'fixture ' + (item.repo || '') + '#' + item.number + ' strip ' + i + ' lights ' + litChevrons(s) + ' chevrons: ' + s)); const rawRowHtml = stageTrackerRowHtml; -stageTrackerRowHtml = (item, stages, ctx) => { rebaseCoherent(item); return rawRowHtml(item, stages, ctx); }; +stageTrackerRowHtml = (item, stages, ctx) => { rebaseCoherent(item); const row = rawRowHtml(item, stages, ctx); atMostTwoLit(item, row); 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('
    [^<]*<\/span>/.test(row) && !/ review_activity: { head: 'f269349', state: 'human_decision', caption: 'Review findings · human decision', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen } }, stages, ctx); assert.ok(/
  • ]*>[\s\S]*?Review 5\/5 · awaiting human decision<\/span>/.test(parkedRow), 'genuinely parked on a person keeps the human word, still not amber: ' + parkedRow); } +// hivecommons/hive#16540 rows. #16509: adopted, CI 7/11 unreported, review +// 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. +{ + 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 }; + const lit = (html) => litChevrons(strip(html)); + const three = stageTrackerRowHtml({ repo: 'acme/console', number: 16509, kind: 'pr', stage: 74, display_column: 30, head: 'f269349', author: 'thatguywob', author_kind: 'human', + code_activity: { head: 'f269349', state: 'adopted', caption: 'Adopted by hive · activity', source: 'adoption', observed_at: seen }, ci_activity: unreported, + review_activity: { head: 'f269349', state: 'human_decision', caption: 'Review findings · human decision', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen } }, stages, ctx); + assert.strictEqual(lit(three), 1, 'adopted + unreported CI + decided review lights one chevron: ' + strip(three)); + assert.ok(/
  • ]*>[\s\S]*?CI 7\/11 · test not reported<\/span>/.test(three), 'unreported checks are pending, not amber: ' + three); + const owner = stageTrackerRowHtml({ repo: 'acme/console', number: 16268, kind: 'pr', stage: 71, display_column: 30, head: 'f269349', author: 'hanthor', author_kind: 'human', + code_activity: { head: 'f269349', state: 'waiting_owner', caption: 'Waiting for @hanthor · not observed coding', actor: 'hanthor', source: 'native-author-wait', observed_at: seen }, ci_activity: unreported, + review_activity: { head: 'f269349', state: 'approved', caption: 'Review approved', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen } }, stages, ctx); + assert.strictEqual(lit(owner), 1, 'with the contributor: only the stage chevron is lit: ' + strip(owner)); + assert.ok(/
  • ]*aria-current="step"/.test(owner) && owner.includes('Waiting for @hanthor'), owner); + assert.ok(/data-track="ci"[^>]*>[\s\S]*?CI 7\/11 · test not reported<\/span>/.test(owner) && /
  • ]*>[\s\S]*?Review 5\/5 approved<\/span>/.test(owner), owner); + const busy = stageTrackerRowHtml({ repo: 'acme/console', number: 16456, kind: 'pr', stage: 70, display_column: 30, head: 'f269349', author: 'hive[bot]', author_kind: 'hive', + 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.ok(/
  • /.test(row) && titled(strip(row)).length === 1, row); diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index d779d80254..5002b9ed8f 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -377,6 +377,12 @@ .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; } + /* Words without motion (checks not reported, unknown evidence, a row + parked on a person): current-phase text on a muted field, never amber. */ + .ham-seg.ham-activity-track.pending { background: var(--surface-3); color: var(--text); box-shadow: none; opacity: 1; animation: none; } + /* The stage chevron while both tracks run: bright words, no amber, no pulse. */ + .ham-seg.active.ham-settled-current { background: var(--surface-3); color: var(--text); animation: none; } + .ham-seg.active.ham-settled-current::before { display: none; } .ham-seg.ham-activity-track.done.decided { background: var(--surface-3); color: var(--muted); box-shadow: none; opacity: 1; animation: none; } /* The count words stay on one line and ellipsize instead of wrapping. */ .ham-chevron-copy.ham-track-state .ham-ico { vertical-align: -2px; margin-right: 3px; } 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 5d69383e19..5f773b014c 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -95,6 +95,31 @@ return !!(hive || item.stage === 74 || item.adopted_by); } + // A row parked on a person: the contributor's move (071/072 or a + // waiting_owner code word), a hold, or a human decision. Nothing of + // the hive's is in motion on it, so no CI / Review track is amber. + function stageTrackerWaitingOnPerson(item) { + if (!item) return false; + if (item.needs_human || item.on_hold || item.hold) return true; + const stage = Number(item.stage); + if (stage === 71 || stage === 72) return true; + const code = item.code_activity; + return !!(code && code.head === item.head && code.state === 'waiting_owner'); + } + + // A CI / Review track is in motion only on concrete evidence on the + // current head: a check-run in_progress / queued, or a reviewer + // running / queued (or the backend's own active flag). Checks that + // have not reported, unknown evidence and settled verdicts are not + // motion (hivecommons/hive#16540). + function stageTrackerTrackRunning(item, kind) { + const a = item && item[kind + '_activity']; + if (!a || !item.head || a.head !== item.head) return false; + if (stageTrackerWaitingOnPerson(item)) return false; + const moving = kind === 'ci' ? ['running', 'queued'] : ['reviewing', 'adjudicating', 'assigned']; + return !!(a.active || moving.includes(a.state)); + } + // 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 @@ -125,7 +150,10 @@ // 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'; + // At most two chevrons on a row are ever amber: a track is active + // only while it is running; words without motion are pending. + const running = stageTrackerTrackRunning(item, kind); + const cls = finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : running ? 'active' : 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() : ''; @@ -215,6 +243,12 @@ const remediation = codeOnHead && ['unassigned', 'remediating', 'fix_pushed'].includes(code.state) ? code.state : ''; if (remediation === 'remediating' && Number(item.display_column) === 30) motion = STAGE_TRACKER_MOTION_ACTIVE; const evidence = item.remediation && item.remediation.kind ? 'evidence: ' + item.remediation.kind + (item.remediation.actor ? ' by ' + item.remediation.actor : '') + (item.remediation.since ? ' since ' + item.remediation.since : '') + (item.remediation.source ? ' (' + item.remediation.source + ')' : '') : ''; + // Both tracks running: the PR waits on them, nobody works it. The + // stage chevron is settled-current (bright words, no amber, no pulse) + // so the row never lights three chevrons (hivecommons/hive#16540). + const tracksRunning = ['ci', 'review'].filter(kind => stageTrackerTrackRunning(item, kind)).length; + const waitingOnTracks = tracksRunning === 2; + if (waitingOnTracks) motion = STAGE_TRACKER_MOTION_STATIC; const motionAttr = motion === STAGE_TRACKER_MOTION_STATIC ? '' : ` data-motion="${motion}"`; return segs.map(sg => { if (sg.number === 50) return ['ci', 'review'].map(kind => stageTrackerActivityTrackHtml(item, kind, sg, sg.number < from || sg.number > to, nowMs)).join(''); @@ -222,7 +256,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, sg.cap ? 'cap' : '', sg.state === 'active' && !sg.cap && waitingOnTracks ? 'ham-settled-current' : '', 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 = ''; @@ -267,6 +301,7 @@ if (code.blocker) tip += ' · ' + code.blocker; if (claimant) tip += ' · ' + stageTrackerClaimantLine(claimant, nowMs); } + if (waitingOnTracks && !sg.cap) tip = 'Waiting on CI and review, both running — ' + tip; } let inner; // A lit chevron on a row parked on a person ("Needs human decision", diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 58d56b99ef..fbea85950e 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1714,6 +1714,12 @@ .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; } + /* Words without motion (checks not reported, unknown evidence, a row + parked on a person): current-phase text on a muted field, never amber. */ + .ham-seg.ham-activity-track.pending { background: var(--surface-3); color: var(--text); box-shadow: none; opacity: 1; animation: none; } + /* The stage chevron while both tracks run: bright words, no amber, no pulse. */ + .ham-seg.active.ham-settled-current { background: var(--surface-3); color: var(--text); animation: none; } + .ham-seg.active.ham-settled-current::before { display: none; } .ham-seg.ham-activity-track.done.decided { background: var(--surface-3); color: var(--muted); box-shadow: none; opacity: 1; animation: none; } /* The count words stay on one line and ellipsize instead of wrapping. */ .ham-chevron-copy.ham-track-state .ham-ico { vertical-align: -2px; margin-right: 3px; } @@ -17885,6 +17891,31 @@

    Where to get help

    return !!(hive || item.stage === 74 || item.adopted_by); } + // A row parked on a person: the contributor's move (071/072 or a + // waiting_owner code word), a hold, or a human decision. Nothing of + // the hive's is in motion on it, so no CI / Review track is amber. + function stageTrackerWaitingOnPerson(item) { + if (!item) return false; + if (item.needs_human || item.on_hold || item.hold) return true; + const stage = Number(item.stage); + if (stage === 71 || stage === 72) return true; + const code = item.code_activity; + return !!(code && code.head === item.head && code.state === 'waiting_owner'); + } + + // A CI / Review track is in motion only on concrete evidence on the + // current head: a check-run in_progress / queued, or a reviewer + // running / queued (or the backend's own active flag). Checks that + // have not reported, unknown evidence and settled verdicts are not + // motion (hivecommons/hive#16540). + function stageTrackerTrackRunning(item, kind) { + const a = item && item[kind + '_activity']; + if (!a || !item.head || a.head !== item.head) return false; + if (stageTrackerWaitingOnPerson(item)) return false; + const moving = kind === 'ci' ? ['running', 'queued'] : ['reviewing', 'adjudicating', 'assigned']; + return !!(a.active || moving.includes(a.state)); + } + // 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 @@ -17915,7 +17946,10 @@

    Where to get help

    // 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'; + // At most two chevrons on a row are ever amber: a track is active + // only while it is running; words without motion are pending. + const running = stageTrackerTrackRunning(item, kind); + const cls = finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : running ? 'active' : 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() : ''; @@ -18005,6 +18039,12 @@

    Where to get help

    const remediation = codeOnHead && ['unassigned', 'remediating', 'fix_pushed'].includes(code.state) ? code.state : ''; if (remediation === 'remediating' && Number(item.display_column) === 30) motion = STAGE_TRACKER_MOTION_ACTIVE; const evidence = item.remediation && item.remediation.kind ? 'evidence: ' + item.remediation.kind + (item.remediation.actor ? ' by ' + item.remediation.actor : '') + (item.remediation.since ? ' since ' + item.remediation.since : '') + (item.remediation.source ? ' (' + item.remediation.source + ')' : '') : ''; + // Both tracks running: the PR waits on them, nobody works it. The + // stage chevron is settled-current (bright words, no amber, no pulse) + // so the row never lights three chevrons (hivecommons/hive#16540). + const tracksRunning = ['ci', 'review'].filter(kind => stageTrackerTrackRunning(item, kind)).length; + const waitingOnTracks = tracksRunning === 2; + if (waitingOnTracks) motion = STAGE_TRACKER_MOTION_STATIC; const motionAttr = motion === STAGE_TRACKER_MOTION_STATIC ? '' : ` data-motion="${motion}"`; return segs.map(sg => { if (sg.number === 50) return ['ci', 'review'].map(kind => stageTrackerActivityTrackHtml(item, kind, sg, sg.number < from || sg.number > to, nowMs)).join(''); @@ -18012,7 +18052,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, sg.cap ? 'cap' : '', sg.state === 'active' && !sg.cap && waitingOnTracks ? 'ham-settled-current' : '', 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 = ''; @@ -18057,6 +18097,7 @@

    Where to get help

    if (code.blocker) tip += ' · ' + code.blocker; if (claimant) tip += ' · ' + stageTrackerClaimantLine(claimant, nowMs); } + if (waitingOnTracks && !sg.cap) tip = 'Waiting on CI and review, both running — ' + tip; } let inner; // A lit chevron on a row parked on a person ("Needs human decision", From 3402c49f3401b7e3bca6321e73e1baa4d7bf2e41 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 3 Nov 2026 23:31:29 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20Tracks=20are=20filled=20only?= =?UTF-8?q?=20while=20running;=20queued=20swarm=20counts=200/N?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CSS: .done / .failing / .pending / .decided on a CI or Review track are words in their colour (green pass, red finding, muted pending) on the muted field — only a running track (.active) is filled. A PR-in-progress row with changes requested shows exactly one filled chevron. - Go: stageTrackerCountPerspectives zeroes perspectives_done when the swarm is unassigned (requested / queued), so "Review 5/5 · swarm requested" cannot occur; total falls back to the configured set. - Tests: Go count case (#16539 shape), rows fixture (#16456 row → 1 lit), node shapes + CSS pins; lift the new helpers in the human-attention test (runtime-tests failure on this PR). Refs #16540 Signed-off-by: Andrew Anderson --- changelog.d/fixed-two-lit-chevrons.md | 2 +- src/pkg/dashboard/stage_tracker_activity.go | 9 ++++++++ .../dashboard/stage_tracker_activity.test.js | 7 +++++- .../dashboard/stage_tracker_activity_test.go | 12 ++++++++++ .../stage_tracker_human_attention.test.js | 2 +- .../stage_tracker_remediation_chevron.test.js | 18 +++++++++++++++ .../dashboard/stage_tracker_ui_rows_test.go | 9 ++++++++ src/pkg/dashboard/static-src/css/tracker.css | 12 +++++++--- .../static-src/js/tracker-row-strip.js | 10 +++++---- src/pkg/dashboard/static/index.html | 22 +++++++++++++------ 10 files changed, 86 insertions(+), 17 deletions(-) diff --git a/changelog.d/fixed-two-lit-chevrons.md b/changelog.d/fixed-two-lit-chevrons.md index 959095bfab..55aa7aa9bf 100644 --- a/changelog.d/fixed-two-lit-chevrons.md +++ b/changelog.d/fixed-two-lit-chevrons.md @@ -1 +1 @@ -- Activity Monitor: a row never lights more than two chevrons. CI and Review are amber only while a check-run or a review perspective is actually running on the current head; unreported checks, unknown evidence and rows waiting on a person render as pending words. When both tracks run, the stage chevron is settled-current (words, no amber, no pulse) (#16540). +- Activity Monitor: a row never lights more than two chevrons, and a filled chevron now always means "this is where the item is / what is in motion". CI and Review are filled (amber) only while a check-run or a review perspective is actually running on the current head; passed / approved, findings, pending and decided verdicts are words in their colour on the muted field. Unreported checks and rows waiting on a person render as pending words, never amber. When both tracks run, the stage chevron is settled-current. A queued review swarm reads "Review 0/5 · swarm requested" instead of 5/5 (#16540). diff --git a/src/pkg/dashboard/stage_tracker_activity.go b/src/pkg/dashboard/stage_tracker_activity.go index 469aa9bce1..acba132a7c 100644 --- a/src/pkg/dashboard/stage_tracker_activity.go +++ b/src/pkg/dashboard/stage_tracker_activity.go @@ -328,6 +328,15 @@ func stageTrackerCountPerspectives(out *StageTrackerActivity, pr github.PullRequ out.PerspectivesDone++ } } + // A swarm that is requested or queued has not started this round: no + // perspective of it is done, whatever an earlier round left behind. + // "Review 5/5 · swarm requested" contradicts itself (hivecommons/hive#16540). + if out.State == "unassigned" { + out.PerspectivesDone = 0 + if out.PerspectivesTotal == 0 { + out.PerspectivesTotal = len(expected) + } + } } func trackerHeadMatches(repo string, number int, head, observedRepo string, observedNumber int, observedHead string) bool { diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 9652679658..da570393d0 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -570,7 +570,12 @@ test('current-phase styling is steady and undimmed, including compact/reduced-mo for (const block of css.match(/\.ham-(?:seg\.)?ham-activity-track[^{]*\{[^}]*\}/g)) { assert.doesNotMatch(block, /clip-path|border(?!-radius)|box-shadow: inset/, block); } - assert.match(css, /\.ham-seg\.ham-activity-track\.failing \{ background: var\(--status-error\); color: var\(--surface-0\);/, 'a finding wears the error colour at full strength'); + // Only a running track is filled (#16540): done / failing / pending / + // decided are words in their colour on the muted field. + assert.match(css, /\.ham-seg\.ham-activity-track\.failing \{ background: var\(--panel-strong\); color: var\(--status-error\);/, 'a finding is red words and glyph, not a red fill'); + assert.match(css, /\.ham-seg\.ham-activity-track\.done \{ background: var\(--panel-strong\); color: var\(--green\);/, 'a pass is green words, not a fill'); + for (const state of ['pending', 'done.decided']) assert.match(css, new RegExp('\\.ham-seg\\.ham-activity-track\\.' + state.replace('.', '\\.') + ' \\{ background: var\\(--panel-strong\\); color: var\\(--muted\\);'), state + ' is muted words on the muted field'); + assert.doesNotMatch(css, /\.ham-seg\.ham-activity-track\.(?:done|failing|pending)[^{]*\{[^}]*background: var\(--(?:amber|status-error|green|red)\)/, 'no fill colour on a non-running track'); assert.doesNotMatch(css, /\.ham-track-state \{[^}]*white-space: nowrap/, 'count words wrap to the strip-wide two-line budget like every other chevron, never ellipsised mid-count'); const current = css.match(/\.ham-activity-track\.ham-current \{([^}]*)\}/)[1]; assert.doesNotMatch(current, /animation|data-motion/); diff --git a/src/pkg/dashboard/stage_tracker_activity_test.go b/src/pkg/dashboard/stage_tracker_activity_test.go index 6b74436097..6c58028cc8 100644 --- a/src/pkg/dashboard/stage_tracker_activity_test.go +++ b/src/pkg/dashboard/stage_tracker_activity_test.go @@ -466,6 +466,18 @@ func TestStageTrackerActivityReviewPerspectiveCounts(t *testing.T) { if got := count(bundle, agg, dispatch); got.PerspectivesTotal != len(expected)+1 || got.PerspectivesDone != 3 { t.Fatalf("extra dispatched perspective counts = %d/%d, want 3/%d", got.PerspectivesDone, got.PerspectivesTotal, len(expected)+1) } + // hive#16539: five verdicts exist for the head but the swarm is queued + // again (a wait, no reviewer free): this round has not started, so the + // word is "Review 0/5 · swarm requested", never "5/5 · swarm requested". + full := &review.Aggregate{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, Verdict: "approve", + Perspectives: map[review.Perspective]review.Verdict{}} + for _, p := range expected { + full.Perspectives[p] = "approve" + } + waiting := review.DispatchState{GeneratedAt: now, Waits: []review.ReviewWaitRecord{{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, Reason: "no-free-reviewer", FirstAt: now.Add(-8 * time.Minute), LastAt: now}}} + if got := count(bundle, full, waiting); got.State != "unassigned" || got.PerspectivesDone != 0 || got.PerspectivesTotal != len(expected) { + t.Fatalf("queued swarm counts = %d/%d (%s), want 0/%d unassigned", got.PerspectivesDone, got.PerspectivesTotal, got.State, len(expected)) + } // Evidence for another head counts nothing for this one. agg.HeadSHA, bundle.HeadSHA = "old-head", "old-head" dispatch.Pending = nil diff --git a/src/pkg/dashboard/stage_tracker_human_attention.test.js b/src/pkg/dashboard/stage_tracker_human_attention.test.js index 39ac5f2286..9b11628d07 100644 --- a/src/pkg/dashboard/stage_tracker_human_attention.test.js +++ b/src/pkg/dashboard/stage_tracker_human_attention.test.js @@ -170,7 +170,7 @@ test('strip uses the person glyph only for a current requirement; claimant and s STAGE_TRACKER_PRE_MERGE_SOAK: 95, STAGE_TRACKER_READY_FOR_HUMAN_MERGE: 90, }); - vm.runInContext(fn('tracker-row-strip', 'stageTrackerStripItems'), c); + vm.runInContext(fn('tracker-row-strip', 'stageTrackerWaitingOnPerson') + fn('tracker-row-strip', 'stageTrackerTrackRunning') + fn('tracker-row-strip', 'stageTrackerStripItems'), c); item.stage = 40; assert.match(c.stageTrackerStripItems(item, [], null, 1, {}), /data-kind="human"/); item.human_attention = null; diff --git a/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js b/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js index 74d4c179ac..6b379b0f28 100644 --- a/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js +++ b/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js @@ -192,3 +192,21 @@ test('three qualify: CI and review running on a lit PR in progress → tracks wi assert.match(one[3], /class="ham-seg active ham-remediation-remediating detoured"[^>]*data-motion="active"/); assert.equal(litCount(one.join('')), 2); }); + +test('#16456 row: PR in progress with changes requested → the stage chevron is the only lit one; review is a red-text finding, CI a green-text pass', () => { + const c = cells(redPR({ display_column: 30, + code_activity: { head: 'abc1234def', state: 'unassigned', caption: 'Changes requested · unassigned · next: scanner', source: 'no-pickup-evidence', since: red, observed_at: seen }, + ci_activity: { head: 'abc1234def', state: 'passing', caption: 'CI green', checks_passed: 11, checks_total: 11, source: 'checks', observed_at: seen }, + review_activity: { head: 'abc1234def', state: 'changes_requested', caption: 'Review findings', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen, since: red } })); + assert.match(c[3], /class="ham-seg active ham-remediation-unassigned detoured"/); + assert.match(c[4], /class="ham-seg ham-activity-track done"[^]*CI 11\/11 passed { + const c = cells(redPR({ display_column: 50, stage: 50, + review_activity: { head: 'abc1234def', state: 'unassigned', caption: 'Review queued · unassigned', blocker: 'no-free-reviewer', perspectives_done: 0, perspectives_total: 5, source: 'review-dispatch-wait', observed_at: seen } })); + assert.match(c[5], /class="ham-seg ham-activity-track pending ham-current"[^]*Review 0\/5 · swarm requested[^<]*<\/span>/.test(row) && !/ 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)); + // #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. + const changes = stageTrackerRowHtml({ repo: 'acme/console', number: 16456, kind: 'pr', stage: 70, display_column: 30, head: 'f269349', author: 'hive[bot]', author_kind: 'hive', + code_activity: { head: 'f269349', state: 'unassigned', caption: 'Changes requested · unassigned · next: scanner', source: 'no-pickup-evidence', since: seen, observed_at: seen }, + ci_activity: { head: 'f269349', state: 'passing', caption: 'CI green', checks_passed: 11, checks_total: 11, source: 'checks', observed_at: seen }, + review_activity: { head: 'f269349', state: 'changes_requested', caption: 'Review findings · changes requested', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen, since: seen } }, stages, ctx); + assert.strictEqual(lit(changes), 1, 'changes requested in PR in progress: one filled chevron: ' + strip(changes)); + assert.ok(/
  • ]*>[\s\S]*?CI 11\/11 passed<\/span>/.test(changes) && /
  • ]*>[\s\S]*?Review 5\/5 · changes requested<\/span>/.test(changes), changes); assert.ok(/
  • `; const name = kind === 'ci' ? 'CI' : 'Review'; diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index fbea85950e..7c0616274b 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1712,15 +1712,21 @@ "current-phase" tint: the operator reads the words, not the shade. Only fresh observed work earns the pulse. */ .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; } + /* A FILLED chevron means "this is where the item is / what moves now" + (hivecommons/hive#16540). A CI / Review track is filled only while it + runs (.active, amber). Every other state is words on the muted field + with the semantic colour on text and glyph only: green for passed / + approved, red for a finding, muted for pending, decided or not started. */ + .ham-seg.ham-activity-track.done { background: var(--panel-strong); color: var(--green); box-shadow: none; opacity: 1; } + .ham-seg.ham-activity-track.failing { background: var(--panel-strong); color: var(--status-error); box-shadow: none; opacity: 1; } .ham-seg.ham-activity-track.failing .ham-ico { stroke-width: 2; } /* Words without motion (checks not reported, unknown evidence, a row parked on a person): current-phase text on a muted field, never amber. */ - .ham-seg.ham-activity-track.pending { background: var(--surface-3); color: var(--text); box-shadow: none; opacity: 1; animation: none; } + .ham-seg.ham-activity-track.pending { background: var(--panel-strong); color: var(--muted); box-shadow: none; opacity: 1; animation: none; } /* The stage chevron while both tracks run: bright words, no amber, no pulse. */ .ham-seg.active.ham-settled-current { background: var(--surface-3); color: var(--text); animation: none; } .ham-seg.active.ham-settled-current::before { display: none; } - .ham-seg.ham-activity-track.done.decided { background: var(--surface-3); color: var(--muted); box-shadow: none; opacity: 1; animation: none; } + .ham-seg.ham-activity-track.done.decided { background: var(--panel-strong); color: var(--muted); box-shadow: none; opacity: 1; animation: none; } /* The count words stay on one line and ellipsize instead of wrapping. */ .ham-chevron-copy.ham-track-state .ham-ico { vertical-align: -2px; margin-right: 3px; } .ham-seg.active[data-motion]::before { content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none; } @@ -17920,10 +17926,12 @@

    Where to get help

    // 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 = the full active + // fill (both tracks may be lit at once; the words disambiguate); done, + // a finding, pending and decided are words in their colour on the muted + // field — only a running track is filled (hivecommons/hive#16540); not + // started = the empty chevron with the glyph alone. Freshness gates only + // the pulse. function stageTrackerActivityTrackHtml(item, kind, sg, blank, nowMs) { if (blank) return ``; const name = kind === 'ci' ? 'CI' : 'Review';