From 75d0a68ac2318c11d9f9c44a6da5c6c952a2d2b2 Mon Sep 17 00:00:00 2001
From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 15:13:31 -0400
Subject: [PATCH 1/8] fix: stage tracker shows the hive is answering Let hive
decide and says why a human is wanted
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
---
...-stage-tracker-let-hive-decide-feedback.md | 1 +
.../stage_tracker_decide_feedback_test.go | 38 +++++++++++++++
src/pkg/dashboard/static-src/css/tracker.css | 1 +
.../static-src/js/tracker-actions.js | 35 ++++++++++++--
.../dashboard/static-src/js/tracker-row.js | 11 ++++-
src/pkg/dashboard/static/index.html | 47 ++++++++++++++++---
6 files changed, 119 insertions(+), 14 deletions(-)
create mode 100644 changelog.d/fixed-stage-tracker-let-hive-decide-feedback.md
create mode 100644 src/pkg/dashboard/stage_tracker_decide_feedback_test.go
diff --git a/changelog.d/fixed-stage-tracker-let-hive-decide-feedback.md b/changelog.d/fixed-stage-tracker-let-hive-decide-feedback.md
new file mode 100644
index 0000000000..b9fa0070e1
--- /dev/null
+++ b/changelog.d/fixed-stage-tracker-let-hive-decide-feedback.md
@@ -0,0 +1 @@
+- Stage tracker: Let hive decide now shows the hive is working at once, covered issues no longer repeat their PR's button, and a person's move says why (#15773)
diff --git a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
new file mode 100644
index 0000000000..856cac4f1a
--- /dev/null
+++ b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
@@ -0,0 +1,38 @@
+package dashboard
+
+import (
+ "strings"
+ "testing"
+)
+
+// Let hive decide answers at once, a covered issue defers to its PR's row,
+// and a person's move says why (hivecommons/hive#15773).
+func TestStageTrackerLetHiveDecideBusyFeedbackJS(t *testing.T) {
+ html := indexHTML(t)
+ for _, want := range []string{
+ "Asking the hive…",
+ "lead.setAttribute('aria-busy', 'true')",
+ "stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows)))",
+ `.ham-lead-act[aria-busy="true"]`,
+ } {
+ if !strings.Contains(html, want) {
+ t.Errorf("index.html missing %q", want)
+ }
+ }
+}
+
+func TestStageTrackerCoveredIssueDropsPRChipJS(t *testing.T) {
+ html := indexHTML(t)
+ for _, want := range []string{"stageTrackerPRListedOwnRow(item, a.target)", "decision pending on #"} {
+ if !strings.Contains(html, want) {
+ t.Errorf("index.html missing %q", want)
+ }
+ }
+}
+
+func TestStageTrackerHumanChevronSaysWhyJS(t *testing.T) {
+ html := indexHTML(t)
+ if !strings.Contains(html, "function stageTrackerHumanWhy(item, kind)") || !strings.Contains(html, "stageTrackerHumanWhy(item, sa.kind)") {
+ t.Error("the human next-move tooltip must fall back to the row's reason")
+ }
+}
diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css
index e84ef59082..f55e9aeb03 100644
--- a/src/pkg/dashboard/static-src/css/tracker.css
+++ b/src/pkg/dashboard/static-src/css/tracker.css
@@ -684,6 +684,7 @@
.ham-lead-act { padding: 0 var(--sp-3); border: var(--line-width) solid var(--cue-state, var(--accent)); border-radius: var(--r-pill); background: color-mix(in srgb, var(--cue-state, var(--accent)) 10%, transparent); color: var(--cue-state, var(--accent)); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.4; cursor: pointer; white-space: nowrap; }
.ham-lead-act:hover, .ham-lead-act:focus-visible { background: color-mix(in srgb, var(--cue-state, var(--accent)) 22%, transparent); outline: none; }
.ham-lead-act:focus-visible { box-shadow: 0 0 0 var(--line-width) var(--accent); }
+ .ham-lead-act[aria-busy="true"] { cursor: progress; opacity: 1; border-style: solid; color: var(--cue-work); }
.ham-lead-act.ham-menu-danger { color: var(--red); border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.ham-lead-act[aria-disabled="true"] { color: var(--text-faint); border-color: var(--line-subtle); border-style: dashed; background: transparent; cursor: default; opacity: 0.7; }
/* The technical background folds behind one collapsed Details. */
diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js
index 5221430a6d..ba1f6fd6d4 100644
--- a/src/pkg/dashboard/static-src/js/tracker-actions.js
+++ b/src/pkg/dashboard/static-src/js/tracker-actions.js
@@ -490,8 +490,15 @@
// button — "Let hive decide" showed twice per item (hive#15320 →
// #15647, hive#15338 → #15648). The ⋯ menu's "Decide PR #N…" stays on
// the parent. subRows: the linked PRs drawn as sub-rows, or none.
+ // Pure: is the covering PR also a row of its own in the tracker (a
+ // top-level item, not a sub-row)? Then only that row carries the button.
+ function stageTrackerPRListedOwnRow(issue, t) {
+ const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
+ return !!_stageTracker && Array.isArray(_stageTracker.items) && _stageTracker.items.some(it => stageTrackerItemKey(it) === key);
+ }
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
+ if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr' && stageTrackerPRListedOwnRow(item, a.target)) return Object.assign({}, a, { passive: a.target.number });
if (!a || !a.target || !Array.isArray(subRows) || !subRows.length || item.kind !== 'issue') return a;
const t = a.target;
if (t.kind !== 'pr') return a;
@@ -507,6 +514,7 @@
function stageTrackerLeadActionHtml(item, ctx, subRows) {
const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
if (!a) return '';
+ if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
const label = String(a.label || a.id);
const tip = a.enabled ? String(a.hint || a.note || a.consequence || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
@@ -1574,8 +1582,12 @@
// or null when cancelled or when the operator took the merge
// alternative (which runs as its own row action with the chosen button
// recorded on the ledger).
- async function stageTrackerDelegatePreview(items) {
- const plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan));
+ async function stageTrackerDelegatePreview(items, rows) {
+ // The plan gathers the PR live (seconds): the row reads "acting…" and
+ // its button busy from the click until the preview can open.
+ const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate'));
+ let plans;
+ try { plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan)); } finally { stageTrackerClearPending(pend); }
const failed = plans.filter(pl => pl.error);
if (failed.length) { showToast('Could not preview ' + failed.map(pl => pl.ref + ' (' + pl.error + ')').join(', '), 'error'); return null; }
const picked = await stageTrackerDelegatePlanDialog(plans, stageTrackerSentinelPreface(items));
@@ -1586,7 +1598,7 @@
}
return { chosen: picked.chosen };
}
- async function stageTrackerActionPayload(items, id) {
+ async function stageTrackerActionPayload(items, id, rows) {
const refs = items.map(stageTrackerRefOf).join(', ');
const who = window._hiveUser || 'you';
const prs = items.length > 0 && items.every(it => it.kind === 'pr');
@@ -1596,7 +1608,7 @@
case 'decide:delegate':
// Preview first (hivecommons/hive#15126): nothing is written
// until the operator picks a button.
- return stageTrackerDelegatePreview(items);
+ return stageTrackerDelegatePreview(items, rows);
case 'decide:delegate-all': {
// Confirms as Let hive decide (same opt-out key), naming each PR.
const prs = [].concat(...items.map(stageTrackerNestedOpenPRs));
@@ -2008,6 +2020,19 @@
for (const n of nodes) {
const key = n.getAttribute('data-ham-sub-key') || n.getAttribute('data-ham-key');
const cap = want[key];
+ // A pending Let hive decide shows on its button too: busy, not clickable again.
+ const lead = n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act^="decide:delegate"]');
+ if (lead) {
+ if (cap && lead.getAttribute('aria-busy') !== 'true') {
+ lead.dataset.hamLabel = lead.textContent;
+ lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true');
+ lead.textContent = '';
+ const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
+ lead.appendChild(document.createTextNode(' Asking the hive…'));
+ } else if (!cap && lead.getAttribute('aria-busy') === 'true') {
+ lead.removeAttribute('aria-busy'); lead.removeAttribute('aria-disabled'); lead.textContent = lead.dataset.hamLabel || '';
+ }
+ }
const strip = n.querySelector(':scope > .ham-strip-row');
// The caption lives inside the lit chevron (the pill), never as a
// separate element beside the ✓ badge (#15126); a row without a
@@ -2101,7 +2126,7 @@
.filter(t => t && !seen[stageTrackerItemKey(t)] && (seen[stageTrackerItemKey(t)] = true));
if (!items.length) { stageTrackerNothingToActOn(id, rows); return { toasts: [], pending: [] }; }
}
- const payload = await stageTrackerActionPayload(items, id);
+ const payload = await stageTrackerActionPayload(items, id, rows);
if (payload == null) return { toasts: [], pending: [], cancelled: true };
const results = await stageTrackerRunActions(items, id, payload, rows);
return { toast: results.toasts[0] || null, toasts: results.toasts, pending: results.pending, results };
diff --git a/src/pkg/dashboard/static-src/js/tracker-row.js b/src/pkg/dashboard/static-src/js/tracker-row.js
index 74d8377c4d..f588d7f98a 100644
--- a/src/pkg/dashboard/static-src/js/tracker-row.js
+++ b/src/pkg/dashboard/static-src/js/tracker-row.js
@@ -197,11 +197,18 @@
}
// " · Next move: hive @fixer — fixer commented · 3m ago", or, with
// nobody on it, " · no one is working on this right now — ".
+ // A person's move with no stage_actor.why says why from the row's own
+ // reason, so the 👤 marker never leaves the question unanswered.
+ function stageTrackerHumanWhy(item, kind) {
+ if (kind !== 'human' && kind !== 'maintainer') return '';
+ return String(item.human_merge_reason_text || item.reason || '').trim();
+ }
function stageTrackerActorTip(item) {
const sa = stageTrackerStageActor(item);
- if (!sa) { const k = stageTrackerActorKind(item); return k ? ' · Next move: ' + k : ''; }
+ if (!sa) { const k = stageTrackerActorKind(item); const w = stageTrackerHumanWhy(item, k); return k ? ' · Next move: ' + k + (w ? ' — ' + w : '') : ''; }
if (sa.kind === STAGE_TRACKER_ACTOR_NONE) return sa.why ? ' · ' + STAGE_TRACKER_NOBODY_LEAD + ' — ' + sa.why : '';
- return ' · Next move: ' + sa.kind + (sa.login ? ' @' + sa.login : '') + (sa.why ? ' — ' + sa.why : '');
+ const why = sa.why || stageTrackerHumanWhy(item, sa.kind);
+ return ' · Next move: ' + sa.kind + (sa.login ? ' @' + sa.login : '') + (why ? ' — ' + why : '');
}
// Who holds the row: the payload's claimant {kind, login, agent, hive,
// since, source} (hivecommons/hive#15422). The chevron gets one short
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index 1e69e749ab..adb403de2b 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -2013,6 +2013,7 @@
.ham-lead-act { padding: 0 var(--sp-3); border: var(--line-width) solid var(--cue-state, var(--accent)); border-radius: var(--r-pill); background: color-mix(in srgb, var(--cue-state, var(--accent)) 10%, transparent); color: var(--cue-state, var(--accent)); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.4; cursor: pointer; white-space: nowrap; }
.ham-lead-act:hover, .ham-lead-act:focus-visible { background: color-mix(in srgb, var(--cue-state, var(--accent)) 22%, transparent); outline: none; }
.ham-lead-act:focus-visible { box-shadow: 0 0 0 var(--line-width) var(--accent); }
+ .ham-lead-act[aria-busy="true"] { cursor: progress; opacity: 1; border-style: solid; color: var(--cue-work); }
.ham-lead-act.ham-menu-danger { color: var(--red); border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.ham-lead-act[aria-disabled="true"] { color: var(--text-faint); border-color: var(--line-subtle); border-style: dashed; background: transparent; cursor: default; opacity: 0.7; }
/* The technical background folds behind one collapsed Details. */
@@ -16633,11 +16634,18 @@ Where to get help
}
// " · Next move: hive @fixer — fixer commented · 3m ago", or, with
// nobody on it, " · no one is working on this right now — ".
+ // A person's move with no stage_actor.why says why from the row's own
+ // reason, so the 👤 marker never leaves the question unanswered.
+ function stageTrackerHumanWhy(item, kind) {
+ if (kind !== 'human' && kind !== 'maintainer') return '';
+ return String(item.human_merge_reason_text || item.reason || '').trim();
+ }
function stageTrackerActorTip(item) {
const sa = stageTrackerStageActor(item);
- if (!sa) { const k = stageTrackerActorKind(item); return k ? ' · Next move: ' + k : ''; }
+ if (!sa) { const k = stageTrackerActorKind(item); const w = stageTrackerHumanWhy(item, k); return k ? ' · Next move: ' + k + (w ? ' — ' + w : '') : ''; }
if (sa.kind === STAGE_TRACKER_ACTOR_NONE) return sa.why ? ' · ' + STAGE_TRACKER_NOBODY_LEAD + ' — ' + sa.why : '';
- return ' · Next move: ' + sa.kind + (sa.login ? ' @' + sa.login : '') + (sa.why ? ' — ' + sa.why : '');
+ const why = sa.why || stageTrackerHumanWhy(item, sa.kind);
+ return ' · Next move: ' + sa.kind + (sa.login ? ' @' + sa.login : '') + (why ? ' — ' + why : '');
}
// Who holds the row: the payload's claimant {kind, login, agent, hive,
// since, source} (hivecommons/hive#15422). The chevron gets one short
@@ -20074,8 +20082,15 @@ All labels
// button — "Let hive decide" showed twice per item (hive#15320 →
// #15647, hive#15338 → #15648). The ⋯ menu's "Decide PR #N…" stays on
// the parent. subRows: the linked PRs drawn as sub-rows, or none.
+ // Pure: is the covering PR also a row of its own in the tracker (a
+ // top-level item, not a sub-row)? Then only that row carries the button.
+ function stageTrackerPRListedOwnRow(issue, t) {
+ const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
+ return !!_stageTracker && Array.isArray(_stageTracker.items) && _stageTracker.items.some(it => stageTrackerItemKey(it) === key);
+ }
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
+ if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr' && stageTrackerPRListedOwnRow(item, a.target)) return Object.assign({}, a, { passive: a.target.number });
if (!a || !a.target || !Array.isArray(subRows) || !subRows.length || item.kind !== 'issue') return a;
const t = a.target;
if (t.kind !== 'pr') return a;
@@ -20091,6 +20106,7 @@ All labels
function stageTrackerLeadActionHtml(item, ctx, subRows) {
const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
if (!a) return '';
+ if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
const label = String(a.label || a.id);
const tip = a.enabled ? String(a.hint || a.note || a.consequence || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
@@ -21158,8 +21174,12 @@ All labels
// or null when cancelled or when the operator took the merge
// alternative (which runs as its own row action with the chosen button
// recorded on the ledger).
- async function stageTrackerDelegatePreview(items) {
- const plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan));
+ async function stageTrackerDelegatePreview(items, rows) {
+ // The plan gathers the PR live (seconds): the row reads "acting…" and
+ // its button busy from the click until the preview can open.
+ const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate'));
+ let plans;
+ try { plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan)); } finally { stageTrackerClearPending(pend); }
const failed = plans.filter(pl => pl.error);
if (failed.length) { showToast('Could not preview ' + failed.map(pl => pl.ref + ' (' + pl.error + ')').join(', '), 'error'); return null; }
const picked = await stageTrackerDelegatePlanDialog(plans, stageTrackerSentinelPreface(items));
@@ -21170,7 +21190,7 @@ All labels
}
return { chosen: picked.chosen };
}
- async function stageTrackerActionPayload(items, id) {
+ async function stageTrackerActionPayload(items, id, rows) {
const refs = items.map(stageTrackerRefOf).join(', ');
const who = window._hiveUser || 'you';
const prs = items.length > 0 && items.every(it => it.kind === 'pr');
@@ -21180,7 +21200,7 @@ All labels
case 'decide:delegate':
// Preview first (hivecommons/hive#15126): nothing is written
// until the operator picks a button.
- return stageTrackerDelegatePreview(items);
+ return stageTrackerDelegatePreview(items, rows);
case 'decide:delegate-all': {
// Confirms as Let hive decide (same opt-out key), naming each PR.
const prs = [].concat(...items.map(stageTrackerNestedOpenPRs));
@@ -21592,6 +21612,19 @@ All labels
for (const n of nodes) {
const key = n.getAttribute('data-ham-sub-key') || n.getAttribute('data-ham-key');
const cap = want[key];
+ // A pending Let hive decide shows on its button too: busy, not clickable again.
+ const lead = n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act^="decide:delegate"]');
+ if (lead) {
+ if (cap && lead.getAttribute('aria-busy') !== 'true') {
+ lead.dataset.hamLabel = lead.textContent;
+ lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true');
+ lead.textContent = '';
+ const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
+ lead.appendChild(document.createTextNode(' Asking the hive…'));
+ } else if (!cap && lead.getAttribute('aria-busy') === 'true') {
+ lead.removeAttribute('aria-busy'); lead.removeAttribute('aria-disabled'); lead.textContent = lead.dataset.hamLabel || '';
+ }
+ }
const strip = n.querySelector(':scope > .ham-strip-row');
// The caption lives inside the lit chevron (the pill), never as a
// separate element beside the ✓ badge (#15126); a row without a
@@ -21685,7 +21718,7 @@ All labels
.filter(t => t && !seen[stageTrackerItemKey(t)] && (seen[stageTrackerItemKey(t)] = true));
if (!items.length) { stageTrackerNothingToActOn(id, rows); return { toasts: [], pending: [] }; }
}
- const payload = await stageTrackerActionPayload(items, id);
+ const payload = await stageTrackerActionPayload(items, id, rows);
if (payload == null) return { toasts: [], pending: [], cancelled: true };
const results = await stageTrackerRunActions(items, id, payload, rows);
return { toast: results.toasts[0] || null, toasts: results.toasts, pending: results.pending, results };
From f1e1119750412bea75c787f2041accb120efa506 Mon Sep 17 00:00:00 2001
From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 15:34:38 -0400
Subject: [PATCH 2/8] fix: guard stageTrackerActorTip's stageTrackerHumanWhy
call for lifted test fixtures
Seven dashboard test fixtures lift stageTrackerActorTip by name without
stageTrackerHumanWhy, so the shuffle job failed with ReferenceError.
Follow the file's existing guarded-helper pattern and regenerate index.html.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
src/pkg/dashboard/stage_tracker_decide_feedback_test.go | 2 +-
src/pkg/dashboard/static-src/js/tracker-row.js | 6 ++++--
src/pkg/dashboard/static/index.html | 6 ++++--
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
index 856cac4f1a..cd12a0fac7 100644
--- a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
+++ b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
@@ -32,7 +32,7 @@ func TestStageTrackerCoveredIssueDropsPRChipJS(t *testing.T) {
func TestStageTrackerHumanChevronSaysWhyJS(t *testing.T) {
html := indexHTML(t)
- if !strings.Contains(html, "function stageTrackerHumanWhy(item, kind)") || !strings.Contains(html, "stageTrackerHumanWhy(item, sa.kind)") {
+ if !strings.Contains(html, "function stageTrackerHumanWhy(item, kind)") || !strings.Contains(html, "sa.why || humanWhy(item, sa.kind)") {
t.Error("the human next-move tooltip must fall back to the row's reason")
}
}
diff --git a/src/pkg/dashboard/static-src/js/tracker-row.js b/src/pkg/dashboard/static-src/js/tracker-row.js
index f588d7f98a..03e16b340b 100644
--- a/src/pkg/dashboard/static-src/js/tracker-row.js
+++ b/src/pkg/dashboard/static-src/js/tracker-row.js
@@ -204,10 +204,12 @@
return String(item.human_merge_reason_text || item.reason || '').trim();
}
function stageTrackerActorTip(item) {
+ // Guarded: test harnesses lift this function by name without stageTrackerHumanWhy.
+ const humanWhy = typeof stageTrackerHumanWhy === 'function' ? stageTrackerHumanWhy : () => '';
const sa = stageTrackerStageActor(item);
- if (!sa) { const k = stageTrackerActorKind(item); const w = stageTrackerHumanWhy(item, k); return k ? ' · Next move: ' + k + (w ? ' — ' + w : '') : ''; }
+ if (!sa) { const k = stageTrackerActorKind(item); const w = humanWhy(item, k); return k ? ' · Next move: ' + k + (w ? ' — ' + w : '') : ''; }
if (sa.kind === STAGE_TRACKER_ACTOR_NONE) return sa.why ? ' · ' + STAGE_TRACKER_NOBODY_LEAD + ' — ' + sa.why : '';
- const why = sa.why || stageTrackerHumanWhy(item, sa.kind);
+ const why = sa.why || humanWhy(item, sa.kind);
return ' · Next move: ' + sa.kind + (sa.login ? ' @' + sa.login : '') + (why ? ' — ' + why : '');
}
// Who holds the row: the payload's claimant {kind, login, agent, hive,
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index adb403de2b..4abc7d3584 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -16641,10 +16641,12 @@ Where to get help
return String(item.human_merge_reason_text || item.reason || '').trim();
}
function stageTrackerActorTip(item) {
+ // Guarded: test harnesses lift this function by name without stageTrackerHumanWhy.
+ const humanWhy = typeof stageTrackerHumanWhy === 'function' ? stageTrackerHumanWhy : () => '';
const sa = stageTrackerStageActor(item);
- if (!sa) { const k = stageTrackerActorKind(item); const w = stageTrackerHumanWhy(item, k); return k ? ' · Next move: ' + k + (w ? ' — ' + w : '') : ''; }
+ if (!sa) { const k = stageTrackerActorKind(item); const w = humanWhy(item, k); return k ? ' · Next move: ' + k + (w ? ' — ' + w : '') : ''; }
if (sa.kind === STAGE_TRACKER_ACTOR_NONE) return sa.why ? ' · ' + STAGE_TRACKER_NOBODY_LEAD + ' — ' + sa.why : '';
- const why = sa.why || stageTrackerHumanWhy(item, sa.kind);
+ const why = sa.why || humanWhy(item, sa.kind);
return ' · Next move: ' + sa.kind + (sa.login ? ' @' + sa.login : '') + (why ? ' — ' + why : '');
}
// Who holds the row: the payload's claimant {kind, login, agent, hive,
From a1d9cf77c11b4d291b789a3705f85fa5a0558dd0 Mon Sep 17 00:00:00 2001
From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 15:55:12 -0400
Subject: [PATCH 3/8] test: lift stageTrackerPRListedOwnRow into the
row-actions preamble
stageTrackerLeadActionOnRow now calls it, and the node fixture that lifts
functions by name raised ReferenceError without it.
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
src/pkg/dashboard/stage_tracker_row_actions_test.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pkg/dashboard/stage_tracker_row_actions_test.go b/src/pkg/dashboard/stage_tracker_row_actions_test.go
index 06606693e2..a8ae006cbe 100644
--- a/src/pkg/dashboard/stage_tracker_row_actions_test.go
+++ b/src/pkg/dashboard/stage_tracker_row_actions_test.go
@@ -96,6 +96,7 @@ func stageTrackerRowActionsPreamble(t *testing.T, html string) string {
jsFunc(t, html, "stageTrackerLeadAction"),
jsFunc(t, html, "stageTrackerMaintainerMoved"),
jsFunc(t, html, "stageTrackerDevWarn"),
+ jsFunc(t, html, "stageTrackerPRListedOwnRow"),
jsFunc(t, html, "stageTrackerLeadActionOnRow"),
jsFunc(t, html, "stageTrackerLeadActionHtml"),
jsFunc(t, html, "stageTrackerMenuTextHtml"),
From 6e5964af774ddab929b2e0a5c0c0d692eaa408c3 Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 17:13:51 -0400
Subject: [PATCH 4/8] fix: busy Let hive decide keeps its colour, only its own
pend busies it, chip names the lead
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Review of #15871:
- The busy lead rule lost the cascade to the equal-specificity
aria-disabled rule that followed it, so the button rendered faint and
dashed while the hive was asked. The rule is now the compound
[aria-busy][aria-disabled] selector and sits after the disabled one.
- stageTrackerPendingSync busied the delegate button for any pending
entry on the row (a confirmed action's "Adopting…", any ⋯ action) and
its restore dropped a pre-existing aria-disabled, making a lead the row
rendered disabled clickable. The preview's pend is now tagged with the
button it busies (stageTrackerSetPending's new busy argument); only a
lead with that data-ham-act goes busy, and its original aria-disabled
and title are saved and put back when the pend clears.
- The passive chip fires for every PR-targeted lead, so its tooltip now
names the lead it stands in for (Merge now, Adopt…) instead of always
saying Let hive decide.
- Tests: node cases cover the covering-PR → passive path (including a
Merge now lead), and busy/restore under stageTrackerPendingSync (tagged
vs untagged pend, other verb left alone, disabled lead restored with
its reason); the CSS test asserts the compound rule follows the
disabled one. The DOM stub gains removeAttribute, dataset and the
row-head descendant selector.
Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
.../stage_tracker_decide_feedback_test.go | 126 ++++++++++++++++--
.../stage_tracker_decided_ui_test.go | 2 +
.../stage_tracker_row_actions_test.go | 10 +-
src/pkg/dashboard/static-src/css/tracker.css | 4 +-
.../static-src/js/tracker-actions.js | 59 +++++---
src/pkg/dashboard/static/index.html | 63 ++++++---
6 files changed, 209 insertions(+), 55 deletions(-)
diff --git a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
index cd12a0fac7..0a62592e51 100644
--- a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
+++ b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
@@ -7,29 +7,133 @@ import (
// Let hive decide answers at once, a covered issue defers to its PR's row,
// and a person's move says why (hivecommons/hive#15773).
-func TestStageTrackerLetHiveDecideBusyFeedbackJS(t *testing.T) {
+
+// The busy button keeps the tracker's working colour: the busy rule also
+// carries aria-disabled (the click guard reads it), so it must be the
+// compound selector and sit after the plain disabled rule, or the faint
+// dashed disabled look wins on equal specificity.
+func TestStageTrackerLetHiveDecideBusyCSS(t *testing.T) {
html := indexHTML(t)
- for _, want := range []string{
- "Asking the hive…",
- "lead.setAttribute('aria-busy', 'true')",
- "stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows)))",
- `.ham-lead-act[aria-busy="true"]`,
- } {
- if !strings.Contains(html, want) {
- t.Errorf("index.html missing %q", want)
+ busy := strings.Index(html, `.ham-lead-act[aria-busy="true"][aria-disabled="true"] {`)
+ disabled := strings.Index(html, `.ham-lead-act[aria-disabled="true"] {`)
+ if busy < 0 || disabled < 0 {
+ t.Fatalf("index.html lacks the busy (%d) or disabled (%d) lead rule", busy, disabled)
+ }
+ if busy < disabled {
+ t.Error("the busy lead rule must come after the disabled one so it wins the cascade")
+ }
+ rule := html[busy : busy+strings.Index(html[busy:], "}")]
+ for _, want := range []string{"color: var(--cue-work)", "cursor: progress", "opacity: 1", "border-style: solid"} {
+ if !strings.Contains(rule, want) {
+ t.Errorf("busy lead rule lacks %q: %s", want, rule)
}
}
}
-func TestStageTrackerCoveredIssueDropsPRChipJS(t *testing.T) {
+// The preview's pend is the one tagged to busy the button; the confirmed
+// action's pend is not.
+func TestStageTrackerLetHiveDecidePreviewTagsPend(t *testing.T) {
html := indexHTML(t)
- for _, want := range []string{"stageTrackerPRListedOwnRow(item, a.target)", "decision pending on #"} {
+ for _, want := range []string{
+ "stageTrackerActingCaption('decide:delegate'), undefined, 'decide:delegate');",
+ "try { plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan)); } finally { stageTrackerClearPending(pend); }",
+ "stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] || '');",
+ } {
if !strings.Contains(html, want) {
t.Errorf("index.html missing %q", want)
}
}
}
+// stageTrackerPendingSync under node: only the tagged pend busies the lead,
+// and only the lead it names; a disabled lead comes back disabled with its
+// reason once the pend clears.
+func TestStageTrackerLetHiveDecideBusyRestoreNode(t *testing.T) {
+ html := indexHTML(t)
+ runStageTrackerRowActionsScript(t, stageTrackerRowActionsPreamble(t, html)+`
+const now = Date.now();
+function hamStubLead(act, disabledWhy) {
+ const head = hamStubEl('div'); head.classList.add('ham-row-head');
+ const b = hamStubEl('button'); b.classList.add('ham-lead-act'); b.setAttribute('data-ham-act', act); b.textContent = 'Let hive decide';
+ if (disabledWhy) { b.setAttribute('aria-disabled', 'true'); b.setAttribute('title', disabledWhy); } else b.setAttribute('title', 'delegate');
+ head.appendChild(b); return { head, b };
+}
+const K = 'hivecommons/hive/pr#15773';
+// 1. The preview's tagged pend: busy + spinner + "Asking the hive…", not clickable; restore puts the label and hint back.
+let row = hamStubRow(K); let { head, b } = hamStubLead('decide:delegate'); row.appendChild(head); hamPanel.children.length = 0; hamPanel.appendChild(row);
+let pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate'), now, 'decide:delegate');
+assert.strictEqual(b.getAttribute('aria-busy'), 'true', 'tagged pend busies the button');
+assert.strictEqual(b.getAttribute('aria-disabled'), 'true', 'busy is not clickable (the click guard reads aria-disabled)');
+assert.strictEqual(b.getAttribute('title'), null, 'the hint does not show while busy');
+assert.ok(b.children.some(c => c.classList && c.classList.contains('cue-acting-spin')), 'spinner');
+assert.strictEqual(b.children[b.children.length - 1].nodeValue, STAGE_TRACKER_LEAD_BUSY_TEXT);
+assert.ok(row.classList.contains('cue-acting'), 'the row still wears the acting caption');
+stageTrackerPendingSync(hamPanel);
+assert.strictEqual(b.children.filter(c => c.classList && c.classList.contains('cue-acting-spin')).length, 1, 'a re-sync adds no second spinner');
+stageTrackerClearPending(pend);
+assert.strictEqual(b.getAttribute('aria-busy'), null); assert.strictEqual(b.getAttribute('aria-disabled'), null, 'an enabled lead is clickable again');
+assert.strictEqual(b.getAttribute('title'), 'delegate', 'the hint is back'); assert.strictEqual(b.textContent, 'Let hive decide');
+// 2. The confirmed action's pend (no tag, "Adopting…" etc.) never touches the button, even on a decide:delegate lead.
+pend = stageTrackerSetPending([K], 'Adopting…', now);
+assert.strictEqual(b.getAttribute('aria-busy'), null, 'an untagged pend leaves the lead alone: ' + JSON.stringify(b.attrs));
+assert.ok(row.classList.contains('cue-acting'), 'but the row caption shows');
+stageTrackerClearPending(pend);
+// 3. A tagged pend on a row whose lead is another verb leaves that lead alone.
+row = hamStubRow(K); ({ head, b } = hamStubLead('decide:merge-now')); row.appendChild(head); hamPanel.children.length = 0; hamPanel.appendChild(row);
+pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate'), now, 'decide:delegate');
+assert.strictEqual(b.getAttribute('aria-busy'), null, 'Merge now does not read Asking the hive…');
+stageTrackerClearPending(pend);
+// 4. A lead the row rendered disabled (aria-disabled + why) is disabled again after the pend clears — not clickable.
+row = hamStubRow(K); ({ head, b } = hamStubLead('decide:delegate', 'Needs write access')); row.appendChild(head); hamPanel.children.length = 0; hamPanel.appendChild(row);
+pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate'), now, 'decide:delegate');
+assert.strictEqual(b.getAttribute('aria-busy'), 'true');
+stageTrackerClearPending(pend);
+assert.strictEqual(b.getAttribute('aria-busy'), null);
+assert.strictEqual(b.getAttribute('aria-disabled'), 'true', 'a disabled lead stays disabled after the pend clears');
+assert.strictEqual(b.getAttribute('title'), 'Needs write access', 'with its reason');
+assert.strictEqual(b.textContent, 'Let hive decide');
+`)
+}
+
+// A covered issue whose PR is listed as its own tracker row renders a
+// passive chip, named after whatever the lead is, not a second button.
+func TestStageTrackerCoveredIssueDropsPRChipNode(t *testing.T) {
+ html := indexHTML(t)
+ runStageTrackerRowActionsScript(t, stageTrackerRowActionsPreamble(t, html)+`
+const NOW = Date.parse('2026-10-30T18:00:00Z');
+const ctx = { user: true, canHold: true, canHuman: true, login: 'octo', nowMs: NOW, governor: {} };
+const buttons = h => (h.match(/ x && x !== c).join(' '); }, contains(c) { return el.className.split(' ').includes(c); } },
appendChild(c) { c.parentNode = el; el.children.push(c); return c; }, prepend(c) { c.parentNode = el; el.children.unshift(c); },
- setAttribute(k, v) { el.attrs[k] = String(v); }, getAttribute(k) { return k in el.attrs ? el.attrs[k] : null; },
+ setAttribute(k, v) { el.attrs[k] = String(v); }, getAttribute(k) { return k in el.attrs ? el.attrs[k] : null; }, removeAttribute(k) { delete el.attrs[k]; }, dataset: {},
addEventListener(n, fn) { el._listeners[n] = fn; }, remove() { if (el.parentNode) el.parentNode.children = el.parentNode.children.filter(c => c !== el); el.parentNode = null; },
get lastChild() { return el.children[el.children.length - 1] || null; },
- querySelector(sel) { const m = sel.match(/^:scope > \.([\w-]+)$/); if (!m) return null; return el.children.find(c => c.classList.contains(m[1])) || null; },
+ querySelector(sel) {
+ // ":scope > .child .descendant[attr]" — the lead button under the row head.
+ const d = sel.match(/^:scope > \.([\w-]+) \.([\w-]+)(?:\[([\w-]+)\])?$/);
+ if (d) { const head = el.children.find(c => c.classList && c.classList.contains(d[1])); if (!head) return null; const walk = n => { for (const c of (n.children || [])) { if (c.classList && c.classList.contains(d[2]) && (!d[3] || c.attrs[d[3]] != null)) return c; const r = walk(c); if (r) return r; } return null; }; return walk(head); }
+ const m = sel.match(/^:scope > \.([\w-]+)$/); if (!m) return null; return el.children.find(c => c.classList && c.classList.contains(m[1])) || null; },
querySelectorAll(sel) { const out = []; const walk = n => { for (const c of (n.children || [])) { if (!c.attrs) continue; if ((sel.includes('[data-ham-key]') && c.attrs['data-ham-key'] != null) || (sel.includes('[data-ham-sub-key]') && c.attrs['data-ham-sub-key'] != null)) out.push(c); walk(c); } }; walk(el); return out; },
};
return el;
diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css
index f55e9aeb03..d4192b1a7f 100644
--- a/src/pkg/dashboard/static-src/css/tracker.css
+++ b/src/pkg/dashboard/static-src/css/tracker.css
@@ -684,9 +684,11 @@
.ham-lead-act { padding: 0 var(--sp-3); border: var(--line-width) solid var(--cue-state, var(--accent)); border-radius: var(--r-pill); background: color-mix(in srgb, var(--cue-state, var(--accent)) 10%, transparent); color: var(--cue-state, var(--accent)); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.4; cursor: pointer; white-space: nowrap; }
.ham-lead-act:hover, .ham-lead-act:focus-visible { background: color-mix(in srgb, var(--cue-state, var(--accent)) 22%, transparent); outline: none; }
.ham-lead-act:focus-visible { box-shadow: 0 0 0 var(--line-width) var(--accent); }
- .ham-lead-act[aria-busy="true"] { cursor: progress; opacity: 1; border-style: solid; color: var(--cue-work); }
.ham-lead-act.ham-menu-danger { color: var(--red); border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.ham-lead-act[aria-disabled="true"] { color: var(--text-faint); border-color: var(--line-subtle); border-style: dashed; background: transparent; cursor: default; opacity: 0.7; }
+ /* Busy (Let hive decide gathering its preview) also sets aria-disabled, so this
+ compound rule sits after the disabled one and wins: the working colour, not faint/dashed. */
+ .ham-lead-act[aria-busy="true"][aria-disabled="true"] { cursor: progress; opacity: 1; border-style: solid; border-color: var(--cue-work); background: color-mix(in srgb, var(--cue-work) 10%, transparent); color: var(--cue-work); }
/* The technical background folds behind one collapsed Details. */
.ham-decision-details { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--text-muted); }
.ham-decision-details > summary { cursor: pointer; color: var(--text-faint); }
diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js
index ba1f6fd6d4..77df86b55b 100644
--- a/src/pkg/dashboard/static-src/js/tracker-actions.js
+++ b/src/pkg/dashboard/static-src/js/tracker-actions.js
@@ -514,7 +514,10 @@
function stageTrackerLeadActionHtml(item, ctx, subRows) {
const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
if (!a) return '';
- if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
+ // The covering PR has its own row: the decision — whatever its lead
+ // (Let hive decide, Merge now, Adopt…) — is taken there, so this row
+ // shows a passive chip that names that lead rather than a second button.
+ if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
const label = String(a.label || a.id);
const tip = a.enabled ? String(a.hint || a.note || a.consequence || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
@@ -1584,8 +1587,10 @@
// recorded on the ledger).
async function stageTrackerDelegatePreview(items, rows) {
// The plan gathers the PR live (seconds): the row reads "acting…" and
- // its button busy from the click until the preview can open.
- const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate'));
+ // its Let hive decide button busy from the click until the preview can
+ // open. The pend is tagged with the button it busies: a confirmed
+ // action's pend (or any other ⋯ action on the row) leaves it alone.
+ const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate'), undefined, 'decide:delegate');
let plans;
try { plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan)); } finally { stageTrackerClearPending(pend); }
const failed = plans.filter(pl => pl.error);
@@ -1983,8 +1988,10 @@
pend.caption = stageTrackerDecidedActing(result, item);
stageTrackerPendingSync(document.getElementById('activity-monitor-panel'));
}
- function stageTrackerSetPending(keys, caption, now) {
- const pend = { keys: keys.slice(), caption, key: '', state: null, decided: false, at: typeof now === 'number' ? now : Date.now() };
+ // busy: the data-ham-act of the row's lead button that reads busy while
+ // this entry is pending ('' — the default — busies no button).
+ function stageTrackerSetPending(keys, caption, now, busy) {
+ const pend = { keys: keys.slice(), caption, key: '', state: null, decided: false, at: typeof now === 'number' ? now : Date.now(), busy: busy || '' };
_stageTrackerPending.push(pend);
stageTrackerPendingSync(document.getElementById('activity-monitor-panel'));
return pend;
@@ -2010,29 +2017,41 @@
});
}
function stageTrackerPendingExpire(d, now) { _stageTrackerPending = stageTrackerPendingLive(_stageTrackerPending, d, typeof now === 'number' ? now : Date.now()); }
+ // The row's lead button while a tagged pend (busyAct, its data-ham-act)
+ // waits: busy, spinner, "Asking the hive…", not clickable again. The
+ // button's own aria-disabled / title are kept and put back when the
+ // pend clears, so a lead the row rendered disabled stays disabled.
+ const STAGE_TRACKER_LEAD_BUSY_TEXT = ' Asking the hive…';
+ function stageTrackerLeadBusySync(lead, busyAct) {
+ if (!lead) return;
+ const on = !!busyAct && lead.getAttribute('data-ham-act') === busyAct;
+ const isBusy = lead.getAttribute('aria-busy') === 'true';
+ if (on && !isBusy) {
+ lead.dataset.hamLabel = lead.textContent;
+ lead.dataset.hamWasDisabled = lead.getAttribute('aria-disabled') === 'true' ? 'true' : '';
+ lead.dataset.hamTitle = lead.getAttribute('title') || '';
+ lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true'); lead.removeAttribute('title');
+ lead.textContent = '';
+ const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
+ lead.appendChild(document.createTextNode(STAGE_TRACKER_LEAD_BUSY_TEXT));
+ } else if (!on && isBusy) {
+ lead.removeAttribute('aria-busy');
+ if (lead.dataset.hamWasDisabled === 'true') lead.setAttribute('aria-disabled', 'true'); else lead.removeAttribute('aria-disabled');
+ if (lead.dataset.hamTitle) lead.setAttribute('title', lead.dataset.hamTitle); else lead.removeAttribute('title');
+ lead.textContent = lead.dataset.hamLabel || '';
+ }
+ }
// Mark rows / sub-rows acting; captions are real nodes so a kept row
// keeps its caption and a re-rendered one gets it back.
function stageTrackerPendingSync(el) {
if (!el || typeof el.querySelectorAll !== 'function') return;
- const want = {};
- for (const p of _stageTrackerPending) for (const k of p.keys) want[k] = p.caption;
+ const want = {}, busy = {};
+ for (const p of _stageTrackerPending) for (const k of p.keys) { want[k] = p.caption; if (p.busy) busy[k] = p.busy; }
const nodes = Array.from(el.querySelectorAll('[data-ham-key], [data-ham-sub-key]'));
for (const n of nodes) {
const key = n.getAttribute('data-ham-sub-key') || n.getAttribute('data-ham-key');
const cap = want[key];
- // A pending Let hive decide shows on its button too: busy, not clickable again.
- const lead = n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act^="decide:delegate"]');
- if (lead) {
- if (cap && lead.getAttribute('aria-busy') !== 'true') {
- lead.dataset.hamLabel = lead.textContent;
- lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true');
- lead.textContent = '';
- const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
- lead.appendChild(document.createTextNode(' Asking the hive…'));
- } else if (!cap && lead.getAttribute('aria-busy') === 'true') {
- lead.removeAttribute('aria-busy'); lead.removeAttribute('aria-disabled'); lead.textContent = lead.dataset.hamLabel || '';
- }
- }
+ stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] || '');
const strip = n.querySelector(':scope > .ham-strip-row');
// The caption lives inside the lit chevron (the pill), never as a
// separate element beside the ✓ badge (#15126); a row without a
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index 4abc7d3584..5fc86cd882 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -2013,9 +2013,11 @@
.ham-lead-act { padding: 0 var(--sp-3); border: var(--line-width) solid var(--cue-state, var(--accent)); border-radius: var(--r-pill); background: color-mix(in srgb, var(--cue-state, var(--accent)) 10%, transparent); color: var(--cue-state, var(--accent)); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.4; cursor: pointer; white-space: nowrap; }
.ham-lead-act:hover, .ham-lead-act:focus-visible { background: color-mix(in srgb, var(--cue-state, var(--accent)) 22%, transparent); outline: none; }
.ham-lead-act:focus-visible { box-shadow: 0 0 0 var(--line-width) var(--accent); }
- .ham-lead-act[aria-busy="true"] { cursor: progress; opacity: 1; border-style: solid; color: var(--cue-work); }
.ham-lead-act.ham-menu-danger { color: var(--red); border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.ham-lead-act[aria-disabled="true"] { color: var(--text-faint); border-color: var(--line-subtle); border-style: dashed; background: transparent; cursor: default; opacity: 0.7; }
+ /* Busy (Let hive decide gathering its preview) also sets aria-disabled, so this
+ compound rule sits after the disabled one and wins: the working colour, not faint/dashed. */
+ .ham-lead-act[aria-busy="true"][aria-disabled="true"] { cursor: progress; opacity: 1; border-style: solid; border-color: var(--cue-work); background: color-mix(in srgb, var(--cue-work) 10%, transparent); color: var(--cue-work); }
/* The technical background folds behind one collapsed Details. */
.ham-decision-details { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--text-muted); }
.ham-decision-details > summary { cursor: pointer; color: var(--text-faint); }
@@ -20108,7 +20110,10 @@ All labels
function stageTrackerLeadActionHtml(item, ctx, subRows) {
const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
if (!a) return '';
- if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
+ // The covering PR has its own row: the decision — whatever its lead
+ // (Let hive decide, Merge now, Adopt…) — is taken there, so this row
+ // shows a passive chip that names that lead rather than a second button.
+ if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
const label = String(a.label || a.id);
const tip = a.enabled ? String(a.hint || a.note || a.consequence || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
@@ -21178,8 +21183,10 @@ All labels
// recorded on the ledger).
async function stageTrackerDelegatePreview(items, rows) {
// The plan gathers the PR live (seconds): the row reads "acting…" and
- // its button busy from the click until the preview can open.
- const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate'));
+ // its Let hive decide button busy from the click until the preview can
+ // open. The pend is tagged with the button it busies: a confirmed
+ // action's pend (or any other ⋯ action on the row) leaves it alone.
+ const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate'), undefined, 'decide:delegate');
let plans;
try { plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan)); } finally { stageTrackerClearPending(pend); }
const failed = plans.filter(pl => pl.error);
@@ -21577,8 +21584,10 @@ All labels
pend.caption = stageTrackerDecidedActing(result, item);
stageTrackerPendingSync(document.getElementById('activity-monitor-panel'));
}
- function stageTrackerSetPending(keys, caption, now) {
- const pend = { keys: keys.slice(), caption, key: '', state: null, decided: false, at: typeof now === 'number' ? now : Date.now() };
+ // busy: the data-ham-act of the row's lead button that reads busy while
+ // this entry is pending ('' — the default — busies no button).
+ function stageTrackerSetPending(keys, caption, now, busy) {
+ const pend = { keys: keys.slice(), caption, key: '', state: null, decided: false, at: typeof now === 'number' ? now : Date.now(), busy: busy || '' };
_stageTrackerPending.push(pend);
stageTrackerPendingSync(document.getElementById('activity-monitor-panel'));
return pend;
@@ -21604,29 +21613,41 @@ All labels
});
}
function stageTrackerPendingExpire(d, now) { _stageTrackerPending = stageTrackerPendingLive(_stageTrackerPending, d, typeof now === 'number' ? now : Date.now()); }
+ // The row's lead button while a tagged pend (busyAct, its data-ham-act)
+ // waits: busy, spinner, "Asking the hive…", not clickable again. The
+ // button's own aria-disabled / title are kept and put back when the
+ // pend clears, so a lead the row rendered disabled stays disabled.
+ const STAGE_TRACKER_LEAD_BUSY_TEXT = ' Asking the hive…';
+ function stageTrackerLeadBusySync(lead, busyAct) {
+ if (!lead) return;
+ const on = !!busyAct && lead.getAttribute('data-ham-act') === busyAct;
+ const isBusy = lead.getAttribute('aria-busy') === 'true';
+ if (on && !isBusy) {
+ lead.dataset.hamLabel = lead.textContent;
+ lead.dataset.hamWasDisabled = lead.getAttribute('aria-disabled') === 'true' ? 'true' : '';
+ lead.dataset.hamTitle = lead.getAttribute('title') || '';
+ lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true'); lead.removeAttribute('title');
+ lead.textContent = '';
+ const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
+ lead.appendChild(document.createTextNode(STAGE_TRACKER_LEAD_BUSY_TEXT));
+ } else if (!on && isBusy) {
+ lead.removeAttribute('aria-busy');
+ if (lead.dataset.hamWasDisabled === 'true') lead.setAttribute('aria-disabled', 'true'); else lead.removeAttribute('aria-disabled');
+ if (lead.dataset.hamTitle) lead.setAttribute('title', lead.dataset.hamTitle); else lead.removeAttribute('title');
+ lead.textContent = lead.dataset.hamLabel || '';
+ }
+ }
// Mark rows / sub-rows acting; captions are real nodes so a kept row
// keeps its caption and a re-rendered one gets it back.
function stageTrackerPendingSync(el) {
if (!el || typeof el.querySelectorAll !== 'function') return;
- const want = {};
- for (const p of _stageTrackerPending) for (const k of p.keys) want[k] = p.caption;
+ const want = {}, busy = {};
+ for (const p of _stageTrackerPending) for (const k of p.keys) { want[k] = p.caption; if (p.busy) busy[k] = p.busy; }
const nodes = Array.from(el.querySelectorAll('[data-ham-key], [data-ham-sub-key]'));
for (const n of nodes) {
const key = n.getAttribute('data-ham-sub-key') || n.getAttribute('data-ham-key');
const cap = want[key];
- // A pending Let hive decide shows on its button too: busy, not clickable again.
- const lead = n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act^="decide:delegate"]');
- if (lead) {
- if (cap && lead.getAttribute('aria-busy') !== 'true') {
- lead.dataset.hamLabel = lead.textContent;
- lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true');
- lead.textContent = '';
- const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
- lead.appendChild(document.createTextNode(' Asking the hive…'));
- } else if (!cap && lead.getAttribute('aria-busy') === 'true') {
- lead.removeAttribute('aria-busy'); lead.removeAttribute('aria-disabled'); lead.textContent = lead.dataset.hamLabel || '';
- }
- }
+ stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] || '');
const strip = n.querySelector(':scope > .ham-strip-row');
// The caption lives inside the lit chevron (the pill), never as a
// separate element beside the ✓ badge (#15126); a row without a
From 4442dac5ca4213e4b8206a515ad553d1a998c9a5 Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 18:12:46 -0400
Subject: [PATCH 5/8] fix: covered-issue chip only when the PR is a drawn row
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
stageTrackerPRListedOwnRow read _stageTracker.items, but a PR nested_under
a listed issue (stage_tracker_links.go) is folded into that issue's sub-row
by stageTrackerVisible and never drawn as its own row outside the Pull
requests view — so the issue row showed a passive "decision pending on #N"
chip pointing at a row that did not exist and lost its only decision
button. The render now records the drawn rows (_stageTracker.rows) and the
chip follows them; without a render the items stand in, minus PRs nested
under a listed issue. Test covers nested_under and the drawn-rows path.
Hive-Fix-Attempt: 2/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
.../stage_tracker_decide_feedback_test.go | 17 +++++++++++++++
.../static-src/js/tracker-actions.js | 18 ++++++++++++++--
.../static-src/js/tracker-filter-render.js | 3 +++
src/pkg/dashboard/static/index.html | 21 +++++++++++++++++--
4 files changed, 55 insertions(+), 4 deletions(-)
diff --git a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
index 0a62592e51..2ee242dc5f 100644
--- a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
+++ b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
@@ -122,6 +122,23 @@ assert.ok(h.includes('decision pending on #15647'), h);
assert.ok(h.includes('Let hive decide lives on its row'), h);
// The PR's own row still carries the button.
assert.strictEqual(buttons(stageTrackerLeadActionHtml(prRow, ctx)), 1);
+// Nested under the issue (stage_tracker_links.go sets nested_under): the PR
+// is in items but stageTrackerVisible folds it into the issue's sub-row, so
+// no chip — the issue keeps its button when no sub-row is drawn (one
+// covering PR) and yields it to the sub-row when several are.
+const nested = Object.assign({}, prRow, { nested_under: 15320 });
+_stageTracker = { items: [issue, nested] };
+a = stageTrackerLeadActionOnRow(issue, ctx);
+assert.ok(a && !a.passive, 'a nested PR is not its own row: ' + JSON.stringify(a));
+assert.strictEqual(buttons(stageTrackerLeadActionHtml(issue, ctx)), 1, 'the issue row keeps its only decision button');
+assert.strictEqual(stageTrackerLeadActionOnRow(issue, ctx, [asking]), null, 'drawn as a sub-row, the sub-row carries it');
+// A render records the drawn rows; the chip follows them, not the items:
+// the PR hidden by the filter leaves the button on the issue, the PR drawn
+// as a row turns it into the chip.
+_stageTracker = { items: [issue, prRow], rows: [issue] };
+assert.ok(!stageTrackerLeadActionOnRow(issue, ctx).passive, 'the PR not drawn: no chip');
+_stageTracker = { items: [issue, nested], rows: [issue, nested] };
+assert.strictEqual(stageTrackerLeadActionOnRow(issue, ctx).passive, 15647, 'the PR drawn (Pull requests view aside, a row is a row): chip');
// A server-marked lead that is not Let hive decide is named as itself.
const merging = Object.assign({}, asking, { decision_needed: { question: 'Merge?', options: [{ action: 'decide:merge-now', label: 'Merge now', enabled: true, lead: true }, { action: 'decide:delegate', label: 'Let hive decide', enabled: true }] } });
const issue2 = Object.assign({}, issue, { number: 15321, linked_prs: [merging] });
diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js
index 77df86b55b..3468cc162c 100644
--- a/src/pkg/dashboard/static-src/js/tracker-actions.js
+++ b/src/pkg/dashboard/static-src/js/tracker-actions.js
@@ -491,10 +491,24 @@
// #15647, hive#15338 → #15648). The ⋯ menu's "Decide PR #N…" stays on
// the parent. subRows: the linked PRs drawn as sub-rows, or none.
// Pure: is the covering PR also a row of its own in the tracker (a
- // top-level item, not a sub-row)? Then only that row carries the button.
+ // top-level row, not a sub-row)? Then only that row carries the button.
+ // Reads the rows the last render drew (_stageTracker.rows, set by
+ // stageTrackerRender from stageTrackerVisible), not the payload's items:
+ // a PR nested_under a listed issue is in items but is never its own row
+ // outside the Pull requests view (tracker-filter.js stageTrackerVisible),
+ // and a filter may hide the PR while it shows the issue. Without a
+ // render (the node harness) the items stand in, minus PRs nested under
+ // a listed issue, so the chip never points at a row that is not drawn.
function stageTrackerPRListedOwnRow(issue, t) {
+ if (!_stageTracker) return false;
const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
- return !!_stageTracker && Array.isArray(_stageTracker.items) && _stageTracker.items.some(it => stageTrackerItemKey(it) === key);
+ let rows = _stageTracker.rows;
+ if (!Array.isArray(rows)) {
+ const items = Array.isArray(_stageTracker.items) ? _stageTracker.items : [];
+ const issues = new Set(items.filter(it => it && it.kind === 'issue').map(it => it.repo + '#' + it.number));
+ rows = items.filter(it => it && !(it.kind === 'pr' && it.nested_under && issues.has(it.repo + '#' + it.nested_under)));
+ }
+ return rows.some(it => it && stageTrackerItemKey(it) === key);
}
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
diff --git a/src/pkg/dashboard/static-src/js/tracker-filter-render.js b/src/pkg/dashboard/static-src/js/tracker-filter-render.js
index 71a9d7dc71..3f8b05ee25 100644
--- a/src/pkg/dashboard/static-src/js/tracker-filter-render.js
+++ b/src/pkg/dashboard/static-src/js/tracker-filter-render.js
@@ -83,6 +83,9 @@
// Repo chips ride the setting against how many repos the payload spans.
if (stageTrackerRepoChipOn(stageTrackerRepoChipSetting(), repos.length)) ctx.repoChips = { primary: stageTrackerPrimaryRepo(), active: f.repo };
const visible = stageTrackerVisible(d.items, f, ctx);
+ // The rows this view draws, for stageTrackerPRListedOwnRow: a covered
+ // issue defers to its PR's row only when that row is actually drawn.
+ if (_stageTracker) _stageTracker.rows = visible;
const ordered = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f));
const grouping = _stageTrackerGroup === 'repo';
const page = grouping
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index 5fc86cd882..110d20ddfc 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -19304,6 +19304,9 @@ All labels
// Repo chips ride the setting against how many repos the payload spans.
if (stageTrackerRepoChipOn(stageTrackerRepoChipSetting(), repos.length)) ctx.repoChips = { primary: stageTrackerPrimaryRepo(), active: f.repo };
const visible = stageTrackerVisible(d.items, f, ctx);
+ // The rows this view draws, for stageTrackerPRListedOwnRow: a covered
+ // issue defers to its PR's row only when that row is actually drawn.
+ if (_stageTracker) _stageTracker.rows = visible;
const ordered = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f));
const grouping = _stageTrackerGroup === 'repo';
const page = grouping
@@ -20087,10 +20090,24 @@ All labels
// #15647, hive#15338 → #15648). The ⋯ menu's "Decide PR #N…" stays on
// the parent. subRows: the linked PRs drawn as sub-rows, or none.
// Pure: is the covering PR also a row of its own in the tracker (a
- // top-level item, not a sub-row)? Then only that row carries the button.
+ // top-level row, not a sub-row)? Then only that row carries the button.
+ // Reads the rows the last render drew (_stageTracker.rows, set by
+ // stageTrackerRender from stageTrackerVisible), not the payload's items:
+ // a PR nested_under a listed issue is in items but is never its own row
+ // outside the Pull requests view (tracker-filter.js stageTrackerVisible),
+ // and a filter may hide the PR while it shows the issue. Without a
+ // render (the node harness) the items stand in, minus PRs nested under
+ // a listed issue, so the chip never points at a row that is not drawn.
function stageTrackerPRListedOwnRow(issue, t) {
+ if (!_stageTracker) return false;
const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
- return !!_stageTracker && Array.isArray(_stageTracker.items) && _stageTracker.items.some(it => stageTrackerItemKey(it) === key);
+ let rows = _stageTracker.rows;
+ if (!Array.isArray(rows)) {
+ const items = Array.isArray(_stageTracker.items) ? _stageTracker.items : [];
+ const issues = new Set(items.filter(it => it && it.kind === 'issue').map(it => it.repo + '#' + it.number));
+ rows = items.filter(it => it && !(it.kind === 'pr' && it.nested_under && issues.has(it.repo + '#' + it.nested_under)));
+ }
+ return rows.some(it => it && stageTrackerItemKey(it) === key);
}
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
From 0a783689b923ea398346c7b47f01a77ada66ab2a Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 22:15:36 -0400
Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=90=9B=20fix:=20one=20preview=20capti?=
=?UTF-8?q?on,=20rows-only=20chip=20rule,=20operator=20doc=20for=20#15773?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Review follow-ups on #15871:
- The Let hive decide preview pend now carries its own entry in
STAGE_TRACKER_ACTING_CAPTIONS ('decide:delegate:preview' →
"Asking the hive…"); the busy lead button renders the pend's caption,
so the row caption and the button say one phrase and the read-only
preview is told apart from the confirmed "Hive deciding…". The
STAGE_TRACKER_LEAD_BUSY_TEXT constant is gone.
- stageTrackerPRListedOwnRow reads only _stageTracker.rows (what the
last render drew); the harness-only items fallback that duplicated
stageTrackerVisible's nesting rule returns false instead, and the node
test sets rows as stageTrackerRender would.
- activity-monitor.md describes the "decision pending on #N" chip, the
pre-preview "Asking the hive…" busy button, and the human-move tooltip
fallback to human_merge_reason_text / reason.
Hive-Fix-Attempt: 3/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
.../dashboard-sections/activity-monitor.md | 15 +++---
.../stage_tracker_decide_feedback_test.go | 35 ++++++++------
.../stage_tracker_decided_ui_test.go | 1 -
.../stage_tracker_row_actions_test.go | 1 -
.../static-src/js/tracker-actions.js | 46 +++++++++----------
src/pkg/dashboard/static/index.html | 46 +++++++++----------
6 files changed, 71 insertions(+), 73 deletions(-)
diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md
index a54de68fbb..d43eedbfa8 100644
--- a/src/docs/dashboard-sections/activity-monitor.md
+++ b/src/docs/dashboard-sections/activity-monitor.md
@@ -369,7 +369,7 @@ Plain words throughout — working / waiting on X / set back by Y / merged — n
#### The row's lead action, inline
-A row whose next move is yours does not hide its answer behind three dots. Beside the chips on the right of the header (and on a nested PR sub-row's own header), the row renders its **lead action** as a real `` — `[Accept triage]` on *Triage needed* (000-new hold or 015), `[Merge now]` (or the server's lead answer) on *Ready for human merge*, `[Let hive decide]` on *Needs human decision* and a duplicate's *Needs a pick*, `[Adopt…]` on a returned contributor PR whose adoption is due, `[Close now]` on an advisory issue. `stageTrackerLeadAction(item, ctx)` picks it from the same `stageTrackerRowActions(...)` list the ⋯ menu shows: the entry flagged `lead`, else the first *Decide…* option, else Adopt / Adopt now / *Let hive decide — all N PRs*; one button only, everything else stays in ⋯. It carries the menu entry's id, its hint as the hover and its enable/disable reason: a viewer without write access sees it greyed with *Sign in with write access to this repo*, a non-merger sees a merge action greyed with the role reason, never hidden. Clicking runs `runRowAction(action, row)` — the menu's own path, so the busy chevron, the acting caption, the toast and the history badge are the same. A row the server marks as the maintainer's move (`actor: maintainer` or `new.next_mover: maintainer`) that yields no lead is a bug: a development host logs a console warning, and `TestStageTrackerMaintainerRowsHaveLeadAction` runs the real fixtures through the picker.
+A row whose next move is yours does not hide its answer behind three dots. Beside the chips on the right of the header (and on a nested PR sub-row's own header), the row renders its **lead action** as a real `` — `[Accept triage]` on *Triage needed* (000-new hold or 015), `[Merge now]` (or the server's lead answer) on *Ready for human merge*, `[Let hive decide]` on *Needs human decision* and a duplicate's *Needs a pick*, `[Adopt…]` on a returned contributor PR whose adoption is due, `[Close now]` on an advisory issue. `stageTrackerLeadAction(item, ctx)` picks it from the same `stageTrackerRowActions(...)` list the ⋯ menu shows: the entry flagged `lead`, else the first *Decide…* option, else Adopt / Adopt now / *Let hive decide — all N PRs*; one button only, everything else stays in ⋯. A covered issue whose covering PR is drawn as its own tracker row renders no button at all but a passive *decision pending on #N* chip (its tooltip names the lead that lives on the PR's row), so the decision has one button, on the PR. It carries the menu entry's id, its hint as the hover and its enable/disable reason: a viewer without write access sees it greyed with *Sign in with write access to this repo*, a non-merger sees a merge action greyed with the role reason, never hidden. Clicking runs `runRowAction(action, row)` — the menu's own path, so the busy chevron, the acting caption, the toast and the history badge are the same. A row the server marks as the maintainer's move (`actor: maintainer` or `new.next_mover: maintainer`) that yields no lead is a bug: a development host logs a console warning, and `TestStageTrackerMaintainerRowsHaveLeadAction` runs the real fixtures through the picker.
#### Row actions (right-click, ⋯, Shift+F10)
@@ -429,7 +429,7 @@ Nothing the dialog would have said is lost: the result toast carries the same
The small icon after the lit pill's words names whose move the row is, and it comes from the payload — `stage_actor: {kind, login, since, why}`, derived server-side for every item and every nested PR — never from a guess on a login string. `kind` is one of **hive** (⬡ honeycomb: a hive lane or agent acts next; `login` is the agent when one is on it right now), **clanker** (robot head: a registered contributor agent must push), **human** (the person glyph the *Needs human decision* pill uses: the author, approver or a maintainer must act; `login` names them when known), **bot** (cog: a non-hive automation account such as `github-actions[bot]` or renovate authored the PR; the hive does not fix bot PRs, it waits for the bot's next run), or **none** (no icon: nobody is working on it — the pill's tooltip then reads *no one is working on this right now — *).
-`why` is a short sentence the tooltip appends after *Next move: @*. A `070` Fixing pill is only shown as **Fixing** when someone can fix it; a bot-authored or unowned red PR reads its state in plain words instead — **Conflicting · bot PR**, **Red · nobody on it** — with the matching icon, so a row such as hivecommons/docs#500 (a nightly resync PR that conflicts with its base) no longer looks like active hive work.
+`why` is a short sentence the tooltip appends after *Next move: @*; when a **human** / maintainer move carries no `why`, the tooltip falls back to the row's own reason (`human_merge_reason_text`, else `reason`), so the person glyph always says why a person is wanted. A `070` Fixing pill is only shown as **Fixing** when someone can fix it; a bot-authored or unowned red PR reads its state in plain words instead — **Conflicting · bot PR**, **Red · nobody on it** — with the matching icon, so a row such as hivecommons/docs#500 (a nightly resync PR that conflicts with its base) no longer looks like active hive work.
Issues riding one covering PR take that PR's actor; nested PR sub-rows carry their own.
@@ -594,10 +594,11 @@ The item leaves 085/045 and proceeds without the owner. The action is audited as
#### How it runs
-1. Read the one-time explanation and confirmation. **Don't ask again for this action** is optional; reset it in ⚙ → **Confirmations**.
-2. The row reads **Hive is deciding…** while the job runs.
-3. Read the persistent result toast. It says what was decided and what happens next; it stays until the target row changes state.
-4. If the result has not happened, use [When the decision doesn't take effect](#when-the-decision-doesnt-take-effect), rather than treating an approval as a completed merge.
+1. From the click until the preview opens, the row's *Let hive decide* button and its caption both read **Asking the hive…** with a spinner (the plan is gathered live; the button cannot be clicked twice).
+2. Read the one-time explanation and confirmation. **Don't ask again for this action** is optional; reset it in ⚙ → **Confirmations**.
+3. The row reads **Hive is deciding…** while the job runs.
+4. Read the persistent result toast. It says what was decided and what happens next; it stays until the target row changes state.
+5. If the result has not happened, use [When the decision doesn't take effect](#when-the-decision-doesnt-take-effect), rather than treating an approval as a completed merge.
Permission is the same as **Hold**: owner, or a signed-in user with repository write access. The recorded decision names the requesting user as the person who delegated it.
@@ -666,7 +667,7 @@ At the same time the hive posts one follow-up comment on the item — *Hive deci
The toast and the decision trail lead with the outcome in one line — *Adopted — hive will rebase & merge it next pass (~4m)*; *Adopted: hive opened #15123 with the same commits and will merge it; #15029 will be closed as superseded* — details second, nothing repeated.
-**Preview before acting.** *Let hive decide* no longer acts on the click. It first calls `POST …/decide-delegated/plan` , a dry run with no side effects that answers `{would, title, summary, why, consequences[], ladder, mergeable_as_is, alternatives[]}`, and shows one decision — built to be read in three seconds (operator feedback on hive's own spoke: the first version was "a wall of text" with a doubled *Hive would: Hive would:*, the PR named twice, three type sizes and a merge button on a head it had just called not mergeable):
+**Preview before acting.** *Let hive decide* no longer acts on the click. The button turns busy and reads **Asking the hive…** (the row caption says the same) while it first calls `POST …/decide-delegated/plan`, a dry run with no side effects that answers `{would, title, summary, why, consequences[], ladder, mergeable_as_is, alternatives[]}`, and shows one decision — built to be read in three seconds (operator feedback on hive's own spoke: the first version was "a wall of text" with a doubled *Hive would: Hive would:*, the PR named twice, three type sizes and a merge button on a head it had just called not mergeable):
- **Title** *Let hive decide*, then one subject line — `hivecommons/hive#15332 · ci: run crux's Go file-size ratchet…` — with a compact **⚠ Sentinel** chip when the sentinel flagged the head (the full finding is in Details).
- **Eyebrow** *Hive would* → **one verb-first sentence**: *Send #15332 back to its author with one instruction: make CI green, nothing else.* → one muted **Why** line (≤ 12 words: *CI is red.*) → **Then**, at most two short items (*Hive posts that instruction on #15332. · The author pushes a fix; the row updates when it lands.*).
diff --git a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
index 2ee242dc5f..2ad3a22ab8 100644
--- a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
+++ b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
@@ -35,9 +35,10 @@ func TestStageTrackerLetHiveDecideBusyCSS(t *testing.T) {
func TestStageTrackerLetHiveDecidePreviewTagsPend(t *testing.T) {
html := indexHTML(t)
for _, want := range []string{
- "stageTrackerActingCaption('decide:delegate'), undefined, 'decide:delegate');",
+ "stageTrackerActingCaption('decide:delegate:preview'), undefined, 'decide:delegate');",
+ `'decide:delegate:preview': 'Asking the hive…'`,
"try { plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan)); } finally { stageTrackerClearPending(pend); }",
- "stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] || '');",
+ "stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] ? busy[key].busy : '', busy[key] ? busy[key].caption : '');",
} {
if !strings.Contains(html, want) {
t.Errorf("index.html missing %q", want)
@@ -59,14 +60,15 @@ function hamStubLead(act, disabledWhy) {
head.appendChild(b); return { head, b };
}
const K = 'hivecommons/hive/pr#15773';
-// 1. The preview's tagged pend: busy + spinner + "Asking the hive…", not clickable; restore puts the label and hint back.
+// 1. The preview's tagged pend: busy + spinner + the pend's caption ("Asking the hive…", the row caption's phrase), not clickable; restore puts the label and hint back.
let row = hamStubRow(K); let { head, b } = hamStubLead('decide:delegate'); row.appendChild(head); hamPanel.children.length = 0; hamPanel.appendChild(row);
-let pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate'), now, 'decide:delegate');
+let pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate:preview'), now, 'decide:delegate');
assert.strictEqual(b.getAttribute('aria-busy'), 'true', 'tagged pend busies the button');
assert.strictEqual(b.getAttribute('aria-disabled'), 'true', 'busy is not clickable (the click guard reads aria-disabled)');
assert.strictEqual(b.getAttribute('title'), null, 'the hint does not show while busy');
assert.ok(b.children.some(c => c.classList && c.classList.contains('cue-acting-spin')), 'spinner');
-assert.strictEqual(b.children[b.children.length - 1].nodeValue, STAGE_TRACKER_LEAD_BUSY_TEXT);
+assert.strictEqual(b.children[b.children.length - 1].nodeValue, ' Asking the hive…', 'the button reads the pend caption, one phrase with the row');
+assert.strictEqual(stageTrackerActingCaption('decide:delegate:preview'), 'Asking the hive…'); assert.strictEqual(stageTrackerActingCaption('decide:delegate'), 'Hive deciding…', 'the confirmed action keeps its own caption');
assert.ok(row.classList.contains('cue-acting'), 'the row still wears the acting caption');
stageTrackerPendingSync(hamPanel);
assert.strictEqual(b.children.filter(c => c.classList && c.classList.contains('cue-acting-spin')).length, 1, 'a re-sync adds no second spinner');
@@ -80,12 +82,12 @@ assert.ok(row.classList.contains('cue-acting'), 'but the row caption shows');
stageTrackerClearPending(pend);
// 3. A tagged pend on a row whose lead is another verb leaves that lead alone.
row = hamStubRow(K); ({ head, b } = hamStubLead('decide:merge-now')); row.appendChild(head); hamPanel.children.length = 0; hamPanel.appendChild(row);
-pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate'), now, 'decide:delegate');
+pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate:preview'), now, 'decide:delegate');
assert.strictEqual(b.getAttribute('aria-busy'), null, 'Merge now does not read Asking the hive…');
stageTrackerClearPending(pend);
// 4. A lead the row rendered disabled (aria-disabled + why) is disabled again after the pend clears — not clickable.
row = hamStubRow(K); ({ head, b } = hamStubLead('decide:delegate', 'Needs write access')); row.appendChild(head); hamPanel.children.length = 0; hamPanel.appendChild(row);
-pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate'), now, 'decide:delegate');
+pend = stageTrackerSetPending([K], stageTrackerActingCaption('decide:delegate:preview'), now, 'decide:delegate');
assert.strictEqual(b.getAttribute('aria-busy'), 'true');
stageTrackerClearPending(pend);
assert.strictEqual(b.getAttribute('aria-busy'), null);
@@ -107,13 +109,17 @@ const asking = { number: 15647, url: 'https://github.com/o/r/pull/15647', title:
decision_needed: { question: 'Approve or send back?', options: [{ action: 'decide:delegate', label: 'Let hive decide', enabled: true }, { action: 'decide:approve', label: 'Approve', enabled: true }] } };
const issue = { repo: 'o/r', kind: 'issue', number: 15320, title: 'Tracker lead chips', url: 'https://github.com/o/r/issues/15320', stage: 40, actor: 'maintainer', modifiers: [], linked_prs: [asking] };
const prRow = Object.assign({ repo: 'o/r', kind: 'pr' }, asking);
+// Rows are what the last render drew (_stageTracker.rows, from
+// stageTrackerVisible); before any render nothing is listed, so no chip.
+_stageTracker = { items: [issue, prRow] };
+assert.ok(!stageTrackerLeadActionOnRow(issue, ctx).passive, 'no render yet: no chip');
// The PR not listed as a row: the issue keeps its button (no sub-rows drawn).
-_stageTracker = { items: [issue] };
+_stageTracker = { items: [issue], rows: [issue] };
let a = stageTrackerLeadActionOnRow(issue, ctx);
assert.strictEqual(a.id, 'decide:delegate'); assert.ok(!a.passive);
assert.strictEqual(buttons(stageTrackerLeadActionHtml(issue, ctx)), 1);
// Listed as its own row: passive, naming the PR; the chip is a span, no button.
-_stageTracker = { items: [issue, prRow] };
+_stageTracker = { items: [issue, prRow], rows: [issue, prRow] };
a = stageTrackerLeadActionOnRow(issue, ctx);
assert.strictEqual(a.passive, 15647, JSON.stringify(a));
let h = stageTrackerLeadActionHtml(issue, ctx);
@@ -123,11 +129,11 @@ assert.ok(h.includes('Let hive decide lives on its row'), h);
// The PR's own row still carries the button.
assert.strictEqual(buttons(stageTrackerLeadActionHtml(prRow, ctx)), 1);
// Nested under the issue (stage_tracker_links.go sets nested_under): the PR
-// is in items but stageTrackerVisible folds it into the issue's sub-row, so
-// no chip — the issue keeps its button when no sub-row is drawn (one
-// covering PR) and yields it to the sub-row when several are.
+// is in items but stageTrackerVisible folds it into the issue's sub-row and
+// leaves it out of rows, so no chip — the issue keeps its button when no
+// sub-row is drawn (one covering PR) and yields it to the sub-row when several are.
const nested = Object.assign({}, prRow, { nested_under: 15320 });
-_stageTracker = { items: [issue, nested] };
+_stageTracker = { items: [issue, nested], rows: [issue] };
a = stageTrackerLeadActionOnRow(issue, ctx);
assert.ok(a && !a.passive, 'a nested PR is not its own row: ' + JSON.stringify(a));
assert.strictEqual(buttons(stageTrackerLeadActionHtml(issue, ctx)), 1, 'the issue row keeps its only decision button');
@@ -142,7 +148,8 @@ assert.strictEqual(stageTrackerLeadActionOnRow(issue, ctx).passive, 15647, 'the
// A server-marked lead that is not Let hive decide is named as itself.
const merging = Object.assign({}, asking, { decision_needed: { question: 'Merge?', options: [{ action: 'decide:merge-now', label: 'Merge now', enabled: true, lead: true }, { action: 'decide:delegate', label: 'Let hive decide', enabled: true }] } });
const issue2 = Object.assign({}, issue, { number: 15321, linked_prs: [merging] });
-_stageTracker = { items: [issue2, Object.assign({ repo: 'o/r', kind: 'pr' }, merging)] };
+const mergingRow = Object.assign({ repo: 'o/r', kind: 'pr' }, merging);
+_stageTracker = { items: [issue2, mergingRow], rows: [issue2, mergingRow] };
a = stageTrackerLeadActionOnRow(issue2, ctx);
assert.strictEqual(a.id, 'decide:merge-now', JSON.stringify(a)); assert.strictEqual(a.passive, 15647);
h = stageTrackerLeadActionHtml(issue2, ctx);
diff --git a/src/pkg/dashboard/stage_tracker_decided_ui_test.go b/src/pkg/dashboard/stage_tracker_decided_ui_test.go
index 61d37c77f2..002cec590d 100644
--- a/src/pkg/dashboard/stage_tracker_decided_ui_test.go
+++ b/src/pkg/dashboard/stage_tracker_decided_ui_test.go
@@ -41,7 +41,6 @@ func stageTrackerDecidedUIJS(t *testing.T, html string) string {
"var _stageTrackerPending = [];",
jsFunc(t, html, "stageTrackerRowDeciding"),
jsFunc(t, html, "stageTrackerSetPending"),
- jsConstLine(t, html, "STAGE_TRACKER_LEAD_BUSY_TEXT"),
jsFunc(t, html, "stageTrackerLeadBusySync"),
jsFunc(t, html, "stageTrackerPendingSync"),
stageTrackerDomStubJS,
diff --git a/src/pkg/dashboard/stage_tracker_row_actions_test.go b/src/pkg/dashboard/stage_tracker_row_actions_test.go
index 2e9c67b44b..f869404edc 100644
--- a/src/pkg/dashboard/stage_tracker_row_actions_test.go
+++ b/src/pkg/dashboard/stage_tracker_row_actions_test.go
@@ -161,7 +161,6 @@ func stageTrackerRowActionsPreamble(t *testing.T, html string) string {
jsFunc(t, html, "stageTrackerClearPending"),
jsFunc(t, html, "stageTrackerPendingLive"),
jsFunc(t, html, "stageTrackerPendingExpire"),
- jsConstLine(t, html, "STAGE_TRACKER_LEAD_BUSY_TEXT"),
jsFunc(t, html, "stageTrackerLeadBusySync"),
jsFunc(t, html, "stageTrackerPendingSync"),
// Progress + failure surfacing for every mutating action (hivecommons/hive#15436).
diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js
index 3468cc162c..bf91857680 100644
--- a/src/pkg/dashboard/static-src/js/tracker-actions.js
+++ b/src/pkg/dashboard/static-src/js/tracker-actions.js
@@ -496,19 +496,13 @@
// stageTrackerRender from stageTrackerVisible), not the payload's items:
// a PR nested_under a listed issue is in items but is never its own row
// outside the Pull requests view (tracker-filter.js stageTrackerVisible),
- // and a filter may hide the PR while it shows the issue. Without a
- // render (the node harness) the items stand in, minus PRs nested under
- // a listed issue, so the chip never points at a row that is not drawn.
+ // and a filter may hide the PR while it shows the issue. The nesting
+ // rule lives in stageTrackerVisible alone: with no rows recorded yet
+ // nothing is drawn, so nothing is "listed" and the chip is not shown.
function stageTrackerPRListedOwnRow(issue, t) {
- if (!_stageTracker) return false;
+ if (!_stageTracker || !Array.isArray(_stageTracker.rows)) return false;
const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
- let rows = _stageTracker.rows;
- if (!Array.isArray(rows)) {
- const items = Array.isArray(_stageTracker.items) ? _stageTracker.items : [];
- const issues = new Set(items.filter(it => it && it.kind === 'issue').map(it => it.repo + '#' + it.number));
- rows = items.filter(it => it && !(it.kind === 'pr' && it.nested_under && issues.has(it.repo + '#' + it.nested_under)));
- }
- return rows.some(it => it && stageTrackerItemKey(it) === key);
+ return _stageTracker.rows.some(it => it && stageTrackerItemKey(it) === key);
}
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
@@ -1600,11 +1594,13 @@
// alternative (which runs as its own row action with the chosen button
// recorded on the ledger).
async function stageTrackerDelegatePreview(items, rows) {
- // The plan gathers the PR live (seconds): the row reads "acting…" and
- // its Let hive decide button busy from the click until the preview can
- // open. The pend is tagged with the button it busies: a confirmed
- // action's pend (or any other ⋯ action on the row) leaves it alone.
- const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate'), undefined, 'decide:delegate');
+ // The plan gathers the PR live (seconds): the row caption and its Let
+ // hive decide button both read the preview's own caption ("Asking the
+ // hive…", one phrase from STAGE_TRACKER_ACTING_CAPTIONS, distinct from
+ // the confirmed action's "Hive deciding…") from the click until the
+ // preview can open. The pend is tagged with the button it busies: a
+ // confirmed action's pend (or any other ⋯ action on the row) leaves it alone.
+ const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate:preview'), undefined, 'decide:delegate');
let plans;
try { plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan)); } finally { stageTrackerClearPending(pend); }
const failed = plans.filter(pl => pl.error);
@@ -1786,7 +1782,7 @@
const STAGE_TRACKER_ACTING_CAPTIONS = {
'hold': 'Holding…', 'release': 'Releasing hold…', 'retry': 'Re-evaluating…', 'needs-human': 'Marking needs-human…', 'accept-triage': 'Accepting triage…',
'blocker:recheck': 'Checking App permissions…', 'blocker:close-partial': 'Closing as partial…',
- 'decide:delegate': 'Hive deciding…', 'decide:delegate-all': 'Hive deciding each PR…', 'decide:delegate:rerun': 'Hive deciding again…', 'decide:approve': 'Approving…', 'decide:direction': 'Recording direction…', 'decide:close-superseded': 'Closing…', 'decide:close-wontfix': 'Closing…', 'decide:close-read': 'Closing…',
+ 'decide:delegate': 'Hive deciding…', 'decide:delegate:preview': 'Asking the hive…', 'decide:delegate-all': 'Hive deciding each PR…', 'decide:delegate:rerun': 'Hive deciding again…', 'decide:approve': 'Approving…', 'decide:direction': 'Recording direction…', 'decide:close-superseded': 'Closing…', 'decide:close-wontfix': 'Closing…', 'decide:close-read': 'Closing…',
'decide:merge-now': 'Merging…', 'decide:queue-merge': 'Recording approval…', 'decide:re-author': 'Queuing re-authoring…',
'decide:adopt': 'Adopting…', 'decide:adopt-now': 'Adopting now…', 'decide:reroute': 'Rerouting…',
};
@@ -2032,11 +2028,11 @@
}
function stageTrackerPendingExpire(d, now) { _stageTrackerPending = stageTrackerPendingLive(_stageTrackerPending, d, typeof now === 'number' ? now : Date.now()); }
// The row's lead button while a tagged pend (busyAct, its data-ham-act)
- // waits: busy, spinner, "Asking the hive…", not clickable again. The
- // button's own aria-disabled / title are kept and put back when the
- // pend clears, so a lead the row rendered disabled stays disabled.
- const STAGE_TRACKER_LEAD_BUSY_TEXT = ' Asking the hive…';
- function stageTrackerLeadBusySync(lead, busyAct) {
+ // waits: busy, spinner, the pend's own caption (the same phrase the row
+ // caption shows), not clickable again. The button's own aria-disabled /
+ // title are kept and put back when the pend clears, so a lead the row
+ // rendered disabled stays disabled.
+ function stageTrackerLeadBusySync(lead, busyAct, caption) {
if (!lead) return;
const on = !!busyAct && lead.getAttribute('data-ham-act') === busyAct;
const isBusy = lead.getAttribute('aria-busy') === 'true';
@@ -2047,7 +2043,7 @@
lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true'); lead.removeAttribute('title');
lead.textContent = '';
const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
- lead.appendChild(document.createTextNode(STAGE_TRACKER_LEAD_BUSY_TEXT));
+ lead.appendChild(document.createTextNode(' ' + String(caption || 'acting…')));
} else if (!on && isBusy) {
lead.removeAttribute('aria-busy');
if (lead.dataset.hamWasDisabled === 'true') lead.setAttribute('aria-disabled', 'true'); else lead.removeAttribute('aria-disabled');
@@ -2060,12 +2056,12 @@
function stageTrackerPendingSync(el) {
if (!el || typeof el.querySelectorAll !== 'function') return;
const want = {}, busy = {};
- for (const p of _stageTrackerPending) for (const k of p.keys) { want[k] = p.caption; if (p.busy) busy[k] = p.busy; }
+ for (const p of _stageTrackerPending) for (const k of p.keys) { want[k] = p.caption; if (p.busy) busy[k] = p; }
const nodes = Array.from(el.querySelectorAll('[data-ham-key], [data-ham-sub-key]'));
for (const n of nodes) {
const key = n.getAttribute('data-ham-sub-key') || n.getAttribute('data-ham-key');
const cap = want[key];
- stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] || '');
+ stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] ? busy[key].busy : '', busy[key] ? busy[key].caption : '');
const strip = n.querySelector(':scope > .ham-strip-row');
// The caption lives inside the lit chevron (the pill), never as a
// separate element beside the ✓ badge (#15126); a row without a
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index 50f1ffa8d2..3b0849d76f 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -20396,19 +20396,13 @@ All labels
// stageTrackerRender from stageTrackerVisible), not the payload's items:
// a PR nested_under a listed issue is in items but is never its own row
// outside the Pull requests view (tracker-filter.js stageTrackerVisible),
- // and a filter may hide the PR while it shows the issue. Without a
- // render (the node harness) the items stand in, minus PRs nested under
- // a listed issue, so the chip never points at a row that is not drawn.
+ // and a filter may hide the PR while it shows the issue. The nesting
+ // rule lives in stageTrackerVisible alone: with no rows recorded yet
+ // nothing is drawn, so nothing is "listed" and the chip is not shown.
function stageTrackerPRListedOwnRow(issue, t) {
- if (!_stageTracker) return false;
+ if (!_stageTracker || !Array.isArray(_stageTracker.rows)) return false;
const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
- let rows = _stageTracker.rows;
- if (!Array.isArray(rows)) {
- const items = Array.isArray(_stageTracker.items) ? _stageTracker.items : [];
- const issues = new Set(items.filter(it => it && it.kind === 'issue').map(it => it.repo + '#' + it.number));
- rows = items.filter(it => it && !(it.kind === 'pr' && it.nested_under && issues.has(it.repo + '#' + it.nested_under)));
- }
- return rows.some(it => it && stageTrackerItemKey(it) === key);
+ return _stageTracker.rows.some(it => it && stageTrackerItemKey(it) === key);
}
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
@@ -21500,11 +21494,13 @@ All labels
// alternative (which runs as its own row action with the chosen button
// recorded on the ledger).
async function stageTrackerDelegatePreview(items, rows) {
- // The plan gathers the PR live (seconds): the row reads "acting…" and
- // its Let hive decide button busy from the click until the preview can
- // open. The pend is tagged with the button it busies: a confirmed
- // action's pend (or any other ⋯ action on the row) leaves it alone.
- const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate'), undefined, 'decide:delegate');
+ // The plan gathers the PR live (seconds): the row caption and its Let
+ // hive decide button both read the preview's own caption ("Asking the
+ // hive…", one phrase from STAGE_TRACKER_ACTING_CAPTIONS, distinct from
+ // the confirmed action's "Hive deciding…") from the click until the
+ // preview can open. The pend is tagged with the button it busies: a
+ // confirmed action's pend (or any other ⋯ action on the row) leaves it alone.
+ const pend = stageTrackerSetPending([].concat(...items.map(it => stageTrackerPendingKeys(it, rows))).filter((k, i, a) => a.indexOf(k) === i), stageTrackerActingCaption('decide:delegate:preview'), undefined, 'decide:delegate');
let plans;
try { plans = await Promise.all(items.map(stageTrackerFetchDelegatePlan)); } finally { stageTrackerClearPending(pend); }
const failed = plans.filter(pl => pl.error);
@@ -21686,7 +21682,7 @@ All labels
const STAGE_TRACKER_ACTING_CAPTIONS = {
'hold': 'Holding…', 'release': 'Releasing hold…', 'retry': 'Re-evaluating…', 'needs-human': 'Marking needs-human…', 'accept-triage': 'Accepting triage…',
'blocker:recheck': 'Checking App permissions…', 'blocker:close-partial': 'Closing as partial…',
- 'decide:delegate': 'Hive deciding…', 'decide:delegate-all': 'Hive deciding each PR…', 'decide:delegate:rerun': 'Hive deciding again…', 'decide:approve': 'Approving…', 'decide:direction': 'Recording direction…', 'decide:close-superseded': 'Closing…', 'decide:close-wontfix': 'Closing…', 'decide:close-read': 'Closing…',
+ 'decide:delegate': 'Hive deciding…', 'decide:delegate:preview': 'Asking the hive…', 'decide:delegate-all': 'Hive deciding each PR…', 'decide:delegate:rerun': 'Hive deciding again…', 'decide:approve': 'Approving…', 'decide:direction': 'Recording direction…', 'decide:close-superseded': 'Closing…', 'decide:close-wontfix': 'Closing…', 'decide:close-read': 'Closing…',
'decide:merge-now': 'Merging…', 'decide:queue-merge': 'Recording approval…', 'decide:re-author': 'Queuing re-authoring…',
'decide:adopt': 'Adopting…', 'decide:adopt-now': 'Adopting now…', 'decide:reroute': 'Rerouting…',
};
@@ -21932,11 +21928,11 @@ All labels
}
function stageTrackerPendingExpire(d, now) { _stageTrackerPending = stageTrackerPendingLive(_stageTrackerPending, d, typeof now === 'number' ? now : Date.now()); }
// The row's lead button while a tagged pend (busyAct, its data-ham-act)
- // waits: busy, spinner, "Asking the hive…", not clickable again. The
- // button's own aria-disabled / title are kept and put back when the
- // pend clears, so a lead the row rendered disabled stays disabled.
- const STAGE_TRACKER_LEAD_BUSY_TEXT = ' Asking the hive…';
- function stageTrackerLeadBusySync(lead, busyAct) {
+ // waits: busy, spinner, the pend's own caption (the same phrase the row
+ // caption shows), not clickable again. The button's own aria-disabled /
+ // title are kept and put back when the pend clears, so a lead the row
+ // rendered disabled stays disabled.
+ function stageTrackerLeadBusySync(lead, busyAct, caption) {
if (!lead) return;
const on = !!busyAct && lead.getAttribute('data-ham-act') === busyAct;
const isBusy = lead.getAttribute('aria-busy') === 'true';
@@ -21947,7 +21943,7 @@ All labels
lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true'); lead.removeAttribute('title');
lead.textContent = '';
const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
- lead.appendChild(document.createTextNode(STAGE_TRACKER_LEAD_BUSY_TEXT));
+ lead.appendChild(document.createTextNode(' ' + String(caption || 'acting…')));
} else if (!on && isBusy) {
lead.removeAttribute('aria-busy');
if (lead.dataset.hamWasDisabled === 'true') lead.setAttribute('aria-disabled', 'true'); else lead.removeAttribute('aria-disabled');
@@ -21960,12 +21956,12 @@ All labels
function stageTrackerPendingSync(el) {
if (!el || typeof el.querySelectorAll !== 'function') return;
const want = {}, busy = {};
- for (const p of _stageTrackerPending) for (const k of p.keys) { want[k] = p.caption; if (p.busy) busy[k] = p.busy; }
+ for (const p of _stageTrackerPending) for (const k of p.keys) { want[k] = p.caption; if (p.busy) busy[k] = p; }
const nodes = Array.from(el.querySelectorAll('[data-ham-key], [data-ham-sub-key]'));
for (const n of nodes) {
const key = n.getAttribute('data-ham-sub-key') || n.getAttribute('data-ham-key');
const cap = want[key];
- stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] || '');
+ stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), busy[key] ? busy[key].busy : '', busy[key] ? busy[key].caption : '');
const strip = n.querySelector(':scope > .ham-strip-row');
// The caption lives inside the lit chevron (the pill), never as a
// separate element beside the ✓ badge (#15126); a row without a
From 16f930f25c6f2aafad62aa11b5d458e48751f169 Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Fri, 30 Oct 2026 23:16:18 -0400
Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=90=9B=20fix:=20085=20stage=5Factor.w?=
=?UTF-8?q?hy=20says=20why;=20drawn-page=20rows=20ride=20ctx,=20not=20the?=
=?UTF-8?q?=20payload?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
stageTrackerActorTip shows stage_actor.why whenever the server sets it, and
the server set a bare "a human decision is owed" on every 085 row, so the
stageTrackerHumanWhy fallback never ran and the 👤 marker stayed
unexplained. The NeedsDecision / IssueNeedsDecision arm now appends the
lane reason in plain words (as the caption does), else the decision's own
question — covered by a direct unit test on stageTrackerStageActor.
The rows the render draws are no longer stashed on the server payload
object: tracker-filter-render.js keeps them in _stageTrackerRows (the drawn
page, group headers aside, so "decision pending on #N" never names a row on
another page), stageTrackerLeadButtonHtml hands them over as ctx.rows, and
stageTrackerPRListedOwnRow(issue, t, rows) is genuinely pure. The passive
chip drops the unused ham-decision-pending class.
Refs hivecommons/hive#15773
Hive-Fix-Attempt: 4/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
src/pkg/dashboard/stage_tracker_actor.go | 16 ++++-
.../stage_tracker_decide_feedback_test.go | 69 ++++++++++++++++---
.../static-src/js/tracker-actions.js | 28 ++++----
.../static-src/js/tracker-filter-render.js | 8 ++-
.../static-src/js/tracker-row-layout.js | 2 +
.../static-src/js/tracker-words-stage.js | 2 +
src/pkg/dashboard/static/index.html | 40 ++++++-----
7 files changed, 120 insertions(+), 45 deletions(-)
diff --git a/src/pkg/dashboard/stage_tracker_actor.go b/src/pkg/dashboard/stage_tracker_actor.go
index ae19674c58..a71760736c 100644
--- a/src/pkg/dashboard/stage_tracker_actor.go
+++ b/src/pkg/dashboard/stage_tracker_actor.go
@@ -201,7 +201,9 @@ func stageTrackerStageActor(it StageTrackerItem, workers map[string]stageTracker
if step, _ := stageTrackerUnauthorized(it.Reason); step != "" {
return set(StageActorHuman, "", "the hive is not permitted to "+step+"; a person must")
}
- return set(StageActorHuman, "", "a human decision is owed")
+ // The why says what is owed, not only that it is (hivecommons/hive#15773):
+ // the lane's reason in plain words, else the decision's own question.
+ return set(StageActorHuman, "", joinClause("a human decision is owed", stageTrackerDecisionWhy(it)))
case stagelabels.ReadyForHumanMerge:
// The chevron and the popover already carry HumanMergeReasonText;
// the next-move line says only who moves (hivecommons/hive#15394).
@@ -214,6 +216,18 @@ func stageTrackerStageActor(it StageTrackerItem, workers map[string]stageTracker
return set(StageActorNone, "", "no stage recorded yet")
}
+// stageTrackerDecisionWhy: the clause after "a human decision is owed" —
+// the lane reason humanized ("workflow path"), else the asker's question.
+func stageTrackerDecisionWhy(it StageTrackerItem) string {
+ if clause := humanizeStageReason(it.Reason); clause != "" {
+ return clause
+ }
+ if it.DecisionNeeded != nil {
+ return strings.TrimSpace(it.DecisionNeeded.Question)
+ }
+ return ""
+}
+
// stageTrackerAuthorStageActor: 070 / 071 / 072 park the PR on its
// author. A hive PR is the hive's (an agent on it is named; otherwise the
// hive re-kicks it), a clanker's is re-kicked by its contributor hive, a
diff --git a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
index 2ad3a22ab8..f4d0b58bec 100644
--- a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
+++ b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
@@ -3,6 +3,10 @@ package dashboard
import (
"strings"
"testing"
+ "time"
+
+ stageengineprstage "github.com/hivecommons/hive/pkg/stageengine/prstage"
+ "github.com/hivecommons/hive/pkg/stagelabels"
)
// Let hive decide answers at once, a covered issue defers to its PR's row,
@@ -109,17 +113,20 @@ const asking = { number: 15647, url: 'https://github.com/o/r/pull/15647', title:
decision_needed: { question: 'Approve or send back?', options: [{ action: 'decide:delegate', label: 'Let hive decide', enabled: true }, { action: 'decide:approve', label: 'Approve', enabled: true }] } };
const issue = { repo: 'o/r', kind: 'issue', number: 15320, title: 'Tracker lead chips', url: 'https://github.com/o/r/issues/15320', stage: 40, actor: 'maintainer', modifiers: [], linked_prs: [asking] };
const prRow = Object.assign({ repo: 'o/r', kind: 'pr' }, asking);
-// Rows are what the last render drew (_stageTracker.rows, from
-// stageTrackerVisible); before any render nothing is listed, so no chip.
+// Rows are what the render draws (ctx.rows, the page from
+// tracker-filter-render.js); before any render nothing is listed, so no chip.
_stageTracker = { items: [issue, prRow] };
assert.ok(!stageTrackerLeadActionOnRow(issue, ctx).passive, 'no render yet: no chip');
+// The helper is pure: it reads only the rows it is given.
+assert.strictEqual(stageTrackerPRListedOwnRow(issue, { kind: 'pr', number: 15647 }), false);
+assert.strictEqual(stageTrackerPRListedOwnRow(issue, { kind: 'pr', number: 15647 }, [issue, prRow]), true);
// The PR not listed as a row: the issue keeps its button (no sub-rows drawn).
-_stageTracker = { items: [issue], rows: [issue] };
+ctx.rows = [issue];
let a = stageTrackerLeadActionOnRow(issue, ctx);
assert.strictEqual(a.id, 'decide:delegate'); assert.ok(!a.passive);
assert.strictEqual(buttons(stageTrackerLeadActionHtml(issue, ctx)), 1);
// Listed as its own row: passive, naming the PR; the chip is a span, no button.
-_stageTracker = { items: [issue, prRow], rows: [issue, prRow] };
+ctx.rows = [issue, prRow];
a = stageTrackerLeadActionOnRow(issue, ctx);
assert.strictEqual(a.passive, 15647, JSON.stringify(a));
let h = stageTrackerLeadActionHtml(issue, ctx);
@@ -133,23 +140,23 @@ assert.strictEqual(buttons(stageTrackerLeadActionHtml(prRow, ctx)), 1);
// leaves it out of rows, so no chip — the issue keeps its button when no
// sub-row is drawn (one covering PR) and yields it to the sub-row when several are.
const nested = Object.assign({}, prRow, { nested_under: 15320 });
-_stageTracker = { items: [issue, nested], rows: [issue] };
+_stageTracker = { items: [issue, nested] }; ctx.rows = [issue];
a = stageTrackerLeadActionOnRow(issue, ctx);
assert.ok(a && !a.passive, 'a nested PR is not its own row: ' + JSON.stringify(a));
assert.strictEqual(buttons(stageTrackerLeadActionHtml(issue, ctx)), 1, 'the issue row keeps its only decision button');
assert.strictEqual(stageTrackerLeadActionOnRow(issue, ctx, [asking]), null, 'drawn as a sub-row, the sub-row carries it');
// A render records the drawn rows; the chip follows them, not the items:
-// the PR hidden by the filter leaves the button on the issue, the PR drawn
-// as a row turns it into the chip.
-_stageTracker = { items: [issue, prRow], rows: [issue] };
+// the PR hidden by the filter or on another page leaves the button on the
+// issue, the PR drawn as a row turns it into the chip.
+_stageTracker = { items: [issue, prRow] }; ctx.rows = [issue];
assert.ok(!stageTrackerLeadActionOnRow(issue, ctx).passive, 'the PR not drawn: no chip');
-_stageTracker = { items: [issue, nested], rows: [issue, nested] };
+_stageTracker = { items: [issue, nested] }; ctx.rows = [issue, nested];
assert.strictEqual(stageTrackerLeadActionOnRow(issue, ctx).passive, 15647, 'the PR drawn (Pull requests view aside, a row is a row): chip');
// A server-marked lead that is not Let hive decide is named as itself.
const merging = Object.assign({}, asking, { decision_needed: { question: 'Merge?', options: [{ action: 'decide:merge-now', label: 'Merge now', enabled: true, lead: true }, { action: 'decide:delegate', label: 'Let hive decide', enabled: true }] } });
const issue2 = Object.assign({}, issue, { number: 15321, linked_prs: [merging] });
const mergingRow = Object.assign({ repo: 'o/r', kind: 'pr' }, merging);
-_stageTracker = { items: [issue2, mergingRow], rows: [issue2, mergingRow] };
+_stageTracker = { items: [issue2, mergingRow] }; ctx.rows = [issue2, mergingRow];
a = stageTrackerLeadActionOnRow(issue2, ctx);
assert.strictEqual(a.id, 'decide:merge-now', JSON.stringify(a)); assert.strictEqual(a.passive, 15647);
h = stageTrackerLeadActionHtml(issue2, ctx);
@@ -163,4 +170,46 @@ func TestStageTrackerHumanChevronSaysWhyJS(t *testing.T) {
if !strings.Contains(html, "function stageTrackerHumanWhy(item, kind)") || !strings.Contains(html, "sa.why || humanWhy(item, sa.kind)") {
t.Error("the human next-move tooltip must fall back to the row's reason")
}
+ // The render hands the drawn page to the lead picker on ctx; the
+ // payload object carries nothing the client derived.
+ for _, want := range []string{
+ "_stageTrackerRows = page.rows.map(e => grouping ? e.item : e).filter(Boolean);",
+ "ctx.rows = typeof _stageTrackerRows !== 'undefined' ? _stageTrackerRows : null;",
+ "stageTrackerPRListedOwnRow(item, a.target, ctx && ctx.rows)",
+ } {
+ if !strings.Contains(html, want) {
+ t.Errorf("index.html missing %q", want)
+ }
+ }
+ if strings.Contains(html, "_stageTracker.rows") {
+ t.Error("the drawn rows must not be stashed on the server payload")
+ }
+}
+
+// The server's stage_actor.why on a 085 row says why the person is wanted
+// — the tooltip shows sa.why whenever it is set, so a bare "a human
+// decision is owed" would leave the 👤 marker unexplained on every row.
+func TestStageTrackerDecisionActorWhySaysWhy(t *testing.T) {
+ now := time.Date(2026, 10, 30, 18, 0, 0, 0, time.UTC)
+ actor := func(it StageTrackerItem) *StageTrackerActor {
+ it.Kind = "pr"
+ return stageTrackerStageActor(it, nil, now)
+ }
+ a := actor(StageTrackerItem{Stage: stagelabels.NeedsDecision.Number(), Reason: "contributor-lane:workflow-path"})
+ if a.Kind != StageActorHuman || a.Why != "a human decision is owed — workflow path" {
+ t.Errorf("reason-backed why = %q (kind %q)", a.Why, a.Kind)
+ }
+ a = actor(StageTrackerItem{Stage: stagelabels.IssueNeedsDecision.Number(), DecisionNeeded: &StageTrackerDecision{Question: "Keep #1 and close #2, or keep #2 and close #1?"}})
+ if a.Kind != StageActorHuman || a.Why != "a human decision is owed — Keep #1 and close #2, or keep #2 and close #1?" {
+ t.Errorf("question-backed why = %q (kind %q)", a.Why, a.Kind)
+ }
+ a = actor(StageTrackerItem{Stage: stagelabels.NeedsDecision.Number()})
+ if a.Kind != StageActorHuman || a.Why != "a human decision is owed" {
+ t.Errorf("bare why = %q (kind %q)", a.Why, a.Kind)
+ }
+ // The unauthorized step keeps its own, more specific, why.
+ a = actor(StageTrackerItem{Stage: stagelabels.NeedsDecision.Number(), Reason: stageengineprstage.StageReasonUnauthorizedPrefix + stageengineprstage.UnauthorizedStepApproveWorkflowRuns})
+ if !strings.Contains(a.Why, "not permitted to") {
+ t.Errorf("unauthorized why = %q", a.Why)
+ }
}
diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js
index bf91857680..dc6d3e84b1 100644
--- a/src/pkg/dashboard/static-src/js/tracker-actions.js
+++ b/src/pkg/dashboard/static-src/js/tracker-actions.js
@@ -490,23 +490,23 @@
// button — "Let hive decide" showed twice per item (hive#15320 →
// #15647, hive#15338 → #15648). The ⋯ menu's "Decide PR #N…" stays on
// the parent. subRows: the linked PRs drawn as sub-rows, or none.
- // Pure: is the covering PR also a row of its own in the tracker (a
- // top-level row, not a sub-row)? Then only that row carries the button.
- // Reads the rows the last render drew (_stageTracker.rows, set by
- // stageTrackerRender from stageTrackerVisible), not the payload's items:
- // a PR nested_under a listed issue is in items but is never its own row
- // outside the Pull requests view (tracker-filter.js stageTrackerVisible),
- // and a filter may hide the PR while it shows the issue. The nesting
- // rule lives in stageTrackerVisible alone: with no rows recorded yet
- // nothing is drawn, so nothing is "listed" and the chip is not shown.
- function stageTrackerPRListedOwnRow(issue, t) {
- if (!_stageTracker || !Array.isArray(_stageTracker.rows)) return false;
+ // Pure: is the covering PR also a row of its own among rows, the rows
+ // the render draws (a top-level row, not a sub-row)? Then only that row
+ // carries the button. rows is ctx.rows at the call site — the drawn
+ // page (tracker-filter-render.js _stageTrackerRows), not the payload's
+ // items: a PR nested_under a listed issue is in items but is never its
+ // own row outside the Pull requests view (tracker-filter.js
+ // stageTrackerVisible), and a filter or the page may hide the PR while
+ // it shows the issue. With no rows given nothing is drawn, so nothing
+ // is "listed" and the chip is not shown.
+ function stageTrackerPRListedOwnRow(issue, t, rows) {
+ if (!Array.isArray(rows)) return false;
const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
- return _stageTracker.rows.some(it => it && stageTrackerItemKey(it) === key);
+ return rows.some(it => it && stageTrackerItemKey(it) === key);
}
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
- if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr' && stageTrackerPRListedOwnRow(item, a.target)) return Object.assign({}, a, { passive: a.target.number });
+ if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr' && stageTrackerPRListedOwnRow(item, a.target, ctx && ctx.rows)) return Object.assign({}, a, { passive: a.target.number });
if (!a || !a.target || !Array.isArray(subRows) || !subRows.length || item.kind !== 'issue') return a;
const t = a.target;
if (t.kind !== 'pr') return a;
@@ -525,7 +525,7 @@
// The covering PR has its own row: the decision — whatever its lead
// (Let hive decide, Merge now, Adopt…) — is taken there, so this row
// shows a passive chip that names that lead rather than a second button.
- if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
+ if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
const label = String(a.label || a.id);
const tip = a.enabled ? String(a.hint || a.note || a.consequence || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
diff --git a/src/pkg/dashboard/static-src/js/tracker-filter-render.js b/src/pkg/dashboard/static-src/js/tracker-filter-render.js
index f7bda5ad62..16d0610bcf 100644
--- a/src/pkg/dashboard/static-src/js/tracker-filter-render.js
+++ b/src/pkg/dashboard/static-src/js/tracker-filter-render.js
@@ -86,15 +86,17 @@
// Repo chips ride the setting against how many repos the payload spans.
if (stageTrackerRepoChipOn(stageTrackerRepoChipSetting(), repos.length)) ctx.repoChips = { primary: stageTrackerPrimaryRepo(), active: f.repo };
const visible = stageTrackerVisible(d.items, f, ctx);
- // The rows this view draws, for stageTrackerPRListedOwnRow: a covered
- // issue defers to its PR's row only when that row is actually drawn.
- if (_stageTracker) _stageTracker.rows = visible;
const ordered = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f));
const grouping = _stageTrackerGroup === 'repo';
const page = grouping
? stageTrackerGroupPage(stageTrackerGroups(ordered, { primary: stageTrackerPrimaryRepo(), collapsed: _stageTrackerCollapsed, stages }), f)
: stageTrackerPage(ordered, f);
if (page.page !== f.page) f.page = page.page;
+ // The rows this render draws (this page, group headers aside), for
+ // stageTrackerPRListedOwnRow: a covered issue defers to its PR's row
+ // only when that row is actually on screen. Kept beside the payload,
+ // not on it — the payload object stays the server's.
+ _stageTrackerRows = page.rows.map(e => grouping ? e.item : e).filter(Boolean);
if (typeof stageTrackerPreparationVisualSync === 'function') stageTrackerPreparationVisualSync(d, ordered, page.rows, stages, nowMs);
if (typeof stageTrackerNativeQueueSync === 'function') stageTrackerNativeQueueSync(d, page.rows, nowMs, f.repo);
// Attention is counted over the filtered set, nested PRs included.
diff --git a/src/pkg/dashboard/static-src/js/tracker-row-layout.js b/src/pkg/dashboard/static-src/js/tracker-row-layout.js
index b9e13cf15f..7404d051e0 100644
--- a/src/pkg/dashboard/static-src/js/tracker-row-layout.js
+++ b/src/pkg/dashboard/static-src/js/tracker-row-layout.js
@@ -199,6 +199,8 @@
const ctx = stageTrackerActionCtx(item.repo);
if (!ctx) return '';
ctx.nowMs = typeof nowMs === 'number' ? nowMs : Date.now();
+ // The rows this render draws, so a covered issue can defer to its PR's row.
+ ctx.rows = typeof _stageTrackerRows !== 'undefined' ? _stageTrackerRows : null;
return stageTrackerLeadActionHtml(item, ctx, subRows);
}
// PR link, then the lineage chip (null = none), then the base pill.
diff --git a/src/pkg/dashboard/static-src/js/tracker-words-stage.js b/src/pkg/dashboard/static-src/js/tracker-words-stage.js
index 873fac7b5c..0cbacc9c46 100644
--- a/src/pkg/dashboard/static-src/js/tracker-words-stage.js
+++ b/src/pkg/dashboard/static-src/js/tracker-words-stage.js
@@ -33,6 +33,8 @@
}
const STAGE_TRACKER_SHORT_SHA = 7;
var _stageTracker = null;
+ // The item rows the last stage-tracker render drew (tracker-filter-render.js).
+ var _stageTrackerRows = null;
var _stageTrackerSig = '';
var _stageTrackerEtag = '';
// Last poll outcome: '' while polls succeed, else a short reason ('HTTP
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index 5587558772..3b27b44ced 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -15376,6 +15376,8 @@ Where to get help
}
const STAGE_TRACKER_SHORT_SHA = 7;
var _stageTracker = null;
+ // The item rows the last stage-tracker render drew (tracker-filter-render.js).
+ var _stageTrackerRows = null;
var _stageTrackerSig = '';
var _stageTrackerEtag = '';
// Last poll outcome: '' while polls succeed, else a short reason ('HTTP
@@ -17643,6 +17645,8 @@ Where to get help
const ctx = stageTrackerActionCtx(item.repo);
if (!ctx) return '';
ctx.nowMs = typeof nowMs === 'number' ? nowMs : Date.now();
+ // The rows this render draws, so a covered issue can defer to its PR's row.
+ ctx.rows = typeof _stageTrackerRows !== 'undefined' ? _stageTrackerRows : null;
return stageTrackerLeadActionHtml(item, ctx, subRows);
}
// PR link, then the lineage chip (null = none), then the base pill.
@@ -19692,15 +19696,17 @@ All labels
// Repo chips ride the setting against how many repos the payload spans.
if (stageTrackerRepoChipOn(stageTrackerRepoChipSetting(), repos.length)) ctx.repoChips = { primary: stageTrackerPrimaryRepo(), active: f.repo };
const visible = stageTrackerVisible(d.items, f, ctx);
- // The rows this view draws, for stageTrackerPRListedOwnRow: a covered
- // issue defers to its PR's row only when that row is actually drawn.
- if (_stageTracker) _stageTracker.rows = visible;
const ordered = stageTrackerTrainContiguous(stageTrackerSort(visible, stages, f));
const grouping = _stageTrackerGroup === 'repo';
const page = grouping
? stageTrackerGroupPage(stageTrackerGroups(ordered, { primary: stageTrackerPrimaryRepo(), collapsed: _stageTrackerCollapsed, stages }), f)
: stageTrackerPage(ordered, f);
if (page.page !== f.page) f.page = page.page;
+ // The rows this render draws (this page, group headers aside), for
+ // stageTrackerPRListedOwnRow: a covered issue defers to its PR's row
+ // only when that row is actually on screen. Kept beside the payload,
+ // not on it — the payload object stays the server's.
+ _stageTrackerRows = page.rows.map(e => grouping ? e.item : e).filter(Boolean);
if (typeof stageTrackerPreparationVisualSync === 'function') stageTrackerPreparationVisualSync(d, ordered, page.rows, stages, nowMs);
if (typeof stageTrackerNativeQueueSync === 'function') stageTrackerNativeQueueSync(d, page.rows, nowMs, f.repo);
// Attention is counted over the filtered set, nested PRs included.
@@ -20479,23 +20485,23 @@ All labels
// button — "Let hive decide" showed twice per item (hive#15320 →
// #15647, hive#15338 → #15648). The ⋯ menu's "Decide PR #N…" stays on
// the parent. subRows: the linked PRs drawn as sub-rows, or none.
- // Pure: is the covering PR also a row of its own in the tracker (a
- // top-level row, not a sub-row)? Then only that row carries the button.
- // Reads the rows the last render drew (_stageTracker.rows, set by
- // stageTrackerRender from stageTrackerVisible), not the payload's items:
- // a PR nested_under a listed issue is in items but is never its own row
- // outside the Pull requests view (tracker-filter.js stageTrackerVisible),
- // and a filter may hide the PR while it shows the issue. The nesting
- // rule lives in stageTrackerVisible alone: with no rows recorded yet
- // nothing is drawn, so nothing is "listed" and the chip is not shown.
- function stageTrackerPRListedOwnRow(issue, t) {
- if (!_stageTracker || !Array.isArray(_stageTracker.rows)) return false;
+ // Pure: is the covering PR also a row of its own among rows, the rows
+ // the render draws (a top-level row, not a sub-row)? Then only that row
+ // carries the button. rows is ctx.rows at the call site — the drawn
+ // page (tracker-filter-render.js _stageTrackerRows), not the payload's
+ // items: a PR nested_under a listed issue is in items but is never its
+ // own row outside the Pull requests view (tracker-filter.js
+ // stageTrackerVisible), and a filter or the page may hide the PR while
+ // it shows the issue. With no rows given nothing is drawn, so nothing
+ // is "listed" and the chip is not shown.
+ function stageTrackerPRListedOwnRow(issue, t, rows) {
+ if (!Array.isArray(rows)) return false;
const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
- return _stageTracker.rows.some(it => it && stageTrackerItemKey(it) === key);
+ return rows.some(it => it && stageTrackerItemKey(it) === key);
}
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
- if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr' && stageTrackerPRListedOwnRow(item, a.target)) return Object.assign({}, a, { passive: a.target.number });
+ if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr' && stageTrackerPRListedOwnRow(item, a.target, ctx && ctx.rows)) return Object.assign({}, a, { passive: a.target.number });
if (!a || !a.target || !Array.isArray(subRows) || !subRows.length || item.kind !== 'issue') return a;
const t = a.target;
if (t.kind !== 'pr') return a;
@@ -20514,7 +20520,7 @@ All labels
// The covering PR has its own row: the decision — whatever its lead
// (Let hive decide, Merge now, Adopt…) — is taken there, so this row
// shows a passive chip that names that lead rather than a second button.
- if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
+ if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
const label = String(a.label || a.id);
const tip = a.enabled ? String(a.hint || a.note || a.consequence || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
From d3aece9091e2266f93e5f63f789eb6e9403369ae Mon Sep 17 00:00:00 2001
From: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Date: Sat, 31 Oct 2026 01:08:19 -0400
Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=90=9B=20fix:=20covered=20issue=20chi?=
=?UTF-8?q?ps=20to=20the=20row=20that=20draws=20its=20PR;=20row=20hover=20?=
=?UTF-8?q?says=20the=20decision=20reason=20once?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- stageTrackerLeadActionOnRow: a secondary covered issue (hive#15503 under
#15502) whose PR is drawn_under another listed issue renders the passive
"decision pending on #N" chip instead of a second Let hive decide button;
the chip names the row that draws the PR. Fixture added to
TestStageTrackerCoveredIssueDropsPRChipNode.
- stageTrackerTooltip: when the 035 next-move why repeats the caption, the
Next move line keeps only who moves; the chevron hover keeps the whole why.
- stageTrackerLeadBusySync stashes label/title/disabled in data-ham-*
attributes like the rest of tracker-*.js; the node DOM stub drops dataset.
- activity-monitor.md documents the server-side 035 why (lane reason, else
decision_needed.question) and reads "Hive deciding…" like the code.
Hive-Fix-Attempt: 5/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
---
.../dashboard-sections/activity-monitor.md | 8 +--
.../stage_tracker_decide_feedback_test.go | 52 ++++++++++++++++-
.../stage_tracker_row_actions_test.go | 3 +-
.../static-src/js/tracker-actions.js | 48 ++++++++++++----
.../static-src/js/tracker-row-strip.js | 9 ++-
src/pkg/dashboard/static/index.html | 57 ++++++++++++++-----
6 files changed, 145 insertions(+), 32 deletions(-)
diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md
index d43eedbfa8..eef8cef64c 100644
--- a/src/docs/dashboard-sections/activity-monitor.md
+++ b/src/docs/dashboard-sections/activity-monitor.md
@@ -369,7 +369,7 @@ Plain words throughout — working / waiting on X / set back by Y / merged — n
#### The row's lead action, inline
-A row whose next move is yours does not hide its answer behind three dots. Beside the chips on the right of the header (and on a nested PR sub-row's own header), the row renders its **lead action** as a real `` — `[Accept triage]` on *Triage needed* (000-new hold or 015), `[Merge now]` (or the server's lead answer) on *Ready for human merge*, `[Let hive decide]` on *Needs human decision* and a duplicate's *Needs a pick*, `[Adopt…]` on a returned contributor PR whose adoption is due, `[Close now]` on an advisory issue. `stageTrackerLeadAction(item, ctx)` picks it from the same `stageTrackerRowActions(...)` list the ⋯ menu shows: the entry flagged `lead`, else the first *Decide…* option, else Adopt / Adopt now / *Let hive decide — all N PRs*; one button only, everything else stays in ⋯. A covered issue whose covering PR is drawn as its own tracker row renders no button at all but a passive *decision pending on #N* chip (its tooltip names the lead that lives on the PR's row), so the decision has one button, on the PR. It carries the menu entry's id, its hint as the hover and its enable/disable reason: a viewer without write access sees it greyed with *Sign in with write access to this repo*, a non-merger sees a merge action greyed with the role reason, never hidden. Clicking runs `runRowAction(action, row)` — the menu's own path, so the busy chevron, the acting caption, the toast and the history badge are the same. A row the server marks as the maintainer's move (`actor: maintainer` or `new.next_mover: maintainer`) that yields no lead is a bug: a development host logs a console warning, and `TestStageTrackerMaintainerRowsHaveLeadAction` runs the real fixtures through the picker.
+A row whose next move is yours does not hide its answer behind three dots. Beside the chips on the right of the header (and on a nested PR sub-row's own header), the row renders its **lead action** as a real `` — `[Accept triage]` on *Triage needed* (000-new hold or 015), `[Merge now]` (or the server's lead answer) on *Ready for human merge*, `[Let hive decide]` on *Needs human decision* and a duplicate's *Needs a pick*, `[Adopt…]` on a returned contributor PR whose adoption is due, `[Close now]` on an advisory issue. `stageTrackerLeadAction(item, ctx)` picks it from the same `stageTrackerRowActions(...)` list the ⋯ menu shows: the entry flagged `lead`, else the first *Decide…* option, else Adopt / Adopt now / *Let hive decide — all N PRs*; one button only, everything else stays in ⋯. A covered issue whose covering PR is drawn as its own tracker row — or, when the PR closes several listed issues, under another listed issue (`drawn_under`) — renders no button at all but a passive *decision pending on #N* chip (its tooltip names the lead and the row it lives on), so the decision has one button, on the row that draws the PR. It carries the menu entry's id, its hint as the hover and its enable/disable reason: a viewer without write access sees it greyed with *Sign in with write access to this repo*, a non-merger sees a merge action greyed with the role reason, never hidden. Clicking runs `runRowAction(action, row)` — the menu's own path, so the busy chevron, the acting caption, the toast and the history badge are the same. A row the server marks as the maintainer's move (`actor: maintainer` or `new.next_mover: maintainer`) that yields no lead is a bug: a development host logs a console warning, and `TestStageTrackerMaintainerRowsHaveLeadAction` runs the real fixtures through the picker.
#### Row actions (right-click, ⋯, Shift+F10)
@@ -399,7 +399,7 @@ The owner's framing (2026-10-28): "Hive is doing the right things mostly; we now
**Where it is** is the lit chevron (the state pill). **Working** — the chevron's icon turns slowly and the pill pulses only while a hive agent is actually on the item right now (the status payload's `agents[].lastAction` for the current round, matched to the row or to the PR shown on its row); its tooltip then leads with *Working now: scout commented · 2m ago —* before the stage words.
-A still chevron means **waiting**; its tooltip already says where it stands and whose move it is (*Needs decision — … · Next move: human*). **Acting** — from the moment you choose a row action the affected row (and the nested PR sub-row when the action targets it) draws faint stripes over its lit chevron and an *Approving… / Hive is deciding… / Holding…* caption with a small spinner; it clears when the tracker reports the target in a new state, at once on a no-op or an error, and never later than three minutes.
+A still chevron means **waiting**; its tooltip already says where it stands and whose move it is (*Needs decision — … · Next move: human*). **Acting** — from the moment you choose a row action the affected row (and the nested PR sub-row when the action targets it) draws faint stripes over its lit chevron and an *Approving… / Hive deciding… / Holding…* caption with a small spinner; it clears when the tracker reports the target in a new state, at once on a no-op or an error, and never later than three minutes.
**Event line** — one short plain sentence under the strip about the latest thing that happened to the row, from the difference between two tracker payloads (the poll / SSE refetch the tracker already makes; no extra requests): *Hive: moved to CI / Review · 12s ago*, *Hive: fell back to Claimed — a reviewer requested changes* (a lower stage number reads as a fall only when the stage table's `falls_to` — the stage engine's regression rule — says so; triage accepted 015 → 010, a decision made 085 → 080 or the author resuming 072 → 070 read *moved to*), *Hive: waiting on a person*, *Hive: hold released*, *You: approved*.
@@ -429,7 +429,7 @@ Nothing the dialog would have said is lost: the result toast carries the same
The small icon after the lit pill's words names whose move the row is, and it comes from the payload — `stage_actor: {kind, login, since, why}`, derived server-side for every item and every nested PR — never from a guess on a login string. `kind` is one of **hive** (⬡ honeycomb: a hive lane or agent acts next; `login` is the agent when one is on it right now), **clanker** (robot head: a registered contributor agent must push), **human** (the person glyph the *Needs human decision* pill uses: the author, approver or a maintainer must act; `login` names them when known), **bot** (cog: a non-hive automation account such as `github-actions[bot]` or renovate authored the PR; the hive does not fix bot PRs, it waits for the bot's next run), or **none** (no icon: nobody is working on it — the pill's tooltip then reads *no one is working on this right now — *).
-`why` is a short sentence the tooltip appends after *Next move: @*; when a **human** / maintainer move carries no `why`, the tooltip falls back to the row's own reason (`human_merge_reason_text`, else `reason`), so the person glyph always says why a person is wanted. A `070` Fixing pill is only shown as **Fixing** when someone can fix it; a bot-authored or unowned red PR reads its state in plain words instead — **Conflicting · bot PR**, **Red · nobody on it** — with the matching icon, so a row such as hivecommons/docs#500 (a nightly resync PR that conflicts with its base) no longer looks like active hive work.
+`why` is a short sentence the tooltip appends after *Next move: @*. On *Needs human decision* (035 / 045) it says what is owed, not only that it is: *a human decision is owed — workflow path* — the lane reason in plain words (the same clause the row caption carries), else the decision's own question (`decision_needed.question`), else the bare phrase — so the 👤 marker never leaves the question unanswered. The row hover says it once: when that why repeats the caption, the *Next move* line keeps only who moves; the chevron hover, which has no caption line, carries the whole why. (Older payloads without `stage_actor` on a human move fall back to the row's own reason: `human_merge_reason_text`, else `reason`.) A `070` Fixing pill is only shown as **Fixing** when someone can fix it; a bot-authored or unowned red PR reads its state in plain words instead — **Conflicting · bot PR**, **Red · nobody on it** — with the matching icon, so a row such as hivecommons/docs#500 (a nightly resync PR that conflicts with its base) no longer looks like active hive work.
Issues riding one covering PR take that PR's actor; nested PR sub-rows carry their own.
@@ -596,7 +596,7 @@ The item leaves 085/045 and proceeds without the owner. The action is audited as
1. From the click until the preview opens, the row's *Let hive decide* button and its caption both read **Asking the hive…** with a spinner (the plan is gathered live; the button cannot be clicked twice).
2. Read the one-time explanation and confirmation. **Don't ask again for this action** is optional; reset it in ⚙ → **Confirmations**.
-3. The row reads **Hive is deciding…** while the job runs.
+3. The row reads **Hive deciding…** while the job runs.
4. Read the persistent result toast. It says what was decided and what happens next; it stays until the target row changes state.
5. If the result has not happened, use [When the decision doesn't take effect](#when-the-decision-doesnt-take-effect), rather than treating an approval as a completed merge.
diff --git a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
index f4d0b58bec..8b7a526bba 100644
--- a/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
+++ b/src/pkg/dashboard/stage_tracker_decide_feedback_test.go
@@ -161,6 +161,31 @@ a = stageTrackerLeadActionOnRow(issue2, ctx);
assert.strictEqual(a.id, 'decide:merge-now', JSON.stringify(a)); assert.strictEqual(a.passive, 15647);
h = stageTrackerLeadActionHtml(issue2, ctx);
assert.ok(h.includes('Merge now lives on its row') && !h.includes('Let hive decide lives'), 'the chip names the lead it stands in for: ' + h);
+// hivecommons/hive#15503 under #15502, both covered by PR #15759: the
+// server nests the PR under the lowest issue (drawn_under: 15502 on both
+// issues' linked_prs), so the PR is never its own row and #15503 draws no
+// sub-row — the button is #15502's, #15503 chips to that row.
+const shared = Object.assign({}, asking, { number: 15759, url: 'https://github.com/o/r/pull/15759', drawn_under: 15502 });
+const primary = Object.assign({}, issue, { number: 15502, linked_prs: [shared] });
+const secondary = Object.assign({}, issue, { number: 15503, linked_prs: [shared] });
+const sharedRow = Object.assign({ repo: 'o/r', kind: 'pr', nested_under: 15502 }, shared);
+_stageTracker = { items: [primary, secondary, sharedRow] }; ctx.rows = [primary, secondary];
+assert.strictEqual(stageTrackerPRDrawnUnderOther(secondary, { kind: 'pr', number: 15759 }, ctx.rows), 15502);
+assert.strictEqual(stageTrackerPRDrawnUnderOther(primary, { kind: 'pr', number: 15759 }, ctx.rows), 0, 'the drawing issue defers to nobody');
+assert.strictEqual(stageTrackerPRDrawnUnderOther(secondary, { kind: 'pr', number: 15759 }, [secondary]), 0, '#15502 not drawn: #15503 keeps the button');
+a = stageTrackerLeadActionOnRow(primary, ctx);
+assert.strictEqual(a.id, 'decide:delegate'); assert.ok(!a.passive, '#15502 draws the PR and carries the one button: ' + JSON.stringify(a));
+assert.strictEqual(buttons(stageTrackerLeadActionHtml(primary, ctx)), 1);
+a = stageTrackerLeadActionOnRow(secondary, ctx);
+assert.strictEqual(a.passive, 15759, JSON.stringify(a)); assert.strictEqual(a.passiveUnder, 15502);
+h = stageTrackerLeadActionHtml(secondary, ctx);
+assert.strictEqual(buttons(h), 0, 'no second Let hive decide on #15503: ' + h);
+assert.ok(h.includes('decision pending on #15759') && h.includes('Let hive decide lives on the row of #15502, which draws the PR'), h);
+// #15502 filtered off the page: #15503 is the only row that can carry it.
+ctx.rows = [secondary];
+a = stageTrackerLeadActionOnRow(secondary, ctx);
+assert.ok(a && !a.passive, JSON.stringify(a));
+assert.strictEqual(buttons(stageTrackerLeadActionHtml(secondary, ctx)), 1);
_stageTracker = null;
`)
}
@@ -175,7 +200,8 @@ func TestStageTrackerHumanChevronSaysWhyJS(t *testing.T) {
for _, want := range []string{
"_stageTrackerRows = page.rows.map(e => grouping ? e.item : e).filter(Boolean);",
"ctx.rows = typeof _stageTrackerRows !== 'undefined' ? _stageTrackerRows : null;",
- "stageTrackerPRListedOwnRow(item, a.target, ctx && ctx.rows)",
+ "stageTrackerPRListedOwnRow(item, a.target, rows)",
+ "stageTrackerPRDrawnUnderOther(item, a.target, rows)",
} {
if !strings.Contains(html, want) {
t.Errorf("index.html missing %q", want)
@@ -186,6 +212,30 @@ func TestStageTrackerHumanChevronSaysWhyJS(t *testing.T) {
}
}
+// The row hover says the reason once: the 035 caption ("A human decision
+// is owed — workflow path") and the next-move why (the same clause, lower
+// case) both land in stageTrackerTooltip, so the next-move line keeps only
+// who moves when its why is the caption again. The chevron hover (no
+// caption line) still carries the full why.
+func TestStageTrackerTooltipSaysDecisionReasonOnceJS(t *testing.T) {
+ html := indexHTML(t)
+ runStageTrackerRowActionsScript(t, stageTrackerRowsPreludeJS(t, html)+"\n"+stageTrackerActorIconJS(t, html)+stageTrackerRowsFixtureJS+`
+const since = new Date(now - 3600000).toISOString();
+const pr = { repo: 'o/r', kind: 'pr', number: 15759, title: 'Fix it', url: 'https://x/15759', author: 'hive', author_kind: 'hive', stage: 35, stage_since: since, reason: 'contributor-lane:workflow-path', modifiers: ['needs-decision'],
+ caption: 'A human decision is owed — workflow path', stage_actor: { kind: 'human', login: '', since, why: 'a human decision is owed — workflow path' } };
+let tip = stageTrackerTooltip(pr, now).split('\n');
+assert.strictEqual(tip.filter(l => /human decision is owed/i.test(l)).length, 1, 'the reason reads once: ' + tip.join(' | '));
+assert.ok(tip.includes('A human decision is owed — workflow path'), tip.join(' | '));
+assert.ok(tip.includes('Next move: human'), 'the next-move line keeps who moves: ' + tip.join(' | '));
+// The chevron hover has no caption line, so the why stays whole there.
+assert.ok(stageTrackerActorTip(pr).includes('Next move: human — a human decision is owed — workflow path'), stageTrackerActorTip(pr));
+// A why that is not the caption is kept (090: the caption says the reason, the why says who moves).
+const merge = Object.assign({}, pr, { stage: 90, caption: 'Ready to merge — a maintainer merges it', stage_actor: { kind: 'human', login: 'octo', since, why: 'a maintainer merges it' } });
+tip = stageTrackerTooltip(merge, now).split('\n');
+assert.ok(tip.includes('Next move: human @octo — a maintainer merges it'), tip.join(' | '));
+`)
+}
+
// The server's stage_actor.why on a 085 row says why the person is wanted
// — the tooltip shows sa.why whenever it is set, so a bare "a human
// decision is owed" would leave the 👤 marker unexplained on every row.
diff --git a/src/pkg/dashboard/stage_tracker_row_actions_test.go b/src/pkg/dashboard/stage_tracker_row_actions_test.go
index f869404edc..3cbe758458 100644
--- a/src/pkg/dashboard/stage_tracker_row_actions_test.go
+++ b/src/pkg/dashboard/stage_tracker_row_actions_test.go
@@ -97,6 +97,7 @@ func stageTrackerRowActionsPreamble(t *testing.T, html string) string {
jsFunc(t, html, "stageTrackerMaintainerMoved"),
jsFunc(t, html, "stageTrackerDevWarn"),
jsFunc(t, html, "stageTrackerPRListedOwnRow"),
+ jsFunc(t, html, "stageTrackerPRDrawnUnderOther"),
jsFunc(t, html, "stageTrackerLeadActionOnRow"),
jsFunc(t, html, "stageTrackerLeadActionHtml"),
jsFunc(t, html, "stageTrackerMenuTextHtml"),
@@ -189,7 +190,7 @@ function hamStubEl(tag) {
const el = { tagName: tag, className: '', textContent: '', children: [], attrs: {}, parentNode: null, _listeners: {},
classList: { add(c) { if (!el.className.split(' ').includes(c)) el.className = (el.className + ' ' + c).trim(); }, remove(c) { el.className = el.className.split(' ').filter(x => x && x !== c).join(' '); }, contains(c) { return el.className.split(' ').includes(c); } },
appendChild(c) { c.parentNode = el; el.children.push(c); return c; }, prepend(c) { c.parentNode = el; el.children.unshift(c); },
- setAttribute(k, v) { el.attrs[k] = String(v); }, getAttribute(k) { return k in el.attrs ? el.attrs[k] : null; }, removeAttribute(k) { delete el.attrs[k]; }, dataset: {},
+ setAttribute(k, v) { el.attrs[k] = String(v); }, getAttribute(k) { return k in el.attrs ? el.attrs[k] : null; }, removeAttribute(k) { delete el.attrs[k]; },
addEventListener(n, fn) { el._listeners[n] = fn; }, remove() { if (el.parentNode) el.parentNode.children = el.parentNode.children.filter(c => c !== el); el.parentNode = null; },
get lastChild() { return el.children[el.children.length - 1] || null; },
querySelector(sel) {
diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js
index dc6d3e84b1..208b2441be 100644
--- a/src/pkg/dashboard/static-src/js/tracker-actions.js
+++ b/src/pkg/dashboard/static-src/js/tracker-actions.js
@@ -504,9 +504,29 @@
const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
return rows.some(it => it && stageTrackerItemKey(it) === key);
}
+ // Pure: the number of the other listed issue whose row draws the
+ // covering PR, or 0. The server nests a PR that closes several issues
+ // under the lowest one (stage_tracker_links.go NestedUnder → each
+ // issue's linked_prs[].drawn_under); the PR is then never a row of its
+ // own and the secondary issue draws no sub-row either (hivecommons/hive
+ // #15503 under #15502), so the decision button belongs to the row that
+ // draws the PR and this issue chips to it.
+ function stageTrackerPRDrawnUnderOther(issue, t, rows) {
+ if (!Array.isArray(rows) || !issue || !Array.isArray(issue.linked_prs)) return 0;
+ const lp = issue.linked_prs.find(x => x && Number(x.number) === Number(t.number) && (!x.repo || !t.repo || x.repo === t.repo));
+ const under = Number(lp && lp.drawn_under) || 0;
+ if (!under || under === (Number(issue.number) || 0)) return 0;
+ const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'issue', number: under });
+ return rows.some(it => it && stageTrackerItemKey(it) === key) ? under : 0;
+ }
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
- if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr' && stageTrackerPRListedOwnRow(item, a.target, ctx && ctx.rows)) return Object.assign({}, a, { passive: a.target.number });
+ if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr') {
+ const rows = ctx && ctx.rows;
+ if (stageTrackerPRListedOwnRow(item, a.target, rows)) return Object.assign({}, a, { passive: a.target.number });
+ const under = stageTrackerPRDrawnUnderOther(item, a.target, rows);
+ if (under) return Object.assign({}, a, { passive: a.target.number, passiveUnder: under });
+ }
if (!a || !a.target || !Array.isArray(subRows) || !subRows.length || item.kind !== 'issue') return a;
const t = a.target;
if (t.kind !== 'pr') return a;
@@ -522,10 +542,14 @@
function stageTrackerLeadActionHtml(item, ctx, subRows) {
const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
if (!a) return '';
- // The covering PR has its own row: the decision — whatever its lead
- // (Let hive decide, Merge now, Adopt…) — is taken there, so this row
- // shows a passive chip that names that lead rather than a second button.
- if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
+ // The covering PR has its own row (or is drawn under another listed
+ // issue): the decision — whatever its lead (Let hive decide, Merge
+ // now, Adopt…) — is taken there, so this row shows a passive chip
+ // that names that lead rather than a second button.
+ if (a.passive) {
+ const where = a.passiveUnder ? 'the row of #' + Number(a.passiveUnder) + ', which draws the PR' : 'its row';
+ return `decision pending on #${Number(a.passive) || 0} `;
+ }
const label = String(a.label || a.id);
const tip = a.enabled ? String(a.hint || a.note || a.consequence || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
@@ -2037,18 +2061,20 @@
const on = !!busyAct && lead.getAttribute('data-ham-act') === busyAct;
const isBusy = lead.getAttribute('aria-busy') === 'true';
if (on && !isBusy) {
- lead.dataset.hamLabel = lead.textContent;
- lead.dataset.hamWasDisabled = lead.getAttribute('aria-disabled') === 'true' ? 'true' : '';
- lead.dataset.hamTitle = lead.getAttribute('title') || '';
+ lead.setAttribute('data-ham-label', lead.textContent);
+ lead.setAttribute('data-ham-was-disabled', lead.getAttribute('aria-disabled') === 'true' ? 'true' : '');
+ lead.setAttribute('data-ham-title', lead.getAttribute('title') || '');
lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true'); lead.removeAttribute('title');
lead.textContent = '';
const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
lead.appendChild(document.createTextNode(' ' + String(caption || 'acting…')));
} else if (!on && isBusy) {
lead.removeAttribute('aria-busy');
- if (lead.dataset.hamWasDisabled === 'true') lead.setAttribute('aria-disabled', 'true'); else lead.removeAttribute('aria-disabled');
- if (lead.dataset.hamTitle) lead.setAttribute('title', lead.dataset.hamTitle); else lead.removeAttribute('title');
- lead.textContent = lead.dataset.hamLabel || '';
+ if (lead.getAttribute('data-ham-was-disabled') === 'true') lead.setAttribute('aria-disabled', 'true'); else lead.removeAttribute('aria-disabled');
+ const title = lead.getAttribute('data-ham-title');
+ if (title) lead.setAttribute('title', title); else lead.removeAttribute('title');
+ lead.textContent = lead.getAttribute('data-ham-label') || '';
+ lead.removeAttribute('data-ham-label'); lead.removeAttribute('data-ham-was-disabled'); lead.removeAttribute('data-ham-title');
}
}
// Mark rows / sub-rows acting; captions are real nodes so a kept row
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 bb88f9a8c0..67bb081578 100644
--- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js
+++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js
@@ -214,8 +214,13 @@
if (item.origin) lines.push('Origin: origin/' + item.origin);
if (item.kind === 'issue' && Array.isArray(item.linked_prs) && item.linked_prs.length) lines.push('Covering PR: ' + item.linked_prs.map(lp => Number(lp.number) || 0).sort((x, y) => x - y).map(n => '#' + n).join(', '));
else if (item.kind === 'issue' && item.linked_pr) lines.push('Covering PR: #' + item.linked_pr + (typeof stageTrackerLineageClause === 'function' ? stageTrackerLineageClause(item) : ''));
- const actorLine = stageTrackerActorTip(item);
- if (actorLine) lines.push(actorLine.replace(/^ · /, ''));
+ let actorLine = stageTrackerActorTip(item).replace(/^ · /, '');
+ // The 035 next-move why is the caption again in lower case ("a human
+ // decision is owed — workflow path"): said once, the next-move line
+ // then names only who moves (hivecommons/hive#15773).
+ const whyAt = actorLine.indexOf(' — ');
+ if (whyAt > 0 && lines[1] && actorLine.slice(whyAt + 3).trim().toLowerCase() === String(lines[1]).trim().toLowerCase()) actorLine = actorLine.slice(0, whyAt);
+ if (actorLine) lines.push(actorLine);
if (typeof stageTrackerNewLines === 'function') lines.push(...stageTrackerNewLines(item, nowMs));
const blockedPR = mods.indexOf('blocked') >= 0 ? stageTrackerBlockedOnPR(item) : null;
if (blockedPR) lines.push(blockedPR.tip);
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index a68cf2fe3b..5d6252fa91 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -17093,8 +17093,13 @@ Where to get help
if (item.origin) lines.push('Origin: origin/' + item.origin);
if (item.kind === 'issue' && Array.isArray(item.linked_prs) && item.linked_prs.length) lines.push('Covering PR: ' + item.linked_prs.map(lp => Number(lp.number) || 0).sort((x, y) => x - y).map(n => '#' + n).join(', '));
else if (item.kind === 'issue' && item.linked_pr) lines.push('Covering PR: #' + item.linked_pr + (typeof stageTrackerLineageClause === 'function' ? stageTrackerLineageClause(item) : ''));
- const actorLine = stageTrackerActorTip(item);
- if (actorLine) lines.push(actorLine.replace(/^ · /, ''));
+ let actorLine = stageTrackerActorTip(item).replace(/^ · /, '');
+ // The 035 next-move why is the caption again in lower case ("a human
+ // decision is owed — workflow path"): said once, the next-move line
+ // then names only who moves (hivecommons/hive#15773).
+ const whyAt = actorLine.indexOf(' — ');
+ if (whyAt > 0 && lines[1] && actorLine.slice(whyAt + 3).trim().toLowerCase() === String(lines[1]).trim().toLowerCase()) actorLine = actorLine.slice(0, whyAt);
+ if (actorLine) lines.push(actorLine);
if (typeof stageTrackerNewLines === 'function') lines.push(...stageTrackerNewLines(item, nowMs));
const blockedPR = mods.indexOf('blocked') >= 0 ? stageTrackerBlockedOnPR(item) : null;
if (blockedPR) lines.push(blockedPR.tip);
@@ -20612,9 +20617,29 @@ All labels
const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'pr', number: t.number });
return rows.some(it => it && stageTrackerItemKey(it) === key);
}
+ // Pure: the number of the other listed issue whose row draws the
+ // covering PR, or 0. The server nests a PR that closes several issues
+ // under the lowest one (stage_tracker_links.go NestedUnder → each
+ // issue's linked_prs[].drawn_under); the PR is then never a row of its
+ // own and the secondary issue draws no sub-row either (hivecommons/hive
+ // #15503 under #15502), so the decision button belongs to the row that
+ // draws the PR and this issue chips to it.
+ function stageTrackerPRDrawnUnderOther(issue, t, rows) {
+ if (!Array.isArray(rows) || !issue || !Array.isArray(issue.linked_prs)) return 0;
+ const lp = issue.linked_prs.find(x => x && Number(x.number) === Number(t.number) && (!x.repo || !t.repo || x.repo === t.repo));
+ const under = Number(lp && lp.drawn_under) || 0;
+ if (!under || under === (Number(issue.number) || 0)) return 0;
+ const key = stageTrackerItemKey({ repo: t.repo || issue.repo, kind: 'issue', number: under });
+ return rows.some(it => it && stageTrackerItemKey(it) === key) ? under : 0;
+ }
function stageTrackerLeadActionOnRow(item, ctx, subRows) {
const a = stageTrackerLeadAction(item, ctx);
- if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr' && stageTrackerPRListedOwnRow(item, a.target, ctx && ctx.rows)) return Object.assign({}, a, { passive: a.target.number });
+ if (a && a.target && item.kind === 'issue' && a.target.kind === 'pr') {
+ const rows = ctx && ctx.rows;
+ if (stageTrackerPRListedOwnRow(item, a.target, rows)) return Object.assign({}, a, { passive: a.target.number });
+ const under = stageTrackerPRDrawnUnderOther(item, a.target, rows);
+ if (under) return Object.assign({}, a, { passive: a.target.number, passiveUnder: under });
+ }
if (!a || !a.target || !Array.isArray(subRows) || !subRows.length || item.kind !== 'issue') return a;
const t = a.target;
if (t.kind !== 'pr') return a;
@@ -20630,10 +20655,14 @@ All labels
function stageTrackerLeadActionHtml(item, ctx, subRows) {
const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
if (!a) return '';
- // The covering PR has its own row: the decision — whatever its lead
- // (Let hive decide, Merge now, Adopt…) — is taken there, so this row
- // shows a passive chip that names that lead rather than a second button.
- if (a.passive) return `decision pending on #${Number(a.passive) || 0} `;
+ // The covering PR has its own row (or is drawn under another listed
+ // issue): the decision — whatever its lead (Let hive decide, Merge
+ // now, Adopt…) — is taken there, so this row shows a passive chip
+ // that names that lead rather than a second button.
+ if (a.passive) {
+ const where = a.passiveUnder ? 'the row of #' + Number(a.passiveUnder) + ', which draws the PR' : 'its row';
+ return `decision pending on #${Number(a.passive) || 0} `;
+ }
const label = String(a.label || a.id);
const tip = a.enabled ? String(a.hint || a.note || a.consequence || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
@@ -22145,18 +22174,20 @@ All labels
const on = !!busyAct && lead.getAttribute('data-ham-act') === busyAct;
const isBusy = lead.getAttribute('aria-busy') === 'true';
if (on && !isBusy) {
- lead.dataset.hamLabel = lead.textContent;
- lead.dataset.hamWasDisabled = lead.getAttribute('aria-disabled') === 'true' ? 'true' : '';
- lead.dataset.hamTitle = lead.getAttribute('title') || '';
+ lead.setAttribute('data-ham-label', lead.textContent);
+ lead.setAttribute('data-ham-was-disabled', lead.getAttribute('aria-disabled') === 'true' ? 'true' : '');
+ lead.setAttribute('data-ham-title', lead.getAttribute('title') || '');
lead.setAttribute('aria-busy', 'true'); lead.setAttribute('aria-disabled', 'true'); lead.removeAttribute('title');
lead.textContent = '';
const sp = document.createElement('span'); sp.className = 'toast-spinner cue-acting-spin'; lead.appendChild(sp);
lead.appendChild(document.createTextNode(' ' + String(caption || 'acting…')));
} else if (!on && isBusy) {
lead.removeAttribute('aria-busy');
- if (lead.dataset.hamWasDisabled === 'true') lead.setAttribute('aria-disabled', 'true'); else lead.removeAttribute('aria-disabled');
- if (lead.dataset.hamTitle) lead.setAttribute('title', lead.dataset.hamTitle); else lead.removeAttribute('title');
- lead.textContent = lead.dataset.hamLabel || '';
+ if (lead.getAttribute('data-ham-was-disabled') === 'true') lead.setAttribute('aria-disabled', 'true'); else lead.removeAttribute('aria-disabled');
+ const title = lead.getAttribute('data-ham-title');
+ if (title) lead.setAttribute('title', title); else lead.removeAttribute('title');
+ lead.textContent = lead.getAttribute('data-ham-label') || '';
+ lead.removeAttribute('data-ham-label'); lead.removeAttribute('data-ham-was-disabled'); lead.removeAttribute('data-ham-title');
}
}
// Mark rows / sub-rows acting; captions are real nodes so a kept row