From 7a7e423c0ce98dcc6190086c7bd82d424a02609c Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Mon, 9 Nov 2026 14:55:04 -0700 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=90=9B=20activity=20monitor:=20light?= =?UTF-8?q?=20a=20needs-decision=20PR's=20real=20stage=20and=20carry=20the?= =?UTF-8?q?=20ask=20as=20a=20pill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A PR parked at stage/085-needs-decision whose head is short of merge-ready (checks running, red or unreported; review verdict pending or asking for a person) forced a 'Needs human · decision' chevron into the PR in progress column while the CI and Review chevrons spun dim (#17442 under #17426; #17416 read 'Needs human · review' the same way). The lit chevron is now the PR's real stage: the CI track (with motion while checks run) or the Review track, wearing an amber ham-human-gated marker; PR in progress is passed and Merge queue stays empty. The ask rides as the needs-decision pill (human icon, question in the hover, decision popover on click) — the server re-adds the modifier once the head's tracks are known, and the page derives it for older payloads — and the lit track's tooltip ends '· needs a person: '. One lit stage per row. Only a merge-ready, queued or merging 085 keeps the gate. Fixes #17453 Signed-off-by: Andrew Anderson --- .../fixed-needs-decision-real-stage.md | 1 + .../dashboard-sections/activity-monitor.md | 9 +-- src/pkg/dashboard/stage_tracker_build.go | 6 +- .../stage_tracker_hold_provenance_test.go | 20 ++++++ .../stage_tracker_item_column_test.go | 48 ++++++++++--- src/pkg/dashboard/stage_tracker_test.go | 5 +- .../dashboard/stage_tracker_ui_rows_test.go | 67 +++++++++++++++---- src/pkg/dashboard/stage_tracker_vocabulary.go | 50 ++++++++++---- src/pkg/dashboard/static-src/css/tracker.css | 4 ++ .../static-src/js/tracker-row-anchor.js | 9 ++- .../static-src/js/tracker-row-strip.js | 27 +++++++- .../static-src/js/tracker-words-core.js | 21 +++--- src/pkg/dashboard/static/index.html | 61 +++++++++++++---- 13 files changed, 260 insertions(+), 68 deletions(-) create mode 100644 changelog.d/fixed-needs-decision-real-stage.md diff --git a/changelog.d/fixed-needs-decision-real-stage.md b/changelog.d/fixed-needs-decision-real-stage.md new file mode 100644 index 0000000000..4f4d690831 --- /dev/null +++ b/changelog.d/fixed-needs-decision-real-stage.md @@ -0,0 +1 @@ +- Activity Monitor: a PR parked at `stage/085-needs-decision` whose head is short of merge-ready (checks running, red or unreported; review verdict pending or asking for a person) now lights its real stage — the CI or Review track, with an amber human-gated marker — and carries the ask as the **needs human decision** pill (question in the hover, decision popover on click) instead of forcing a *Needs human · decision* chevron into the PR in progress column while CI and Review spun dim (#17442, #17416). PR in progress is passed, Merge queue stays empty; one lit stage per row. diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index bcb18bf3d7..35cc562f46 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -72,7 +72,7 @@ Side stages share a column rather than adding columns: | 045 Needs human decision | Actionable on an issue. A pre-045 issue still wearing 085 is drawn here until reconciliation. | | 070 Fixing / 071 Needs author / 072 Returned to contributor | CI / Review: Hive repairs its own PR at 070; a human author acts at 071; a contributor agent gets its PR back at 072. `needs-rebase` explains a repair here, not at 050. | | 074 Adopted by hive | CI / Review while the Hive repairs adopted work; pending, green or red pushes remain 074 until the merge gate takes it. | -| 085 Needs human decision / 090 Ready for human merge | Merge queue on a PR. Read the decision or merge reason rather than assuming Hive will merge it. A 090 cell reading **Held · sentinel · confirm intent** or **Held · hold** is a gate on an otherwise ready PR: Hive never merges it while the gate stands. | +| 085 Needs human decision / 090 Ready for human merge | A human gate is a pill on the PR's real stage, not a stage of its own ([#17327](https://github.com/hivecommons/hive/issues/17327), [#17453](https://github.com/hivecommons/hive/issues/17453)). A 085 PR whose head is short of merge-ready — checks running, red or unreported; the review verdict pending or asking for a person — lights **CI / Review** (the CI track while checks run or are not green, the Review track while its verdict is what waits), with an amber marker on the lit track and the **needs human decision** pill carrying the question (its popover holds the actions); PR in progress is passed, Merge queue empty. Only a 085 PR that is merge-ready (review approved, CI green on this head), queued or merging, and every 090, sits in the **Merge queue** column — read the decision or merge reason rather than assuming Hive will merge it. A 090 cell reading **Held · sentinel · confirm intent** or **Held · hold** is a gate on an otherwise ready PR: Hive never merges it while the gate stands. | | 060 / 080 / 095 / 100 | Separate gate states; use the [merge-gate reference](#merge-queue-pills--legend) below for exact words and countdowns. | The author legend is a blue Hive hexagon, purple contributor-agent robot or teal human silhouette. The kind is `author/*`, inferred from the snapshot if its label is absent; the link tooltip names the login. On Claimed, the actor is the claim holder; on PR in progress and Returned to contributor it is the author. Hive owns review, adoption and auto-merge work; a human owns a human decision or manual merge. The payload's `stage_actor` is the authoritative actor (see [Who is on it](#who-is-on-it-actor-icons)). @@ -244,13 +244,13 @@ The payload also carries `sentinel_details`: one entry per finding with its `rul A person's *Approve* through that dialog **is** the human review the alert asked for: it removes the `sentinel-alert` label when present and records a `sentinel_acknowledged` human action keyed to the head in the review evidence bundle, so a bundle-only alert (findings but no label — hivecommons/crux#30) clears too; the payload then reads `sentinel_alert: false` with `sentinel_reason` suffixed `— acknowledged by @login`, the findings stay on record, and a new head starts over. -The delegated *Let hive decide* path never clears it. Hovering the lit chevron of a parked row names the parking stage itself (`Needs human decision`), not the 080 column it rides on; `Next move` follows the real stage (human at 085 and at a held 090, hive at 080). A held row's stage never advances the merge: the lanes and the dashboard's one-click shortcuts check the gate itself, so a parked PR never merges unattended. Lane text and chip update in place on refresh (keyed reconcile, no flash). +The delegated *Let hive decide* path never clears it. Hovering the lit chevron of a parked row names the parking stage itself (`Needs human decision`) when it sits in the Merge queue column, and *· needs a person: * on the lit CI / Review track when the head is not merge-ready ([#17453](https://github.com/hivecommons/hive/issues/17453)); `Next move` follows the real stage (human at 085 and at a held 090, hive at 080). A held row's stage never advances the merge: the lanes and the dashboard's one-click shortcuts check the gate itself, so a parked PR never merges unattended. Lane text and chip update in place on refresh (keyed reconcile, no flash). #### Unauthorized pill A pull request the hive cannot move because its GitHub App lacks a permission for the next step — it wears `hive:unauthorized` ([#14589](https://github.com/hivecommons/hive/issues/14589)); first case: approving held `action_required` workflow runs needs `actions: write` — carries the `unauthorized` modifier in the tracker payload, drawn in the far-right pill column exactly like `stalled` / `hold` / `draft` but muted (dashed, `--text-muted`), never red: it is nothing wrong, just a step only a person may take. -It counts under **Needs attention**. Before the merge gate only the held-workflow-runs step shows (see *Pills before the merge gate*). Its tooltip (payload `unauthorized`) names the missing permission and the human step; on the **Needs human decision** lane the lit chevron and the caption read **Awaiting human: approve workflow runs** (payload `unauthorized_step`, from the `unauthorized:` stage reason). The pill, label and payload fields clear themselves in the tick the step is no longer needed. +It counts under **Needs attention**. Before the merge gate only the held-workflow-runs step shows (see *Pills before the merge gate*). Its tooltip (payload `unauthorized`) names the missing permission and the human step; on the **Needs human decision** lane the caption reads **Awaiting human: approve workflow runs** (payload `unauthorized_step`, from the `unauthorized:` stage reason) and the row lights its real stage — the CI / Review track, amber-marked — with the `unauthorized` pill carrying the step ([#16524](https://github.com/hivecommons/hive/issues/16524), [#17453](https://github.com/hivecommons/hive/issues/17453)). The pill, label and payload fields clear themselves in the tick the step is no longer needed. #### Merge train @@ -456,7 +456,8 @@ An *active* chevron is filled amber and carries words; an inactive one is its ic 2. **CI and Review resolve first.** A track is active only while it genuinely runs on the current head (a check-run in progress or queued, a ring not yet full; a reviewer running or queued). If either runs, the PR is waiting on it: the stage chevron (PR in progress, Merge queue …) renders settled-current — filled but still, icon only, its words in the tooltip — and nothing else is active. 3. **CI leads Review.** When both tracks would light at once — CI running while the review is queued, in progress or being re-adjudicated — CI is the lit chevron and Review is dim with a small note (*re-review queued* after a push, *review in progress*, *review queued*); its words stay in the tooltip, ending *… behind CI*. The stage chevron is the fallback: active only when no track is in motion. 4. **The PR in progress chevron speaks the PR's lifecycle** — draft, pushed, rebasing, *Unassigned · next: scanner*, *Deferred · waiting on #N*, *Waiting for @author · fix owed* — never a CI or review verdict. *CI failing*, *CI 4/11 · 1 failing* and *changes requested* are the CI and Review chevrons' words; the PR in progress tooltip keeps the red reason as detail. -5. **The CI and Review tooltips state what the track waits on — never "activity unknown".** With no verdict and no reviewer in flight the spoke derives the Review statement from what it already knows, in this order: the PR is merged or closed (*Review · n/a (closed)*), it is a draft (*Review · draft, not requested*), CI on the head has not finished (*Review · waiting for CI*), CI is done and nobody started (*Review · not started · hive reviewer next*, or *· needs reviewer* when the repo has no hive reviewer lane). A settled verdict explains itself — *Changes requested by the hive reviewer: 1 perspective posted findings … · 12m ago · quality ✓ · security ✗: token logged* — and stays known as its observation ages. The one no-data wording, *Review · no data for head f269349 yet · refreshing* (CI: *CI · no checks observed for head … yet · refreshing*), appears only when the spoke has fetched nothing for the head, and names the next step. +5. **A human gate is a pill, not a stage.** A PR parked at 085 for a person — a reviewer's question, a permission only a maintainer holds, a rerun to approve — with checks running, red or unreported, or its review verdict pending, is drawn at its real stage: CI (with motion while checks run) or Review is the one lit chevron, wearing an amber marker (`ham-human-gated`), and the ask is the **needs human decision** pill in the row's pill strip (human icon, the question in its hover, the decision popover on click); the lit track's tooltip ends *· needs a person: *. It never lights a *Needs human · decision* chevron in the PR in progress column while CI and Review spin dim ([#17453](https://github.com/hivecommons/hive/issues/17453): #17442 did, with CI 3/9 running; #17416 read *Needs human · review* the same way). Only a merge-ready, queued or merging 085 is a Merge queue matter. +6. **The CI and Review tooltips state what the track waits on — never "activity unknown".** With no verdict and no reviewer in flight the spoke derives the Review statement from what it already knows, in this order: the PR is merged or closed (*Review · n/a (closed)*), it is a draft (*Review · draft, not requested*), CI on the head has not finished (*Review · waiting for CI*), CI is done and nobody started (*Review · not started · hive reviewer next*, or *· needs reviewer* when the repo has no hive reviewer lane). A settled verdict explains itself — *Changes requested by the hive reviewer: 1 perspective posted findings … · 12m ago · quality ✓ · security ✗: token logged* — and stays known as its observation ages. The one no-data wording, *Review · no data for head f269349 yet · refreshing* (CI: *CI · no checks observed for head … yet · refreshing*), appears only when the spoke has fetched nothing for the head, and names the next step. On a red PR (CI failing or changes requested on the current head, or a 07x fix stage) the PR in progress word comes from pickup evidence: diff --git a/src/pkg/dashboard/stage_tracker_build.go b/src/pkg/dashboard/stage_tracker_build.go index 7ad8b31296..e56e7682ba 100644 --- a/src/pkg/dashboard/stage_tracker_build.go +++ b/src/pkg/dashboard/stage_tracker_build.go @@ -166,7 +166,10 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto it.Modifiers, it.DeferredModifiers = stageTrackerModifiers(labels, status.HiveID, rec, hasRec, overrides, now, draft, it.Reason, it.Kind, stage, it.Mirrored) // 045/085 have their own chevron word ("Needs human decision"); the // chip only adds information when needs-decision modifies another - // stage. + // stage — or when the 085 row's chevron is its real stage (CI / + // Review) and the pill is what carries the ask; that case is + // re-added once the head's tracks are known + // (stageTrackerApplyPersonActsOnPRPill). if stage == stagelabels.NeedsDecision || stage == stagelabels.IssueNeedsDecision { it.Modifiers = slices.DeleteFunc(it.Modifiers, func(m string) bool { return m == modNeedsDecision }) } @@ -565,6 +568,7 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto it.CodeActivity, it.Remediation, it.Deferral, it.ReviewActivity, it.DisplayColumn, it.Caption = activityItem.CodeActivity, activityItem.Remediation, activityItem.Deferral, activityItem.ReviewActivity, activityItem.DisplayColumn, activityItem.Caption stageTrackerApplyReworkOwedBy(it) stageTrackerApplyTrainQueuedCaption(it) + stageTrackerApplyPersonActsOnPRPill(it) } stageTrackerApplyReauthor(resp.Items, store, status.GitHubBaseURL, now) resp.NeedsHuman, resp.OnHold = stageTrackerHumanCounts(resp.Items) diff --git a/src/pkg/dashboard/stage_tracker_hold_provenance_test.go b/src/pkg/dashboard/stage_tracker_hold_provenance_test.go index 29b326842b..3cc5d0c677 100644 --- a/src/pkg/dashboard/stage_tracker_hold_provenance_test.go +++ b/src/pkg/dashboard/stage_tracker_hold_provenance_test.go @@ -156,6 +156,7 @@ func TestStageTrackerHoldProvenanceJS(t *testing.T) { jsFunc(t, html, "stageTrackerHoldPill"), jsFunc(t, html, "stageTrackerHoldTip"), jsFunc(t, html, "stageTrackerChipsHtml"), + stageTrackerManualMergeJS(t, html), }, "\n")+` const hold = { by: 'hive', source: 'reporter-trust', reason: 'reporter trust (issue #15017 by @Karibhou, contributor)', since: '2026-10-20T17:14:14Z', issue: 15017, reporter: 'Karibhou', association: 'contributor', pill: 'Held by hive · reporter trust (issue #15017 by @Karibhou, contributor)' }; const decision = { question: 'The hive held this PR itself for reporter trust (issue #15017 by @Karibhou, contributor). Release the hold, or keep it?', asked_by: 'the hive', options: [ { action: 'release', label: 'Release hold', enabled: true } ] }; @@ -182,5 +183,24 @@ assert.strictEqual(stageTrackerHoldPill({ hold: null }), ''); assert.strictEqual(stageTrackerHoldTip({ hold: {} }, 0), ''); // Without the pill field the text is built from the parts. assert.strictEqual(stageTrackerHoldPill({ hold: { by: 'hive', reason: 'r' } }), 'Held by hive · r'); +// hivecommons/hive#17442 (#17453): a 085 PR with CI running and the review +// verdict pending lights its real stage, so the ask rides as the +// needs-decision pill — even on a payload that predates the server adding +// the modifier — and that pill opens the decision popover. +const ask = { question: 'Dependabot alerts need the security_events read permission. Grant it, or merge without the check?', asked_by: 'sec-check', options: [ { action: 'decide:approve', label: 'Approve', enabled: true }, { action: 'decide:delegate', label: 'Let hive decide', enabled: true } ] }; +const running = { repo: 'hivecommons/hive', kind: 'pr', number: 17442, stage: 85, head: 'c0ffee1', modifiers: [], decision_needed: ask, + ci_activity: { head: 'c0ffee1', state: 'running', active: true, checks_passed: 3, checks_total: 9 }, + review_activity: { head: 'c0ffee1', state: 'human_decision', perspectives_done: 5, perspectives_total: 5 } }; +const rpill = stageTrackerChipsHtml(running); +assert.ok(rpill.includes('ham-mod-needs-decision') && rpill.includes('>needs human decision<'), rpill); +assert.ok(rpill.includes('ham-decision-trigger') && rpill.includes('data-ham-decision="hivecommons/hive/pr#17442"'), rpill); +assert.ok(!rpill.includes('+1'), 'one pill, not duplicated: ' + rpill); +// The server already carrying the modifier adds nothing twice. +const served = stageTrackerChipsHtml(Object.assign({}, running, { modifiers: ['needs-decision'] })); +assert.strictEqual((served.match(/ham-mod-needs-decision/g) || []).length, 1, served); +assert.ok(!served.includes('+1'), served); +// A merge-ready 085 twin (approved + CI green) is the gate's: no invented pill. +const ready = stageTrackerChipsHtml(Object.assign({}, running, { ci_activity: { head: 'c0ffee1', state: 'passing' }, review_activity: { head: 'c0ffee1', state: 'approved' } })); +assert.ok(!ready.includes('ham-mod-needs-decision'), ready); `) } diff --git a/src/pkg/dashboard/stage_tracker_item_column_test.go b/src/pkg/dashboard/stage_tracker_item_column_test.go index 6404ddc4b7..3c5b547ce2 100644 --- a/src/pkg/dashboard/stage_tracker_item_column_test.go +++ b/src/pkg/dashboard/stage_tracker_item_column_test.go @@ -143,9 +143,12 @@ func TestStageTrackerFixingAfterMergeFailedColumn(t *testing.T) { // TestStageTrackerPersonActsOnPRColumn replays hive's own #16524: a PR // parked at 085 under hive:unauthorized (a maintainer must rerun shared // CI on GitHub) with CI unknown and review findings open. The ask is a -// person's move ON THE PR, so its chevron is PR in progress and the -// Merge queue column is empty — the gate is only for rows queued / -// merging / merged, or a merge-ready PR parked on a merge decision. +// person's move ON THE PR, so its chevron is the PR's REAL stage — the +// CI / Review column — and the Merge queue column is empty: the gate is +// only for rows queued / merging / merged, or a merge-ready PR parked on +// a merge decision. The human gate itself is the needs-decision pill, +// never a PR in progress chevron (hivecommons/hive#17453, replaying +// #17442: 085 with CI running and the review verdict pending). func TestStageTrackerPersonActsOnPRColumn(t *testing.T) { head := "7879a51f276a0f9aa5adc995d9d09a74487bbcf4" ci := func(state string) *StageTrackerActivity { return &StageTrackerActivity{Head: head, State: state} } @@ -160,19 +163,22 @@ func TestStageTrackerPersonActsOnPRColumn(t *testing.T) { mut func(*StageTrackerItem) want int }{ - {"#16524 as served", func(*StageTrackerItem) {}, trackerColumnPR}, - {"unauthorized step, no track evidence", func(it *StageTrackerItem) { it.CIActivity, it.ReviewActivity = nil, nil }, trackerColumnPR}, + {"#16524 as served", func(*StageTrackerItem) {}, trackerColumnReview}, + {"unauthorized step, no track evidence", func(it *StageTrackerItem) { it.CIActivity, it.ReviewActivity = nil, nil }, trackerColumnReview}, {"unauthorized step on a merge-ready head", func(it *StageTrackerItem) { it.CIActivity, it.ReviewActivity = ci("passing"), review("approved") }, trackerColumnMergeGate}, - {"decision with review findings open", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep = "", "" }, trackerColumnPR}, + {"decision with review findings open", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep = "", "" }, trackerColumnReview}, {"decision with CI red, review approved", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", ci("failing"), review("approved") - }, trackerColumnPR}, - {"approved decision with CI running on the head keeps the gate", func(it *StageTrackerItem) { + }, trackerColumnReview}, + {"#17442: decision with CI running, review verdict pending (#17453)", func(it *StageTrackerItem) { + it.Number, it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = 17442, "", "", ci("running"), review("human_decision") + }, trackerColumnReview}, + {"approved decision with CI running on the head is at CI, not the gate (#17453)", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", ci("running"), review("approved") - }, trackerColumnMergeGate}, - {"approved decision with CI queued on the head keeps the gate", func(it *StageTrackerItem) { + }, trackerColumnReview}, + {"approved decision with CI queued on the head is at CI, not the gate (#17453)", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", ci("queued"), review("approved") - }, trackerColumnMergeGate}, + }, trackerColumnReview}, {"bare 085 decision keeps the gate (#14821)", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", nil, nil }, trackerColumnMergeGate}, @@ -203,4 +209,24 @@ func TestStageTrackerPersonActsOnPRColumn(t *testing.T) { if !strings.Contains(caption, "Waiting for a maintainer · rerun shared ci on GitHub") || strings.Contains(caption, "Awaiting human") || actor != "maintainer" { t.Fatalf("caption %q actor %q", caption, actor) } + // The ask rides as the needs-decision pill once the head's tracks are + // known (hivecommons/hive#17453): added when a person acts on the PR, + // never duplicated, and left alone on a merge-ready or queued row. + pill := live() + pill.Number, pill.Reason, pill.UnauthorizedStep, pill.CIActivity, pill.ReviewActivity = 17442, "", "", ci("running"), review("human_decision") + pill.Modifiers = []string{modStalled} + stageTrackerApplyPersonActsOnPRPill(&pill) + if strings.Join(pill.Modifiers, ",") != modStalled+","+modNeedsDecision { + t.Fatalf("#17442 modifiers %v, want [%s %s]", pill.Modifiers, modStalled, modNeedsDecision) + } + stageTrackerApplyPersonActsOnPRPill(&pill) + if strings.Join(pill.Modifiers, ",") != modStalled+","+modNeedsDecision { + t.Fatalf("#17442 modifiers duplicated: %v", pill.Modifiers) + } + ready := live() + ready.Reason, ready.UnauthorizedStep, ready.CIActivity, ready.ReviewActivity = "", "", ci("passing"), review("approved") + stageTrackerApplyPersonActsOnPRPill(&ready) + if len(ready.Modifiers) != 0 { + t.Fatalf("merge-ready 085 grew modifiers %v", ready.Modifiers) + } } diff --git a/src/pkg/dashboard/stage_tracker_test.go b/src/pkg/dashboard/stage_tracker_test.go index 7e567fa29f..805a31e63c 100644 --- a/src/pkg/dashboard/stage_tracker_test.go +++ b/src/pkg/dashboard/stage_tracker_test.go @@ -539,8 +539,11 @@ func TestStageTrackerEndpoint(t *testing.T) { t.Fatalf("pr103 history = %+v, want the second hop marked as the 100 → 050 fall", h) } + // A label-only 085 PR with no merge-ready evidence on its head lights + // its real stage (CI / Review), so the ask rides as the needs-decision + // pill (hivecommons/hive#17453). pr104 := trackerItem(t, resp, "pr", 104) - if pr104.Stage != 85 || pr104.StageSince != nil || len(pr104.History) != 0 || hasMod(pr104, modNeedsDecision) || pr104.Actor != "maintainer" { + if pr104.Stage != 85 || pr104.StageSince != nil || len(pr104.History) != 0 || !hasMod(pr104, modNeedsDecision) || pr104.Actor != "maintainer" { t.Fatalf("label-only pr104 = %+v", pr104) } diff --git a/src/pkg/dashboard/stage_tracker_ui_rows_test.go b/src/pkg/dashboard/stage_tracker_ui_rows_test.go index 451e71cd42..28acd1d148 100644 --- a/src/pkg/dashboard/stage_tracker_ui_rows_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_rows_test.go @@ -697,7 +697,13 @@ assert.ok(/[^<]*<\/span>/.test(row) && !/ assert.strictEqual(ci[1], 'done', '11/11 passed is done-style: ' + adoptedRow); const parkedRow = stageTrackerRowHtml({ repo: 'acme/console', number: 16510, kind: 'pr', stage: 85, display_column: 85, head: 'f269349', needs_human: true, author: 'thatguywob', author_kind: 'human', review_activity: { head: 'f269349', state: 'human_decision', caption: 'Review findings · human decision', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen } }, stages, ctx); - assert.ok(/
  • ]*title="Review: Review 5\/5 · needs owner sign-off · /.test(parkedRow), 'genuinely parked on a person names the sign-off in the tooltip, still not amber: ' + parkedRow); + // Genuinely parked on a person (085, no checks known): the row's real stage + // is Review, whose verdict asked for that person — it is the one lit + // chevron, amber-marked for the human gate, naming the sign-off + // (hivecommons/hive#17453); CI is the dim unknown ring. + assert.ok(/
  • ]*title="Current pipeline phase · Review: Review 5\/5 · needs owner sign-off · /.test(parkedRow), 'genuinely parked on a person lights Review with the sign-off, amber-marked: ' + parkedRow); + assert.strictEqual(litChevrons(strip(parkedRow)), 1, parkedRow); + assert.ok(/
  • [^<]*<\/span>/.test(row) && !/ } // hivecommons/hive#16524: 085 under hive:unauthorized (a maintainer must // rerun shared CI on GitHub), CI unknown, review findings open. The ask is -// the person's move ON THE PR, not a merge matter: the chevron lights PR in -// progress with "Waiting for @clubanderson · rerun shared ci on GitHub" -// and the person icon; the Merge queue column stays empty. A merge-ready -// twin (approved + CI green) or a queued one keeps the gate. +// the person's move ON THE PR, not a merge matter: the row lights its REAL +// stage — the CI track, stalled, amber-marked (ham-human-gated) — with +// PR in progress passed and the Merge queue column empty; the ask rides +// as the needs-human pill, never as a "Needs human" chevron of its own +// (hivecommons/hive#17453). A merge-ready twin (approved + CI green) or a +// queued one keeps the gate. { const seen = new Date(now - 60000).toISOString(); const head = '7879a51'; @@ -755,12 +763,11 @@ assert.ok(/[^<]*<\/span>/.test(row) && !/ ci_activity: { head, state: 'unknown', caption: 'CI unknown · no check results observed for this head yet', checks_passed: 34, checks_total: 42, checks_failed: 1, source: 'github-graphql-cache+required-branch', observed_at: seen }, review_activity: { head, state: 'changes_requested', caption: 'Review findings · awaiting author', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen, since: seen } }, extra || {}); const rerun = stageTrackerRowHtml(shape(), stages, ctx); - assert.strictEqual(stageTrackerAnchor(85, stages, 'pr', shape()), 30, 'the ask is the person\'s move on the PR: PR in progress'); - assert.deepStrictEqual(segStates(rerun), [D, D, D, 'active detoured', T, T, 'todo cap'], 'PR in progress lit, Merge queue empty: ' + strip(rerun)); - assert.ok(rerun.includes('Waiting for @clubanderson · rerun shared ci on GitHub'), 'the chevron names the person and the step: ' + strip(rerun)); - assert.ok(!/
  • ]*>[\s\S]*?Awaiting human/.test(strip(rerun)), 'no "Awaiting human" chevron: ' + strip(rerun)); - const litSeg = /
  • ]*>([\s\S]*?)<\/li>/.exec(strip(rerun)); - assert.ok(litSeg && litSeg[1].includes('ham-actor-ico'), 'the person icon stays on the lit chevron: ' + strip(rerun)); + assert.strictEqual(stageTrackerAnchor(85, stages, 'pr', shape()), 50, 'the ask is the person\'s move on the PR: its real stage, CI / Review'); + assert.deepStrictEqual(segStates(rerun), [D, D, D, D, 'active detoured', T, 'todo cap'], 'CI / Review lit, PR in progress passed, Merge queue empty: ' + strip(rerun)); + assert.ok(/
  • ]*>[\s\S]*?(?:Awaiting human|Needs human|Waiting for @clubanderson)/.test(strip(rerun)), 'no "Needs human" stage chevron: ' + strip(rerun)); + assert.ok(rerun.includes('ham-mod-unauthorized'), 'the ask rides as the pill: ' + strip(rerun)); const mergeSeg = Array.from(strip(rerun).matchAll(/
  • ]*>([\s\S]*?)<\/li>/g)).filter(m => !m[1].includes('ham-activity-track') && !m[1].includes('ham-head'))[4]; assert.ok(mergeSeg && mergeSeg[1] === 'todo' && !/ham-chevron-copy/.test(mergeSeg[2]), 'the merge-queue chevron carries no words: ' + mergeSeg[0]); assert.strictEqual(litChevrons(strip(rerun)), 1, 'one lit chevron: ' + strip(rerun)); @@ -772,7 +779,43 @@ assert.ok(/[^<]*<\/span>/.test(row) && !/ assert.strictEqual(stageTrackerAnchor(85, stages, 'pr', { kind: 'pr', stage: 85, caption: 'decision requested' }), 80); // A nested PR under its issue follows the same column. const nested = stageTrackerRowHtml({ repo: 'hivecommons/hive', number: 16500, kind: 'issue', stage: 40, linked_prs: [shape()] }, stages, ctx); - assert.ok(nested.includes('Waiting for @clubanderson · rerun shared ci on GitHub'), 'nested PR carries the word: ' + nested); + assert.deepStrictEqual(segStates(nested), [D, D, D, D, 'active detoured', T, 'todo cap'], 'nested PR lights the same column: ' + strip(nested)); + assert.ok(/ham-activity-track active ham-stalled ham-human-gated/.test(nested), 'nested PR carries the amber marker: ' + strip(nested)); +} +// hivecommons/hive#17442 under #17426 (issue #17453, 2026-11-09 21:37Z): a +// plain 085 PR with CI running on its head and the review verdict pending +// read "Needs human · decision" as a lit PR in progress chevron while the +// CI and Review chevrons spun dim. The lit chevron is the PR's REAL stage: +// CI (running, with motion) wearing the amber human-gated marker; PR in +// progress is passed; Merge queue is empty; the ask is the needs-decision +// pill with the question in the CI tooltip. One lit stage per row. +{ + const seen = new Date(now - 60000).toISOString(); + const head = 'ab12cd3'; + const question = 'sec-check needs the Dependabot alerts read permission on this repo. Grant it, or merge without the check?'; + const ask = { question, asked_by: 'sec-check', since: seen, options: [{ action: 'decide:approve', label: 'Approve', enabled: true }, { action: 'decide:delegate', label: 'Let hive decide', enabled: true }] }; + const shape = (extra) => Object.assign({ repo: 'hivecommons/hive', number: 17442, kind: 'pr', stage: 85, head, author: 'hive[bot]', author_kind: 'hive', modifiers: ['needs-decision'], + caption: 'Needs human decision', decision_needed: ask, + ci_activity: { head, state: 'running', active: true, caption: 'CI running', checks_passed: 3, checks_total: 9, source: 'checks', observed_at: seen }, + review_activity: { head, state: 'human_decision', caption: 'Review 5/5 · needs human decision', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen, since: seen } }, extra || {}); + const row = stageTrackerRowHtml(shape(), stages, ctx); + assert.strictEqual(stageTrackerAnchor(85, stages, 'pr', shape()), 50, 'CI running on the head: the real stage is CI / Review'); + assert.deepStrictEqual(segStates(row), [D, D, D, D, 'active detoured', T, 'todo cap'], 'PR in progress passed, Merge queue empty: ' + strip(row)); + assert.strictEqual(litChevrons(strip(row)), 1, 'one lit chevron: ' + strip(row)); + assert.ok(/
  • ]*data-motion="active"[^>]*>[\s\S]*?CI 3\/9 · 6 running<\/span>/.test(row), 'CI is the lit chevron, in motion, amber-marked: ' + strip(row)); + assert.ok(/
  • ]*>[\s\S]*?Needs human/.test(strip(row)), 'no "Needs human" stage chevron: ' + strip(row)); + assert.ok(row.includes('ham-mod-needs-decision') && row.includes('>needs human decision<'), 'the ask rides as the needs-decision pill: ' + strip(row)); + assert.ok(row.includes('needs a person: ' + question.replace(/'/g, ''')) || row.includes('needs a person: ' + question), 'the lit CI chevron\'s tooltip carries the question: ' + row); + // The same row with CI green and the review verdict pending lights Review, stalled, amber-marked. + const reviewing = stageTrackerRowHtml(shape({ ci_activity: { head, state: 'passing', caption: 'CI green', checks_passed: 9, checks_total: 9, source: 'checks', observed_at: seen }, review_activity: { head, state: 'unknown', caption: 'Review pending', perspectives_done: 0, perspectives_total: 5, source: 'review-dispatch-wait', observed_at: seen } }), stages, ctx); + assert.strictEqual(litChevrons(strip(reviewing)), 1, strip(reviewing)); + assert.ok(/
  • ]*data-verdict="pass"/.test(reviewing), 'green CI is the ring alone: ' + strip(reviewing)); + // A payload that predates the server re-adding the modifier still shows the pill. + const bare = stageTrackerRowHtml(shape({ modifiers: [] }), stages, ctx); + assert.ok(bare.includes('ham-mod-needs-decision'), 'the pill is derived client-side too: ' + strip(bare)); + assert.strictEqual((bare.match(/ham-mod-needs-decision/g) || []).length, 1, bare); } // hivecommons/hive#16599 rows (canonical: active = amber + words, inactive = // icon only). #16567 (dependabot, 050, review approved, 10 workflow runs diff --git a/src/pkg/dashboard/stage_tracker_vocabulary.go b/src/pkg/dashboard/stage_tracker_vocabulary.go index f752323174..334fe8f5f3 100644 --- a/src/pkg/dashboard/stage_tracker_vocabulary.go +++ b/src/pkg/dashboard/stage_tracker_vocabulary.go @@ -2,6 +2,7 @@ package dashboard import ( "regexp" + "slices" "strings" "github.com/hivecommons/hive/pkg/stagelabels" @@ -89,21 +90,27 @@ func stageTrackerItemColumn(it *StageTrackerItem) int { } } if stageTrackerPersonActsOnPR(it) { - return trackerColumnPR + return trackerColumnReview } return stageTrackerColumn(st) } // stageTrackerPersonActsOnPR: a PR parked at 085 because a person has to // act ON THE PR — rerun CI, approve workflow runs, resolve a permission -// (reason `unauthorized:`), or answer review findings / red checks -// still open on its head — is not queued, merging or merge-ready, so its -// chevron lights PR in progress, never Merge queue. The Merge queue -// column is only for rows actually queued / merging / merged, or a -// merge-ready PR (review approved, CI green) parked on a merge decision. -// A bare 085 with no track evidence keeps the gate: the person decides -// there (hive#14821). Hive's own #16524 read "Awaiting human: rerun -// shared ci" under Merge queue with CI unknown and review findings open. +// (reason `unauthorized:`), or answer review findings / red or +// running checks still open on its head — is not queued, merging or +// merge-ready, so its chevron lights its REAL stage, CI / Review (the CI +// track while checks run or are red / unknown, the Review track while the +// verdict is pending), never Merge queue and never PR in progress: the +// human gate is a pill on the real stage, not a stage of its own (owner +// rule 2026-11-08, hivecommons/hive#17327; #17453 for the 085 park). The +// Merge queue column is only for rows actually queued / merging / merged, +// or a merge-ready PR (review approved, CI green) parked on a merge +// decision. A bare 085 with no track evidence keeps the gate: the person +// decides there (hive#14821). Hive's own #16524 read "Awaiting human: +// rerun shared ci" under Merge queue with CI unknown and review findings +// open; #17442 read "Needs human · decision" under PR in progress while +// CI ran. func stageTrackerPersonActsOnPR(it *StageTrackerItem) bool { if it == nil || it.Kind != "pr" || stageByNumber(it.Stage) != stagelabels.NeedsDecision { return false @@ -120,6 +127,23 @@ func stageTrackerPersonActsOnPR(it *StageTrackerItem) bool { return stageTrackerNotMergeReadyEvidence(it) } +// stageTrackerApplyPersonActsOnPRPill: once the head's tracks are known, +// a 085 PR whose chevron is its real stage (stageTrackerPersonActsOnPR → +// CI / Review) gets the `needs-decision` modifier back, so the pill strip +// carries the ask — the human icon, the decision popover, the question in +// the tooltip — where the chevron no longer says "Needs human decision" +// (hivecommons/hive#17453). The modifier keeps its place in the pill +// order (stageTrackerModifierOrder). +func stageTrackerApplyPersonActsOnPRPill(it *StageTrackerItem) { + if it == nil || !stageTrackerPersonActsOnPR(it) || slices.Contains(it.Modifiers, modNeedsDecision) { + return + } + it.Modifiers = append(it.Modifiers, modNeedsDecision) + slices.SortStableFunc(it.Modifiers, func(a, b string) int { + return slices.Index(stageTrackerModifierOrder, a) - slices.Index(stageTrackerModifierOrder, b) + }) +} + func stageTrackerActivityOnHead(it *StageTrackerItem, a *StageTrackerActivity) bool { return a != nil && (a.Head == "" || it.Head == "" || strings.EqualFold(a.Head, it.Head)) } @@ -134,12 +158,12 @@ func stageTrackerMergeReadyEvidence(it *StageTrackerItem) bool { // stageTrackerNotMergeReadyEvidence: a track on the current head says the // PR is short of merge-ready (review not approved, CI not green). CI that -// is queued or running on the same head is a re-run, not a regression, so -// it does not count. +// is queued or running on the same head counts too: the head's real stage +// is CI while checks run, so the row lights the CI track, not the gate +// (hivecommons/hive#17453). func stageTrackerNotMergeReadyEvidence(it *StageTrackerItem) bool { return (stageTrackerActivityOnHead(it, it.ReviewActivity) && it.ReviewActivity.State != "approved") || - (stageTrackerActivityOnHead(it, it.CIActivity) && it.CIActivity.State != "passing" && - it.CIActivity.State != "queued" && it.CIActivity.State != "running") + (stageTrackerActivityOnHead(it, it.CIActivity) && it.CIActivity.State != "passing") } // stageTrackerStagePhrase is the stage as a lowercase clause for the diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index cca0e25e3f..3748b2445f 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -470,6 +470,10 @@ the Merge queue cell wears the pill amber — held, not queued, not red. */ .ham-seg.active.ham-held { background: var(--amber); color: var(--surface-0); } .ham-seg.active.ham-held .ham-detour::before { content: '⏸'; margin-right: var(--sp-1); } + /* A 085 PR a person acts on lights its real stage — the CI / Review + track — and that track wears an amber marker; the gate itself is the + needs-human pill beside the row (hivecommons/hive#17453). */ + .ham-seg.ham-activity-track.active.ham-human-gated { outline: var(--focus-ring-width) solid var(--amber); outline-offset: calc(-1 * var(--focus-ring-width)); } .ham-seg.active.ham-open-hold .ham-seg-t::before { content: '⏸'; margin-right: var(--sp-1); } .ham-seg.active.ham-open-blocked { background: var(--yellow); color: var(--surface-0); } .ham-seg.active.ham-open-blocked .ham-seg-t::before { content: '⛔'; margin-right: var(--sp-1); } diff --git a/src/pkg/dashboard/static-src/js/tracker-row-anchor.js b/src/pkg/dashboard/static-src/js/tracker-row-anchor.js index b8454d15d9..3974e51083 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-anchor.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-anchor.js @@ -45,9 +45,12 @@ // next to its 2nd-place sibling in Merge queue (hivecommons/hive#15395). if (item && item.merge_train && item.merge_train.state && cur > STAGE_TRACKER_PR_COLUMN) return STAGE_TRACKER_MERGE_COLUMN; // A person owes a step on the PR itself (085 under hive:unauthorized, - // not merge-ready): PR in progress, with the merge-queue chevron - // empty (hivecommons/hive#16524). - if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return STAGE_TRACKER_PR_COLUMN; + // a reviewer's question, CI running or red on the head — not + // merge-ready): the row lights its REAL stage, CI / Review, with the + // merge-queue chevron empty and PR in progress passed; the human gate + // rides as the needs-human pill, never as a chevron of its own + // (hivecommons/hive#16524, #17327, #17453). + if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return 50; if (cur === STAGE_TRACKER_ISSUE_NEEDS_DECISION || cur === STAGE_TRACKER_TRIAGE_NEEDED || cur === STAGE_TRACKER_POSSIBLY_EXISTS || cur === STAGE_TRACKER_OPEN_FOR_DISCUSSION) return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (cur === STAGE_TRACKER_NEEDS_DECISION && kind === 'issue') return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (STAGE_TRACKER_PATH.indexOf(cur) >= 0) return cur; 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 e1b1f840f2..2f379c5709 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -205,6 +205,10 @@ function stageTrackerStalledTrack(item) { const on = kind => { const a = item && item[kind + '_activity']; return a && item.head && a.head === item.head ? a.state || 'unknown' : 'unknown'; }; if (typeof stageTrackerStageTrack === 'function' && stageTrackerStageTrack(item)) return ''; + // A 085 PR a person acts on whose review already asked for that + // person (human_decision) is at Review: the ask came from the + // review, whatever CI has or has not reported (hivecommons/hive#17453). + if (on('review') === 'human_decision' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return 'review'; if (on('ci') !== 'passing') return 'ci'; return 'review'; } @@ -256,7 +260,12 @@ function stageTrackerTrackRunning(item, kind) { const a = item && item[kind + '_activity']; if (!a || !item.head || a.head !== item.head) return false; - if (stageTrackerWaitingOnPerson(item)) return false; + // A 085 PR a person acts on (stageTrackerPersonActsOnPR) is parked, + // but checks genuinely running on its head are still motion: the CI + // track is its real stage and lights (hivecommons/hive#17453). + // Inferred motion (the ring count below) stays off for it. + const personActs = typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item); + if (stageTrackerWaitingOnPerson(item) && !personActs) return false; const moving = kind === 'ci' ? ['running', 'queued'] : ['reviewing', 'adjudicating', 'assigned']; if (a.active || moving.includes(a.state)) return true; // A CI ring that is not full is a running ring: checks counted on @@ -374,7 +383,11 @@ const queuedNote = queued && typeof stageTrackerQueuedTrackNote === 'function' ? stageTrackerQueuedTrackNote(item, kind) : ''; // A demoted track is still: no pulse beside the lead. if (queued) active = false; - const cls = lit ? 'active' + (stalled ? ' ham-stalled' : '') : (finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : 'todo') + (queued ? ' ham-track-queued' : ''); + // The lit track of a 085 PR a person acts on wears an amber marker + // (ham-human-gated): the chevron is the real stage, the gate is the + // needs-human pill beside it (hivecommons/hive#17453). + const humanGated = lit && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item); + const cls = lit ? 'active' + (stalled ? ' ham-stalled' : '') + (humanGated ? ' ham-human-gated' : '') : (finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : 'todo') + (queued ? ' ham-track-queued' : ''); const approvalPending = kind === 'ci' && matches ? stageTrackerWorkflowApprovalPending(a) : 0; const humanAction = approvalPending > 0 ? STAGE_TRACKER_WORKFLOW_APPROVAL_TIP : kind === 'review' && state === 'human_decision' ? 'Needs a person\'s decision' : ''; const personIco = stalled && humanAction ? stageTrackerIcon('human', 'ham-ico ham-actor-ico', humanAction) : ''; @@ -432,6 +445,7 @@ (matches && a.actor ? ' · actor ' + a.actor : '') + (codeNote || contextWord ? ' · ' + (codeNote || contextWord) : '') + (hold ? ' · ' + (hold.pill || 'Held by @' + hold.by) + (hold.reason ? ' · ' + hold.reason : '') : '') + + (humanGated && item.decision_needed && item.decision_needed.question && !String(tip).includes(String(item.decision_needed.question)) ? ' · needs a person: ' + String(item.decision_needed.question) : '') + (waitLead ? ' · hive is waiting on ' + waitLead.waitingOn + (waitLead.newHead && sha7 ? ' for new head ' + sha7 : '') : '') + (queuedNote ? ' · ' + queuedNote + ' behind ' + (lead === 'ci' ? 'CI' : 'Review') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); @@ -946,6 +960,15 @@ const sentinel = stageTrackerSentinelChipHtml(item) + (typeof stageTrackerPreparationChipHtml === 'function' ? stageTrackerPreparationChipHtml(item) : '') + (typeof stageTrackerAdoptionChipHtml === 'function' ? stageTrackerAdoptionChipHtml(item) : '') + (typeof stageTrackerPresenceChipHtml === 'function' ? stageTrackerPresenceChipHtml(item) : '') + (typeof stageTrackerPushChipHtml === 'function' ? stageTrackerPushChipHtml(item, Date.now()) : '') + (typeof stageTrackerReroutePillHtml === 'function' ? stageTrackerReroutePillHtml(item) : '') + (typeof stageTrackerSupersedesChipHtml === 'function' ? stageTrackerSupersedesChipHtml(item, Date.now()) : '') + (typeof stageTrackerOverlapBadgeHtml === 'function' ? stageTrackerOverlapBadgeHtml(item) : ''); const mods = (Array.isArray(item.modifiers) ? item.modifiers.slice() : []) .sort((x, y) => STAGE_TRACKER_MOD_PRIORITY.indexOf(x) - STAGE_TRACKER_MOD_PRIORITY.indexOf(y)); + // A 085 PR a person acts on lights its real stage (CI / Review), so + // the chevron no longer says "Needs human decision": the ask rides + // here as the needs-decision pill (hivecommons/hive#17453). The server + // re-adds the modifier (stageTrackerApplyPersonActsOnPRPill); this + // covers a payload that predates it. + if (item.kind === 'pr' && mods.indexOf('needs-decision') < 0 && mods.indexOf('needs-human') < 0 && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) { + mods.push('needs-decision'); + mods.sort((x, y) => STAGE_TRACKER_MOD_PRIORITY.indexOf(x) - STAGE_TRACKER_MOD_PRIORITY.indexOf(y)); + } if (!mods.length) return sentinel; // A regression the hive is working through yields the lead pill to any // other modifier and, alone, draws muted as "stage reset" rather than red. diff --git a/src/pkg/dashboard/static-src/js/tracker-words-core.js b/src/pkg/dashboard/static-src/js/tracker-words-core.js index 49f64ece3e..2fea65774a 100644 --- a/src/pkg/dashboard/static-src/js/tracker-words-core.js +++ b/src/pkg/dashboard/static-src/js/tracker-words-core.js @@ -60,14 +60,19 @@ } // A PR parked at 085 because a person has to act ON THE PR (rerun CI, // approve workflow runs, resolve a permission, answer review findings - // or red checks still open on its head) is not queued, merging or - // merge-ready: it lights PR in progress, never Merge queue. Merge - // queue is only for rows actually queued / merging / merged, or a - // merge-ready PR (review approved, CI green on this head) parked on a - // merge decision. A bare 085 with no track evidence keeps the gate: - // the person decides there (hive#14821). Hive's own #16524 read - // "Awaiting human: rerun shared ci" under Merge queue with CI unknown - // and review findings open. Mirrors stageTrackerPersonActsOnPR in Go. + // or red / running checks still open on its head) is not queued, + // merging or merge-ready: it lights its REAL stage, CI / Review — the + // CI track while checks run or are red / unknown, the Review track + // while the verdict is pending — never Merge queue and never PR in + // progress; the gate is the needs-human pill (hivecommons/hive#17327, + // #17453). Merge queue is only for rows actually queued / merging / + // merged, or a merge-ready PR (review approved, CI green on this head) + // parked on a merge decision. A bare 085 with no track evidence keeps + // the gate: the person decides there (hive#14821). Hive's own #16524 + // read "Awaiting human: rerun shared ci" under Merge queue with CI + // unknown and review findings open; #17442 read "Needs human · + // decision" under PR in progress while CI ran. Mirrors + // stageTrackerPersonActsOnPR in Go. function stageTrackerPersonActsOnPR(item) { if (!item || (item.via_pr ? 'pr' : item.kind) !== 'pr' || Number(item.stage) !== STAGE_TRACKER_HUMAN_GATED) return false; if (item.merge_gate && item.merge_gate.state) return false; diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index d8aaeee6d0..127d0ccbdf 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1813,6 +1813,10 @@ the Merge queue cell wears the pill amber — held, not queued, not red. */ .ham-seg.active.ham-held { background: var(--amber); color: var(--surface-0); } .ham-seg.active.ham-held .ham-detour::before { content: '⏸'; margin-right: var(--sp-1); } + /* A 085 PR a person acts on lights its real stage — the CI / Review + track — and that track wears an amber marker; the gate itself is the + needs-human pill beside the row (hivecommons/hive#17453). */ + .ham-seg.ham-activity-track.active.ham-human-gated { outline: var(--focus-ring-width) solid var(--amber); outline-offset: calc(-1 * var(--focus-ring-width)); } .ham-seg.active.ham-open-hold .ham-seg-t::before { content: '⏸'; margin-right: var(--sp-1); } .ham-seg.active.ham-open-blocked { background: var(--yellow); color: var(--surface-0); } .ham-seg.active.ham-open-blocked .ham-seg-t::before { content: '⛔'; margin-right: var(--sp-1); } @@ -15783,14 +15787,19 @@

    Where to get help

    } // A PR parked at 085 because a person has to act ON THE PR (rerun CI, // approve workflow runs, resolve a permission, answer review findings - // or red checks still open on its head) is not queued, merging or - // merge-ready: it lights PR in progress, never Merge queue. Merge - // queue is only for rows actually queued / merging / merged, or a - // merge-ready PR (review approved, CI green on this head) parked on a - // merge decision. A bare 085 with no track evidence keeps the gate: - // the person decides there (hive#14821). Hive's own #16524 read - // "Awaiting human: rerun shared ci" under Merge queue with CI unknown - // and review findings open. Mirrors stageTrackerPersonActsOnPR in Go. + // or red / running checks still open on its head) is not queued, + // merging or merge-ready: it lights its REAL stage, CI / Review — the + // CI track while checks run or are red / unknown, the Review track + // while the verdict is pending — never Merge queue and never PR in + // progress; the gate is the needs-human pill (hivecommons/hive#17327, + // #17453). Merge queue is only for rows actually queued / merging / + // merged, or a merge-ready PR (review approved, CI green on this head) + // parked on a merge decision. A bare 085 with no track evidence keeps + // the gate: the person decides there (hive#14821). Hive's own #16524 + // read "Awaiting human: rerun shared ci" under Merge queue with CI + // unknown and review findings open; #17442 read "Needs human · + // decision" under PR in progress while CI ran. Mirrors + // stageTrackerPersonActsOnPR in Go. function stageTrackerPersonActsOnPR(item) { if (!item || (item.via_pr ? 'pr' : item.kind) !== 'pr' || Number(item.stage) !== STAGE_TRACKER_HUMAN_GATED) return false; if (item.merge_gate && item.merge_gate.state) return false; @@ -17999,9 +18008,12 @@

    Where to get help

    // next to its 2nd-place sibling in Merge queue (hivecommons/hive#15395). if (item && item.merge_train && item.merge_train.state && cur > STAGE_TRACKER_PR_COLUMN) return STAGE_TRACKER_MERGE_COLUMN; // A person owes a step on the PR itself (085 under hive:unauthorized, - // not merge-ready): PR in progress, with the merge-queue chevron - // empty (hivecommons/hive#16524). - if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return STAGE_TRACKER_PR_COLUMN; + // a reviewer's question, CI running or red on the head — not + // merge-ready): the row lights its REAL stage, CI / Review, with the + // merge-queue chevron empty and PR in progress passed; the human gate + // rides as the needs-human pill, never as a chevron of its own + // (hivecommons/hive#16524, #17327, #17453). + if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return 50; if (cur === STAGE_TRACKER_ISSUE_NEEDS_DECISION || cur === STAGE_TRACKER_TRIAGE_NEEDED || cur === STAGE_TRACKER_POSSIBLY_EXISTS || cur === STAGE_TRACKER_OPEN_FOR_DISCUSSION) return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (cur === STAGE_TRACKER_NEEDS_DECISION && kind === 'issue') return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (STAGE_TRACKER_PATH.indexOf(cur) >= 0) return cur; @@ -18630,6 +18642,10 @@

    Where to get help

    function stageTrackerStalledTrack(item) { const on = kind => { const a = item && item[kind + '_activity']; return a && item.head && a.head === item.head ? a.state || 'unknown' : 'unknown'; }; if (typeof stageTrackerStageTrack === 'function' && stageTrackerStageTrack(item)) return ''; + // A 085 PR a person acts on whose review already asked for that + // person (human_decision) is at Review: the ask came from the + // review, whatever CI has or has not reported (hivecommons/hive#17453). + if (on('review') === 'human_decision' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return 'review'; if (on('ci') !== 'passing') return 'ci'; return 'review'; } @@ -18681,7 +18697,12 @@

    Where to get help

    function stageTrackerTrackRunning(item, kind) { const a = item && item[kind + '_activity']; if (!a || !item.head || a.head !== item.head) return false; - if (stageTrackerWaitingOnPerson(item)) return false; + // A 085 PR a person acts on (stageTrackerPersonActsOnPR) is parked, + // but checks genuinely running on its head are still motion: the CI + // track is its real stage and lights (hivecommons/hive#17453). + // Inferred motion (the ring count below) stays off for it. + const personActs = typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item); + if (stageTrackerWaitingOnPerson(item) && !personActs) return false; const moving = kind === 'ci' ? ['running', 'queued'] : ['reviewing', 'adjudicating', 'assigned']; if (a.active || moving.includes(a.state)) return true; // A CI ring that is not full is a running ring: checks counted on @@ -18799,7 +18820,11 @@

    Where to get help

    const queuedNote = queued && typeof stageTrackerQueuedTrackNote === 'function' ? stageTrackerQueuedTrackNote(item, kind) : ''; // A demoted track is still: no pulse beside the lead. if (queued) active = false; - const cls = lit ? 'active' + (stalled ? ' ham-stalled' : '') : (finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : 'todo') + (queued ? ' ham-track-queued' : ''); + // The lit track of a 085 PR a person acts on wears an amber marker + // (ham-human-gated): the chevron is the real stage, the gate is the + // needs-human pill beside it (hivecommons/hive#17453). + const humanGated = lit && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item); + const cls = lit ? 'active' + (stalled ? ' ham-stalled' : '') + (humanGated ? ' ham-human-gated' : '') : (finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : 'todo') + (queued ? ' ham-track-queued' : ''); const approvalPending = kind === 'ci' && matches ? stageTrackerWorkflowApprovalPending(a) : 0; const humanAction = approvalPending > 0 ? STAGE_TRACKER_WORKFLOW_APPROVAL_TIP : kind === 'review' && state === 'human_decision' ? 'Needs a person\'s decision' : ''; const personIco = stalled && humanAction ? stageTrackerIcon('human', 'ham-ico ham-actor-ico', humanAction) : ''; @@ -18857,6 +18882,7 @@

    Where to get help

    (matches && a.actor ? ' · actor ' + a.actor : '') + (codeNote || contextWord ? ' · ' + (codeNote || contextWord) : '') + (hold ? ' · ' + (hold.pill || 'Held by @' + hold.by) + (hold.reason ? ' · ' + hold.reason : '') : '') + + (humanGated && item.decision_needed && item.decision_needed.question && !String(tip).includes(String(item.decision_needed.question)) ? ' · needs a person: ' + String(item.decision_needed.question) : '') + (waitLead ? ' · hive is waiting on ' + waitLead.waitingOn + (waitLead.newHead && sha7 ? ' for new head ' + sha7 : '') : '') + (queuedNote ? ' · ' + queuedNote + ' behind ' + (lead === 'ci' ? 'CI' : 'Review') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); @@ -19371,6 +19397,15 @@

    Where to get help

    const sentinel = stageTrackerSentinelChipHtml(item) + (typeof stageTrackerPreparationChipHtml === 'function' ? stageTrackerPreparationChipHtml(item) : '') + (typeof stageTrackerAdoptionChipHtml === 'function' ? stageTrackerAdoptionChipHtml(item) : '') + (typeof stageTrackerPresenceChipHtml === 'function' ? stageTrackerPresenceChipHtml(item) : '') + (typeof stageTrackerPushChipHtml === 'function' ? stageTrackerPushChipHtml(item, Date.now()) : '') + (typeof stageTrackerReroutePillHtml === 'function' ? stageTrackerReroutePillHtml(item) : '') + (typeof stageTrackerSupersedesChipHtml === 'function' ? stageTrackerSupersedesChipHtml(item, Date.now()) : '') + (typeof stageTrackerOverlapBadgeHtml === 'function' ? stageTrackerOverlapBadgeHtml(item) : ''); const mods = (Array.isArray(item.modifiers) ? item.modifiers.slice() : []) .sort((x, y) => STAGE_TRACKER_MOD_PRIORITY.indexOf(x) - STAGE_TRACKER_MOD_PRIORITY.indexOf(y)); + // A 085 PR a person acts on lights its real stage (CI / Review), so + // the chevron no longer says "Needs human decision": the ask rides + // here as the needs-decision pill (hivecommons/hive#17453). The server + // re-adds the modifier (stageTrackerApplyPersonActsOnPRPill); this + // covers a payload that predates it. + if (item.kind === 'pr' && mods.indexOf('needs-decision') < 0 && mods.indexOf('needs-human') < 0 && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) { + mods.push('needs-decision'); + mods.sort((x, y) => STAGE_TRACKER_MOD_PRIORITY.indexOf(x) - STAGE_TRACKER_MOD_PRIORITY.indexOf(y)); + } if (!mods.length) return sentinel; // A regression the hive is working through yields the lead pill to any // other modifier and, alone, draws muted as "stage reset" rather than red. From 6837568b23cecae53d31c0d58a20700449284c5a Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Mon, 9 Nov 2026 15:04:22 -0700 Subject: [PATCH 2/6] fix(dashboard): sync shared anchor asset; needs-decision fallback yields to human pills Signed-off-by: Andrew Anderson --- src/pkg/dashboard/stage_tracker_hold_provenance_test.go | 4 ++++ src/pkg/dashboard/static-src/js/tracker-row-strip.js | 5 +++-- src/pkg/dashboard/static/index.html | 5 +++-- src/pkg/webassets/trackerrow/tracker-row-anchor.js | 9 ++++++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_hold_provenance_test.go b/src/pkg/dashboard/stage_tracker_hold_provenance_test.go index 3cc5d0c677..6de7cf8f2a 100644 --- a/src/pkg/dashboard/stage_tracker_hold_provenance_test.go +++ b/src/pkg/dashboard/stage_tracker_hold_provenance_test.go @@ -146,6 +146,7 @@ func TestStageTrackerHoldProvenanceJS(t *testing.T) { "function stageTrackerItemKey(it) { return it.repo + '/' + it.kind + '#' + it.number; }", "function stageTrackerDecisionTriggerHtml(decision, inner, tip, cls) { return ''; }", jsConstLine(t, html, "STAGE_TRACKER_MOD_PRIORITY"), + jsConstLine(t, html, "STAGE_TRACKER_HUMAN_MODS"), jsConstLine(t, html, "STAGE_TRACKER_MOD_TEXT"), jsConstLine(t, html, "STAGE_TRACKER_HANDLED_TEXT"), jsConstLine(t, html, "STAGE_TRACKER_DRAFT_TIP"), @@ -199,6 +200,9 @@ assert.ok(!rpill.includes('+1'), 'one pill, not duplicated: ' + rpill); const served = stageTrackerChipsHtml(Object.assign({}, running, { modifiers: ['needs-decision'] })); assert.strictEqual((served.match(/ham-mod-needs-decision/g) || []).length, 1, served); assert.ok(!served.includes('+1'), served); +// A pill that already names the person owed (unauthorized, hold) stands in: no needs-decision stacked behind it. +const gated = stageTrackerChipsHtml(Object.assign({}, running, { modifiers: ['unauthorized'] })); +assert.ok(!gated.includes('ham-mod-needs-decision') && !gated.includes('+1'), gated); // A merge-ready 085 twin (approved + CI green) is the gate's: no invented pill. const ready = stageTrackerChipsHtml(Object.assign({}, running, { ci_activity: { head: 'c0ffee1', state: 'passing' }, review_activity: { head: 'c0ffee1', state: 'approved' } })); assert.ok(!ready.includes('ham-mod-needs-decision'), ready); 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 2f379c5709..c04f750f6c 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -964,8 +964,9 @@ // the chevron no longer says "Needs human decision": the ask rides // here as the needs-decision pill (hivecommons/hive#17453). The server // re-adds the modifier (stageTrackerApplyPersonActsOnPRPill); this - // covers a payload that predates it. - if (item.kind === 'pr' && mods.indexOf('needs-decision') < 0 && mods.indexOf('needs-human') < 0 && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) { + // covers a payload that predates it. Any pill that already names the + // person owed (unauthorized, hold …) stands in for it. + if (item.kind === 'pr' && !mods.some(m => STAGE_TRACKER_HUMAN_MODS.indexOf(m) >= 0) && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) { mods.push('needs-decision'); mods.sort((x, y) => STAGE_TRACKER_MOD_PRIORITY.indexOf(x) - STAGE_TRACKER_MOD_PRIORITY.indexOf(y)); } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 127d0ccbdf..0e92ca4bef 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -19401,8 +19401,9 @@

    Where to get help

    // the chevron no longer says "Needs human decision": the ask rides // here as the needs-decision pill (hivecommons/hive#17453). The server // re-adds the modifier (stageTrackerApplyPersonActsOnPRPill); this - // covers a payload that predates it. - if (item.kind === 'pr' && mods.indexOf('needs-decision') < 0 && mods.indexOf('needs-human') < 0 && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) { + // covers a payload that predates it. Any pill that already names the + // person owed (unauthorized, hold …) stands in for it. + if (item.kind === 'pr' && !mods.some(m => STAGE_TRACKER_HUMAN_MODS.indexOf(m) >= 0) && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) { mods.push('needs-decision'); mods.sort((x, y) => STAGE_TRACKER_MOD_PRIORITY.indexOf(x) - STAGE_TRACKER_MOD_PRIORITY.indexOf(y)); } diff --git a/src/pkg/webassets/trackerrow/tracker-row-anchor.js b/src/pkg/webassets/trackerrow/tracker-row-anchor.js index b8454d15d9..3974e51083 100644 --- a/src/pkg/webassets/trackerrow/tracker-row-anchor.js +++ b/src/pkg/webassets/trackerrow/tracker-row-anchor.js @@ -45,9 +45,12 @@ // next to its 2nd-place sibling in Merge queue (hivecommons/hive#15395). if (item && item.merge_train && item.merge_train.state && cur > STAGE_TRACKER_PR_COLUMN) return STAGE_TRACKER_MERGE_COLUMN; // A person owes a step on the PR itself (085 under hive:unauthorized, - // not merge-ready): PR in progress, with the merge-queue chevron - // empty (hivecommons/hive#16524). - if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return STAGE_TRACKER_PR_COLUMN; + // a reviewer's question, CI running or red on the head — not + // merge-ready): the row lights its REAL stage, CI / Review, with the + // merge-queue chevron empty and PR in progress passed; the human gate + // rides as the needs-human pill, never as a chevron of its own + // (hivecommons/hive#16524, #17327, #17453). + if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return 50; if (cur === STAGE_TRACKER_ISSUE_NEEDS_DECISION || cur === STAGE_TRACKER_TRIAGE_NEEDED || cur === STAGE_TRACKER_POSSIBLY_EXISTS || cur === STAGE_TRACKER_OPEN_FOR_DISCUSSION) return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (cur === STAGE_TRACKER_NEEDS_DECISION && kind === 'issue') return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (STAGE_TRACKER_PATH.indexOf(cur) >= 0) return cur; From db5955e1a5cbdd8278e7ea8b15191d41dccdd54f Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Mon, 9 Nov 2026 16:26:44 -0700 Subject: [PATCH 3/6] fix(dashboard): pad the needs-decision popover pill to the phone tap target Signed-off-by: Andrew Anderson --- src/pkg/dashboard/static-src/css/tracker.css | 5 +++++ src/pkg/dashboard/static/index.html | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 3748b2445f..f4a70796e7 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -1217,6 +1217,11 @@ box-sizing: border-box; min-height: var(--tap-target); min-width: var(--tap-target); } #activity-monitor-section .ham-notes-btn { font-size: var(--tap-glyph); padding-top: var(--sp-2); padding-bottom: var(--sp-2); } + /* A needs-human / hold pill that opens the decision popover keeps its + one-line box so a card row stays under the #17161 height budget; the + hit area is padded out to the tap target like .ham-pill (#17453). */ + #activity-monitor-section .ham-badge-mod.ham-decision-trigger { position: relative; } + #activity-monitor-section .ham-badge-mod.ham-decision-trigger::before { content: ""; position: absolute; inset: calc((1lh - var(--tap-target)) / 2) 0; } /* A card keeps its two-line head and its density (#17161): the 🗒 shows on a phone only once the item has notes; the row's ⋯ menu carries "Maintainer notes…" for the rest. */ diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 0e92ca4bef..8d1a9ba492 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -2560,6 +2560,11 @@ box-sizing: border-box; min-height: var(--tap-target); min-width: var(--tap-target); } #activity-monitor-section .ham-notes-btn { font-size: var(--tap-glyph); padding-top: var(--sp-2); padding-bottom: var(--sp-2); } + /* A needs-human / hold pill that opens the decision popover keeps its + one-line box so a card row stays under the #17161 height budget; the + hit area is padded out to the tap target like .ham-pill (#17453). */ + #activity-monitor-section .ham-badge-mod.ham-decision-trigger { position: relative; } + #activity-monitor-section .ham-badge-mod.ham-decision-trigger::before { content: ""; position: absolute; inset: calc((1lh - var(--tap-target)) / 2) 0; } /* A card keeps its two-line head and its density (#17161): the 🗒 shows on a phone only once the item has notes; the row's ⋯ menu carries "Maintainer notes…" for the rest. */ From 0361c43825ca0356539897fad93509951bf45af0 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Mon, 9 Nov 2026 16:43:31 -0700 Subject: [PATCH 4/6] fix(dashboard): keep the needs-decision pill on one line in nested-PR heads Signed-off-by: Andrew Anderson --- src/pkg/dashboard/static-src/css/tracker.css | 4 ++++ src/pkg/dashboard/static/index.html | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index f4a70796e7..1729c446e8 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -137,6 +137,10 @@ .ham-head-cols .ham-seg.ham-head-tools { align-items: flex-start; } .ham-head-cols .ham-seg.ham-head-tools:has(> .ham-badges:empty) { display: none; } .ham-head-cols .ham-badges > :is(button, a) { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } + /* The short needs-human popover pill stays one line: breaking "needs + human decision" mid-pill grows a nested-PR row by a text line and a + landscape phone loses its second row (hivecommons/hive#17453). */ + .ham-head-cols .ham-badges > .ham-badge-mod.ham-mod-needs-decision { white-space: nowrap; } .ham-head-cols .ham-badge { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .ham-head-main { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: var(--sp-3); min-width: 0; } .ham-head-main > .ham-badge { flex: 0 1 auto; } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 8d1a9ba492..d273db7253 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1480,6 +1480,10 @@ .ham-head-cols .ham-seg.ham-head-tools { align-items: flex-start; } .ham-head-cols .ham-seg.ham-head-tools:has(> .ham-badges:empty) { display: none; } .ham-head-cols .ham-badges > :is(button, a) { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } + /* The short needs-human popover pill stays one line: breaking "needs + human decision" mid-pill grows a nested-PR row by a text line and a + landscape phone loses its second row (hivecommons/hive#17453). */ + .ham-head-cols .ham-badges > .ham-badge-mod.ham-mod-needs-decision { white-space: nowrap; } .ham-head-cols .ham-badge { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .ham-head-main { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: var(--sp-3); min-width: 0; } .ham-head-main > .ham-badge { flex: 0 1 auto; } From 3414abfe9cca0d36c4b559aa7cf94e963e65446d Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Mon, 9 Nov 2026 17:06:53 -0700 Subject: [PATCH 5/6] fix(dashboard): ask pill wears the person icon and folds to it in the stacked head Signed-off-by: Andrew Anderson --- .../dashboard/stage_tracker_hold_provenance_test.go | 3 +++ src/pkg/dashboard/static-src/css/tracker.css | 7 ++++++- .../dashboard/static-src/js/tracker-row-strip.js | 6 +++++- src/pkg/dashboard/static/index.html | 13 +++++++++++-- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_hold_provenance_test.go b/src/pkg/dashboard/stage_tracker_hold_provenance_test.go index 6de7cf8f2a..e3741971a8 100644 --- a/src/pkg/dashboard/stage_tracker_hold_provenance_test.go +++ b/src/pkg/dashboard/stage_tracker_hold_provenance_test.go @@ -156,6 +156,8 @@ func TestStageTrackerHoldProvenanceJS(t *testing.T) { jsFunc(t, html, "stageTrackerDecisionOf"), jsFunc(t, html, "stageTrackerHoldPill"), jsFunc(t, html, "stageTrackerHoldTip"), + jsConstBlock(t, html, "STAGE_TRACKER_ICONS"), + jsFunc(t, html, "stageTrackerIcon"), jsFunc(t, html, "stageTrackerChipsHtml"), stageTrackerManualMergeJS(t, html), }, "\n")+` @@ -194,6 +196,7 @@ const running = { repo: 'hivecommons/hive', kind: 'pr', number: 17442, stage: 85 review_activity: { head: 'c0ffee1', state: 'human_decision', perspectives_done: 5, perspectives_total: 5 } }; const rpill = stageTrackerChipsHtml(running); assert.ok(rpill.includes('ham-mod-needs-decision') && rpill.includes('>needs human decision<'), rpill); +assert.ok(rpill.includes('ham-mod-ask') && rpill.includes('ham-mod-ico') && rpill.includes('needs human decision'), 'the ask pill wears the person icon with its words foldable: ' + rpill); assert.ok(rpill.includes('ham-decision-trigger') && rpill.includes('data-ham-decision="hivecommons/hive/pr#17442"'), rpill); assert.ok(!rpill.includes('+1'), 'one pill, not duplicated: ' + rpill); // The server already carrying the modifier adds nothing twice. diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 1729c446e8..c568480192 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -141,6 +141,8 @@ human decision" mid-pill grows a nested-PR row by a text line and a landscape phone loses its second row (hivecommons/hive#17453). */ .ham-head-cols .ham-badges > .ham-badge-mod.ham-mod-needs-decision { white-space: nowrap; } + .ham-badge-mod.ham-mod-ask { position: relative; } + .ham-badge-mod .ham-mod-ico { vertical-align: text-bottom; margin-right: var(--sp-1); } .ham-head-cols .ham-badge { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .ham-head-main { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: var(--sp-3); min-width: 0; } .ham-head-main > .ham-badge { flex: 0 1 auto; } @@ -993,6 +995,9 @@ .ham-head-cols .ham-strip > .ham-seg { grid-column: 1 / -1; grid-row: auto; padding: 0; } .ham-head-cols .ham-head-lead:empty { display: none; } .ham-head-cols > .ham-since { display: none; } + /* Stacked head: the ask pill is its person icon alone (#17453). */ + .ham-head-cols .ham-badges > .ham-badge-mod.ham-mod-ask > .ham-mod-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } + .ham-head-cols .ham-badges > .ham-badge-mod.ham-mod-ask > .ham-mod-ico { margin-right: 0; } .ham-row .ham-seg { padding: 0 var(--sp-2) 0 var(--sp-3); } .ham-row .ham-seg.cap { flex-basis: 2em; } .ham-since { width: 3em; } @@ -1225,7 +1230,7 @@ one-line box so a card row stays under the #17161 height budget; the hit area is padded out to the tap target like .ham-pill (#17453). */ #activity-monitor-section .ham-badge-mod.ham-decision-trigger { position: relative; } - #activity-monitor-section .ham-badge-mod.ham-decision-trigger::before { content: ""; position: absolute; inset: calc((1lh - var(--tap-target)) / 2) 0; } + #activity-monitor-section .ham-badge-mod.ham-decision-trigger::before { content: ""; position: absolute; inset: calc((1lh - var(--tap-target)) / 2) calc((100% - var(--tap-target)) / 2); } /* A card keeps its two-line head and its density (#17161): the 🗒 shows on a phone only once the item has notes; the row's ⋯ menu carries "Maintainer notes…" for the rest. */ 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 c04f750f6c..4ea3ce113a 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -1022,7 +1022,11 @@ // of a native tooltip. // A hive-set hold is a decision too (release or keep): its pill opens the same popover. const decision = (mods[0] === 'needs-human' || mods[0] === 'needs-decision' || decisionPR || (holdPill && item.hold && item.hold.by === 'hive')) && typeof stageTrackerDecisionOf === 'function' ? stageTrackerDecisionOf(item) : null; - if (decision) return sentinel + stageTrackerDecisionTriggerHtml(decision, inner, tip, 'ham-badge ham-badge-mod ' + cls); + // The ask pill wears the person icon; in the stacked head layout the + // words fold into the icon so a nested PR's title keeps its line and + // the popover / hover still carry the question (hivecommons/hive#17453). + const askIco = askable && typeof stageTrackerIcon === 'function' ? stageTrackerIcon('human', 'ham-ico ham-mod-ico') : ''; + if (decision) return sentinel + stageTrackerDecisionTriggerHtml(decision, askIco ? askIco + `${inner}` : inner, tip, 'ham-badge ham-badge-mod ' + cls + (askIco ? ' ham-mod-ask' : '')); // No popover to open (the ask is the issue's own while a covering // PR drives the strip): the pill is a button that reveals the row's // "Needs human: …" note line and carries the full reason as its hover. diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index d273db7253..22238192df 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1484,6 +1484,8 @@ human decision" mid-pill grows a nested-PR row by a text line and a landscape phone loses its second row (hivecommons/hive#17453). */ .ham-head-cols .ham-badges > .ham-badge-mod.ham-mod-needs-decision { white-space: nowrap; } + .ham-badge-mod.ham-mod-ask { position: relative; } + .ham-badge-mod .ham-mod-ico { vertical-align: text-bottom; margin-right: var(--sp-1); } .ham-head-cols .ham-badge { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; } .ham-head-main { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: var(--sp-3); min-width: 0; } .ham-head-main > .ham-badge { flex: 0 1 auto; } @@ -2336,6 +2338,9 @@ .ham-head-cols .ham-strip > .ham-seg { grid-column: 1 / -1; grid-row: auto; padding: 0; } .ham-head-cols .ham-head-lead:empty { display: none; } .ham-head-cols > .ham-since { display: none; } + /* Stacked head: the ask pill is its person icon alone (#17453). */ + .ham-head-cols .ham-badges > .ham-badge-mod.ham-mod-ask > .ham-mod-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } + .ham-head-cols .ham-badges > .ham-badge-mod.ham-mod-ask > .ham-mod-ico { margin-right: 0; } .ham-row .ham-seg { padding: 0 var(--sp-2) 0 var(--sp-3); } .ham-row .ham-seg.cap { flex-basis: 2em; } .ham-since { width: 3em; } @@ -2568,7 +2573,7 @@ one-line box so a card row stays under the #17161 height budget; the hit area is padded out to the tap target like .ham-pill (#17453). */ #activity-monitor-section .ham-badge-mod.ham-decision-trigger { position: relative; } - #activity-monitor-section .ham-badge-mod.ham-decision-trigger::before { content: ""; position: absolute; inset: calc((1lh - var(--tap-target)) / 2) 0; } + #activity-monitor-section .ham-badge-mod.ham-decision-trigger::before { content: ""; position: absolute; inset: calc((1lh - var(--tap-target)) / 2) calc((100% - var(--tap-target)) / 2); } /* A card keeps its two-line head and its density (#17161): the 🗒 shows on a phone only once the item has notes; the row's ⋯ menu carries "Maintainer notes…" for the rest. */ @@ -19468,7 +19473,11 @@

    Where to get help

    // of a native tooltip. // A hive-set hold is a decision too (release or keep): its pill opens the same popover. const decision = (mods[0] === 'needs-human' || mods[0] === 'needs-decision' || decisionPR || (holdPill && item.hold && item.hold.by === 'hive')) && typeof stageTrackerDecisionOf === 'function' ? stageTrackerDecisionOf(item) : null; - if (decision) return sentinel + stageTrackerDecisionTriggerHtml(decision, inner, tip, 'ham-badge ham-badge-mod ' + cls); + // The ask pill wears the person icon; in the stacked head layout the + // words fold into the icon so a nested PR's title keeps its line and + // the popover / hover still carry the question (hivecommons/hive#17453). + const askIco = askable && typeof stageTrackerIcon === 'function' ? stageTrackerIcon('human', 'ham-ico ham-mod-ico') : ''; + if (decision) return sentinel + stageTrackerDecisionTriggerHtml(decision, askIco ? askIco + `${inner}` : inner, tip, 'ham-badge ham-badge-mod ' + cls + (askIco ? ' ham-mod-ask' : '')); // No popover to open (the ask is the issue's own while a covering // PR drives the strip): the pill is a button that reveals the row's // "Needs human: …" note line and carries the full reason as its hover. From 091be5a9d5497e46b1eed977eb4aa566d9ff08af Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Mon, 9 Nov 2026 17:17:37 -0700 Subject: [PATCH 6/6] test(dashboard): track the ask pill's trigger call in the popover source guard Signed-off-by: Andrew Anderson --- src/pkg/dashboard/stage_tracker_decision_popover_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/dashboard/stage_tracker_decision_popover_test.go b/src/pkg/dashboard/stage_tracker_decision_popover_test.go index 8ef140c234..3b1f6c75c2 100644 --- a/src/pkg/dashboard/stage_tracker_decision_popover_test.go +++ b/src/pkg/dashboard/stage_tracker_decision_popover_test.go @@ -155,7 +155,7 @@ func TestStageTrackerDecisionPopoverTriggersInRow(t *testing.T) { `typeof stageTrackerDecisionOf === 'function' ? stageTrackerDecisionOf(item) : null`, `stageTrackerDecisionTriggerHtml(decision, caption, fullTip)`, `if (typeof hideConfigTooltip === 'function') hideConfigTooltip();`, - `stageTrackerDecisionTriggerHtml(decision, inner, tip, 'ham-badge ham-badge-mod ' + cls)`, + `stageTrackerDecisionTriggerHtml(decision, askIco ? askIco + ` + "`${inner}`" + ` : inner, tip, 'ham-badge ham-badge-mod ' + cls + (askIco ? ' ham-mod-ask' : ''))`, `${decision ? '' : ` + "` title=\"${esc(tip)}\"`" + `}`, `if (typeof stageTrackerWireDecisionPop === 'function') stageTrackerWireDecisionPop(el);`, `decision_needed: lp.decision_needed || null`,