Skip to content

✨ Surface items waiting on the operator: sidebar badge, topbar pill, filter, toast - #15639

Merged
clubanderson merged 1 commit into
v5from
feat/waiting-on-you
Oct 30, 2026
Merged

clubanderson merged 1 commit into
v5from
feat/waiting-on-you

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15638

Why

Maintainer: "tell me how we will fix me not knowing that the items are waiting on a human". A dozen PRs sat 3–21 h at 085 needs-decision and nothing in the dashboard added them up or said so. This is the surfacing layer; the 085 computation and suppressed-label rendering are fixed in separate PRs.

What

Backend (stage_tracker_waiting.go, wired after stageTrackerHumanCounts): /api/stage-tracker gains

"waiting_on_human": { "count": 3, "items": [ { "repo": "hivecommons/hive", "number": 15312, "type": "pr", "kind": "needs-decision", "since": "…", "who": "operator" } ] }

kind ∈ needs-decision (045/085 or modifier), ready-for-human-merge (090), approve-needed (needs-human/unauthorized), returned-to-contributor-offline (071/072 only once the author's grace elapsed — Takeover.GraceElapsed/AdoptNow, Adoption.Due or Presence.Next=adopt; who is the contributor, operator is the fallback), other-human-wait (015). Hold, advisories, decided, nested PRs are excluded. Each item also carries waiting_on_you / wait_kind. No new state — only existing record fields.

SPA (tracker-waiting.js + small tracker-filter.js hooks):

  • Sidebar: second badge #activity-monitor-waiting-badge on Hive activity monitor, --status-attention, hidden at 0, tooltip = 5 longest waits with kind + age.
  • Topbar: #oc-waiting-on-you button "Waiting on you · N" beside Health, hidden at 0; click → ocNavigate('activity-monitor-section') + hamFilter('waitingOnYou', true). ?filter=waiting-on-you deep-links the same view (param consumed once).
  • Toolbar chip Waiting on you (new filter key waitingOnYou, persisted like the others, title covered by the help test).
  • Toast via the existing showToast(..., 'warning', {actionLabel:'Show', onAction, autoDismissMs}) (countdown bar) when the count rises; ≤ 1 per 10 min (localStorage), never when window.hiveKioskMode().

Docs: dashboard-sections.md → How you'll know something is waiting on you; changelog fragment.

Hub follow-up (not in this PR)

The heartbeat relay is fixed-shape across spoke.GovernorSummary → hub.GovernorSummary → HiveStatus → hub_widget.go → openapi.yaml, and the spoke builds it in cmd/hive/main.go without access to the stage-tracker build. Extending that chain is a separate change; the spoke-side truth (waiting_on_human.count) is in place for it.

Tests

  • Go: TestStageTrackerWaitingOnHuman_* (kinds, attribution, grace signals, zero/nil), stage_tracker_ui_test.go (badge/pill/chip ids, filter guard, kiosk guard).
  • JS: stage_tracker_waiting.test.js (badge/pill/chip rendering, tooltip cap, fallback, toast debounce + action + singular, kiosk, URL filter).
  • go test -count=1 ./pkg/dashboard/ ./pkg/dashboard/webstatic/ and node --test stage_tracker_*.test.js green locally; index.html regenerated with go generate.

No screenshots: no fixture hive available locally.

…toast

The stage tracker payload gains waiting_on_human (count + items with
repo, number, type, kind, since, who) and per-item waiting_on_you /
wait_kind, computed from the fields the tracker already carries (stage,
modifiers, decision_needed, adoption, takeover, decided, advisory).
Hold, advisories, decided rows, nested PRs and contributors still inside
their grace are not counted.

The SPA reads it in three places: a second attention-coloured badge on
the Hive activity monitor sidebar item (tooltip lists the five longest
waits), a Waiting on you · N topbar pill hidden at zero that lands on
the activity monitor with the new waitingOnYou filter (also reachable
via ?filter=waiting-on-you), and a debounced toast (one per ten minutes,
never in kiosk mode) with a Show action when the count rises.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15566 🌱 refactor: split stage tracker UI tests same files src/pkg/dashboard/stage_tracker_ui_test.go
src/pkg/dashboard/static-src/html/tracker.html
src/pkg/dashboard/static/index.html
#15565 🌱 refactor: split tracker words source same files src/pkg/dashboard/static-src/js/tracker-words.js
src/pkg/dashboard/static-src/manifest.txt
#15526 🌱 dashboard: split stage_tracker.go into 4 files same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
#15574 🌱 dashboard: split stage_tracker.go into 4 files same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
#15633 🌱 refactor: split stage tracker UI tests same files src/pkg/dashboard/stage_tracker_ui_test.go
src/pkg/dashboard/static-src/html/tracker.html
src/pkg/dashboard/static/index.html
#15637 📖 community: list the Twitch live stream everywhere community links live same files src/pkg/dashboard/static-src/html/sidebar.html
src/pkg/dashboard/static/index.html
#15521 🌱 refactor: split tracker row source same files src/pkg/dashboard/static-src/manifest.txt
#15530 🐛 fix(dashboard): issue-row linked PR passes null when the lineage chip is empty same files src/pkg/dashboard/static/index.html
#15632 🌱 refactor: split tracker words source same files src/pkg/dashboard/static-src/js/tracker-words.js
src/pkg/dashboard/static-src/manifest.txt

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conclusion: the classification and payload shape look right to me; one ordering defect makes the documented "count a nested decision once" rule dead code, and the unit test is shaped so it cannot notice. Scoped to the Go side — I did not read the CSS/HTML beyond the wiring.

Nested-row dedup never fires (medium).
src/pkg/dashboard/stage_tracker_waiting.go:139 skips rows with it.NestedUnder != 0 ("Nested rows … are skipped so one decision is counted once"). But NestedUnder is assigned in exactly one place, stage_tracker.go:3243-3244, inside stageTrackerResolveLinkedPRs — and buildStageTracker calls stageTrackerWaitingOnHuman(resp.Items) at stage_tracker.go:2454, one line before stageTrackerResolveLinkedPRs at :2455. At call time every item has NestedUnder == 0, so a PR at 085 drawn under its issue at 045 is counted twice, flagged waiting_on_you on both rows, and the header count the badge/pill/toast show is inflated accordingly. TestStageTrackerWaitingOnHuman_KindsAndAttribution (stage_tracker_waiting_test.go, item Number: 63, NestedUnder: 20) hands the function a pre-nested item directly, so it passes without exercising the production order. Fix is either to move the call after stageTrackerResolveLinkedPRs (and before the final sort), or — if a PR waiting under a non-waiting issue should still count, which the filter chip arguably wants — drop the skip and the comment, and dedup on the issue side instead. Either way a buildStageTracker-level test with a linked issue+PR pair would pin it.

Note the pre-existing stageTrackerHumanCounts at :2453 has the same ordering and makes no nesting claim, so needs_human and waiting_on_human.count will at least disagree in the nested case once this is fixed one way or the other.

Verified as correct: Adoption/Presence/Takeover (:2187-2195), DecisionNeeded (:2321, :2404), Decided/Advisory and hold are all populated before :2454, so the kind switch and the grace/decided/advisory exclusions read real values. The JS fallback in tracker-waiting.js filters !it.nested_under but is only reached when the header block is absent, so it does not mask the server-side count. The toast is gated on count rising, localStorage 10-minute gap and kiosk mode, and uses the in-app showToast, not a native dialog.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

hivecommons-hive Bot added a commit that referenced this pull request Oct 30, 2026
…ing into stage_tracker_build.go

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
hivecommons-hive Bot added a commit that referenced this pull request Oct 30, 2026
…lt into tracker-words-stage.js

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operator is never told that items are waiting on a human decision

1 participant