Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-tracker-history-icon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Activity Monitor: the right-most tracker column no longer shows a βœ“ β€” the column header, the unmerged cap chevron and the "did I act on this?" badge now wear a history mark (clock with a counter-clockwise arrow); the badge is a neutral pill, carries the count of recorded actions and an aria-label, and keeps its hover history. The green βœ“ remains only once a PR has merged.
10 changes: 5 additions & 5 deletions src/docs/dashboard-sections.md

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/pkg/dashboard/operator_actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,16 @@ func TestOperatorActionRecordedByDecisionEndpoint(t *testing.T) {
}

// stageTrackerActedJS lifts the "did I act on this?" badge helpers the row
// renderer and the filter call (operator_actions.go payload fields).
// renderer and the filter call (operator_actions.go payload fields). Callers
// lift STAGE_TRACKER_ICONS themselves: the history badge draws from it.
func stageTrackerActedJS(t *testing.T, html string) string {
t.Helper()
return strings.Join([]string{
jsConstBlock(t, html, "STAGE_TRACKER_ACTED_LABELS"),
jsConstLine(t, html, "STAGE_TRACKER_ACTED_STATES"),
jsConstLine(t, html, "STAGE_TRACKER_ACTED_FILTERS"),
jsConstLine(t, html, "STAGE_TRACKER_ACTED_STUCK_DEFAULT_S"),
jsConstLine(t, html, "STAGE_TRACKER_HISTORY_ICON"),
jsConstLine(t, html, "STAGE_TRACKER_ACTED_GLYPH"),
jsConstBlock(t, html, "STAGE_TRACKER_ACTED_PLAIN"),
jsFunc(t, html, "stageTrackerActedLabel"),
Expand Down
39 changes: 35 additions & 4 deletions src/pkg/dashboard/stage_tracker_acted.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// "Did I act on this?" badge in the Hive activity monitor: the tracker
// payload carries `last_operator_action` (operator_actions.go) and the row
// wears a βœ“ badge whose in-app tooltip names the action, when, the outcome
// wears a history badge (clock + counter-clockwise arrow, never a βœ“: the
// tick read as "done") whose in-app tooltip names the action, when, the outcome
// and the current stage; amber once the row has sat at the same stage past
// the window; a Decisions filter narrows to awaiting / acted / stuck. The
// functions are lifted straight out of index.html so this runs against the
Expand Down Expand Up @@ -29,6 +30,8 @@ const src = [
pick(/const STAGE_TRACKER_ACTED_STATES = [^\n]*\n/, 'STAGE_TRACKER_ACTED_STATES'),
pick(/const STAGE_TRACKER_ACTED_FILTERS = [^\n]*\n/, 'STAGE_TRACKER_ACTED_FILTERS'),
pick(/const STAGE_TRACKER_ACTED_STUCK_DEFAULT_S = [^\n]*\n/, 'STAGE_TRACKER_ACTED_STUCK_DEFAULT_S'),
pick(/const STAGE_TRACKER_ICONS = \{[\s\S]*?\n \};\n/, 'STAGE_TRACKER_ICONS'),
pick(/const STAGE_TRACKER_HISTORY_ICON = [^\n]*\n/, 'STAGE_TRACKER_HISTORY_ICON'),
pick(/const STAGE_TRACKER_ACTED_GLYPH = [^\n]*\n/, 'STAGE_TRACKER_ACTED_GLYPH'),
pick(/function stageTrackerActedLabel\(action\) \{[^\n]*\n/, 'stageTrackerActedLabel'),
pick(/function stageTrackerActedSource\(item\) \{[\s\S]*?\n \}\n/, 'stageTrackerActedSource'),
Expand Down Expand Up @@ -64,9 +67,14 @@ test('no recorded action: no badge, acted filters exclude, awaiting includes par
assert.strictEqual(api.matches({ repo: 'r', number: 2, kind: 'pr', stage: 30 }, 'awaiting', NOW), false);
});

test('fresh action: green βœ“ badge with an in-app tooltip, no native title', () => {
test('fresh action: history badge (clock + arrow, count 1) with an in-app tooltip, no native title', () => {
const h = api.badge(row(), NOW);
assert.match(h, /class="ham-badge ham-acted ham-acted-waiting config-info"/);
assert.match(h, /<svg class="ham-ico ham-history-ico"[^>]*aria-hidden="true"><path d="M2 8a6 6 0 1 0 6-6/, 'history glyph');
assert.match(h, /data-ham-acted-count="1"/);
assert.match(h, /<span class="ham-acted-n" aria-hidden="true">1<\/span>/);
assert.match(h, /aria-label="History: 1 action β€” Approve β€” waiting"/);
assert.doesNotMatch(h, /[βœ“βœ”βœ—]/, 'no check glyph in the history badge');
assert.match(h, /tabindex="0"/);
assert.match(h, /data-action="gh3" data-stop="1"/);
assert.match(h, /aria-describedby="ham-acted-tip-hivecommons-hive-42"/);
Expand Down Expand Up @@ -104,10 +112,12 @@ test('stuck: server-derived or aged client-side past the window β†’ amber, "requ

test('pending and failed states', () => {
const pending = row({ last_operator_action: act({ action: 'let-hive-decide', outcome: 'pending', state: 'pending' }) });
assert.match(api.badge(pending, NOW), /ham-acted-pending config-info"[^>]*>…</);
assert.match(api.badge(pending, NOW), /ham-acted-pending config-info"[^>]*><svg class="ham-ico ham-history-ico"/);
assert.doesNotMatch(api.badge(pending, NOW).split('<span id=')[0], /[βœ“βœ—β€¦]/, 'glyph slot carries no text mark');
assert.match(api.tip(pending, NOW), /^At Merge gate while the hive decides\.\nYou chose Let hive decide Β· .* Β· the hive is deciding…\.$/);
const failed = row({ last_operator_action: act({ outcome: 'failed', detail: 'github 502', state: 'failed' }) });
assert.match(api.badge(failed, NOW), /ham-acted-failed config-info"[^>]*>βœ—</);
assert.match(api.badge(failed, NOW), /ham-acted-failed config-info"[^>]*><svg class="ham-ico ham-history-ico"/);
assert.doesNotMatch(api.badge(failed, NOW).split('<span id=')[0], /[βœ“βœ—]/);
assert.match(api.tip(failed, NOW), /^Still at Merge gate β€” try again, or act on GitHub\.\n.* Β· failed β€” github 502\./);
assert.strictEqual(api.matches(Object.assign(failed, { parked: true }), 'awaiting', NOW), true);
});
Expand All @@ -121,6 +131,27 @@ test('target, note and earlier-action count surface in the tooltip; HTML is esca
const h = api.badge(r, NOW);
assert.match(h, /Your note: &lt;b&gt;dup&lt;\/b&gt;/);
assert.match(h, /<br>/);
assert.match(h, /data-ham-acted-count="3"/);
assert.match(h, /<span class="ham-acted-n" aria-hidden="true">3<\/span>/);
assert.match(h, /aria-label="History: 3 actions β€” Close as superseded β€” waiting"/);
});

test('the history column: header and unmerged cap chevron wear the history mark, not a βœ“; merged keeps its βœ“', () => {
// Column header (the "since" row): history icon, labelled, with the hover text.
const head = html.match(/<li class="ham-seg cap ham-history-head" title="History β€” decisions and actions on this item">\$\{stageTrackerIcon\('history', 'ham-ico ham-history-ico', 'History β€” decisions and actions on this item'\)\}<\/li>/);
assert.ok(head, 'column header cap renders the history icon with its hover text');
assert.doesNotMatch(html, /<li class="ham-seg cap">\$\{stageTrackerIcon\(STAGE_TRACKER_TERMINAL, 'ham-ico'\)\}<\/li>/, 'no βœ“ column header remains');
// Row cap chevron: βœ“ (icon 110) only once merged (sg.terminal), history otherwise.
assert.match(html, /if \(sg\.cap\) inner = sg\.terminal \? stageTrackerIcon\(sg\.number, 'ham-ico'\) : stageTrackerIcon\('history', 'ham-ico ham-history-ico', 'History β€” no decisions or actions recorded yet'\);/);
// The icon map carries the shared path and the badge is neutral, not green.
assert.match(html, / history: '<path d="M2 8a6 6 0 1 0 6-6 6\.5 6\.5 0 0 0-4\.5 1\.83L2 5\.33"\/><path d="M2 2v3\.33h3\.33"\/><path d="M8 4\.67V8l2\.67 1\.33"\/>',\n/);
// The βœ“ (icon 110) is still the merged mark, nowhere else in the column.
assert.match(html, / 110: '<path d="M3 8l3 3 7-7"\/>',\n/);
assert.match(html, /\.config-info\.ham-acted \{[^}]*color: var\(--text\);/, 'neutral at rest');
assert.doesNotMatch(html, /\.config-info\.ham-acted \{[^}]*var\(--green\)/, 'not the green ok colour');
assert.doesNotMatch(html, /\.config-info\.ham-acted \{[^}]*var\(--brand\)/, 'not the amber the stuck state uses');
const glyphLine = html.match(/const STAGE_TRACKER_ACTED_GLYPH = [^\n]*/)[0];
assert.doesNotMatch(glyphLine, /[βœ“βœ—β€¦]/, 'no text glyphs left in the acted badge map');
});

test('issue row drawn over a single covering PR borrows that PR\'s action', () => {
Expand Down
1 change: 1 addition & 0 deletions src/pkg/dashboard/stage_tracker_attention_order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func TestStageTrackerAttentionOrderJS(t *testing.T) {
jsFunc(t, html, "stageTrackerRegressionHandled"),
jsFunc(t, html, "stageTrackerNeedsAttention"),
jsFunc(t, html, "stageTrackerWaitSince"),
jsConstBlock(t, html, "STAGE_TRACKER_ICONS"),
stageTrackerActedJS(t, html),
jsFunc(t, html, "stageTrackerNormalizeFilter"),
jsFunc(t, html, "stageTrackerSort"),
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/stage_tracker_motion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ func TestStageTrackerMotionRowStamp(t *testing.T) {
jsFunc(t, html, "stageTrackerChipsHtml"),
jsFunc(t, html, "stageTrackerHeadColsHtml"),
jsFunc(t, html, "stageTrackerSinceHtml"),
jsConstBlock(t, html, "STAGE_TRACKER_ICONS"),
stageTrackerActedJS(t, html),
jsFunc(t, html, "stageTrackerSubRowHtml"),
jsFunc(t, html, "stageTrackerLinkedPRItem"),
Expand All @@ -469,7 +470,6 @@ func TestStageTrackerMotionRowStamp(t *testing.T) {
}, "\n") + `
const now = Date.parse('2026-01-01T12:00:00Z');
const stages = [{ number: 10, label: 'Actionable', short: 'Actionable' }, { number: 20, label: 'Claimed', short: 'Claimed' }, { number: 30, label: 'PR in progress', short: 'PR in progress' }, { number: 50, label: 'Review pending', short: 'CI / Review' }, { number: 80, label: 'Awaiting merge admission', short: 'Merge gate' }, { number: 110, label: 'Merged', short: 'Merged' }];
const STAGE_TRACKER_ICONS = {};
const prev = [{ kind: 'issue', repo: 'a/b', number: 1, stage: 10 }, { kind: 'issue', repo: 'a/b', number: 2, stage: 20, linked_prs: [{ number: 7, stage: 30 }, { number: 8, stage: 50 }] }, { kind: 'pr', repo: 'a/b', number: 3, stage: 50 }];
const next = [{ kind: 'issue', repo: 'a/b', number: 1, stage: 20 }, { kind: 'issue', repo: 'a/b', number: 2, stage: 20, linked_prs: [{ number: 7, stage: 30 }, { number: 8, stage: 80 }] }, { kind: 'pr', repo: 'a/b', number: 3, stage: 50 }];
const ctx = { nowMs: now, stages, moves: stageTrackerColMoves(stageTrackerColMap(prev, stages), stageTrackerColMap(next, stages)) };
Expand Down
5 changes: 4 additions & 1 deletion src/pkg/dashboard/stage_tracker_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ assert.ok(/aria-label="Pipeline progress">[\s\S]*?<\/ol>\s*<span class="ham-sinc
assert.ok(/<li class="ham-seg cap"><span class="ham-badges">[\s\S]*?<\/span><\/li><\/ol><span class="ham-since"><\/span><\/div>\s*<\/div>\s*<div class="ham-strip-row">/.test(row), 'the chip cell closes the title line, directly above its own strip row');
assert.ok(row.indexOf('<div class="ham-row-head">') < row.indexOf('ham-badges') && row.indexOf('ham-badges') < row.indexOf('aria-label="Pipeline progress"'), 'chip and strip share one row container');
assert.ok(row.includes('ham-kind-ico'), 'kind icon');
assert.strictEqual((strip(row).match(/<svg class="ham-ico"/g) || []).length, 6, 'icons on every drawn non-active chevron');
assert.strictEqual((strip(row).match(/<svg class="ham-ico( ham-history-ico)?"/g) || []).length, 6, 'icons on every drawn non-active chevron');
assert.ok(/<li class="ham-seg todo cap"><svg class="ham-ico ham-history-ico"/.test(strip(row)), 'the unmerged cap wears the history mark, not the βœ“');
assert.ok(!strip(row).includes('βœ“'), 'no βœ“ in the strip before the PR merges');
assert.ok(tooltip(row).includes('Claimed by scanner') && tooltip(row).includes('@alice') && tooltip(row).includes('30 min ago'), tooltip(row));
assert.ok(!row.includes('βœ“'), 'no text check glyphs');

Expand Down Expand Up @@ -870,6 +872,7 @@ func TestStageTrackerFilterSortPage(t *testing.T) {
jsFunc(t, html, "stageTrackerItemNeedsHuman"),
jsFunc(t, html, "stageTrackerLabelCompare"),
jsFunc(t, html, "stageTrackerLabelDialogData"),
jsConstBlock(t, html, "STAGE_TRACKER_ICONS"),
stageTrackerActedJS(t, html),
jsFunc(t, html, "stageTrackerNormalizeFilter"),
jsFunc(t, html, "stageTrackerFilterActive"),
Expand Down
Loading
Loading