From 6cb2fa5966286b064f2babab21dd312710fb0016 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 3 Nov 2026 23:18:36 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Activity=20Monitor:=20show?= =?UTF-8?q?=20Let=20hive=20decide=20beside=20the=20lead=20and=20make=20act?= =?UTF-8?q?ion=20pills=20read=20as=20buttons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A row parked on a human decision rendered only the server's lead pill (Re-author); Let hive decide sat under ⋯ → Decide…, invisible. Both now render inline, lead first, via stageTrackerLeadCompanion / stageTrackerLeadActionsOnRow, wired to the same data-ham-act dispatch. Inline action pills were the same muted outline as record pills (adopted from #N, base branch) and read as history. They are now filled buttons — amber primary, neutral secondary, red danger — with a trailing ▸ glyph, hover/focus ring, and a consequence tooltip (server consequence, else a client clause per verb). Fixes #16543 Signed-off-by: Andrew Anderson --- changelog.d/fixed-lead-delegate-inline.md | 1 + .../stage_tracker_decided_ui_test.go | 5 ++ .../stage_tracker_lead_action_test.go | 66 +++++++++++++++-- .../stage_tracker_row_actions_test.go | 4 + src/pkg/dashboard/static-src/css/tracker.css | 24 +++--- .../static-src/js/tracker-actions.js | 49 +++++++++++-- src/pkg/dashboard/static/index.html | 73 +++++++++++++++---- 7 files changed, 187 insertions(+), 35 deletions(-) create mode 100644 changelog.d/fixed-lead-delegate-inline.md 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 `; } 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 ``; } // 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..10585054e8 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: '▸'; font-size: 0.85em; 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 `; } 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 ``; } // Pure: the actions for a row parked on a blocker (hivecommons/hive#15099): // the server lists them in decision_needed.options (a capability gap From 5f2c0895860412a59deff5e51dbc007fd97c60b8 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Tue, 3 Nov 2026 23:32:02 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20Activity=20Monitor:=20drop?= =?UTF-8?q?=20raw=20font-size=20on=20the=20action-pill=20glyph=20(style=20?= =?UTF-8?q?ratchet)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrew Anderson --- src/pkg/dashboard/static-src/css/tracker.css | 2 +- src/pkg/dashboard/static/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 9340390a19..6c37d0bc05 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -774,7 +774,7 @@ 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: '▸'; font-size: 0.85em; opacity: 0.85; } + .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); } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 10585054e8..e0e165c32e 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -2111,7 +2111,7 @@ 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: '▸'; font-size: 0.85em; opacity: 0.85; } + .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); }