diff --git a/changelog.d/fixed-lead-delegate-inline.md b/changelog.d/fixed-lead-delegate-inline.md
new file mode 100644
index 0000000000..194036b8e1
--- /dev/null
+++ b/changelog.d/fixed-lead-delegate-inline.md
@@ -0,0 +1 @@
+- Activity Monitor: a row parked on a human decision now shows "Let hive decide" inline beside the server's lead (e.g. "Re-author") instead of hiding it under ⋯ → Decide…, and inline action pills are filled buttons with a ▸ glyph and a consequence tooltip so they no longer pass for record pills like "adopted from #N".
diff --git a/src/pkg/dashboard/stage_tracker_decided_ui_test.go b/src/pkg/dashboard/stage_tracker_decided_ui_test.go
index a4921a9cc3..7faae2855f 100644
--- a/src/pkg/dashboard/stage_tracker_decided_ui_test.go
+++ b/src/pkg/dashboard/stage_tracker_decided_ui_test.go
@@ -262,6 +262,11 @@ assert.strictEqual(stageTrackerLinkedSupersededText({ adopted_by: 9, adopted_by_
assert.strictEqual(stageTrackerLinkedSupersededText({}, null), '');
assert.strictEqual(stageTrackerLinkedSupersededTip({ superseded_by: 9 }), 'Hive re-authored this PR as #9 with the same commits and sign-off. This PR closes as superseded when #9 merges.');
assert.strictEqual(stageTrackerLinkedSupersededTip({ adopted_by: 9, state: 'closed' }), 'Hive re-authored this PR as #9 with the same commits and sign-off. This PR is closed as superseded.');
+// A record pill ("↳ adopted from #N") is a muted ham-badge, never the
+// filled inline-action class — the two must not look alike (hive#16456).
+{ const chip = stageTrackerAdoptedFromChipHtml({ adopted_from: { number: 16398, url: 'https://github.com/o/r/pull/16398' } }, 0);
+ assert.ok(chip.includes('class="ham-badge ham-adopted-from"'), chip);
+ assert.ok(!chip.includes('ham-lead-act') && !chip.includes('Let hive decide '), h);
+let leads = stageTrackerLeadActionsOnRow(human, ctx);
+assert.strictEqual(leads.length, 2);
+assert.strictEqual(leads[1].id, 'decide:delegate');
+assert.strictEqual(leads[1].target, human, 'delegate carries the decide target');
+assert.strictEqual(leads[1].enabled, true);
+// The parked issue whose lead already is delegate: one pill, never two.
+assert.strictEqual(stageTrackerLeadActionsOnRow(parked, ctx).length, 1);
+// A Re-author lead (the #16456 row): both pills, delegate disabled with its
+// reason for a reader.
+const reauthor = { ...human, number: 16456, decision_needed: { question: 'Changes requested', options: [{ action: 'decide:re-author', label: 'Re-author', enabled: true, lead: true }, { action: 'decide:delegate', label: 'Let hive decide', enabled: true }] } };
+h = stageTrackerLeadActionHtml(reauthor, ctx);
+assert.strictEqual(buttons(h), 2, h);
+assert.strictEqual(labelOf(h), 'Re-author', h);
+assert.ok(h.includes('data-ham-act="decide:delegate"'), h);
+// Owner on that row: "Re-author" read as a record of what happened — the
+// action pills and the record pills ("adopted from #N", the base branch)
+// wore the same outline. Inline actions are s with the filled
+// action class (primary / secondary / danger), never the record class;
+// a record pill never carries the action class. The server's
+// consequence is the lead's hover text; a lead without one gets the
+// client's clause for its verb.
+assert.ok(h.includes(' h.indexOf('data-ham-act="' + lead.id + '"'), 'lead first on ' + it.kind + '#' + it.number);
}
assert.deepStrictEqual(missing, [], 'maintainer-moved rows without an enabled lead action');
`)
diff --git a/src/pkg/dashboard/stage_tracker_row_actions_test.go b/src/pkg/dashboard/stage_tracker_row_actions_test.go
index 6c8c70cb69..e53a892ab4 100644
--- a/src/pkg/dashboard/stage_tracker_row_actions_test.go
+++ b/src/pkg/dashboard/stage_tracker_row_actions_test.go
@@ -19,6 +19,7 @@ func stageTrackerRowActionsPreamble(t *testing.T, html string) string {
jsConstLine(t, html, "STAGE_TRACKER_GROUP_KEY_PREFIX"),
jsConstLine(t, html, "STAGE_TRACKER_DECISION_STAGES"),
jsConstLine(t, html, "STAGE_TRACKER_SEL_ACTIONS"),
+ jsConstLine(t, html, "STAGE_TRACKER_ACTION_CONSEQUENCES"),
jsConstLine(t, html, "STAGE_TRACKER_MENU_MARGIN"),
jsConstLine(t, html, "STAGE_TRACKER_MENU_FAIL_LINES"),
jsConstBlock(t, html, "STAGE_TRACKER_DECISION_GLOSSARY"),
@@ -100,7 +101,10 @@ func stageTrackerRowActionsPreamble(t *testing.T, html string) string {
jsFunc(t, html, "stageTrackerPRListedOwnRow"),
jsFunc(t, html, "stageTrackerPRDrawnUnderOther"),
jsFunc(t, html, "stageTrackerLeadActionOnRow"),
+ jsFunc(t, html, "stageTrackerLeadCompanion"),
+ jsFunc(t, html, "stageTrackerLeadActionsOnRow"),
jsFunc(t, html, "stageTrackerLeadActionHtml"),
+ jsFunc(t, html, "stageTrackerLeadPillHtml"),
jsFunc(t, html, "stageTrackerMenuTextHtml"),
jsFunc(t, html, "stageTrackerFlatActions"),
jsFunc(t, html, "stageTrackerSelectionActions"),
diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css
index d779d80254..6c37d0bc05 100644
--- a/src/pkg/dashboard/static-src/css/tracker.css
+++ b/src/pkg/dashboard/static-src/css/tracker.css
@@ -765,15 +765,21 @@
.ham-decision-act[aria-disabled="true"] { color: var(--text-faint); border-style: dashed; cursor: default; opacity: 0.6; }
.ham-decision-act[aria-disabled="true"]:hover { background: transparent; border-color: var(--line-subtle); }
.ham-decision-act.ham-decision-more { color: var(--text-muted); }
- /* The row's inline lead action (the ⋯ menu's lead entry, in sight): a
- small primary pill in the chip slot, the popover lead's recipe, the
- row's cue colour; dashed and faint with its reason when the viewer
- may not take it. */
- .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.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 row's inline action pills (the ⋯ menu's lead entry, and "Let hive
+ decide" beside it on a row parked on a human decision): real buttons
+ that must not pass for the record pills in the same slot ("adopted
+ from #N", the base branch — muted outlines, no hover). So: a filled
+ chip, a trailing ▸ glyph, pointer cursor, hover lift and focus ring.
+ Primary (the lead) fills amber; secondary (delegate) fills neutral;
+ danger (a server-led close) fills red. Dashed, faint and glyph-less
+ with its reason when the viewer may not take it. */
+ .ham-lead-act { --ham-act-fill: var(--amber); --ham-act-ink: var(--bg); display: inline-flex; align-items: center; gap: var(--sp-1); padding: 0 var(--sp-3); border: var(--line-width) solid var(--ham-act-fill); border-radius: var(--r-pill); background: var(--ham-act-fill); color: var(--ham-act-ink); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.5; cursor: pointer; white-space: nowrap; transition: filter 120ms ease, box-shadow 120ms ease; }
+ .ham-lead-act::after { content: '▸'; opacity: 0.85; }
+ .ham-lead-act.ham-act-secondary { --ham-act-fill: var(--panel-strong); --ham-act-ink: var(--text); border-color: var(--line-strong); }
+ .ham-lead-act.ham-menu-danger { --ham-act-fill: var(--red); --ham-act-ink: var(--bg); }
+ .ham-lead-act:hover, .ham-lead-act:focus-visible { filter: brightness(1.12); outline: none; box-shadow: 0 0 0 var(--line-width) var(--bg), 0 0 0 calc(var(--line-width) * 3) var(--ham-act-fill); }
+ .ham-lead-act[aria-disabled="true"] { --ham-act-fill: transparent; --ham-act-ink: var(--text-faint); border-color: var(--line-subtle); border-style: dashed; background: transparent; cursor: default; opacity: 0.7; filter: none; box-shadow: none; }
+ .ham-lead-act[aria-disabled="true"]::after { content: none; }
/* 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); }
diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js
index 55f7ed287d..5eeb8bbe87 100644
--- a/src/pkg/dashboard/static-src/js/tracker-actions.js
+++ b/src/pkg/dashboard/static-src/js/tracker-actions.js
@@ -557,12 +557,50 @@
const sub = typeof stageTrackerLinkedPRItem === 'function' ? stageTrackerLinkedPRItem(item, lp) : null;
return sub && stageTrackerLeadAction(sub, ctx) ? null : a;
}
- // The inline lead button for a row: a real carrying the same
- // id, hint and enable/disable reason as the ⋯ menu entry it mirrors;
+ // Pure: the second inline pill of a row parked on a human decision —
+ // the Decide… submenu's "Let hive decide" (decide:delegate), carrying
+ // the decide target and enable reason the way stageTrackerLeadAction's
+ // fallback does — when the server's lead is another verb (Re-author,
+ // Merge now…). A row saw only "Re-author" and asked where "Let hive
+ // decide" went (hivecommons/hive#16265 / #16456): the ⋯ menu is
+ // invisible, so both stand on the row. null when the lead already is
+ // delegate, the row has no human decision, or the lead is a passive chip.
+ function stageTrackerLeadCompanion(item, ctx, lead) {
+ if (!item || !lead || lead.passive || lead.id === 'decide:delegate') return null;
+ const dec = typeof stageTrackerDecisionOf === 'function' ? stageTrackerDecisionOf(item) : null;
+ const human = !!(dec && dec.item && dec.item.decision_needed) || (item.stage_actor && item.stage_actor.kind === 'human') || (Number(item.stage) || 0) === 85;
+ if (!human) return null;
+ const decide = stageTrackerRowActions(item, ctx).find(a => a.id === 'decide');
+ const o = decide && Array.isArray(decide.submenu) ? decide.submenu.find(x => x && x.id === 'decide:delegate') : null;
+ if (!o) return null;
+ const enabled = !!decide.enabled && !!o.enabled;
+ return Object.assign({}, o, { target: decide.target, enabled, why: enabled ? '' : (decide.enabled ? o.why : decide.why), hint: STAGE_TRACKER_ACTION_CONSEQUENCES['decide:delegate'], companion: true });
+ }
+ // Pure: the inline pills a row renders — its lead, then (a row parked
+ // on a human decision whose lead is not delegate) "Let hive decide".
+ function stageTrackerLeadActionsOnRow(item, ctx, subRows) {
+ const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
+ if (!a) return [];
+ const companion = stageTrackerLeadCompanion(item, ctx, a);
+ return companion ? [a, companion] : [a];
+ }
+ // The inline lead button(s) for a row: real s carrying the same
+ // id, hint and enable/disable reason as the ⋯ menu entries they mirror;
// '' when the row has no lead. Click handling is delegated in
// stageTrackerWireRowActions and runs runRowAction, the menu's path.
function stageTrackerLeadActionHtml(item, ctx, subRows) {
- const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
+ return stageTrackerLeadActionsOnRow(item, ctx, subRows).map(a => stageTrackerLeadPillHtml(item, a)).join('');
+ }
+ // The hover text of an inline pill when the server sent no
+ // `consequence`: what happens when it is pressed, in one clause.
+ const STAGE_TRACKER_ACTION_CONSEQUENCES = { 'decide:delegate': 'The hive decides for you under its policy and rails; recorded as your decision with an audit marker.', 'decide:re-author': 'The hive opens a fresh PR for the same issue from the current base and closes this one as superseded.', 'decide:adopt': 'The hive takes the PR over: a hive copy on its own branch; the original is closed as superseded.', 'accept-triage': 'Marks the issue accepted; the hive takes it on its next pass.' };
+ // A row's inline pills are buttons and must read as buttons beside the
+ // record pills they share a slot with ("adopted from #N", the base
+ // branch): a filled chip — ham-act-primary (the lead), ham-act-secondary
+ // ("Let hive decide" beside it) or ham-menu-danger — with a trailing
+ // glyph (tracker.css ::after). Owner on #16456: "Re-author" in the
+ // outlined pill read as a record of what happened, not a verb.
+ function stageTrackerLeadPillHtml(item, a) {
if (!a) return '';
// The covering PR has its own row (or is drawn under another listed
// issue): the decision — whatever its lead (Let hive decide, Merge
@@ -577,10 +615,11 @@
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 tip = a.enabled ? String(a.hint || a.note || a.consequence || STAGE_TRACKER_ACTION_CONSEQUENCES[a.id] || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
const state = a.enabled ? (tip ? ` title="${esc(tip)}"` : '') : ` aria-disabled="true" title="${esc(tip)}"`;
- return ``;
+ const tone = a.danger ? ' ham-menu-danger' : (a.companion ? ' ham-act-secondary' : ' ham-act-primary');
+ return `${esc(label)} `;
}
// Pure: the actions for a row parked on a blocker (hivecommons/hive#15099):
// the server lists them in decision_needed.options (a capability gap
diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html
index 58d56b99ef..e0e165c32e 100644
--- a/src/pkg/dashboard/static/index.html
+++ b/src/pkg/dashboard/static/index.html
@@ -2102,15 +2102,21 @@
.ham-decision-act[aria-disabled="true"] { color: var(--text-faint); border-style: dashed; cursor: default; opacity: 0.6; }
.ham-decision-act[aria-disabled="true"]:hover { background: transparent; border-color: var(--line-subtle); }
.ham-decision-act.ham-decision-more { color: var(--text-muted); }
- /* The row's inline lead action (the ⋯ menu's lead entry, in sight): a
- small primary pill in the chip slot, the popover lead's recipe, the
- row's cue colour; dashed and faint with its reason when the viewer
- may not take it. */
- .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.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 row's inline action pills (the ⋯ menu's lead entry, and "Let hive
+ decide" beside it on a row parked on a human decision): real buttons
+ that must not pass for the record pills in the same slot ("adopted
+ from #N", the base branch — muted outlines, no hover). So: a filled
+ chip, a trailing ▸ glyph, pointer cursor, hover lift and focus ring.
+ Primary (the lead) fills amber; secondary (delegate) fills neutral;
+ danger (a server-led close) fills red. Dashed, faint and glyph-less
+ with its reason when the viewer may not take it. */
+ .ham-lead-act { --ham-act-fill: var(--amber); --ham-act-ink: var(--bg); display: inline-flex; align-items: center; gap: var(--sp-1); padding: 0 var(--sp-3); border: var(--line-width) solid var(--ham-act-fill); border-radius: var(--r-pill); background: var(--ham-act-fill); color: var(--ham-act-ink); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.5; cursor: pointer; white-space: nowrap; transition: filter 120ms ease, box-shadow 120ms ease; }
+ .ham-lead-act::after { content: '▸'; opacity: 0.85; }
+ .ham-lead-act.ham-act-secondary { --ham-act-fill: var(--panel-strong); --ham-act-ink: var(--text); border-color: var(--line-strong); }
+ .ham-lead-act.ham-menu-danger { --ham-act-fill: var(--red); --ham-act-ink: var(--bg); }
+ .ham-lead-act:hover, .ham-lead-act:focus-visible { filter: brightness(1.12); outline: none; box-shadow: 0 0 0 var(--line-width) var(--bg), 0 0 0 calc(var(--line-width) * 3) var(--ham-act-fill); }
+ .ham-lead-act[aria-disabled="true"] { --ham-act-fill: transparent; --ham-act-ink: var(--text-faint); border-color: var(--line-subtle); border-style: dashed; background: transparent; cursor: default; opacity: 0.7; filter: none; box-shadow: none; }
+ .ham-lead-act[aria-disabled="true"]::after { content: none; }
/* 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); }
@@ -22160,12 +22166,50 @@ All labels
const sub = typeof stageTrackerLinkedPRItem === 'function' ? stageTrackerLinkedPRItem(item, lp) : null;
return sub && stageTrackerLeadAction(sub, ctx) ? null : a;
}
- // The inline lead button for a row: a real carrying the same
- // id, hint and enable/disable reason as the ⋯ menu entry it mirrors;
+ // Pure: the second inline pill of a row parked on a human decision —
+ // the Decide… submenu's "Let hive decide" (decide:delegate), carrying
+ // the decide target and enable reason the way stageTrackerLeadAction's
+ // fallback does — when the server's lead is another verb (Re-author,
+ // Merge now…). A row saw only "Re-author" and asked where "Let hive
+ // decide" went (hivecommons/hive#16265 / #16456): the ⋯ menu is
+ // invisible, so both stand on the row. null when the lead already is
+ // delegate, the row has no human decision, or the lead is a passive chip.
+ function stageTrackerLeadCompanion(item, ctx, lead) {
+ if (!item || !lead || lead.passive || lead.id === 'decide:delegate') return null;
+ const dec = typeof stageTrackerDecisionOf === 'function' ? stageTrackerDecisionOf(item) : null;
+ const human = !!(dec && dec.item && dec.item.decision_needed) || (item.stage_actor && item.stage_actor.kind === 'human') || (Number(item.stage) || 0) === 85;
+ if (!human) return null;
+ const decide = stageTrackerRowActions(item, ctx).find(a => a.id === 'decide');
+ const o = decide && Array.isArray(decide.submenu) ? decide.submenu.find(x => x && x.id === 'decide:delegate') : null;
+ if (!o) return null;
+ const enabled = !!decide.enabled && !!o.enabled;
+ return Object.assign({}, o, { target: decide.target, enabled, why: enabled ? '' : (decide.enabled ? o.why : decide.why), hint: STAGE_TRACKER_ACTION_CONSEQUENCES['decide:delegate'], companion: true });
+ }
+ // Pure: the inline pills a row renders — its lead, then (a row parked
+ // on a human decision whose lead is not delegate) "Let hive decide".
+ function stageTrackerLeadActionsOnRow(item, ctx, subRows) {
+ const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
+ if (!a) return [];
+ const companion = stageTrackerLeadCompanion(item, ctx, a);
+ return companion ? [a, companion] : [a];
+ }
+ // The inline lead button(s) for a row: real s carrying the same
+ // id, hint and enable/disable reason as the ⋯ menu entries they mirror;
// '' when the row has no lead. Click handling is delegated in
// stageTrackerWireRowActions and runs runRowAction, the menu's path.
function stageTrackerLeadActionHtml(item, ctx, subRows) {
- const a = stageTrackerLeadActionOnRow(item, ctx, subRows);
+ return stageTrackerLeadActionsOnRow(item, ctx, subRows).map(a => stageTrackerLeadPillHtml(item, a)).join('');
+ }
+ // The hover text of an inline pill when the server sent no
+ // `consequence`: what happens when it is pressed, in one clause.
+ const STAGE_TRACKER_ACTION_CONSEQUENCES = { 'decide:delegate': 'The hive decides for you under its policy and rails; recorded as your decision with an audit marker.', 'decide:re-author': 'The hive opens a fresh PR for the same issue from the current base and closes this one as superseded.', 'decide:adopt': 'The hive takes the PR over: a hive copy on its own branch; the original is closed as superseded.', 'accept-triage': 'Marks the issue accepted; the hive takes it on its next pass.' };
+ // A row's inline pills are buttons and must read as buttons beside the
+ // record pills they share a slot with ("adopted from #N", the base
+ // branch): a filled chip — ham-act-primary (the lead), ham-act-secondary
+ // ("Let hive decide" beside it) or ham-menu-danger — with a trailing
+ // glyph (tracker.css ::after). Owner on #16456: "Re-author" in the
+ // outlined pill read as a record of what happened, not a verb.
+ function stageTrackerLeadPillHtml(item, a) {
if (!a) return '';
// The covering PR has its own row (or is drawn under another listed
// issue): the decision — whatever its lead (Let hive decide, Merge
@@ -22180,10 +22224,11 @@ All labels
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 tip = a.enabled ? String(a.hint || a.note || a.consequence || STAGE_TRACKER_ACTION_CONSEQUENCES[a.id] || '') : String(a.why || '');
const ref = typeof stageTrackerRefOf === 'function' ? stageTrackerRefOf(item) : '';
const state = a.enabled ? (tip ? ` title="${esc(tip)}"` : '') : ` aria-disabled="true" title="${esc(tip)}"`;
- return ``;
+ const tone = a.danger ? ' ham-menu-danger' : (a.companion ? ' ham-act-secondary' : ' ham-act-primary');
+ return `${esc(label)} `;
}
// Pure: the actions for a row parked on a blocker (hivecommons/hive#15099):
// the server lists them in decision_needed.options (a capability gap