diff --git a/changelog.d/fixed-settled-open-chevron-tint.md b/changelog.d/fixed-settled-open-chevron-tint.md new file mode 100644 index 0000000000..055c1dc98b --- /dev/null +++ b/changelog.d/fixed-settled-open-chevron-tint.md @@ -0,0 +1 @@ +- Activity Monitor: while CI or review runs, the stage chevron keeps its neutral settled-current fill — the Open-column draft / blocked / New / stale tints no longer paint a second coloured chevron beside the running track (a draft PR with no stage read as slate Open + amber CI). diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index 01606bd2e8..e912a6f266 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -453,7 +453,7 @@ 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. **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. +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. Settled-current is always the neutral fill: the Open column's draft, blocked, New and stale tints and the held-gate amber never repaint it, so the running track is the row's only coloured chevron ([#17461](https://github.com/hivecommons/hive/issues/17461): a draft PR with no stage yet read as a slate Open beside amber CI). 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*, *Deferred · waiting on #N*, *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/pkg/dashboard/stage_tracker_remediation_chevron.test.js b/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js index 9827f18c1e..defa54ca6c 100644 --- a/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js +++ b/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js @@ -40,6 +40,9 @@ const segments = new Function('stageTrackerAnchor', globals + ` const STAGE_TRACKER_ACTIVE_WORD = {70: 'Fixing'}; const STAGE_TRACKER_HUMAN_GATED = 85, STAGE_TRACKER_READY_FOR_HUMAN_MERGE = 90, STAGE_TRACKER_ADOPTED_BY_HIVE = 74; function stageTrackerSentinelInLane() { return false; } +function stageTrackerOpenSince(it) { return { ms: Date.parse(it.created_at || '') || 0 }; } +function stageTrackerShortAgo() { return '1d'; } +const STAGE_TRACKER_OPEN_STALE_DAYS = 7; function stageTrackerUnauthorizedWord() { return ''; } function stageTrackerManualMergeWord() { return 'Ready for human merge'; } function stageTrackerAdoptedWord() { return 'Adopted by hive'; } @@ -47,6 +50,7 @@ function stageTrackerAdoptedWord() { return 'Adopted by hive'; } const renderStrip = new Function('esc', 'stageTrackerSegments', 'stageTrackerActivityTrackHtml', globals + ` const STAGE_TRACKER_MOTION_STATIC = 'static', STAGE_TRACKER_MOTION_ACTIVE = 'active'; const STAGE_TRACKER_READY_FOR_HUMAN_MERGE = 90; +const STAGE_TRACKER_DRAFT_TIP = 'Draft — the author is still working on it.'; function stageTrackerActorKind() { return ''; } function stageTrackerActorTip() { return ''; } function stageTrackerMotion() { return STAGE_TRACKER_MOTION_STATIC; } @@ -334,3 +338,31 @@ test('a stalled or stale-polled text-bearing track is plainly active: one amber if (words) assert.ok(/\bactive\b/.test(m[1]) && !/\b(pending|todo|done|failing|ham-settled-current)\b/.test(m[1]), 'text without the one active fill: ' + m[1]); } }); + +// hivecommons/hive#17461: a draft PR with no stage yet (Open column) whose CI +// runs draws the Open chevron settled-current — icon only, neutral fill — +// and the running track is the row's only coloured chevron. The Open word +// tints (draft, blocked, New, stale) are declared after the settled rule at +// equal specificity; the settled fill must still win. +test('a draft Open PR with running CI: Open is settled-current and no Open tint repaints it', () => { + const c = cells(redPR({ stage: 0, modifiers: ['draft'], created_at: '2026-11-03T01:50:50Z', + ci_activity: { head: 'abc1234def', state: 'running', active: true, caption: 'CI 51/64 · 12 running', checks_passed: 51, checks_total: 64, source: 'checks', observed_at: '2026-11-04T02:40:00Z' }, + review_activity: { head: 'abc1234def', state: 'not_started', caption: 'Review · draft, not requested', source: 'none', observed_at: '2026-11-04T02:40:00Z' } })); + assert.match(c[0], /^
  • ({ sel: m[1].trim(), body: m[2] })); + const tints = rules.filter(r => /^\.ham-seg\.active\.(ham-open-\w+|ham-held)$/.test(r.sel) && /background/.test(r.body)); + assert.ok(tints.length >= 4, 'the Open tints are still single-rule backgrounds: ' + tints.map(r => r.sel).join(' | ')); + const settled = rules.findIndex(r => r.sel === '.ham-seg.ham-seg.active.ham-settled-current'); + assert.ok(settled >= 0, 'a settled-current rule outranks the three-class tints'); + assert.match(rules[settled].body, /background: var\(--surface-3\)/); + for (const t of tints) assert.ok(rules.indexOf(t) < settled, t.sel + ' is declared before the settled-current override'); + for (const t of tints) assert.ok(t.sel.split('.').length - 1 < rules[settled].sel.split('.').length - 1, t.sel + ' has lower specificity than the settled-current override'); +}); diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index cca0e25e3f..6971828712 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -484,6 +484,14 @@ .ham-seg.active.ham-open-advisory { background: var(--surface-2); color: var(--muted); } .ham-seg.active.ham-open-advisory .ham-seg-t::before { content: 'ⓘ'; margin-right: var(--sp-1); } .ham-seg.active.ham-open-stale { background: color-mix(in srgb, var(--amber) 65%, var(--red)); } + /* While a CI / Review track runs, the stage chevron is settled-current: + the neutral still location, icon only (rule 2, hivecommons/hive#16643). + That fill wins over the Open word tints above (draft slate, blocked + yellow, New blue, stale amber-red) and the held-gate amber, which are + declared later at equal specificity and would otherwise paint a second + coloured chevron beside the running track (hivecommons/hive#17461: + a draft PR with no stage read as slate Open + amber CI). */ + .ham-seg.ham-seg.active.ham-settled-current { background: var(--surface-3); color: var(--text); } .ham-detour { white-space: normal; overflow-wrap: anywhere; } .ham-current-stage { display: none; margin: 0; font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; } .ham-active-ico { display: none; } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 51e0f53220..988d035a97 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1827,6 +1827,14 @@ .ham-seg.active.ham-open-advisory { background: var(--surface-2); color: var(--muted); } .ham-seg.active.ham-open-advisory .ham-seg-t::before { content: 'ⓘ'; margin-right: var(--sp-1); } .ham-seg.active.ham-open-stale { background: color-mix(in srgb, var(--amber) 65%, var(--red)); } + /* While a CI / Review track runs, the stage chevron is settled-current: + the neutral still location, icon only (rule 2, hivecommons/hive#16643). + That fill wins over the Open word tints above (draft slate, blocked + yellow, New blue, stale amber-red) and the held-gate amber, which are + declared later at equal specificity and would otherwise paint a second + coloured chevron beside the running track (hivecommons/hive#17461: + a draft PR with no stage read as slate Open + amber CI). */ + .ham-seg.ham-seg.active.ham-settled-current { background: var(--surface-3); color: var(--text); } .ham-detour { white-space: normal; overflow-wrap: anywhere; } .ham-current-stage { display: none; margin: 0; font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; } .ham-active-ico { display: none; }