Skip to content

✨ Animate live tracker, contributor and Knowledge count deltas - #15866

Merged
clubanderson merged 4 commits into
v5from
feat/tracker-pill-delta
Oct 30, 2026
Merged

clubanderson merged 4 commits into
v5from
feat/tracker-pill-delta

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Summary

  • Add one lightweight raw-number delta helper for the two tracker navigation badges, online contributors, and Knowledge facts. Preserve existing count sources, live-update cadence, click targets and tooltips.
  • Show a short amber directional arrow with actual signed net changes; keep reduced-motion feedback static, leave initial/unknown/identical/cached-route renders quiet, and cancel stale cue timers. The existing delayed merge-hold release also updates its count cue.
  • Keep contributor registered-total changes quiet, use contributorPool.online (the existing registered-profile heartbeat predicate), and avoid treating disabled Knowledge priming as fact deletion.

Count mapping

  • Tracker gold: default-view rows (issues except folded review notes, plus PRs not drawn under an issue), not PR count alone.
  • Tracker orange: waiting_on_human.count, with the existing older-payload per-item flag calculation.
  • Contributors: contributorPool.online only; registered remains the denominator.
  • Knowledge: sum of layers[].total_pages (facts), displayed as zero when disabled.

Validation

  • Existing dashboard generator and generated-artifact check.
  • 17 focused Node behavior tests: baseline/unchanged, issue increase, PR decrease, batched and rapid deltas, explicit zero, unknown-to-known, held-merge release, timer cleanup/replacement, rerenders, contributor denominator-only changes, Knowledge formatting and priming semantics.
  • Isolated Chrome CDP checks with real theme styles: signed cues, no cue-induced badge layout shift, reduced-motion CSS, and a dark-theme visual self-review. The browser tab was closed after checks; no service or polling was added.
  • No local Go tests/build/vet or citation guards per AGENTS.md; CI is the repository verdict.

Concurrent work

Owner requested implementation PR only: no deployment, settings changes, or merge.

Signed-off-by: Andy 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 kellyaa 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
#15877 ✨ feature: show abandoned counts on contributor cards and status same files src/pkg/dashboard/static-src/js/contributors.js
src/pkg/dashboard/static/index.html
#15871 🐛 fix: stage tracker gives immediate Let-hive-decide feedback and says why a human is wanted same files src/pkg/dashboard/static/index.html
#15885 ✨ Add integration-aware orchestration above preparation and native queues same files src/pkg/dashboard/static/index.html
#15880 🐛 dashboard: merge banners drain the toast countdown bar same files src/pkg/dashboard/static-src/js/tracker-merged.js
src/pkg/dashboard/static/index.html
#15771 🌱 refactor: split tracker row source same files src/pkg/dashboard/static-src/manifest.txt
#15853 ✨ Complete native GitHub queue CI and policy integration same files src/pkg/dashboard/static/index.html
#15849 ✨ Show online ClankeR IDs on the Contributors count pill CONFLICT src/pkg/dashboard/static-src/js/contributors.js
src/pkg/dashboard/static/index.html
#15854 🐛 fix: preserve merge notifications across reloads and show countdown CONFLICT src/pkg/dashboard/static-src/js/tracker-filter-render.js
src/pkg/dashboard/static-src/js/tracker-merged.js
src/pkg/dashboard/static/index.html
#15859 ✨ feature: add abandoned counts to contributor leaderboards same files src/pkg/dashboard/static-src/js/contributors.js
src/pkg/dashboard/static/index.html

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission → 050-review-pending: required-check-pending:build-and-test

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (rest 3/4)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (rest 3/4)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission → 071-needs-author: optional-check-failing:test (rest 3/4)

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (rest 4/4)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission → 071-needs-author: optional-check-failing:test (rest 4/4)

@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.

Reviewed — no findings from this perspective.

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

@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.

Correctness (read at head 3698583)

Knowledge section stops loading when any remote layer is unhealthy — src/pkg/dashboard/static-src/js/knowledge.js:244-248

