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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-tracker-actor-icon-dedupe-counter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Hive Activity Monitor: every lit stage pill now draws its actor icon from a server-derived `stage_actor` (hive ⬑, contributor clanker, human, bot cog, or none with a "no one is working on this right now β€” why" tooltip) instead of guessing from the author; a bot-authored or unowned red PR reads "Conflicting Β· bot PR" / "Red Β· nobody on it" instead of an active "Fixing"; a PR closing several open issues is drawn once (`drawn_under`) with a "↳ #N Β· under #M" chip on the other issues; and the "Merged today" counter sits directly above the Merge gate / βœ“ column header so the merge token's flight ends above the gate.
6 changes: 5 additions & 1 deletion src/docs/dashboard-sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,11 @@ Fed by `GET /api/stage-tracker`. Every issue and pull request follows the same p

**Confirmations and "Don't ask again".** Each confirm dialog a row action raises β€” Approve (including a sentinel-flagged head: *⚠ Sentinel flagged security-relevant changes at 40a959b …*), Let hive decide, Close as superseded / won't-fix, Mark needs-human and the rest β€” carries a **Don't ask again for this action** box. Ticking it and confirming stores `hive.tracker.confirm.<action>=skip` in this browser's `localStorage` (one key per action id, e.g. `hive.tracker.confirm.decide:delegate`); later clicks on that action run at once. Nothing the dialog would have said is lost: the result toast carries the same ⚠ sentinel line (it is per head, so skipping the confirm never skips the warning) and the one-line item summary. Actions that need your text (*Give direction…*, *Send back…*, the superseder picker) always ask. The βš™ settings dialog's **Confirmations** section lists which actions are skipped and has one **Reset confirmations** button that turns them all back on.

