From 1e281dde87ee8d46aea7a4b44d917add3398357c Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 3 Nov 2026 19:44:28 -0500 Subject: [PATCH 1/2] fix(dashboard): CI/Review chevrons carry pass/total and done/total counts, lit while in progress Operator steer on #16488: dull current-phase tint with glyph-only chevrons was unreadable. Every CI/Review chevron in progress or finished on the current head now reads a count caption (CI p/t, Review d/t) with the full active fill, done style when complete, error style on a finding, and the glyph alone only when not started. Server adds checks_passed/total/failed/ failing and perspectives_done/total to StageTrackerActivity. Signed-off-by: Andrew Anderson --- .../fixed-16484-tracker-chevron-state-word.md | 1 - .../fixed-16493-tracker-chevron-counts.md | 1 + src/pkg/dashboard/stage_tracker_activity.go | 140 ++++++++++++++ .../dashboard/stage_tracker_activity.test.js | 178 +++++++++++------- .../dashboard/stage_tracker_activity_test.go | 99 ++++++++++ src/pkg/dashboard/stage_tracker_build.go | 3 + src/pkg/dashboard/static-src/css/tracker.css | 20 +- .../static-src/js/tracker-row-strip.js | 86 ++++++--- src/pkg/dashboard/static/index.html | 106 ++++++++--- 9 files changed, 499 insertions(+), 135 deletions(-) delete mode 100644 changelog.d/fixed-16484-tracker-chevron-state-word.md create mode 100644 changelog.d/fixed-16493-tracker-chevron-counts.md diff --git a/changelog.d/fixed-16484-tracker-chevron-state-word.md b/changelog.d/fixed-16484-tracker-chevron-state-word.md deleted file mode 100644 index 815c0a5480..0000000000 --- a/changelog.d/fixed-16484-tracker-chevron-state-word.md +++ /dev/null @@ -1 +0,0 @@ -- The Activity Monitor's CI and Review chevrons always carry a state word beside their glyph — unknown or stale evidence now reads "CI waiting · test not observed · seen 14m ago" instead of a bare icon — and when both tracks share the current phase the text says which one the hive is waiting on ("· new head d3c0824", "· waiting on CI", "· waiting on the fix") ([#16484](https://github.com/hivecommons/hive/issues/16484)). diff --git a/changelog.d/fixed-16493-tracker-chevron-counts.md b/changelog.d/fixed-16493-tracker-chevron-counts.md new file mode 100644 index 0000000000..499e963bbd --- /dev/null +++ b/changelog.d/fixed-16493-tracker-chevron-counts.md @@ -0,0 +1 @@ +- The Activity Monitor's CI and Review chevrons now show counts instead of a bare glyph or a muted tint: `CI 12/14 passed`, `CI 11/14 · 1 failing (lint)`, `CI 0/14 · queued`, `Review 3/5 perspectives`, `Review 5/5 approved`, `Review 0/5 · re-review pending (new head)`. A track in progress on the current head wears the full active fill (both may be lit at once — the counts disambiguate, and the tooltip says which one the hive is waiting on), a finished track wears the done style, a red check or changes-requested verdict wears the error colour, and only a not-yet-started track is a glyph alone. The server now reports `checks_passed/total/failed/failing` and `perspectives_done/total` on every CI/Review activity ([#16493](https://github.com/hivecommons/hive/issues/16493)). diff --git a/src/pkg/dashboard/stage_tracker_activity.go b/src/pkg/dashboard/stage_tracker_activity.go index 42a840c41a..469aa9bce1 100644 --- a/src/pkg/dashboard/stage_tracker_activity.go +++ b/src/pkg/dashboard/stage_tracker_activity.go @@ -7,6 +7,7 @@ import ( "time" "github.com/hivecommons/hive/crux" + "github.com/hivecommons/hive/pkg/config" "github.com/hivecommons/hive/pkg/evidence" "github.com/hivecommons/hive/pkg/github" "github.com/hivecommons/hive/pkg/review" @@ -30,6 +31,20 @@ type StageTrackerActivity struct { Blocker string `json:"blocker,omitempty"` URL string `json:"url,omitempty"` Active bool `json:"active,omitempty"` + // Check counts on the current head for the CI track (hivecommons/hive#16484): + // over the required checks when branch protection is known, otherwise + // over every check run observed on the head. ChecksTotal == 0 means no + // count could be made ("CI ?/?"). + ChecksPassed int `json:"checks_passed,omitempty"` + ChecksTotal int `json:"checks_total,omitempty"` + ChecksFailed int `json:"checks_failed,omitempty"` + ChecksFailing []string `json:"checks_failing,omitempty"` + // Perspective counts on the current head for the Review track: Total is + // the swarm's expected set for this PR (configured perspectives plus any + // extra one dispatched or reported for the head), Done the ones with a + // verdict for the current head. + PerspectivesDone int `json:"perspectives_done,omitempty"` + PerspectivesTotal int `json:"perspectives_total,omitempty"` } const trackerActivityFreshWindow = 2 * time.Minute @@ -53,6 +68,7 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA out.Source += "+github-commit-statuses" } if !a.RequiredKnown || a.RequiredSource == "" || len(a.RequiredChecks) == 0 || len(a.Required) == 0 { + stageTrackerCountHeadChecks(out, a) return out } type requiredObservation struct { @@ -87,10 +103,14 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA } } if !found { + stageTrackerCountHeadChecks(out, a) return out } } out.State, out.Caption = "passing", "CI green" + // Per required-check name: the leading state across its observations, + // for the passed / failed counts. + perName := map[string]string{} running := false // Per required-check name: which have a final result, for the running count. settled := map[string]bool{} @@ -132,6 +152,9 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA } // A red required check leads, then missing/unknown, then running/queued. rank := map[string]int{"passing": 0, "queued": 1, "running": 2, "skipped": 3, "unknown": 4, "missing": 5, "failing": 6} + if previous, seen := perName[name]; !seen || rank[state] >= rank[previous] { + perName[name] = state + } if rank[state] >= rank[out.State] { out.State, out.Since, out.URL = state, check.Since, check.URL out.ObservedAt = a.ObservedAt @@ -154,6 +177,16 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA } } total := len(a.Required) + out.ChecksTotal = total + for _, name := range a.Required { + switch perName[name] { + case "passing": + out.ChecksPassed++ + case "failing": + out.ChecksFailed++ + out.ChecksFailing = append(out.ChecksFailing, name) + } + } check := fmt.Sprintf("%q", out.Blocker) switch out.State { case "passing": @@ -190,6 +223,113 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA return out } +// stageTrackerCountHeadChecks fills the check counts from every check run +// observed on the head when the required set is not known: one entry per +// check name, red if any run of that name is red, green only if its latest +// run succeeded. +func stageTrackerCountHeadChecks(out *StageTrackerActivity, a *github.PRCIActivity) { + type tally struct { + passing, failing bool + since time.Time + } + byName := map[string]*tally{} + var order []string + for _, check := range a.Checks { + if check.Head != "" && !strings.EqualFold(check.Head, a.Head) { + continue + } + t := byName[check.Name] + if t == nil { + t = &tally{} + byName[check.Name] = t + order = append(order, check.Name) + } + at := time.Time{} + if check.Since != nil { + at = *check.Since + } + red := check.State == "completed" && (check.Conclusion == "failure" || check.Conclusion == "timed_out" || check.Conclusion == "cancelled" || check.Conclusion == "action_required" || check.Conclusion == "startup_failure" || check.Conclusion == "stale") + if red { + t.failing = true + } + if !at.Before(t.since) { + t.since, t.passing = at, check.State == "completed" && check.Conclusion == "success" + } + } + out.ChecksTotal = len(order) + for _, name := range order { + t := byName[name] + switch { + case t.failing: + out.ChecksFailed++ + out.ChecksFailing = append(out.ChecksFailing, name) + case t.passing: + out.ChecksPassed++ + } + } +} + +// stageTrackerExpectedPerspectives is the swarm's perspective set for this +// hive: the configured list (built-ins when empty), falling back to the +// built-ins when the configuration cannot be resolved. +func stageTrackerExpectedPerspectives(cfg *config.Config) []review.Perspective { + var names []string + var prompts map[string]string + if cfg != nil { + names, prompts = cfg.Review.Perspectives, cfg.Review.PerspectivePrompts + } + if set, err := review.NewPerspectiveSet(names, prompts); err == nil && set.Len() > 0 { + return set.List() + } + return append([]review.Perspective(nil), review.DefaultPerspectives...) +} + +// stageTrackerCountPerspectives fills the Review track's done / total +// perspective counts for the PR's current head: total is the expected set +// plus any extra perspective dispatched or reported for the head; done the +// perspectives with a verdict for the head (the aggregate's, or the latest +// verified bundle verdict). +func stageTrackerCountPerspectives(out *StageTrackerActivity, pr github.PullRequest, bundle *evidence.Bundle, agg *review.Aggregate, dispatch review.DispatchState, qualify func(string) string, expected []review.Perspective) { + if out == nil || pr.HeadSHA == "" { + return + } + total := map[review.Perspective]bool{} + done := map[review.Perspective]bool{} + for _, p := range expected { + total[p] = true + } + if agg != nil && trackerHeadMatches(pr.Repo, pr.Number, pr.HeadSHA, agg.Repo, agg.Number, agg.HeadSHA) { + for p, v := range agg.Perspectives { + total[p] = true + if v != "" { + done[p] = true + } + } + } + if bundle != nil && trackerHeadMatches(pr.Repo, pr.Number, pr.HeadSHA, bundle.Repo, bundle.Number, bundle.HeadSHA) { + for _, verdict := range trackerLatestBundleVerdicts(bundle) { + if verdict.Perspective == "" { + continue + } + total[review.Perspective(verdict.Perspective)] = true + if verdict.Verdict != "" { + done[review.Perspective(verdict.Perspective)] = true + } + } + } + for _, pending := range dispatch.Pending { + if pending.Perspective != "" && !pending.Decision && trackerHeadMatches(pr.Repo, pr.Number, pr.HeadSHA, qualify(pending.Repo), pending.Number, pending.HeadSHA) { + total[pending.Perspective] = true + } + } + out.PerspectivesTotal, out.PerspectivesDone = len(total), 0 + for p := range done { + if total[p] { + out.PerspectivesDone++ + } + } +} + func trackerHeadMatches(repo string, number int, head, observedRepo string, observedNumber int, observedHead string) bool { return number == observedNumber && head != "" && strings.EqualFold(head, observedHead) && strings.EqualFold(repo, observedRepo) } diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 5bccfa73e9..8b4bf58881 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, 'stageTrackerActivityTrackHtml') + ';return stageTrackerActivityTrackHtml;')(esc, (n, cls) => ``); +const track = new Function('esc', 'stageTrackerIcon', fn(strip, 'stageTrackerTrackLead') + 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'); @@ -169,7 +169,7 @@ test('12:01 screenshot density preserves physical tracks for issue-only, one-to- assert.ok(cells.slice(3).every(cell => /class="ham-seg blank/.test(cell)), 'multi-PR issue owns no PR-side activity'); } if (item.number === 344) { - assert.match(cells[4], /todo ham-current/); + assert.match(cells[4], /active ham-current[^]*CI \?\/\? · queued /data-display-state="unknown"/.test(cell))) { const content = cell.match(/aria-describedby="[^"]+">([^]*?)]*>/g, '').trim(), /unknown/, 'missing evidence still says so in words (#16484)'); + const words = content.replace(/<[^>]*>/g, '').trim(); + if (/ham-current/.test(cell)) assert.match(words, /^(CI|Review)\b/, 'a track in the current phase always carries count words (#16484)'); + else assert.equal(words, '', 'a track not started on this head is the glyph alone'); } } } @@ -452,12 +454,14 @@ test('Hotshot #344 shape: queued CI and approved review retain current phase wit const item = livePR({ stage: 60, ci_activity: activity('queued', 'CI queued · "build" waiting for a runner'), review_activity: activity('approved', 'Review approved') }); const before = JSON.stringify(item); const cells = physicalTracks(item); - assert.match(cells.ci, /ham-activity-track todo ham-current/); + assert.match(cells.ci, /ham-activity-track active ham-current/, 'queued CI is in progress: the full active fill, no pulse'); + assert.match(cells.ci, /ham-track-state">]*><\/svg>CI \?\/\? · queued(?:Fixing|Remediating) ·/); @@ -497,15 +505,15 @@ test('Hive #16268 shape: held native Fixing waits for a fixer in the CI/Review p test('current phase, running activity, failure and successful completion are independent dimensions', () => { for (const [state, caption, running, cls] of [ - ['failing', 'CI failing · "build" red', false, 'todo'], + ['failing', 'CI failing · "build" red', false, 'failing'], ['running', 'CI running · 1/2 checks done', true, 'active'], ['passing', 'CI green · all 2 required checks passed', false, 'done'], - ['skipped', 'CI skipped · check "build" skipped', false, 'todo'], + ['skipped', 'CI skipped · check "build" skipped', false, 'active'], ]) { const cells = physicalTracks(livePR({ ci_activity: activity(state, caption, running) })); - assert.ok(cells.ci.includes('ham-activity-track ' + cls + ' ham-current')); + assert.ok(cells.ci.includes('ham-activity-track ' + cls + ' ham-current'), state + ' → ' + cls); assert.equal(cells.ci.includes('data-motion="active"'), running); - assert.match(cells.review, /todo ham-current[^]*data-activity-state="unknown"/); + 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/); @@ -523,10 +531,18 @@ test('old-head or stale observations cannot fabricate running/completion, but do } const cells = physicalTracks(livePR({ ci_activity: ci, review_activity: review })); for (const cell of [cells.ci, cells.review]) { - assert.match(cell, /todo ham-current/); - assert.doesNotMatch(cell, /data-motion=|ham-activity-track done|ham-activity-track active/); + assert.match(cell, /ham-current/); + assert.doesNotMatch(cell, /data-motion=/, mode + ': no pulse without a fresh observation'); + } + if (mode === 'old-head') { + assert.match(cells.review, /data-activity-state="unknown"/); + assert.match(cells.ci, /active ham-current[^]*CI \?\/\? · no checks reported yet { const css = fs.readFileSync(path.join(__dirname, 'static-src/css/tracker.css'), 'utf8'); assert.match(css, /\.ham-activity-track\.ham-current \{[^}]*opacity: 1;[^}]*box-shadow: none/); - assert.match(css, /\.ham-activity-track\.ham-current:not\(\.active\) \{ background: color-mix/); + assert.doesNotMatch(css, /\.ham-activity-track\.ham-current:not\(\.active\)/, 'no muted current-phase tint: a lit track is .active, a finished one .done (#16484)'); // Lanes are chevrons like every other stage (#16384's boxed card is // gone): no clip-path opt-out, no border/ring; state is fill and colour. assert.doesNotMatch(css, /\.ham-activity-track \{/, 'no activity-track rule overrides the .ham-seg chevron shape'); 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\[data-activity-state="failing"\], \.ham-seg\.ham-activity-track\[data-activity-state="changes_requested"\] \{ background: color-mix\(in srgb, var\(--amber\) \d+%, var\(--panel\)\); color: var\(--amber\);/); + 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'); + assert.match(css, /\.ham-chevron-copy\.ham-track-state \{[^}]*white-space: nowrap;[^}]*text-overflow: ellipsis;/, 'count words stay on one line'); const current = css.match(/\.ham-activity-track\.ham-current \{([^}]*)\}/)[1]; assert.doesNotMatch(current, /animation|data-motion/); assert.ok(css.indexOf('.ham-activity-track.ham-current {') > css.indexOf('.ham-seg.todo {'), 'current occupancy overrides generic upcoming-track dimming'); @@ -570,7 +587,8 @@ test('unknown tracks wear the canonical column glyph beside their caption, prese const rendered = track(item, kind, { state: 'active' }, false, now); const content = rendered.match(/aria-describedby="[^"]+">([^]*?)]*>/g, '').includes((kind === 'ci' ? 'CI' : 'Review') + ' unknown · full precise reason'), 'the caption rides beside the glyph, never a bare icon (#16484)'); + assert.equal(content.replace(/<[^>]*>/g, ''), kind === 'ci' ? 'CI ?/? · no checks reported yet' : 'Review · swarm requested', 'the count words ride beside the glyph, never a bare icon (#16484)'); + assert.match(rendered, /role="tooltip">[^]*full precise reason/, 'the precise backend caption stays in the tooltip'); assert.match(content, /aria-label="Open current-head/); assert.match(rendered, /class="ham-chevron-info config-info" tabindex="0"/); assert.match(rendered, /role="tooltip">[^]*full precise reason[^]*head head/); @@ -637,15 +655,15 @@ function stageTrackerIcon(n, cls) { return ''; } assert.equal((administration.match(/data-motion="active"/g) || []).length, 2, 'cached generic PR administration cannot animate coding'); }); -test('stale activity is visibly unknown and old green observations cannot look live', () => { - const item = { kind: 'pr', head: 'head', review_activity: activity('reviewing', 'Review working · reviewer', true) }; +test('stale activity is visibly unknown in the tooltip, never pulses, and still reads in words', () => { + const item = { kind: 'pr', head: 'head', review_activity: { ...activity('reviewing', 'Review working · reviewer', true), actor: 'reviewer', perspectives_done: 1, perspectives_total: 5 } }; const html = track(item, 'review', {}, false, now + 300000); assert.match(html, /activity unknown · last observed reviewing/); assert.doesNotMatch(html, /data-motion/); assert.match(html, /data-display-state="unknown"/); - assert.match(html, /ham-chevron-copy ham-track-state">]*>(<\/svg>)?Review working · reviewer · seen 5m ago/, 'stale evidence keeps its words and says how old it is'); - item.review_activity = activity('approved', 'Review approved'); - assert.doesNotMatch(track(item, 'review', {}, false, now + 300000), /ham-activity-track done/); + assert.match(html, /ham-activity-track active"[^]*ham-chevron-copy ham-track-state">]*><\/svg>Review 1\/5 · reviewer reviewing { @@ -697,55 +715,71 @@ test('the backend detail sentence rides in the track tooltip, not on the chevron assert.match(html, /title="[^"]*Branch protection requires a check named "test", but no check run/); }); -test('#16484: a PR-row track never renders as a bare glyph in any of the four operator shapes', () => { - const stale = (state, caption, extra = {}) => ({ head: 'head', state, caption, source: 'cache', observed_at: new Date(now - 14 * 60000).toISOString(), ...extra }); - const shapes = { - 'new head, review findings': { stage: 70, display_column: 50, push: { state: 'pushed', sha: 'head', next: 're-review' }, code_activity: { head: 'head', state: 'pushed', caption: 'New head pushed · CI and re-review', source: 'recorded-push' }, ci_activity: stale('missing', 'CI waiting · test not observed'), review_activity: stale('changes_requested', 'Review findings · awaiting author') }, - 'red CI, review findings': { stage: 70, display_column: 50, ci_activity: { ...stale('failing', 'CI failing · test (26)'), observed_at: new Date(now).toISOString() }, review_activity: stale('changes_requested', 'Review findings · awaiting author · adjudicator') }, - 'both unknown': { stage: 50, display_column: 50, ci_activity: { head: 'head', state: 'unknown', caption: 'CI unknown · required checks not observed', source: 'unavailable' }, review_activity: { head: 'head', state: 'unknown', caption: 'Review unknown · current-head evidence unavailable', source: 'unavailable' } }, - 'held, stale approval': { stage: 70, display_column: 50, modifiers: ['hold'], hold: { by: 'hanthor', pill: 'Held by @hanthor' }, code_activity: { head: 'head', state: 'waiting_fixer', caption: 'Waiting for fixer · no code work observed', source: 'native-fix-request' }, ci_activity: stale('missing', 'CI waiting · test not observed'), review_activity: stale('approved', 'Review approved') }, - 'no evidence at all': { stage: 50, display_column: 50 }, - }; - for (const [name, fields] of Object.entries(shapes)) { - const cells = physicalTracks(livePR(fields)); - for (const [kind, cell] of [['ci', cells.ci], ['review', cells.review]]) { - const content = cell.match(/aria-describedby="[^"]+">([^]*?)]*>/g, '').trim(); - assert.match(content, / 0 && /CI|Review/.test(words), name + ' ' + kind + ' carries a state word: ' + JSON.stringify(words)); - assert.match(cell, /ham-current/, name + ' ' + kind + ' stays in the current phase'); - } - } - const noEvidence = physicalTracks(livePR(shapes['no evidence at all'])); - assert.match(noEvidence.ci.replace(/<[^>]*>/g, ''), /CI unknown · no evidence for head/); -}); - -test('#16484: when CI and Review share the phase the chevrons say which one the hive waits on', () => { - const fresh = (state, caption, extra = {}) => ({ head: 'd3c0824304d4c97b8ee76a267fb1e91f6d4c79a4', state, caption, source: 'cache', observed_at: new Date(now).toISOString(), ...extra }); +test('#16484: count grammar — CI passed/total and Review done/total across every state', () => { + const word = new Function(fn(strip, 'stageTrackerTrackWord') + ';return stageTrackerTrackWord;')(); + const ci = (state, extra = {}) => word({ head: 'h', ci_activity: { head: 'h', state, ...extra } }, 'ci', true); + assert.equal(ci('passing', { checks_passed: 14, checks_total: 14 }), 'CI 14/14 passed'); + assert.equal(ci('failing', { checks_passed: 11, checks_total: 14, checks_failed: 1, checks_failing: ['lint'] }), 'CI 11/14 · 1 failing (lint)'); + assert.equal(ci('failing', { checks_passed: 10, checks_total: 14, checks_failed: 3, checks_failing: ['lint', 'test', 'e2e'] }), 'CI 10/14 · 3 failing (lint, test, …)'); + assert.equal(ci('failing', { blocker: 'native-queue-policy' }), 'CI ?/? · failing (native-queue-policy)', 'older servers without counts still name the red check'); + assert.equal(ci('running', { checks_passed: 3, checks_total: 14 }), 'CI 3/14 · running'); + assert.equal(ci('running', { checks_passed: 3, checks_total: 14, checks_failed: 1, checks_failing: ['lint'] }), 'CI 3/14 · running · 1 failing (lint)'); + assert.equal(ci('queued', { checks_passed: 0, checks_total: 14 }), 'CI 0/14 · queued'); + assert.equal(ci('missing', { checks_passed: 0, checks_total: 14, blocker: 'test' }), 'CI 0/14 · no checks reported yet'); + assert.equal(ci('missing', { checks_passed: 13, checks_total: 14, blocker: 'test' }), 'CI 13/14 · test not reported'); + assert.equal(ci('skipped', { checks_passed: 13, checks_total: 14, blocker: 'build' }), 'CI 13/14 · build skipped'); + assert.equal(ci('unknown'), 'CI ?/? · no checks reported yet'); + assert.equal(ci('unknown', { checks_passed: 51, checks_total: 68 }), 'CI 51/68 · no verdict yet', 'unprotected base: head-wide counts without a required verdict'); + assert.equal(word({ head: 'h' }, 'ci', true), 'CI ?/? · no checks reported yet', 'no evidence at all in the current phase'); + assert.equal(word({ head: 'h' }, 'ci', false), '', 'no evidence outside the current phase: not started, glyph alone'); + assert.equal(word({ head: 'h', ci_activity: { head: 'old', state: 'passing', checks_passed: 14, checks_total: 14 } }, 'ci', true), 'CI ?/? · no checks reported yet', 'old-head evidence counts for nothing'); + const review = (state, extra = {}, item = {}) => word({ head: 'h', ...item, review_activity: { head: 'h', state, perspectives_done: 3, perspectives_total: 5, ...extra } }, 'review', true); + assert.equal(review('approved', { perspectives_done: 5 }), 'Review 5/5 approved'); + assert.equal(review('changes_requested'), 'Review 3/5 · changes requested'); + assert.equal(review('human_decision'), 'Review 3/5 · awaiting human decision'); + assert.equal(review('reviewing', { actor: 'reviewer-2' }), 'Review 3/5 · reviewer-2 reviewing'); + assert.equal(review('adjudicating', { actor: 'adjudicator' }), 'Review 3/5 · adjudicator reviewing'); + assert.equal(review('assigned', { actor: 'reviewer' }), 'Review 3/5 · reviewer queued'); + assert.equal(review('assigned'), 'Review 3/5 · queued'); + assert.equal(review('unassigned', { perspectives_done: 0 }), 'Review 0/5 · swarm requested'); + assert.equal(review('unknown', { perspectives_done: 0 }), 'Review 0/5 · swarm requested'); + assert.equal(review('unknown', { perspectives_done: 0 }, { push: { state: 'pushed', sha: 'h', next: 're-review' } }), 'Review 0/5 · re-review pending (new head)'); + assert.equal(review('unknown'), 'Review 3/5 · perspectives', 'partial verdicts with no aggregate verdict yet'); + assert.equal(word({ head: 'h', review_activity: { head: 'h', state: 'approved' } }, 'review', true), 'Review approved', 'older servers without counts'); + 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', () => { 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, ''); - // New head pushed, CI not yet reporting, review pending: CI leads on the new head, review waits on CI. - let cells = physicalTracks(livePR({ head, stage: 50, display_column: 50, push: { state: 'pushed', sha: head, next: 're-review' }, code_activity: { head, state: 'pushed', caption: 'New head pushed · CI and re-review', source: 'recorded-push' }, ci_activity: fresh('missing', 'CI waiting · test not observed'), review_activity: fresh('pending', 'Review pending · reviewer-2 queued') })); - assert.equal(text(cells.ci), 'CI waiting · test not observed · new head d3c0824'); - assert.equal(text(cells.review), 'Review pending · reviewer-2 queued · waiting on CI'); - assert.match(cells.review, /hive is waiting on CI for new head d3c0824/); - // Review findings: the fixer's turn; CI is not the blocker and says so. - cells = physicalTracks(livePR({ head, stage: 70, display_column: 50, ci_activity: fresh('missing', 'CI waiting · test not observed'), review_activity: fresh('changes_requested', 'Review findings · awaiting author') })); - assert.equal(text(cells.ci), 'CI waiting · test not observed · waiting on the fix'); - assert.equal(text(cells.review), 'Review findings · awaiting author'); - // Red CI plus review findings: both are findings, neither defers to the other. - cells = physicalTracks(livePR({ head, stage: 70, display_column: 50, ci_activity: fresh('failing', 'CI failing · test (26)'), review_activity: fresh('changes_requested', 'Review findings · awaiting author') })); - assert.equal(text(cells.ci), 'CI failing · test (26)'); - assert.equal(text(cells.review), 'Review findings · awaiting author'); - // CI green, review pending: review leads, CI is done and says nothing extra. - cells = physicalTracks(livePR({ head, stage: 50, display_column: 50, ci_activity: fresh('passing', 'CI passed'), review_activity: fresh('pending', 'Review pending') })); - assert.equal(text(cells.ci), 'CI passed'); - assert.equal(text(cells.review), 'Review pending'); - // Both unknown (fresh PR): CI leads, review waits on CI. - cells = physicalTracks(livePR({ head, stage: 50, display_column: 50, ci_activity: { head, state: 'unknown', caption: 'CI unknown · required checks not observed', source: 'unavailable' }, review_activity: { head, state: 'unknown', caption: 'Review unknown · current-head evidence unavailable', source: 'unavailable' } })); - assert.equal(text(cells.ci), 'CI unknown · required checks not observed'); - assert.equal(text(cells.review), 'Review unknown · current-head evidence unavailable · waiting on CI'); - // Outside the current phase (merge gate) the lead clause is silent. - cells = physicalTracks(livePR({ head, stage: 80, display_column: 80, ci_activity: fresh('passing', 'CI passed'), review_activity: fresh('pending', 'Review pending') })); - assert.doesNotMatch(cells.review, /waiting on/); + const cls = cell => cell.match(/class="ham-seg ham-activity-track ([a-z]+)/)[1]; + // #16456: CI running on the new head while the re-review is pending → BOTH lit, counts disambiguate. + let cells = physicalTracks(livePR({ head, stage: 70, display_column: 50, push: { state: 'pushed', sha: head, next: 're-review' }, + code_activity: { head, state: 'pushed', caption: 'New head pushed · CI and re-review', source: 'recorded-push' }, + 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.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.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' }, + ci_activity: fresh('failing', { checks_passed: 13, checks_total: 14, checks_failed: 1, checks_failing: ['native-queue-policy'], blocker: 'native-queue-policy' }), + review_activity: fresh('approved', { perspectives_done: 5, perspectives_total: 5 }) })); + assert.equal(cls(cells.ci), 'failing'); assert.equal(text(cells.ci), 'CI 13/14 · 1 failing (native-queue-policy)'); + assert.equal(cls(cells.review), 'done'); assert.equal(text(cells.review), 'Review 5/5 approved'); + assert.match(cells.review, /Held by @hanthor/); + // Not started: a PR still being written (column 30) with no evidence shows the glyph alone, never lit. + cells = physicalTracks(livePR({ head, stage: 30, display_column: 30 })); + for (const cell of [cells.ci, cells.review]) { + assert.equal(cls(cell), 'todo'); + assert.equal(text(cell), ''); + assert.match(cell, / matches ? Number(a[k]) || 0 : 0; + if (kind === 'ci') { + const total = n('checks_total'); + const passed = n('checks_passed'); + const failed = n('checks_failed'); + const names = matches && Array.isArray(a.checks_failing) ? a.checks_failing : []; + const count = 'CI ' + (total ? passed + '/' + total : '?/?'); + const failing = failed ? failed + ' failing' + (names.length ? ' (' + names.slice(0, 2).join(', ') + (names.length > 2 ? ', …' : '') + ')' : '') : ''; + const blocker = matches && a.blocker ? String(a.blocker) : ''; + switch (state) { + case 'passing': return count + ' passed'; + case 'failing': return count + ' · ' + (failing || 'failing' + (blocker ? ' (' + blocker + ')' : '')); + case 'running': return count + ' · running' + (failing ? ' · ' + failing : ''); + case 'queued': return count + ' · queued' + (failing ? ' · ' + failing : ''); + case 'skipped': return count + ' · ' + (blocker ? blocker + ' skipped' : 'skipped'); + case 'missing': return count + ' · ' + (passed ? (blocker ? blocker + ' not reported' : 'not all reported') : 'no checks reported yet') + (failing ? ' · ' + failing : ''); + default: return count + ' · ' + (total ? 'no verdict yet' : 'no checks reported yet'); + } + } + const total = n('perspectives_total'); + const done = n('perspectives_done'); + const count = 'Review' + (total ? ' ' + done + '/' + total : ''); + const actor = matches && a.actor ? String(a.actor) : ''; + const code = item.code_activity; + const push = item.push; + const newHead = !!((code && code.head === item.head && code.state === 'pushed') || (push && push.state === 'pushed' && push.sha === item.head)); + switch (state) { + case 'approved': return count + ' approved'; + case 'changes_requested': return count + ' · changes requested'; + case 'human_decision': return count + ' · awaiting human decision'; + case 'reviewing': case 'adjudicating': return count + ' · ' + (actor ? actor + ' reviewing' : 'reviewing'); + case 'assigned': return count + ' · ' + (actor ? actor + ' queued' : 'queued'); + case 'unassigned': return count + ' · swarm requested'; + default: return count + ' · ' + (newHead ? 're-review pending (new head)' : total && done ? 'perspectives' : 'swarm requested'); + } + } + // 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 always carries a state word beside its glyph: unknown or - // stale evidence says so in words ("· seen 14m ago"), it never shrinks - // to a bare icon (hivecommons/hive#16484). Freshness still gates the - // pulse and the green fill, not the text. + // 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. function stageTrackerActivityTrackHtml(item, kind, sg, blank, nowMs) { if (blank) return ``; const name = kind === 'ci' ? 'CI' : 'Review'; @@ -57,7 +109,11 @@ const known = matches && state !== 'unknown' && Number.isFinite(observed) && !stale; const active = known && a.active; if (matches && !known && state !== 'unknown') caption = name + ' activity unknown · last observed ' + state + ' · ' + caption; - const cls = known && (state === 'passing' || state === 'approved') ? 'done' : active ? 'active' : 'todo'; + const ownsPR = item.kind === 'pr' || item.via_pr; + const text = typeof stageTrackerTrackWord === 'function' ? stageTrackerTrackWord(item, kind, current) : (matches ? a.caption || name + ' ' + state : ''); + const finished = matches && (state === 'passing' || state === 'approved'); + const finding = matches && (state === 'failing' || state === 'changes_requested'); + const cls = finished ? 'done' : finding ? 'failing' : text ? 'active' : '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() : ''; @@ -66,7 +122,6 @@ // the tooltip only; the chevron clamps the caption. const detail = matches && a.detail ? ' · ' + a.detail : ''; let tip = caption + blocker + detail + ' · head ' + (item.head || 'unknown') + ' · ' + source + ' · ' + freshness + since; - const ownsPR = item.kind === 'pr' || item.via_pr; const code = item.code_activity; const codeNote = code && code.head === item.head && Number(item.display_column) === 50 && ((kind === 'review' && code.state === 'waiting_fixer') || (kind === 'ci' && code.state === 'waiting_ci')) ? code.caption : ''; @@ -77,34 +132,21 @@ 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) : ''; - let seen = ''; - if (matches && !known && state !== 'unknown') { - if (!Number.isFinite(observed)) seen = ' · observation time unknown'; - else if (observed > clock) seen = ' · observation ahead of clock'; - else { - const m = Math.floor((clock - observed) / 60000); - const h = Math.floor(m / 60); - seen = ' · seen ' + (m < 1 ? 'under a minute' : m < 60 ? m + 'm' : h < 48 ? h + 'h' : Math.floor(h / 24) + 'd') + ' ago'; - } - } - let text = !matches ? name + ' unknown · no evidence for ' + (sha7 || 'this head') : (a.caption || name + ' ' + state) + seen; const lead = current && ownsPR && typeof stageTrackerTrackLead === 'function' ? stageTrackerTrackLead(item) : null; - if (lead && lead.track === kind && lead.newHead && kind === 'ci' && sha7) text += ' · new head ' + sha7; - else if (lead && lead.track !== kind && !(state === 'passing' || state === 'approved' || state === 'failing' || state === 'changes_requested')) text += ' · waiting on ' + lead.waitingOn; const word = esc(text); const evidenceURL = matches && /^https?:\/\//i.test(String(a.url || '')) ? a.url : ''; const icon = stageTrackerIcon(kind === 'ci' ? 'ci' : 50, 'ham-ico', name); const evidenceLink = ownsPR && evidenceURL ? `${icon}${word}` : icon + word; const routeState = (sg.state || 'todo') + (sg.detour ? ' detoured' : ''); const hold = item.hold; - const fullTip = (current ? 'Current pipeline phase · ' : '') + name + ': ' + tip + + const fullTip = (current ? 'Current pipeline phase · ' : '') + name + ': ' + (text ? text + ' · ' : '') + tip + (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 : '') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); - const linkedIcon = `${evidenceLink}`; - return `
  • ${linkedIcon}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; + const copy = `${evidenceLink}`; + return `
  • ${copy}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; } // Chevrons for one item. range bounds the columns the item owns (an diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 7fd8fb7b73..d71897d0a4 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1685,16 +1685,18 @@ layerize pass of the page every vsync (#13764). ::after is the movement effects' (flash / ripple / wash). */ .ham-seg.active { background: var(--amber); color: var(--surface-0); } - /* Position is independent of observed work: queued, held and unknown - tracks keep a steady current-phase tint (a muted amber fill, full - opacity, no dimming ring), never a work pulse; only fresh observed - work earns the lit .active fill. */ + /* A CI / Review track wears its own state on the current head + (hivecommons/hive#16484): in progress = the full .active fill, done = + .done, a finding (red CI, changes requested) = .failing in the error + colour, not started = .todo with the glyph alone. No muted + "current-phase" tint: the operator reads the words, not the shade. + Only fresh observed work earns the pulse. */ .ham-activity-track.ham-current { opacity: 1; box-shadow: none; } - .ham-activity-track.ham-current:not(.active) { background: color-mix(in srgb, var(--amber) 28%, var(--panel)); color: var(--text); } - /* Findings (red CI, changes requested) are an amber-tinted chevron with - amber words — full opacity, still not the hive's own work; the finding - outranks the current-phase tint when both apply. */ - .ham-seg.ham-activity-track[data-activity-state="failing"], .ham-seg.ham-activity-track[data-activity-state="changes_requested"] { background: color-mix(in srgb, var(--amber) 18%, var(--panel)); color: var(--amber); box-shadow: none; opacity: 1; } + .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; } + /* The count words stay on one line and ellipsize instead of wrapping. */ + .ham-chevron-copy.ham-track-state { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; } + .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; } .ham-seg.active[data-motion="active"]::before { background: white; animation: ham-pulse 1.6s ease-in-out infinite; } .ham-seg.active[data-motion="needs-human"]::before { background: var(--red); animation: ham-breathe-human 2.8s ease-in-out infinite; } @@ -17791,12 +17793,64 @@

    Where to get help

    return { track: 'ci', waitingOn: 'CI', newHead }; } + // Pure: the chevron's primary words — the count grammar the operator + // asked for (hivecommons/hive#16484): "CI 12/14 passed", "CI 11/14 · 1 + // failing (lint)", "CI 0/14 · queued", "CI ?/? · no checks reported + // yet"; "Review 3/5 perspectives", "Review 5/5 approved", "Review 0/5 · + // re-review pending (new head)", "Review 2/5 · awaiting human + // decision". '' means the track has not started on this head (the + // chevron shows its glyph alone). current: column 50 is the row's + // active phase, so even absent evidence is "in progress" there. + function stageTrackerTrackWord(item, kind, current) { + const a = item && item[kind + '_activity']; + const matches = !!(a && item.head && a.head === item.head); + const state = matches ? a.state || 'unknown' : 'unknown'; + if (state === 'unknown' && !current) return ''; + const n = k => matches ? Number(a[k]) || 0 : 0; + if (kind === 'ci') { + const total = n('checks_total'); + const passed = n('checks_passed'); + const failed = n('checks_failed'); + const names = matches && Array.isArray(a.checks_failing) ? a.checks_failing : []; + const count = 'CI ' + (total ? passed + '/' + total : '?/?'); + const failing = failed ? failed + ' failing' + (names.length ? ' (' + names.slice(0, 2).join(', ') + (names.length > 2 ? ', …' : '') + ')' : '') : ''; + const blocker = matches && a.blocker ? String(a.blocker) : ''; + switch (state) { + case 'passing': return count + ' passed'; + case 'failing': return count + ' · ' + (failing || 'failing' + (blocker ? ' (' + blocker + ')' : '')); + case 'running': return count + ' · running' + (failing ? ' · ' + failing : ''); + case 'queued': return count + ' · queued' + (failing ? ' · ' + failing : ''); + case 'skipped': return count + ' · ' + (blocker ? blocker + ' skipped' : 'skipped'); + case 'missing': return count + ' · ' + (passed ? (blocker ? blocker + ' not reported' : 'not all reported') : 'no checks reported yet') + (failing ? ' · ' + failing : ''); + default: return count + ' · ' + (total ? 'no verdict yet' : 'no checks reported yet'); + } + } + const total = n('perspectives_total'); + const done = n('perspectives_done'); + const count = 'Review' + (total ? ' ' + done + '/' + total : ''); + const actor = matches && a.actor ? String(a.actor) : ''; + const code = item.code_activity; + const push = item.push; + const newHead = !!((code && code.head === item.head && code.state === 'pushed') || (push && push.state === 'pushed' && push.sha === item.head)); + switch (state) { + case 'approved': return count + ' approved'; + case 'changes_requested': return count + ' · changes requested'; + case 'human_decision': return count + ' · awaiting human decision'; + case 'reviewing': case 'adjudicating': return count + ' · ' + (actor ? actor + ' reviewing' : 'reviewing'); + case 'assigned': return count + ' · ' + (actor ? actor + ' queued' : 'queued'); + case 'unassigned': return count + ' · swarm requested'; + default: return count + ' · ' + (newHead ? 're-review pending (new head)' : total && done ? 'perspectives' : 'swarm requested'); + } + } + // 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 always carries a state word beside its glyph: unknown or - // stale evidence says so in words ("· seen 14m ago"), it never shrinks - // to a bare icon (hivecommons/hive#16484). Freshness still gates the - // pulse and the green fill, not the text. + // 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. function stageTrackerActivityTrackHtml(item, kind, sg, blank, nowMs) { if (blank) return ``; const name = kind === 'ci' ? 'CI' : 'Review'; @@ -17812,7 +17866,11 @@

    Where to get help

    const known = matches && state !== 'unknown' && Number.isFinite(observed) && !stale; const active = known && a.active; if (matches && !known && state !== 'unknown') caption = name + ' activity unknown · last observed ' + state + ' · ' + caption; - const cls = known && (state === 'passing' || state === 'approved') ? 'done' : active ? 'active' : 'todo'; + const ownsPR = item.kind === 'pr' || item.via_pr; + const text = typeof stageTrackerTrackWord === 'function' ? stageTrackerTrackWord(item, kind, current) : (matches ? a.caption || name + ' ' + state : ''); + const finished = matches && (state === 'passing' || state === 'approved'); + const finding = matches && (state === 'failing' || state === 'changes_requested'); + const cls = finished ? 'done' : finding ? 'failing' : text ? 'active' : '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() : ''; @@ -17821,7 +17879,6 @@

    Where to get help

    // the tooltip only; the chevron clamps the caption. const detail = matches && a.detail ? ' · ' + a.detail : ''; let tip = caption + blocker + detail + ' · head ' + (item.head || 'unknown') + ' · ' + source + ' · ' + freshness + since; - const ownsPR = item.kind === 'pr' || item.via_pr; const code = item.code_activity; const codeNote = code && code.head === item.head && Number(item.display_column) === 50 && ((kind === 'review' && code.state === 'waiting_fixer') || (kind === 'ci' && code.state === 'waiting_ci')) ? code.caption : ''; @@ -17832,34 +17889,21 @@

    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) : ''; - let seen = ''; - if (matches && !known && state !== 'unknown') { - if (!Number.isFinite(observed)) seen = ' · observation time unknown'; - else if (observed > clock) seen = ' · observation ahead of clock'; - else { - const m = Math.floor((clock - observed) / 60000); - const h = Math.floor(m / 60); - seen = ' · seen ' + (m < 1 ? 'under a minute' : m < 60 ? m + 'm' : h < 48 ? h + 'h' : Math.floor(h / 24) + 'd') + ' ago'; - } - } - let text = !matches ? name + ' unknown · no evidence for ' + (sha7 || 'this head') : (a.caption || name + ' ' + state) + seen; const lead = current && ownsPR && typeof stageTrackerTrackLead === 'function' ? stageTrackerTrackLead(item) : null; - if (lead && lead.track === kind && lead.newHead && kind === 'ci' && sha7) text += ' · new head ' + sha7; - else if (lead && lead.track !== kind && !(state === 'passing' || state === 'approved' || state === 'failing' || state === 'changes_requested')) text += ' · waiting on ' + lead.waitingOn; const word = esc(text); const evidenceURL = matches && /^https?:\/\//i.test(String(a.url || '')) ? a.url : ''; const icon = stageTrackerIcon(kind === 'ci' ? 'ci' : 50, 'ham-ico', name); const evidenceLink = ownsPR && evidenceURL ? `${icon}${word}` : icon + word; const routeState = (sg.state || 'todo') + (sg.detour ? ' detoured' : ''); const hold = item.hold; - const fullTip = (current ? 'Current pipeline phase · ' : '') + name + ': ' + tip + + const fullTip = (current ? 'Current pipeline phase · ' : '') + name + ': ' + (text ? text + ' · ' : '') + tip + (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 : '') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); - const linkedIcon = `${evidenceLink}`; - return `
  • ${linkedIcon}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; + const copy = `${evidenceLink}`; + return `
  • ${copy}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; } // Chevrons for one item. range bounds the columns the item owns (an From baa28ad90fd6ad8c4c828b12f71a298ec2dc211c Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 3 Nov 2026 20:00:23 -0500 Subject: [PATCH 2/2] test(dashboard): geometry probe expects count words on lit tracks; count captions wrap like peer chevrons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The browser probe's 'unknown track is icon-only' assertion predates the count captions; a lit unknown track now reads 'CI ?/? · no checks reported yet' and only a not-started (.todo) track is the glyph alone. Drop the nowrap/ellipsis rule so the count caption honours the strip's two-line wrap budget instead of truncating mid-count on phones. Signed-off-by: Andrew Anderson --- src/pkg/dashboard/stage_tracker_activity.test.js | 2 +- src/pkg/dashboard/static-src/css/tracker.css | 1 - src/pkg/dashboard/static/index.html | 1 - .../webstatic/testdata/tracker-header-geometry.js | 7 ++++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 8b4bf58881..baf6570328 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -571,7 +571,7 @@ test('current-phase styling is steady and undimmed, including compact/reduced-mo 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'); - assert.match(css, /\.ham-chevron-copy\.ham-track-state \{[^}]*white-space: nowrap;[^}]*text-overflow: ellipsis;/, 'count words stay on one line'); + 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/); assert.ok(css.indexOf('.ham-activity-track.ham-current {') > css.indexOf('.ham-seg.todo {'), 'current occupancy overrides generic upcoming-track dimming'); diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 34e085263e..9ff3371cc4 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -358,7 +358,6 @@ .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; } /* The count words stay on one line and ellipsize instead of wrapping. */ - .ham-chevron-copy.ham-track-state { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; } .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; } .ham-seg.active[data-motion="active"]::before { background: white; animation: ham-pulse 1.6s ease-in-out infinite; } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index d71897d0a4..72b941a67f 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1695,7 +1695,6 @@ .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; } /* The count words stay on one line and ellipsize instead of wrapping. */ - .ham-chevron-copy.ham-track-state { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; } .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; } .ham-seg.active[data-motion="active"]::before { background: white; animation: ham-pulse 1.6s ease-in-out infinite; } diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js b/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js index f3506a6c7f..a92940b879 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js @@ -204,7 +204,12 @@ } if (cell.dataset.displayState === 'unknown') { coverage.unknown++; - assert(cell.innerText.trim() === '', name + 'unknown track is icon-only'); + // #16493: a track in the current phase always carries count words + // ("CI ?/? · no checks reported yet"); only a not-started track is + // the glyph alone. + const words = cell.querySelector('.ham-track-state')?.innerText.trim() || ''; + if (cell.classList.contains('todo')) assert(words === '', name + 'not-started track is icon-only'); + else assert(/^(CI|Review)\b/.test(words), name + 'lit unknown track carries count words, never a bare glyph: ' + JSON.stringify(words)); assert(!!cell.querySelector('svg'), name + 'unknown track retains the column glyph'); assert(!cell.hasAttribute('data-motion'), name + 'unknown cannot animate as observed work'); }