kbSidebarFactCount returns null if any layer lacks an integer total_pages (knowledge.js:157), and fetchKnowledgeStats then returns before _kbCache = next, before _kbInitialLoad = false, and before renderKnowledge() (knowledge.js:249-272). The server produces exactly that shape in a normal steady state: KnowledgeAPI.Stats only sets total_pages when lc.client.Stats(ctx) succeeds, and emits {type, url, healthy:false} otherwise (src/pkg/knowledge/api.go:253-262). So with one remote layer down, the Knowledge section never renders on first load and never refreshes afterwards, while the badge keeps a stale value. At merge-base this case rendered normally with the missing layer counted as 0 (kbTotalFactsFromStats, knowledge.js:145-147). The focused test even locks in the stale-render behaviour (nav_count_delta.test.js:230-231 asserts the badge keeps 1021 after { enabled: true }), and no case covers healthy:false without total_pages.

Suppress only the delta cue on an unknown count; keep the load path unchanged:

         const prev = _kbCache;
-        const next = await r.json();
-        const kbBadge = document.getElementById('knowledge-sidebar-badge');
-        const kbFacts = kbSidebarFactCount(next);
-        if (kbFacts === null) {
-          navCountDelta(kbBadge, null);
-          return;
-        }
-        _kbCache = next;
+        _kbCache = await r.json();
         _kbCache._documents = (docsR && docsR.ok) ? await docsR.json() : [];
         setSectionSummary('knowledge-section', kbFactsLabel(kbTotalFactsFromStats(_kbCache)));
+        const kbBadge = document.getElementById('knowledge-sidebar-badge');
         if (kbBadge) {
+          const kbShown = kbTotalFactsFromStats(_kbCache);
+          // null when a layer is unhealthy/unknown: display still updates, only the cue is skipped.
+          const kbFacts = kbSidebarFactCount(_kbCache);
           // Toggling priming changes what the badge shows, not stored facts.
           if (prev && prev.enabled !== _kbCache.enabled) navCountDelta(kbBadge, null);
-          setSidebarCountBadge(kbBadge, kbFacts, kbFactsLabel(kbTotalFactsFromStats(_kbCache)));
-          navCountDelta(kbBadge, kbFacts, kbFactsLabel(kbFacts));
+          setSidebarCountBadge(kbBadge, _kbCache.enabled ? kbShown : 0, kbFactsLabel(kbShown));
+          navCountDelta(kbBadge, kbFacts, kbFactsLabel(kbFacts === null ? kbShown : kbFacts));
         }

and add a test feeding { enabled: true, layers: [{ type: 'project', total_pages: 5 }, { type: 'global', healthy: false }] } that asserts the badge shows 5, no cue, and the section still renders.

Checked and fine: tracker waiting_on_human.items is always [] from the hub (stage_tracker_waiting.go:136), so the new count: null path in tracker-waiting.js:30 is not reachable from live payloads; contributor online/registered are plain ints (api_contribute.go:95-96).

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

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson

Copy link
Copy Markdown
Member Author

CLI author follow-through:

  • Head 3698583 reached terminal green: 62 successful checks, no pending/failing contexts. The one targeted rest 4/4 rerun and dependent coverage/test gates passed; there was no full-matrix retry loop. The older needs-author note referenced that now-resolved rest-shard result, not a current CI failure.
  • Accepted the correctness review at 20:19Z: unknown remote Knowledge counts must suppress only count feedback, not stop cache/doc/section loading. Corrective DCO commit is pushed on this branch: preserve the load path, display available layer facts with an explicit partial accessible label/tooltip, clear delta state while incomplete, and seed a fresh baseline on recovery.
  • Added behavior coverage for first load with healthy:false and no total_pages, subsequent refresh/recovery, accessible partial labels and cue timer cleanup. A separate read-only code-review agent reviewed this uncommitted correction and found no significant issues before commit. No local tests/builds/guards were run for this correction; only the explicitly requested embedded-dashboard generator.

This PR is owned by our CLI repair path; @clubanderson is not being asked to write the fix. Leaving current-base admission, reviews and normal Hive merge scheduling unchanged; no manual queue/label/hold bypass and no deployment. New-head CI is the next required verdict.

@clubanderson
clubanderson merged commit d5eac9e into v5 Oct 30, 2026
77 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/tracker-pill-delta branch October 30, 2026 21:06
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR 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.

1 participant