**Merged today.** The toolbar's right end shows a small hex glyph with **Merged today: N** β€” pull requests the hive saw merge since your local midnight (seeded after a reload from the tracker payload's `merged_24h` list, the audit log's `pr_merged` entries over the last 24 hours, and grown live by the same merge detector that plays the zap); hovering lists the last five with their times. When a PR on the list merges its row does **not** simply vanish on the next refresh: it stays pinned for about 2.5 s, its βœ“ cell glows amber, the event line reads *Hive: merged #14947 Β· by hive*, a flat brand-amber hex token lifts out of the βœ“ cell and arcs (β‰ˆ0.5 s) to the counter, which ticks up with a soft scale-pop β€” the merge zap, when sound is on, plays as the token lands β€” and then the row takes its normal exit. Several merges in one refresh stagger 200 ms apart with at most three tokens in flight (the rest tick the count without flying); a merged PR that is filtered out or on another page still counts. Under reduced motion nothing flies: the count ticks and the row glows. A PR drawn inline on its issue's row (the usual case β€” one covering PR, no sub-row) celebrates on that issue row: every row stamps the PR keys it draws (`data-ham-prs`) and the SPA remembers each PR's host row from the last payload, so the flight has somewhere to start from even when the merge also closes the issue. The βš™ dialog's **Merges** section has **Celebrate merges** (default on, `hive.tracker.celebrate`); off, the row leaves as before and the zap plays at once. **Test celebration** beside it plays one flight from the first row of the list to the counter (pop and zap, the count unchanged) so the effect can be checked without waiting for a merge; under reduced motion it says so and only pops. The row effect is reusable in the SPA as `celebrateRow(rowEl, {kind: 'merged' | 'closed-by-merge'})`.
**Who is on it (actor icons).** The small icon after the lit pill's words names whose move the row is, and it comes from the payload β€” `stage_actor: {kind, login, since, why}`, derived server-side for every item and every nested PR β€” never from a guess on a login string. `kind` is one of **hive** (⬑ honeycomb: a hive lane or agent acts next; `login` is the agent when one is on it right now), **clanker** (robot head: a registered contributor agent must push), **human** (the person glyph the *Needs human decision* pill uses: the author, approver or a maintainer must act; `login` names them when known), **bot** (cog: a non-hive automation account such as `github-actions[bot]` or renovate authored the PR; the hive does not fix bot PRs, it waits for the bot's next run), or **none** (no icon: nobody is working on it β€” the pill's tooltip then reads *no one is working on this right now β€” <why>*). `why` is a short sentence the tooltip appends after *Next move: <kind> @<login>*. A `070` Fixing pill is only shown as **Fixing** when someone can fix it; a bot-authored or unowned red PR reads its state in plain words instead β€” **Conflicting Β· bot PR**, **Red Β· nobody on it** β€” with the matching icon, so a row such as hivecommons/docs#500 (a nightly resync PR that conflicts with its base) no longer looks like active hive work. Issues riding one covering PR take that PR's actor; nested PR sub-rows carry their own.

**One row per PR.** A pull request that closes several open issues (`Closes #A` and `Closes #B`) is drawn once, under the issue the server names in each linked entry's `drawn_under` (its `nested_under`, the lowest-numbered open issue it closes). The other issues keep their own strip and show a compact **↳ #N Β· under #M** chip beside the title (tooltip: *PR #N covers this issue too; its row is drawn under #M*) instead of a second identical sub-row, so hivecommons/hive#14921 appears once under #14910 and #14911 points at it. Payloads without `drawn_under` draw as before.

**Merged today.** The column header carries, directly above the **Merge gate** and βœ“ columns (right-aligned over the gate, never in the filter chip bar, so it stays put however the toolbar wraps), a small hex glyph with **Merged today: N** β€” pull requests the hive saw merge since your local midnight (seeded after a reload from the tracker payload's `merged_24h` list, the audit log's `pr_merged` entries over the last 24 hours, and grown live by the same merge detector that plays the zap); hovering lists the last five with their times. When a PR on the list merges its row does **not** simply vanish on the next refresh: it stays pinned for about 2.5 s, its βœ“ cell glows amber, the event line reads *Hive: merged #14947 Β· by hive*, a flat brand-amber hex token lifts out of the βœ“ cell and arcs (β‰ˆ0.5 s) straight up the gate column to the counter above it β€” into the hive β€” which ticks up with a soft scale-pop β€” the merge zap, when sound is on, plays as the token lands β€” and then the row takes its normal exit. Several merges in one refresh stagger 200 ms apart with at most three tokens in flight (the rest tick the count without flying); a merged PR that is filtered out or on another page still counts. Under reduced motion nothing flies: the count ticks and the row glows. A PR drawn inline on its issue's row (the usual case β€” one covering PR, no sub-row) celebrates on that issue row: every row stamps the PR keys it draws (`data-ham-prs`) and the SPA remembers each PR's host row from the last payload, so the flight has somewhere to start from even when the merge also closes the issue. The βš™ dialog's **Merges** section has **Celebrate merges** (default on, `hive.tracker.celebrate`); off, the row leaves as before and the zap plays at once. **Test celebration** beside it plays one flight from the first row of the list to the counter (pop and zap, the count unchanged) so the effect can be checked without waiting for a merge; under reduced motion it says so and only pops. The row effect is reusable in the SPA as `celebrateRow(rowEl, {kind: 'merged' | 'closed-by-merge'})`; the counter is one DOM node (`#activity-monitor-merged`) that the renderer mounts into the header slot after each refresh and parks in its toolbar home while the board is empty, so the token always targets wherever it currently sits.

**Multi-select.** The checkbox in a row's left gutter selects the row β€” and the checkbox in a nested PR sub-row's gutter selects that PR on its own, so one or more PRs under an issue can be picked without the issue or each other; **Shift+click** selects the range from the last clicked row (sub-rows are in the range order right after their issue), **Cmd/Ctrl+click** toggles, **Cmd/Ctrl+Shift+click** adds a range to what is selected; with a row focused, **Space** toggles it (Shift+Space extends). Cmd/Ctrl- or Shift-clicking the row itself, away from its links, selects it too. A selection bar appears above the list with the count, **Clear**, and the same actions for the whole selection β€” *Decide…* (opens the group as a menu, *Let hive decide* first β€” each selected row gets its own delegated-decision job, see below), **Let hive decide (N selected)** (one click for the whole selection: one delegated-decision job per selected item, each nested PR sub-row by its own number, with one summary toast β€” "3 sent Β· 2 decided Β· 1 no-op", plus "Β· 1 failed" when any failed β€” and the per-action confirm / *Don't ask again* of *Let hive decide*), *Hold*, *Release hold*, *Re-evaluate now*, *Mark needs-human…*, *Copy links* β€” each enabled only when it is valid for every selected row and otherwise greyed with the first reason ("Not applicable to acme/console#12", "Sign in with write access…"). Right-clicking a selected row acts on the whole selection. Bulk actions run one request per row, in list order, under a progress toast ("Hold 2/5 β€” acme/console#12…"); the result toast lists each failure by row and the successes stand, after which the list and the status snapshot refresh (a hive-wide rescan is sent once per batch). Selection is keyed on the row's item (repository, kind, number), not its node, so the live re-render keeps it; a row that leaves the list β€” merged, closed, filtered or paged out β€” leaves the selection.

Expand Down
45 changes: 44 additions & 1 deletion src/pkg/dashboard/stage_tracker.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package dashboard

import (
Expand Down Expand Up @@ -415,7 +415,12 @@
// ClaimantKind is the author kind of whoever holds the live claim on a
// claimed issue (human / clanker / hive), from the worker-claim ledger.
ClaimantKind string `json:"claimant_kind,omitempty"`
LinkedPR int `json:"linked_pr,omitempty"`
// StageActor is who holds the next move on this row β€” hive, clanker,
// human, a foreign bot, or nobody β€” with the plain-words why. The SPA
// draws the stage pill's actor icon from StageActor.Kind only
// (stage_tracker_actor.go).
StageActor *StageTrackerActor `json:"stage_actor,omitempty"`
LinkedPR int `json:"linked_pr,omitempty"`
// LinkedPRs lists the open pull requests covering an issue (the one
// named in the stage reason first) with everything the tracker needs
// to draw each as a sub-row nested under the issue.
Expand Down Expand Up @@ -516,6 +521,16 @@
OperatorActionCount int `json:"operator_action_count,omitempty"`
// Hold mirrors the nested PR's own row field (hivecommons/hive#15020).
Hold *StageTrackerHold `json:"hold,omitempty"`
// StageActor mirrors the nested PR's own row field so the sub-row's
// pill wears the same actor icon.
StageActor *StageTrackerActor `json:"stage_actor,omitempty"`
// DrawnUnder is the issue whose row draws this PR's full sub-row (the
// PR's NestedUnder). A PR that closes several open issues (`Closes
// #14910` and `Closes #14911` in one body) is listed by each of them,
// but its live strip is drawn once, under this issue; every other
// parent shows a compact "↳ #N Β· under #M" reference instead of a
// second identical row (hivecommons/hive#14921 drew twice).
DrawnUnder int `json:"drawn_under,omitempty"`
}

// StageTrackerHold is the row's hold provenance (stagelabels.HoldProvenance
Expand Down Expand Up @@ -1632,6 +1647,7 @@
}
presence, maintainerPolicy := s.stageTrackerPresence(), s.stageTrackerMaintainerPolicy()
sweep := s.stageTrackerSweepState()
workers := stageTrackerWorkersFromStatus(status)
finish := func(it *StageTrackerItem, labels []string, stage stagelabels.Stage, rec stagelabels.Record, hasRec bool, draft bool) {
// "Needs human decision" is read from the item's current labels, not
// a store record that outlived them: once the park label is gone
Expand Down Expand Up @@ -1712,6 +1728,11 @@
if slices.Contains(it.Modifiers, modUnauthorized) || slices.Contains(it.DeferredModifiers, modUnauthorized) {
it.UnauthorizedStep, it.Unauthorized = stageTrackerUnauthorized(it.Reason)
}
// A foreign bot's PR the lane filed under 070: nobody in the hive
// is fixing it, and the caption must not claim so.
if stage == stagelabels.Fixing && it.Kind == "pr" && stageTrackerBotAuthor(it.Author, it.AuthorKind) {
it.Caption, it.Actor = stageTrackerBotFixingCaption(*it), StageActorBot
}
it.History = stageTrackerHistory(rec)
}
seen := map[string]bool{}
Expand Down Expand Up @@ -1787,6 +1808,7 @@
}
}
it.DecisionNeeded = stageTrackerDecisionNeededAt(it, nil, sentinelLabel, now)
it.StageActor = stageTrackerStageActor(it, workers, now)
add(it)
}
addPR := func(repoName string, pr github.PullRequest, verdict *github.MergeVerdict, bucket, bucketReason string) {
Expand Down Expand Up @@ -1837,12 +1859,19 @@
it.Caption += ": " + info.KeepReason
}
it.Actor = "maintainer"
if it.Stage == trackerNumberFixing && stageTrackerBotAuthor(it.Author, it.AuthorKind) {
// docs#500: a conflicting bot PR already replaced by a
// merged one is not a maintainer's decision to make; the
// bot's next run supersedes it (hivecommons/docs#500).
it.Caption, it.Actor = stageTrackerBotFixingCaption(it), StageActorBot
}
}
var agg *review.Aggregate
if a, ok := verdictFor(repoName, pr.Number, pr.HeadSHA); ok {
agg = &a
}
it.DecisionNeeded = stageTrackerDecisionNeededAt(it, agg, sentinelLabel, now)
it.StageActor = stageTrackerStageActor(it, workers, now)
add(it)
}
for _, repo := range status.Repos {
Expand Down Expand Up @@ -1874,6 +1903,7 @@
s.applyOperatorActions(resp.Items, now)
resp.NeedsHuman, resp.OnHold = stageTrackerHumanCounts(resp.Items)
stageTrackerResolveLinkedPRs(resp.Items)
stageTrackerResolveActors(resp.Items)
sort.SliceStable(resp.Items, stageTrackerLess(resp.Items))
return resp
}
Expand Down Expand Up @@ -2637,6 +2667,19 @@
}
it.LinkedPRs = out
}
// NestedUnder is final only once every issue has been read; name it on
// each listing so the SPA draws the PR's strip under one parent only.
for i := range items {
it := &items[i]
if it.Kind != "issue" {
continue
}
for j := range it.LinkedPRs {
if pr := prs[it.Repo+"#"+strconv.Itoa(it.LinkedPRs[j].Number)]; pr != nil {
it.LinkedPRs[j].DrawnUnder = pr.NestedUnder
}
}
}
for i := range items {
if items[i].Kind == "pr" {
items[i].ClosedIssue = stageTrackerClosedIssueAnchor(items[i])
Expand Down
Loading
Loading