diff --git a/changelog.d/fixed-offline-clanker-pr-in-progress.md b/changelog.d/fixed-offline-clanker-pr-in-progress.md new file mode 100644 index 0000000000..7d5afe3ded --- /dev/null +++ b/changelog.d/fixed-offline-clanker-pr-in-progress.md @@ -0,0 +1 @@ +- Activity monitor: a contributor PR whose `stage/*` labels the write-back gate kept off GitHub (fork PR, no opt-in label) no longer reads as an unclassified "PR in progress · @x's clanker" when the stage engine holds it at `stage/085`: the stage record carries `labels_suppressed` and the tracker trusts it instead of treating the missing park label as a lifted park. An unclassified clanker PR now carries its author's `presence`; when the clanker is offline the chevron reads `PR in progress · @x's clanker · ■ offline 3h` and the caption names the next automatic step (a green PR is reviewed and merged without its author; hive adopts only once it is returned and nothing is pushed for `adoption.after_offline`). Human-authored PRs are unchanged and never adopted. diff --git a/src/docs/dashboard-copy-inventory.md b/src/docs/dashboard-copy-inventory.md index 6ec7793fdc..90b9f2e288 100644 --- a/src/docs/dashboard-copy-inventory.md +++ b/src/docs/dashboard-copy-inventory.md @@ -68,6 +68,7 @@ The new hover, verbatim (title line omitted): | `stageTrackerLeadActionHtml` (`tracker-actions.js`) | the row header's inline lead button (chip slot) | — (the lead sat in the ⋯ menu only) | the menu entry's label (1–4), its hint as the hover | `TestStageTrackerLeadActionInline`, `TestStageTrackerMaintainerRowsHaveLeadAction` | | Toasts (`STAGE_TRACKER_ACTING_CAPTIONS`, acted labels) | toast | 2–4 each | unchanged | — | | `stageTrackerStripItems` holder token + `stageTrackerClaimantIconKind` (`tracker-row.js`) on the PR in progress chevron ([#15541](https://github.com/hivecommons/hive/issues/15541)) | lit chevron word, chevron hover | *PR in progress* (bare; the holder token only reached PRs from review on) | *PR in progress · scanner ⬡*, *PR in progress · @odttlnt's clanker 🤖*, *PR in progress · @clubanderson 👤* — the same token and hover line as *Claimed ·*; the name ellipsizes before the one-line sub-row wraps; a detour word that already names them (*Returned to @bob's clanker*) does not repeat them | `TestStageTrackerClaimantChevronJS`, `TestStageTrackerPRClaimant`, `TestStageTrackerClaimantStage` | +| `stageTrackerHolderPresenceHtml` (`tracker-words.js`) after the holder token; `stageTrackerOfflineAuthorCaption` + `stageTrackerWaitingOn` at stage None (Go) | lit chevron holder suffix, chevron hover, row caption | *PR in progress · @odttlnt's clanker 🤖* (no live state; a fork PR the gate kept label-less read as unclassified even when the engine held it at 085) | *PR in progress · @odttlnt's clanker 🤖 · ■ offline 3h* (muted; *· ○ not registered* for a login with no profile here; nothing when online); caption "@odttlnt's clanker is offline 3h; a green PR is reviewed and merged without its author — hive adopts it only once it is returned (red CI, conflicts or review asks) and nothing is pushed for 15m"; a suppressed-label 085 record keeps *Needs human decision* | `TestStageTrackerHolderPresenceJS`, `TestStageTrackerUnclassifiedClankerPROfflineCaption`, `TestStageTrackerSuppressedDecisionRecordKeepsStage` | | `stageTrackerLinkedPRProgress` (Go) + `stageTrackerEventText` / `stageTrackerNestedOpenPRs` (`tracker-motion.js`, `tracker-row.js`) on an adoption pair ([#15495](https://github.com/hivecommons/hive/issues/15495)) | issue row caption, feed line, inline lead button | *fell back to Covered by pr — Covered by PR #15537 — Review swarm requested; … ; PR #15508 — Hive adopted this PR … — changes requested* (48) and a *Let hive decide — all 2 PRs* lead on a row with nothing to decide | *Covered by #15537 (adopted from @mendezr's #15508) — in CI / review* (11); the feed says *moved to* when an issue stops mirroring its PR; the pair counts as one open PR so no lead button | `TestStageTrackerLinkedPRProgressCollapsesAdoptionPair`, `TestStageTrackerAdoptionPairIsOneOpenPR`, `TestStageTrackerEventTextUnmirroredCoveredByPR` | | `stageTrackerSelectionTriage` (`tracker-actions.js`) | selection bar lead button / bulk ⋯ menu entry, summary toast | — (no bulk Accept triage; one row at a time) | *Accept triage (4 selected)* / *Accept triage (2 of 4)* with the hint *skips the 2 not waiting on triage*; one toast *Accepted 4 issues* | `TestStageTrackerBulkAcceptTriage` | | Settings → Features → Auto-merge → "Merge only on current base" help (`renderGovFeatures`, `config-features.js`) and the Repos-tab override row / repo-card `current-base` chip ([#15335](https://github.com/hivecommons/hive/issues/15335)) | settingHelpMark popover, checkbox label, chip hover | — (new) | 56 (help), 5 (row label), 1 (chip) | `TestCurrentBaseSettingsMarkupNodeGuard` | diff --git a/src/docs/dashboard-sections.md b/src/docs/dashboard-sections.md index 0afdfcde94..b556f8c7fc 100644 --- a/src/docs/dashboard-sections.md +++ b/src/docs/dashboard-sections.md @@ -987,6 +987,10 @@ Shape, not colour alone, carries the state; the indicator has its own `aria-labe It refreshes with the tracker like every other pill. +**An offline clanker's PR that has not been returned.** A clanker-authored PR the engine has not classified yet (the chevron reads `PR in progress · @odttlnt's clanker`) carries the same `presence` for its author, with `next: wait` and no `adopt_at` — the adoption clock runs only at 072. When the clanker is offline (or not registered here) the chevron's holder gains a muted suffix with the state square: `PR in progress · @odttlnt's clanker · ■ offline 3h`, and the caption states the next automatic step: "@odttlnt's clanker is offline 3h; a green PR is reviewed and merged without its author — hive adopts it only once it is returned (red CI, conflicts or review asks) and nothing is pushed for 15m" (`governor.labels.stage.adoption.after_offline`). A green PR does not need its author online: review and merge admission run on the contributor lane regardless; adoption is the exit for a PR that is red, conflicting or asked to change while its clanker is away, never for a green one, and never for a human's PR. + +A contributor PR whose `stage/*` labels the write-back gate kept off GitHub (no opt-in label, see [What hive writes to GitHub, and when](operator-reference.md#what-hive-writes-to-github-and-when)) is tracked from the engine's record alone: the record carries `labels_suppressed` and the tracker trusts its stage (085 reads *Needs human decision*, not *PR in progress*) even though the item's labels say nothing. Until this fix the tracker read the missing park label as a lifted park and dropped the record, so a dozen fork PRs parked at 085 for a human's decision sat under "PR in progress · @x's clanker" for hours while their clankers were offline. + #### Rework pickup on the waiting-on pill **Rework pickup on the waiting-on pill.** The same 071 / 072 rows also carry `rework{state: requested|acknowledged|in_progress|pushed, actor, requested_at, since, evidence: queued|claim|activity|commit, mode, ahead, head}` — whether the person the row waits on has picked up the rework the hive (or a human reviewer) asked for ([hivecommons/hive#15280](https://github.com/hivecommons/hive/issues/15280): "waiting on @x" said who, never whether anything had happened since). It is derived from data the tracker already holds, no extra GitHub calls: `requested_at` is the first nudge the contributor engine recorded on the current head (`stage/072`) or, before any nudge, when the row entered the stage (`stage/071` after a human's changes-requested review); **pushed** when the PR's head is no longer the head the request named (`evidence: commit` — the stage engine routes the row back to `050` on its next sweep, the pill says `re-review pending` meanwhile); **in_progress** when the author's clanker relay — or, after a Reroute, the target's — has taken the `fix-pr` task from the contributor fix queue (`evidence: claim`, `mode` spawn/preempt/boundary, `since` the dispatch); **acknowledged** when the PR's `updated_at` moved after the request and after the hive's own nudge comment (`evidence: activity` — a reply, a review-thread answer, an edit; reactions do not bump it, so an 👀 alone is not seen); otherwise **requested**, with `evidence: queued` and `ahead` when the fix is enqueued on the clanker's hub queue but not yet dispatched. The pill appends the state after the login — `waiting on @x · no response`, `· queued`, `· acknowledged`, `· working`, `· re-review pending` — and its tooltip (and the row tooltip's `Rework:` line) says since when: "rework requested 1 hour ago (13:32 UTC) · no response from @x yet", "@x acknowledged · activity on the PR 20 min ago", "@x's clanker picked up the rework 5 min ago (spawn)", "@x pushed a new head 1 min ago · re-review pending". A state change at an unchanged stage writes the row's event line ("@x acknowledged the rework request", "@x's clanker picked up the rework", "@x pushed a new head — re-review pending"). The presence indicator stays; a nested per-PR row under an issue mirrors the field. diff --git a/src/pkg/dashboard/stage_tracker.go b/src/pkg/dashboard/stage_tracker.go index bfe7e63e68..1697897eab 100644 --- a/src/pkg/dashboard/stage_tracker.go +++ b/src/pkg/dashboard/stage_tracker.go @@ -1963,11 +1963,18 @@ func (s *Server) stageDwellOverrides() map[string]time.Duration { // 045/085 while its current labels carry no park signal at all — no stage // label for the bay, no `needs-human`, no retired needs-decision spelling. // The labels are the newer fact: the park lifted and the record is waiting -// on the engine's next reconcile. +// on the engine's next reconcile. Not so when the write-back gate kept the +// labels off the item (a contributor PR without the opt-in label): the +// labels never carried the park, the record is the only stage there is, +// and dropping it read the row as an unclassified "PR in progress" for +// hours while the engine held it at 085. func stageTrackerStaleDecisionRecord(rec stagelabels.Record, labels []string) bool { if rec.Stage != stagelabels.NeedsDecision && rec.Stage != stagelabels.IssueNeedsDecision { return false } + if rec.LabelsSuppressed { + return false + } for _, l := range labels { switch strings.ToLower(strings.TrimSpace(l)) { case needsDecisionLabel, prNeedsDecisionLabel, "needs-decision", "needs-human", "needs-direction": @@ -2310,6 +2317,9 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto it.Caption = stageTrackerReturnedToHiveCaption(it.Caption, it.Author, requesters) } applyStageTrackerNew(&it, stageTrackerNewState(it, ok, issueFilter, status.Governor, now)) + // After the New caption: an unclassified clanker PR whose clanker + // is offline says what that means for it. + it.Caption = stageTrackerOfflineAuthorCaption(it.Caption, it.Presence, it.Stage, adoptionClock, now) it.SentinelAlert, it.SentinelFindings, it.SentinelReason = s.stageTrackerSentinel(evidenceVerifier, repoName, pr.Number, pr.HeadSHA, pr.Labels) // The sentinel chip is a merge-gate pill too (the trusted-author // notice and the real alert alike): sentinel_alert stays truthful diff --git a/src/pkg/dashboard/stage_tracker_offline_clanker_test.go b/src/pkg/dashboard/stage_tracker_offline_clanker_test.go new file mode 100644 index 0000000000..7856451eae --- /dev/null +++ b/src/pkg/dashboard/stage_tracker_offline_clanker_test.go @@ -0,0 +1,139 @@ +package dashboard + +import ( + "strings" + "testing" + "time" + + "github.com/hivecommons/hive/pkg/config" + "github.com/hivecommons/hive/pkg/github" + "github.com/hivecommons/hive/pkg/github/automerge" + "github.com/hivecommons/hive/pkg/stagelabels" +) + +// An offline clanker's PRs sat at "PR in progress · @odttlnt's clanker" +// for hours while the engine held them at 085: the write-back gate kept the +// stage label off the fork PR, and the tracker read the label-less item as +// a lifted park and dropped the record. The record now says the labels +// were suppressed and the row keeps its stage; an unclassified clanker PR +// carries its author's presence and a caption naming the next automatic +// step. + +func offlineClankerFixture(t *testing.T, now time.Time, lastSeen time.Time) (*Server, *stagelabels.Store, *StatusPayload) { + t.Helper() + s := newTestServer() + store := stagelabels.NewStore("", func() time.Time { return now }) + s.stageStore = store + s.presenceLookup = func(login string) (automerge.ContributorPresence, bool) { + if login != "odttlnt" { + return automerge.ContributorPresence{}, false + } + return automerge.ContributorPresence{Registered: true, Online: false, LastSeen: lastSeen}, true + } + s.deps = &Dependencies{Config: &config.Config{}} + status := minimalPayload() + status.HiveID = "hive" + status.Repos = []FrontendRepo{{ + Name: "hive", Full: "hivecommons/hive", + OpenPrs: []any{ + FrontendPR{PullRequest: github.PullRequest{Number: 15312, Title: "Decision asked", Author: "odttlnt", HeadSHA: "036b", Labels: []string{"dco-signoff: yes", "size/M", "author/clanker"}}}, + FrontendPR{PullRequest: github.PullRequest{Number: 15343, Title: "Unclassified", Author: "odttlnt", HeadSHA: "d15e", Labels: []string{"dco-signoff: yes", "author/clanker"}}}, + FrontendPR{PullRequest: github.PullRequest{Number: 15400, Title: "Human's PR", Author: "zoe", HeadSHA: "aaaa", Labels: []string{"author/human"}}}, + }, + }} + s.UpdateStatus(status) + return s, store, status +} + +// A 085 record whose labels the gate suppressed is the row's stage. +func TestStageTrackerSuppressedDecisionRecordKeepsStage(t *testing.T) { + now := time.Date(2026, 10, 29, 20, 30, 0, 0, time.UTC) + s, store, status := offlineClankerFixture(t, now, now.Add(-3*time.Hour)) + key := stagelabels.Key("hivecommons/hive", 15312) + store.Observe(key, stagelabels.NeedsDecision, "contributor-lane:decision-requested") + store.NoteLabelsSuppressed(key, true) + it := trackerItem(t, s.buildStageTracker(status, store, now), "pr", 15312) + if it.Stage != stagelabels.NeedsDecision.Number() || it.StageSince == nil { + t.Fatalf("suppressed 085 record: stage %d since %v caption %q, want 085 from the record", it.Stage, it.StageSince, it.Caption) + } + if it.Presence != nil { + t.Fatalf("a row waiting on a person's decision carries no author presence: %+v", it.Presence) + } + // The same record with the label write landed and then removed is a + // lifted park, as before. + store.NoteLabelsSuppressed(key, false) + if it := trackerItem(t, s.buildStageTracker(status, store, now), "pr", 15312); it.Stage == stagelabels.NeedsDecision.Number() { + t.Fatalf("label-less 085 record with labels not suppressed still parks the row: %+v", it) + } +} + +// An unclassified clanker PR carries its author's presence and the +// caption says what the offline clanker means for it; a human's does not. +func TestStageTrackerUnclassifiedClankerPROfflineCaption(t *testing.T) { + now := time.Date(2026, 10, 29, 20, 30, 0, 0, time.UTC) + s, store, status := offlineClankerFixture(t, now, now.Add(-3*time.Hour)) + on, off := true, false + s.deps.Config.Governor.Labels.Stage.Adoption.Enabled = &on + tr := s.buildStageTracker(status, store, now) + it := trackerItem(t, tr, "pr", 15343) + if it.Stage != 0 { + t.Fatalf("stage = %d, want unclassified", it.Stage) + } + p := it.Presence + if p == nil || p.Login != "odttlnt" || p.State != presenceStateOffline || p.Kind != presenceKindClanker || p.Next != presenceNextWait || p.AdoptAt != nil { + t.Fatalf("presence = %+v, want offline clanker, next wait, no adopt-at (the clock runs at 072 only)", p) + } + if p.LastSeen == nil || !p.LastSeen.Equal(now.Add(-3*time.Hour)) { + t.Fatalf("last_seen = %v", p.LastSeen) + } + for _, want := range []string{"waiting for the stage-label pass", "@odttlnt's clanker is offline 3h", "reviewed and merged without its author", "hive adopts it only once it is returned", "nothing is pushed for 15m"} { + if !strings.Contains(it.Caption, want) { + t.Errorf("caption lacks %q: %s", want, it.Caption) + } + } + if h := trackerItem(t, tr, "pr", 15400); h.Presence != nil || strings.Contains(h.Caption, "clanker") { + t.Fatalf("human's unclassified PR = presence %+v caption %q, want neither", h.Presence, h.Caption) + } + // Adoption off: no promise about adopting. + s.deps.Config.Governor.Labels.Stage.Adoption.Enabled = &off + if c := trackerItem(t, s.buildStageTracker(status, store, now), "pr", 15343).Caption; strings.Contains(c, "adopts") || !strings.Contains(c, "offline 3h") { + t.Fatalf("adoption off caption = %q", c) + } +} + +// The chevron's holder gains the clanker's offline state and the title +// carries the next step (node, lifted from index.html). +func TestStageTrackerHolderPresenceJS(t *testing.T) { + html := indexHTML(t) + script := strings.Join([]string{ + stageTrackerRowActionsPreamble(t, html), + stageTrackerPresenceJS(t, html), + jsFunc(t, html, "stageTrackerHolderPresenceHtml"), + ` +const NOW = Date.parse('2026-10-30T00:30:00Z'); +Date.now = () => NOW; +const iso = ms => new Date(ms).toISOString(); +const HOUR = 3600000; +const claimant = { kind: 'clanker', login: 'odttlnt', source: 'author' }; +const offline = { kind: 'pr', repo: 'hivecommons/hive', number: 15343, stage: 0, author: 'odttlnt', author_kind: 'clanker', claimant, + presence: { login: 'odttlnt', state: 'offline', kind: 'clanker', since: iso(NOW - 7 * HOUR), last_seen: iso(NOW - 3 * HOUR), next: 'wait' } }; +const h = stageTrackerHolderPresenceHtml(offline, claimant, NOW); +assert.ok(/^ · <\/i>offline 3h<\/span>$/.test(h), h); +// Online: nothing to flag. Another holder: not theirs. Human: no presence. Unregistered: said so. +assert.strictEqual(stageTrackerHolderPresenceHtml(Object.assign({}, offline, { presence: Object.assign({}, offline.presence, { state: 'online' }) }), claimant, NOW), ''); +assert.strictEqual(stageTrackerHolderPresenceHtml(offline, { kind: 'clanker', login: 'karibhou' }, NOW), ''); +assert.strictEqual(stageTrackerHolderPresenceHtml(offline, { kind: 'person', login: 'odttlnt' }, NOW), ''); +assert.ok(stageTrackerHolderPresenceHtml(Object.assign({}, offline, { presence: Object.assign({}, offline.presence, { state: 'unknown' }) }), claimant, NOW).includes('>not registered')); +assert.strictEqual(stageTrackerHolderPresenceHtml({ kind: 'pr', stage: 0 }, claimant, NOW), ''); +`, + }, "\n") + runStageTrackerRowActionsScript(t, script) + for _, want := range []string{ + "stageTrackerHolderPresenceHtml(item, claimant, nowMs)", + ".ham-holder-presence {", + } { + if !strings.Contains(html, want) { + t.Errorf("index.html lacks %q", want) + } + } +} diff --git a/src/pkg/dashboard/stage_tracker_presence.go b/src/pkg/dashboard/stage_tracker_presence.go index 6deeba6a11..322bca0aa0 100644 --- a/src/pkg/dashboard/stage_tracker_presence.go +++ b/src/pkg/dashboard/stage_tracker_presence.go @@ -1,6 +1,7 @@ package dashboard import ( + "fmt" "strings" "time" @@ -83,8 +84,11 @@ func (s *Server) stageTrackerAdoptionClock() stageTrackerAdoptionClock { } // stageTrackerWaitingOn names the person a PR row waits on: its author at -// the stages whose caption says "@author must act". "" when the row waits -// on the hive, a gate or an unnamed maintainer. +// the stages whose caption says "@author must act", and a clanker's PR the +// engine has not classified yet (the row reads "PR in progress · +// @author's clanker": the clanker is the one on it, so whether it is +// still there is the row's live fact). "" when the row waits on the hive, +// a gate or an unnamed maintainer. func stageTrackerWaitingOn(it StageTrackerItem, stage stagelabels.Stage) string { if it.Kind != "pr" || strings.TrimSpace(it.Author) == "" { return "" @@ -92,10 +96,49 @@ func stageTrackerWaitingOn(it StageTrackerItem, stage stagelabels.Stage) string switch stage { case stagelabels.NeedsAuthor, stagelabels.ReturnedToContributor, stagelabels.PossiblyExisting: return strings.TrimSpace(it.Author) + case stagelabels.None: + if it.AuthorKind == authorKindClanker { + return strings.TrimSpace(it.Author) + } } return "" } +// stageTrackerOfflineAuthorCaption appends, to the caption of a clanker's +// PR whose clanker is offline, what that means for the row: on a PR the +// engine has not classified, nothing — a green PR is reviewed and merged +// without its author; adoption starts only once the PR is returned to the +// contributor (red CI, conflicts, review asks) and the clanker stays away +// for the offline grace. 072 rows carry the adoption line instead +// (stageTrackerAdoptionCaption) and are left alone here. +func stageTrackerOfflineAuthorCaption(caption string, p *StageTrackerPresence, stage int, clock stageTrackerAdoptionClock, now time.Time) string { + if p == nil || p.Kind != presenceKindClanker || p.State != presenceStateOffline || stage != stagelabels.None.Number() { + return caption + } + gone := stageTrackerAdoptionOfflineFor(StageTrackerAdoption{Since: p.Since, AuthorLastSeen: p.LastSeen}, now) + clause := "@" + p.Login + "'s clanker is offline" + gone + "; a green PR is reviewed and merged without its author" + if clock.Enabled { + grace := orDefault(clock.AdoptAfterOffline, config.DefaultAdoptAfterOffline) + clause += " — hive adopts it only once it is returned (red CI, conflicts or review asks) and nothing is pushed for " + stageTrackerShortDuration(grace) + } + return joinClause(caption, clause) +} + +// stageTrackerShortDuration renders a grace window as "30m" / "2h" / +// "1h30m". +func stageTrackerShortDuration(d time.Duration) string { + d = d.Round(time.Minute) + h, m := int(d/time.Hour), int(d%time.Hour/time.Minute) + switch { + case h > 0 && m > 0: + return fmt.Sprintf("%dh%dm", h, m) + case h > 0: + return fmt.Sprintf("%dh", h) + default: + return fmt.Sprintf("%dm", m) + } +} + // stageTrackerPresenceFor builds the `presence` field for a row waiting on // login. presence is the live lookup (nil when the server has none: the // state is then unknown); rec is the row's stage record for the nudge diff --git a/src/pkg/dashboard/stage_tracker_test.go b/src/pkg/dashboard/stage_tracker_test.go index 99cfb6bc6c..df4c6ce380 100644 --- a/src/pkg/dashboard/stage_tracker_test.go +++ b/src/pkg/dashboard/stage_tracker_test.go @@ -953,6 +953,7 @@ func TestStageTrackerStaleDecisionRecord(t *testing.T) { {"045 record backed by needs-human", stagelabels.Record{Stage: stagelabels.IssueNeedsDecision}, []string{"Needs-Human"}, false}, {"045 record backed by retired spelling", stagelabels.Record{Stage: stagelabels.IssueNeedsDecision}, []string{"needs-decision"}, false}, {"085 record backed by 085 label", stagelabels.Record{Stage: stagelabels.NeedsDecision}, []string{"stage/085-needs-decision"}, false}, + {"085 record whose labels the write-back gate held off GitHub", stagelabels.Record{Stage: stagelabels.NeedsDecision, LabelsSuppressed: true}, []string{"dco-signoff: yes", "size/M"}, false}, {"other stage, no labels", stagelabels.Record{Stage: stagelabels.Claimed}, nil, false}, } for _, tc := range cases { diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 446eab8ac6..d3cd6e194a 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -291,6 +291,9 @@ .ham-seg.active.merged .ham-ico { stroke-width: 2.5; } .ham-seg-t { white-space: normal; overflow-wrap: anywhere; } .ham-holder { font-weight: normal; } + /* The holder's offline / not-registered state is muted: a flag, not an alarm. */ + .ham-holder-presence { margin-right: 0; color: var(--text-faint); font-weight: normal; } + .ham-holder-presence.ham-presence-offline { --ham-presence-color: var(--text-faint); } /* A word with a holder ("PR in progress · @bob's clanker") stays on one line: the stage word keeps its width and the name gives way with an ellipsis before anything wraps (hivecommons/hive#15541). */ diff --git a/src/pkg/dashboard/static-src/js/tracker-row.js b/src/pkg/dashboard/static-src/js/tracker-row.js index d67145a284..4c694bc9ae 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row.js +++ b/src/pkg/dashboard/static-src/js/tracker-row.js @@ -335,7 +335,10 @@ const actorTip = stageTrackerActorTip(item); const claimant = typeof stageTrackerClaimant === 'function' ? stageTrackerClaimant(item) : null; const holderShort = claimant ? stageTrackerClaimantShort(claimant) : ''; - const holderHtml = holderShort ? ` · ${esc(holderShort)}` : ''; + // "· @odttlnt's clanker · ■ offline 3h": the holder's live state + // rides after the holder when the row's presence is theirs. + const holderPresence = holderShort && typeof stageTrackerHolderPresenceHtml === 'function' ? stageTrackerHolderPresenceHtml(item, claimant, nowMs) : ''; + const holderHtml = holderShort ? ` · ${esc(holderShort)}${holderPresence}` : ''; // A row whose next mover is nobody (an unclassified PR under its // issue reads "PR in progress") still shows WHO holds it: the // holder's own kind icon stands where the actor icon would diff --git a/src/pkg/dashboard/static-src/js/tracker-words.js b/src/pkg/dashboard/static-src/js/tracker-words.js index a9569e186a..d70af6a6b3 100644 --- a/src/pkg/dashboard/static-src/js/tracker-words.js +++ b/src/pkg/dashboard/static-src/js/tracker-words.js @@ -1237,6 +1237,24 @@ const dot = p.kind === 'human' ? '' : ''; return `${ico}${dot}`; } + // The holder's live state after the chevron's "· @odttlnt's clanker": + // " · [■] offline 3h" when the row's presence is for that clanker and + // it is gone, " · [○] not registered" when no clanker is registered + // here for the login. An online clanker adds nothing (the row is + // moving, nothing to flag); a human has no presence. The title is the + // presence tooltip, so the next automatic step is one hover away. + function stageTrackerHolderPresenceHtml(item, claimant, nowMs) { + const p = stageTrackerPresenceOf(item); + if (!p || p.kind !== 'clanker' || !claimant || claimant.kind !== 'clanker' || !claimant.login) return ''; + if (String(claimant.login).toLowerCase() !== p.login.toLowerCase()) return ''; + const now = Number(nowMs) || Date.now(); + let word = ''; + if (p.state === 'offline') word = 'offline' + (stageTrackerPresenceGone(p, now) ? ' ' + stageTrackerPresenceGone(p, now) : ''); + else if (p.state === 'unknown') word = 'not registered'; + if (!word) return ''; + const tip = stageTrackerPresenceTip(item, now); + return ` · ${esc(word)}`; + } // Pill text with the indicator placed just before the @login (or // leading, when the text names nobody): "waiting on [robot ●] @hanthor". function stageTrackerPresenceInPillHtml(item, text) { diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 8e805c0719..ea2c6c6b6a 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1616,6 +1616,9 @@ .ham-seg.active.merged .ham-ico { stroke-width: 2.5; } .ham-seg-t { white-space: normal; overflow-wrap: anywhere; } .ham-holder { font-weight: normal; } + /* The holder's offline / not-registered state is muted: a flag, not an alarm. */ + .ham-holder-presence { margin-right: 0; color: var(--text-faint); font-weight: normal; } + .ham-holder-presence.ham-presence-offline { --ham-presence-color: var(--text-faint); } /* A word with a holder ("PR in progress · @bob's clanker") stays on one line: the stage word keeps its width and the name gives way with an ellipsis before anything wraps (hivecommons/hive#15541). */ @@ -15487,6 +15490,24 @@