From aa2a1276a8759bbe1e915a0cd41fc274bf3e0c25 Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Fri, 30 Oct 2026 14:02:32 -0400 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=A8=20Show=20online=20ClankeR=20IDs?= =?UTF-8?q?=20on=20the=20Contributors=20count=20pill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- .../added-contributor-pill-online-ids.md | 1 + dashboard/test/config-tooltip.test.js | 72 ++++++++++++++++++- src/pkg/dashboard/api_contribute.go | 23 ++++-- .../dashboard/contributor_pool_online_test.go | 46 ++++++++++++ src/pkg/dashboard/sidebar_pair_badge_test.go | 5 +- .../static-src/css/config-dialog.css | 3 + .../dashboard/static-src/html/sidebar.html | 3 +- .../dashboard/static-src/js/contributors.js | 24 ++++++- .../static-src/js/tooltips-dialogs.js | 10 +-- src/pkg/dashboard/static/index.html | 40 ++++++++--- 10 files changed, 198 insertions(+), 29 deletions(-) create mode 100644 changelog.d/added-contributor-pill-online-ids.md diff --git a/changelog.d/added-contributor-pill-online-ids.md b/changelog.d/added-contributor-pill-online-ids.md new file mode 100644 index 0000000000..4cc69e3ad2 --- /dev/null +++ b/changelog.d/added-contributor-pill-online-ids.md @@ -0,0 +1 @@ +- Show online ClankeR contributor IDs vertically in the Contributors sidebar count pill's hover and keyboard-focus tooltip. diff --git a/dashboard/test/config-tooltip.test.js b/dashboard/test/config-tooltip.test.js index 891fea35d6..0cfd1803a3 100644 --- a/dashboard/test/config-tooltip.test.js +++ b/dashboard/test/config-tooltip.test.js @@ -72,6 +72,12 @@ class FakeElement { while (n.parentNode) n = n.parentNode; return n.isRoot === true; } + get textContent() { return this._textContent || ''; } + set textContent(value) { + this._textContent = String(value); + for (const child of this.children) child.parentNode = null; + this.children = []; + } get classList() { const self = this; return { @@ -86,8 +92,8 @@ class FakeElement { return false; } closest(selector) { - const cls = selector.replace(/^\./, ''); - for (let n = this; n; n = n.parentNode) if (n.classList && n.classList.contains(cls)) return n; + const classes = selector.split(',').map(s => s.trim().replace(/^\./, '')); + for (let n = this; n; n = n.parentNode) if (n.classList && classes.some(cls => n.classList.contains(cls))) return n; return null; } querySelector(selector) { @@ -157,8 +163,12 @@ function harness() { 'let _configTooltipOpenTimer = 0;', 'let _configTooltipCloseTimer = 0;', ...HELPER_FUNCTIONS.map(extractFunction), + ...['esc', 'sidebarPairBadgeText', 'setSidebarPairBadge', 'contributorsOnlineTitle', 'contributorsOnlineTooltip', 'updateContributorBadge'].map(extractFunction), + 'let _cachedContributors = [];', + 'function refreshSectionCardShell() {} function setSectionSummary() {} function contributorsSectionSummary() {}', extractListeners(), ...HELPER_FUNCTIONS.map(n => `exports.${n} = ${n};`), + 'exports.updateContributorBadge = updateContributorBadge;', 'exports.openDelay = CONFIG_TOOLTIP_OPEN_DELAY_MS; exports.closeGrace = CONFIG_TOOLTIP_CLOSE_GRACE_MS;', ].join('\n'); vm.runInNewContext(source, context); @@ -316,6 +326,17 @@ test('clicking inside the popover does not hide it', () => { assert.equal(h.isOpen(), true); }); +test('scrolling a long online ID list keeps the tooltip open, page scrolling still dismisses it', () => { + const h = harness(); + const pill = makeTrigger(h.root, 'contributors'); + pill.className = 'contributor-online-trigger'; + h.fire('document', 'focusin', pill); + h.fire('window', 'scroll', h.portal()); + assert.equal(h.isOpen(), true); + h.fire('window', 'scroll', h.root); + assert.equal(h.isOpen(), false); +}); + test('Escape dismissal and modal-open hooks are wired to the shared helper', () => { const dismiss = extractFunction('hiveDismissTopOverlay'); assert.match(dismiss, /configTooltipIsOpen\(\)/); @@ -329,3 +350,50 @@ test('Escape dismissal and modal-open hooks are wired to the shared helper', () test('portal stylesheet hides the portal when the hidden attribute is set', () => { assert.match(indexHtml, /\.config-tooltip-portal\[hidden\] \{ display: none; \}/); }); + +test('Contributors tooltip targets the count pill and supports focus without changing navigation or pill styling', () => { + const badge = indexHtml.match(/]+>/)[0]; + assert.match(badge, /class="badge-count oc-nav-count contributor-online-trigger"/); + assert.match(badge, /tabindex="0" role="link"/); + assert.match(badge, /data-keydown-action="ocNavigate" data-arg0="contributors-section"/); + assert.match(indexHtml, /data-action="ocNavigate" data-arg0="contributors-section">👥/); + assert.match(indexHtml, /\.contributor-online-ids li \{ display: block; \}/, 'one ID per line'); + + const h = harness(); + const pill = new FakeElement('span', 'badge-count oc-nav-count contributor-online-trigger'); + pill.id = 'contributors-sidebar-badge'; + h.root.appendChild(pill); + h.api.updateContributorBadge({ online: 2, registered: 4, presence_window: '15m', online_ids: ['clanker-a', 'clanker-b'] }); + assert.equal(pill.textContent, '2/4'); + assert.equal(pill.getAttribute('title'), null, 'no duplicate browser-native title'); + assert.match(pill.getAttribute('aria-label'), /2 online · 4 registered/); + h.fire('document', 'focusin', pill); + assert.equal(h.isOpen(), true); + assert.match(h.portal().innerHTML, /
  • clanker-a<\/li>
  • clanker-b<\/li>/); + + h.api.updateContributorBadge({ online: 1, registered: 4, online_ids: ['clanker-reconnected'] }); + assert.equal(pill.textContent, '1/4'); + assert.match(h.portal().innerHTML, /
  • clanker-reconnected<\/li>/); + assert.doesNotMatch(h.portal().innerHTML, /clanker-a|clanker-b/); + + h.api.updateContributorBadge({ online: 0, registered: 4, online_ids: [] }); + assert.equal(pill.textContent, '0/4'); + assert.match(h.portal().innerHTML, /No ClankeRs online/); + h.api.hideConfigTooltip(); + h.fire('document', 'mouseover', pill); + h.advance(h.api.openDelay); + assert.equal(h.isOpen(), true, 'same pill also opens on hover'); +}); + +test('Contributors tooltip escapes IDs and distinguishes unavailable IDs from no online ClankeRs', () => { + const context = {}; + vm.runInNewContext(['esc', 'contributorsOnlineTitle', 'contributorsOnlineTooltip'].map(extractFunction).join('\n'), context); + const html = context.contributorsOnlineTooltip({ online: 1, registered: 2, online_ids: ['&'] }); + assert.match(html, /
  • <img src=x onerror="bad">&<\/li>/); + assert.doesNotMatch(html, /Contributors`, - `if (sidebarBadge) setSidebarPairBadge(sidebarBadge, onlineCount, totalCount, tip);`, + `Contributors`, + `setSidebarPairBadge(sidebarBadge, onlineCount, totalCount);`, + `tooltip.innerHTML = contributorsOnlineTooltip(pool);`, `function contributorsOnlineTitle(online, total, window)`, ``, } { diff --git a/src/pkg/dashboard/static-src/css/config-dialog.css b/src/pkg/dashboard/static-src/css/config-dialog.css index b1cf90c7ad..66f42f13b8 100644 --- a/src/pkg/dashboard/static-src/css/config-dialog.css +++ b/src/pkg/dashboard/static-src/css/config-dialog.css @@ -456,6 +456,9 @@ /* The author `display: block` above outranks the UA `[hidden] { display: none }` rule, so without this the portal stayed on screen after `portal.hidden = true`. */ .config-tooltip-portal[hidden] { display: none; } + .contributor-online-tooltip { max-height: calc(100vh - var(--sp-8)); overflow-y: auto; pointer-events: auto; overflow-wrap: anywhere; } + .contributor-online-ids { display: block; list-style: none; margin: var(--sp-2) 0 0; padding: 0; } + .contributor-online-ids li { display: block; } .config-info:hover .config-tooltip, .config-info:focus-within .config-tooltip { display: none; } .section-help-mark { text-decoration: none; } .section-help-mark .section-help-tip-action { display: block; margin-top: var(--sp-2); color: var(--muted); } diff --git a/src/pkg/dashboard/static-src/html/sidebar.html b/src/pkg/dashboard/static-src/html/sidebar.html index bce56b237e..c823fd7cdb 100644 --- a/src/pkg/dashboard/static-src/html/sidebar.html +++ b/src/pkg/dashboard/static-src/html/sidebar.html @@ -34,7 +34,7 @@
    Intelligence
    @@ -105,4 +105,3 @@ block turns it on. Its id is registered in OVERLAY_SELECTOR so the existing installModalScrollLock() observer body-locks scroll for free. -->
    - diff --git a/src/pkg/dashboard/static-src/js/contributors.js b/src/pkg/dashboard/static-src/js/contributors.js index f08f576d9c..eb1071f344 100644 --- a/src/pkg/dashboard/static-src/js/contributors.js +++ b/src/pkg/dashboard/static-src/js/contributors.js @@ -514,8 +514,16 @@ const totalCount = pool.registered; const tip = contributorsOnlineTitle(onlineCount, totalCount, pool.presence_window); // Same two-part pill as Governor / Overview: "online/total". - if (sidebarBadge) setSidebarPairBadge(sidebarBadge, onlineCount, totalCount, tip); + if (sidebarBadge) setSidebarPairBadge(sidebarBadge, onlineCount, totalCount); navCountDelta(sidebarBadge, onlineCount, 'Contributors: ' + tip); + if (sidebarBadge) { + const tooltip = document.createElement('span'); + tooltip.className = 'config-tooltip contributor-online-tooltip'; + tooltip.hidden = true; + tooltip.innerHTML = contributorsOnlineTooltip(pool); + sidebarBadge.appendChild(tooltip); + if (_configTooltipTrigger === sidebarBadge) positionConfigTooltip(sidebarBadge); + } setSectionSummary('contributors-section', contributorsSectionSummary(_cachedContributors || [], pool)); if (statusBadge) { statusBadge.textContent = `${onlineCount} online / ${totalCount} registered`; @@ -524,7 +532,19 @@ } } - // contributorsOnlineTitle is the pill tooltip: "3 online · 12 registered + function contributorsOnlineTooltip(pool) { + const online = Number(pool.online) || 0; + const summary = esc(contributorsOnlineTitle(online, pool.registered, pool.presence_window)); + const ids = pool.online_ids; + if (!Array.isArray(ids) || ids.length !== online || ids.some(id => typeof id !== 'string' || !id)) { + return summary + '
    Online ClankeR IDs unavailable
    '; + } + if (!ids.length) return summary + '
    No ClankeRs online
    '; + return summary + '
    Online ClankeRs
      ' + + ids.map(id => '
    • ' + esc(id) + '
    • ').join('') + '
    '; + } + + // contributorsOnlineTitle is the presence summary: "3 online · 12 registered // (heartbeat within 15m)". The window is the hub's presence_window, the // same one the tracker's "(offline 13m)" caption is judged against. function contributorsOnlineTitle(online, total, window) { diff --git a/src/pkg/dashboard/static-src/js/tooltips-dialogs.js b/src/pkg/dashboard/static-src/js/tooltips-dialogs.js index d28aeb13d5..3fb78d20d1 100644 --- a/src/pkg/dashboard/static-src/js/tooltips-dialogs.js +++ b/src/pkg/dashboard/static-src/js/tooltips-dialogs.js @@ -132,7 +132,7 @@ } function configTooltipPointerOver(target) { - const info = target && target.closest ? target.closest('.config-info') : null; + const info = target && target.closest ? target.closest('.config-info, .contributor-online-trigger') : null; if (info) { scheduleConfigTooltipOpen(info); return; } if (configTooltipOwns(target)) { cancelConfigTooltipClose(); return; } // Pointer is over something else: a sibling, a modal overlay that now @@ -142,13 +142,13 @@ function configTooltipPointerOut(target, relatedTarget) { if (configTooltipOwns(relatedTarget)) return; - if (relatedTarget && relatedTarget.closest && relatedTarget.closest('.config-info')) return; - const info = target && target.closest ? target.closest('.config-info') : null; + if (relatedTarget && relatedTarget.closest && relatedTarget.closest('.config-info, .contributor-online-trigger')) return; + const info = target && target.closest ? target.closest('.config-info, .contributor-online-trigger') : null; if (info || configTooltipOwns(target)) scheduleConfigTooltipHide(); } function configTooltipFocusIn(target) { - const info = target && target.closest ? target.closest('.config-info') : null; + const info = target && target.closest ? target.closest('.config-info, .contributor-online-trigger') : null; if (info) { positionConfigTooltip(info); return; } if (configTooltipOwns(target)) { cancelConfigTooltipClose(); return; } if (configTooltipIsOpen()) hideConfigTooltip(); @@ -164,7 +164,7 @@ document.addEventListener('focusin', (e) => configTooltipFocusIn(e.target)); document.addEventListener('focusout', (e) => configTooltipFocusOut(e.target, e.relatedTarget)); document.addEventListener('click', (e) => { if (configTooltipIsOpen() && !configTooltipOwns(e.target)) hideConfigTooltip(); }); - window.addEventListener('scroll', () => { if (configTooltipIsOpen()) hideConfigTooltip(); }, true); + window.addEventListener('scroll', (e) => { if (configTooltipIsOpen() && !configTooltipOwns(e.target)) hideConfigTooltip(); }, true); window.addEventListener('resize', () => { if (configTooltipIsOpen()) hideConfigTooltip(); }); // ── Event delegation for actions with user-controlled data ── diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 51a950591b..553107c333 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -4459,6 +4459,9 @@ /* The author `display: block` above outranks the UA `[hidden] { display: none }` rule, so without this the portal stayed on screen after `portal.hidden = true`. */ .config-tooltip-portal[hidden] { display: none; } + .contributor-online-tooltip { max-height: calc(100vh - var(--sp-8)); overflow-y: auto; pointer-events: auto; overflow-wrap: anywhere; } + .contributor-online-ids { display: block; list-style: none; margin: var(--sp-2) 0 0; padding: 0; } + .contributor-online-ids li { display: block; } .config-info:hover .config-tooltip, .config-info:focus-within .config-tooltip { display: none; } .section-help-mark { text-decoration: none; } .section-help-mark .section-help-tip-action { display: block; margin-top: var(--sp-2); color: var(--muted); } @@ -7432,7 +7435,7 @@

    🐝 Getting Started
    Resources
    📦Projects0 - 👥Contributors + 👥Contributors

    Intelligence
    @@ -7503,7 +7506,6 @@

    🐝 Getting Started

    -
    @@ -42907,8 +42909,16 @@ const totalCount = pool.registered; const tip = contributorsOnlineTitle(onlineCount, totalCount, pool.presence_window); // Same two-part pill as Governor / Overview: "online/total". - if (sidebarBadge) setSidebarPairBadge(sidebarBadge, onlineCount, totalCount, tip); + if (sidebarBadge) setSidebarPairBadge(sidebarBadge, onlineCount, totalCount); navCountDelta(sidebarBadge, onlineCount, 'Contributors: ' + tip); + if (sidebarBadge) { + const tooltip = document.createElement('span'); + tooltip.className = 'config-tooltip contributor-online-tooltip'; + tooltip.hidden = true; + tooltip.innerHTML = contributorsOnlineTooltip(pool); + sidebarBadge.appendChild(tooltip); + if (_configTooltipTrigger === sidebarBadge) positionConfigTooltip(sidebarBadge); + } setSectionSummary('contributors-section', contributorsSectionSummary(_cachedContributors || [], pool)); if (statusBadge) { statusBadge.textContent = `${onlineCount} online / ${totalCount} registered`; @@ -42917,7 +42927,19 @@ } } - // contributorsOnlineTitle is the pill tooltip: "3 online · 12 registered + function contributorsOnlineTooltip(pool) { + const online = Number(pool.online) || 0; + const summary = esc(contributorsOnlineTitle(online, pool.registered, pool.presence_window)); + const ids = pool.online_ids; + if (!Array.isArray(ids) || ids.length !== online || ids.some(id => typeof id !== 'string' || !id)) { + return summary + '
    Online ClankeR IDs unavailable
    '; + } + if (!ids.length) return summary + '
    No ClankeRs online
    '; + return summary + '
    Online ClankeRs
      ' + + ids.map(id => '
    • ' + esc(id) + '
    • ').join('') + '
    '; + } + + // contributorsOnlineTitle is the presence summary: "3 online · 12 registered // (heartbeat within 15m)". The window is the hub's presence_window, the // same one the tracker's "(offline 13m)" caption is judged against. function contributorsOnlineTitle(online, total, window) { @@ -45431,7 +45453,7 @@

    GitHub Projects sync

    } function configTooltipPointerOver(target) { - const info = target && target.closest ? target.closest('.config-info') : null; + const info = target && target.closest ? target.closest('.config-info, .contributor-online-trigger') : null; if (info) { scheduleConfigTooltipOpen(info); return; } if (configTooltipOwns(target)) { cancelConfigTooltipClose(); return; } // Pointer is over something else: a sibling, a modal overlay that now @@ -45441,13 +45463,13 @@

    GitHub Projects sync

    function configTooltipPointerOut(target, relatedTarget) { if (configTooltipOwns(relatedTarget)) return; - if (relatedTarget && relatedTarget.closest && relatedTarget.closest('.config-info')) return; - const info = target && target.closest ? target.closest('.config-info') : null; + if (relatedTarget && relatedTarget.closest && relatedTarget.closest('.config-info, .contributor-online-trigger')) return; + const info = target && target.closest ? target.closest('.config-info, .contributor-online-trigger') : null; if (info || configTooltipOwns(target)) scheduleConfigTooltipHide(); } function configTooltipFocusIn(target) { - const info = target && target.closest ? target.closest('.config-info') : null; + const info = target && target.closest ? target.closest('.config-info, .contributor-online-trigger') : null; if (info) { positionConfigTooltip(info); return; } if (configTooltipOwns(target)) { cancelConfigTooltipClose(); return; } if (configTooltipIsOpen()) hideConfigTooltip(); @@ -45463,7 +45485,7 @@

    GitHub Projects sync

    document.addEventListener('focusin', (e) => configTooltipFocusIn(e.target)); document.addEventListener('focusout', (e) => configTooltipFocusOut(e.target, e.relatedTarget)); document.addEventListener('click', (e) => { if (configTooltipIsOpen() && !configTooltipOwns(e.target)) hideConfigTooltip(); }); - window.addEventListener('scroll', () => { if (configTooltipIsOpen()) hideConfigTooltip(); }, true); + window.addEventListener('scroll', (e) => { if (configTooltipIsOpen() && !configTooltipOwns(e.target)) hideConfigTooltip(); }, true); window.addEventListener('resize', () => { if (configTooltipIsOpen()) hideConfigTooltip(); }); // ── Event delegation for actions with user-controlled data ── From 2a07a95e0f86b08a6fd1190d2544ec157219238b Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Fri, 30 Oct 2026 15:14:27 -0400 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=90=9B=20Repair=20contributor=20toolt?= =?UTF-8?q?ip=20regression=20guard=20and=20shifted=20citations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- src/pkg/dashboard/modal_tooltip_regression_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/dashboard/modal_tooltip_regression_test.go b/src/pkg/dashboard/modal_tooltip_regression_test.go index a6018c1c3a..5bcb6070be 100644 --- a/src/pkg/dashboard/modal_tooltip_regression_test.go +++ b/src/pkg/dashboard/modal_tooltip_regression_test.go @@ -90,7 +90,7 @@ func TestHelpTooltipsUseBodyFixedPortal11269(t *testing.T) { "portal.id = 'config-tooltip-portal'", "document.body.appendChild(portal)", "const rect = info.getBoundingClientRect()", - "window.addEventListener('scroll', () => { if (configTooltipIsOpen()) hideConfigTooltip(); }, true)", + "window.addEventListener('scroll', (e) => { if (configTooltipIsOpen() && !configTooltipOwns(e.target)) hideConfigTooltip(); }, true)", "window.addEventListener('resize', () => { if (configTooltipIsOpen()) hideConfigTooltip(); })", } { if !strings.Contains(html, want) { From 0ff4ed17ecc2a0db382223f703ef7f7d7bcc3d6d Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 31 Oct 2026 06:58:34 -0400 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=93=96=20docs:=20refresh=20api-refere?= =?UTF-8?q?nce=20citations=20after=20rebase=20onto=20v5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrew Anderson --- src/docs/api-reference/contribute.md | 82 ++++++++++++------------ src/docs/api-reference/dashboard-misc.md | 26 ++++---- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/docs/api-reference/contribute.md b/src/docs/api-reference/contribute.md index e69f2b1b33..c79eb89bf6 100644 --- a/src/docs/api-reference/contribute.md +++ b/src/docs/api-reference/contribute.md @@ -5,50 +5,50 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f | Method | Path | Auth | Purpose | Source | |---|---|---|---|---| -| `GET` | `/contribute` | Public | Contribute Landing | `pkg/dashboard/api_contribute.go:187` | -| `GET` | `/contribute/{tab}` | Public | Contribute Landing | `pkg/dashboard/api_contribute.go:193` | -| `GET` | `/api/contribute/ws` | Public | s.contribute Hub.Handle WS | `pkg/dashboard/api_contribute.go:201` | -| `POST` | `/api/contribute/register` | Public | Contribute Register | `pkg/dashboard/api_contribute.go:202` | -| `POST` | `/api/contribute/invite` | Public | Contribute Invite | `pkg/dashboard/api_contribute.go:208` | -| `POST` | `/api/contribute/reissue-token` | Public | Contribute Reissue Token | `pkg/dashboard/api_contribute.go:209` | -| `GET` | `/api/contribute/status` | Public | Contribute Status | `pkg/dashboard/api_contribute.go:211` | -| `GET` | `/api/contribute/repositories` | Public | Contribution-eligible repositories for a contributor `repo_scope`: `{repositories:[{id,forge,host,full_name}],generated_at}`, the monitored repos minus `hub.disabled_repos`; `id` is `{forge}/{host}/{owner}/{name}` lower-cased ([#12805](https://github.com/hivecommons/hive/issues/12805)) | `pkg/dashboard/api_contribute.go:214` | -| `GET` | `/api/contribute/activity` | Public | Contribute Activity | `pkg/dashboard/api_contribute.go:218` | -| `GET` | `/api/contribute/fleet` | Public | Contribute Fleet | `pkg/dashboard/api_contribute.go:219` | -| `GET` | `/api/contribute/events` | Public | Contribute Events (SSE). Every frame carries a monotonic `seq`; a connection whose channel filled gets a `gap` frame naming how many events it missed, so a long-lived client can tell "nothing happened" from "I missed events" ([#6218](https://github.com/hivecommons/hive/issues/6218)) | `pkg/dashboard/api_contribute.go:223` | -| `GET` | `/api/contribute/queue` | Public | Contribute Queue | `pkg/dashboard/api_contribute.go:226` | -| `GET` | `/api/contribute/opportunistic` | Public | Contribute Opportunistic | `pkg/dashboard/api_contribute.go:230` | -| `GET` | `/api/contribute/limits` | Public | Contribute Limits | `pkg/dashboard/api_contribute.go:235` | -| `GET` | `/api/contribute/metrics` | Public | Contribute Metrics | `pkg/dashboard/api_contribute.go:241` | -| `GET` | `/api/contribute/me` | Public path; caller identity resolved server-side (401 anonymous; a signed-in caller with no profile on this hive gets 200 with `has_profile:false` and no counters, [#12111](https://github.com/hivecommons/hive/issues/12111)) | The caller's OWN contribution stats — issues worked (24h and all-time), completions that produced a verified PR (24h and all-time, [#7894](https://github.com/hivecommons/hive/issues/7894)), and failures. No username parameter, so it only ever answers for its caller ([#6543](https://github.com/hivecommons/hive/issues/6543)) | `pkg/dashboard/api_contribute.go:251` | +| `GET` | `/contribute` | Public | Contribute Landing | `pkg/dashboard/api_contribute.go:196` | +| `GET` | `/contribute/{tab}` | Public | Contribute Landing | `pkg/dashboard/api_contribute.go:202` | +| `GET` | `/api/contribute/ws` | Public | s.contribute Hub.Handle WS | `pkg/dashboard/api_contribute.go:210` | +| `POST` | `/api/contribute/register` | Public | Contribute Register | `pkg/dashboard/api_contribute.go:211` | +| `POST` | `/api/contribute/invite` | Public | Contribute Invite | `pkg/dashboard/api_contribute.go:217` | +| `POST` | `/api/contribute/reissue-token` | Public | Contribute Reissue Token | `pkg/dashboard/api_contribute.go:218` | +| `GET` | `/api/contribute/status` | Public | Contribute Status | `pkg/dashboard/api_contribute.go:220` | +| `GET` | `/api/contribute/repositories` | Public | Contribution-eligible repositories for a contributor `repo_scope`: `{repositories:[{id,forge,host,full_name}],generated_at}`, the monitored repos minus `hub.disabled_repos`; `id` is `{forge}/{host}/{owner}/{name}` lower-cased ([#12805](https://github.com/hivecommons/hive/issues/12805)) | `pkg/dashboard/api_contribute.go:223` | +| `GET` | `/api/contribute/activity` | Public | Contribute Activity | `pkg/dashboard/api_contribute.go:227` | +| `GET` | `/api/contribute/fleet` | Public | Contribute Fleet | `pkg/dashboard/api_contribute.go:228` | +| `GET` | `/api/contribute/events` | Public | Contribute Events (SSE). Every frame carries a monotonic `seq`; a connection whose channel filled gets a `gap` frame naming how many events it missed, so a long-lived client can tell "nothing happened" from "I missed events" ([#6218](https://github.com/hivecommons/hive/issues/6218)) | `pkg/dashboard/api_contribute.go:232` | +| `GET` | `/api/contribute/queue` | Public | Contribute Queue | `pkg/dashboard/api_contribute.go:235` | +| `GET` | `/api/contribute/opportunistic` | Public | Contribute Opportunistic | `pkg/dashboard/api_contribute.go:239` | +| `GET` | `/api/contribute/limits` | Public | Contribute Limits | `pkg/dashboard/api_contribute.go:244` | +| `GET` | `/api/contribute/metrics` | Public | Contribute Metrics | `pkg/dashboard/api_contribute.go:250` | +| `GET` | `/api/contribute/me` | Public path; caller identity resolved server-side (401 anonymous; a signed-in caller with no profile on this hive gets 200 with `has_profile:false` and no counters, [#12111](https://github.com/hivecommons/hive/issues/12111)) | The caller's OWN contribution stats — issues worked (24h and all-time), completions that produced a verified PR (24h and all-time, [#7894](https://github.com/hivecommons/hive/issues/7894)), and failures. No username parameter, so it only ever answers for its caller ([#6543](https://github.com/hivecommons/hive/issues/6543)) | `pkg/dashboard/api_contribute.go:260` | | `GET` | `/api/contribute/run-stats/models` | Public | Per-model run evidence for the contributor wall: runs, verified-PR share, and failure rate over the selected window. | `pkg/dashboard/api_contribute.go` | | `GET` | `/api/contribute/wall` | Public | Contributor wall posts when the hive-wide wall switch is enabled; anonymous readers see visible posts, authors can still see their own hidden posts. | `pkg/dashboard/api_contribute.go` | | `POST` | `/api/contribute/wall` | Signed-in contributor | Create a 500-character plain-text wall post or one-level reply, with optional `model`, `backend`, and `repo` tags. Returns 401 anonymous, 403 when disabled/revoked/muted, and 429 when rate-limited. | `pkg/dashboard/api_contribute.go` | | `DELETE` | `/api/contribute/wall/{id}` | Post author | Author deletes their own wall post; action is audit logged. | `pkg/dashboard/api_contribute.go` | | `POST` | `/api/contribute/wall/{id}/hide` | Owner/read-write | Hide a wall post from public readers while leaving it visible to the author; action is audit logged and pushed over `/api/contribute/events`. | `pkg/dashboard/api_contribute.go` | | `POST` | `/api/contribute/wall/{id}/flag` | Signed-in contributor | Flag a wall post for Management review; action is audit logged. | `pkg/dashboard/api_contribute.go` | -| `GET` | `/api/contribute/triage` | Public | Contribute Triage | `pkg/dashboard/api_contribute.go:272` | -| `PUT` | `/api/contribute/queue/order` | Public | Contribute Queue Order | `pkg/dashboard/api_contribute.go:276` | -| `POST` | `/api/contribute/queue/hold` | Public | Contribute Queue Hold | `pkg/dashboard/api_contribute.go:281` | -| `POST` | `/api/contribute/queue/hold/clear` | Public | Contribute Queue Hold Clear | `pkg/dashboard/api_contribute.go:285` | -| `GET` | `/api/contribute/interests` | Public | Contribute Interests | `pkg/dashboard/api_contribute.go:291` | -| `PUT` | `/api/contribute/interests` | Public | Contribute Interests | `pkg/dashboard/api_contribute.go:292` | -| `GET` | `/api/contributors` | Dashboard auth/session | Contributors List | `pkg/dashboard/api_contribute.go:300` | -| `GET` | `/api/contributors/{id}` | Dashboard auth/session | Contributor Get | `pkg/dashboard/api_contribute.go:301` | +| `GET` | `/api/contribute/triage` | Public | Contribute Triage | `pkg/dashboard/api_contribute.go:281` | +| `PUT` | `/api/contribute/queue/order` | Public | Contribute Queue Order | `pkg/dashboard/api_contribute.go:285` | +| `POST` | `/api/contribute/queue/hold` | Public | Contribute Queue Hold | `pkg/dashboard/api_contribute.go:290` | +| `POST` | `/api/contribute/queue/hold/clear` | Public | Contribute Queue Hold Clear | `pkg/dashboard/api_contribute.go:294` | +| `GET` | `/api/contribute/interests` | Public | Contribute Interests | `pkg/dashboard/api_contribute.go:300` | +| `PUT` | `/api/contribute/interests` | Public | Contribute Interests | `pkg/dashboard/api_contribute.go:301` | +| `GET` | `/api/contributors` | Dashboard auth/session | Contributors List | `pkg/dashboard/api_contribute.go:309` | +| `GET` | `/api/contributors/{id}` | Dashboard auth/session | Contributor Get | `pkg/dashboard/api_contribute.go:310` | | `POST` | `/api/contributors/{id}/wall-mute` | Owner only | Mute or unmute a contributor from posting to the contributor wall; action is audit logged. | `pkg/dashboard/api_contribute.go` | -| `PUT` | `/api/contributors/{id}/trust` | Owner only | Contributor Trust | `pkg/dashboard/api_contribute.go:303` | -| `PUT` | `/api/contributors/{id}/agent-role` | Owner only | Contributor Agent Role | `pkg/dashboard/api_contribute.go:304` | -| `PUT` | `/api/contributors/{id}/agent-role-grants` | Owner only | Contributor Agent Role Grants | `pkg/dashboard/api_contribute.go:305` | -| `POST` | `/api/contributors/{id}/revoke` | Owner only | Contributor Revoke | `pkg/dashboard/api_contribute.go:306` | -| `POST` | `/api/contributors/{id}/requeue` | Dashboard auth/session | Contributor Requeue | `pkg/dashboard/api_contribute.go:307` | -| `DELETE` | `/api/contributors/{id}` | Owner only | Contributor Delete | `pkg/dashboard/api_contribute.go:308` | -| `GET` | `/contribute/dossier/{username}` | Public | Contributor Dossier Page (HTML) | `pkg/dashboard/api_contribute.go:200` | -| `GET` | `/api/contribute/run-stats` | Public | Contribute Run Stats | `pkg/dashboard/api_contribute.go:259` | -| `GET` | `/api/contribute/runs` | Public | Contribute Per-Run History | `pkg/dashboard/api_contribute.go:349` | -| `GET` | `/api/contribute/decisions` | Owner/read-write | Contribute Hub Decisions | `pkg/dashboard/api_contribute.go:359` | -| `GET` | `/api/contribute/dossier` | Public | Contribute Dossier Get | `pkg/dashboard/api_contribute.go:296` | -| `POST` | `/api/contribute/dossier` | Public | Contribute Dossier Update | `pkg/dashboard/api_contribute.go:297` | -| `GET` | `/api/leaderboard/contributor/{username}/heraldry` | Public | Contributor Heraldry | `pkg/dashboard/api_contribute.go:329` | +| `PUT` | `/api/contributors/{id}/trust` | Owner only | Contributor Trust | `pkg/dashboard/api_contribute.go:312` | +| `PUT` | `/api/contributors/{id}/agent-role` | Owner only | Contributor Agent Role | `pkg/dashboard/api_contribute.go:313` | +| `PUT` | `/api/contributors/{id}/agent-role-grants` | Owner only | Contributor Agent Role Grants | `pkg/dashboard/api_contribute.go:314` | +| `POST` | `/api/contributors/{id}/revoke` | Owner only | Contributor Revoke | `pkg/dashboard/api_contribute.go:315` | +| `POST` | `/api/contributors/{id}/requeue` | Dashboard auth/session | Contributor Requeue | `pkg/dashboard/api_contribute.go:316` | +| `DELETE` | `/api/contributors/{id}` | Owner only | Contributor Delete | `pkg/dashboard/api_contribute.go:317` | +| `GET` | `/contribute/dossier/{username}` | Public | Contributor Dossier Page (HTML) | `pkg/dashboard/api_contribute.go:209` | +| `GET` | `/api/contribute/run-stats` | Public | Contribute Run Stats | `pkg/dashboard/api_contribute.go:268` | +| `GET` | `/api/contribute/runs` | Public | Contribute Per-Run History | `pkg/dashboard/api_contribute.go:358` | +| `GET` | `/api/contribute/decisions` | Owner/read-write | Contribute Hub Decisions | `pkg/dashboard/api_contribute.go:368` | +| `GET` | `/api/contribute/dossier` | Public | Contribute Dossier Get | `pkg/dashboard/api_contribute.go:305` | +| `POST` | `/api/contribute/dossier` | Public | Contribute Dossier Update | `pkg/dashboard/api_contribute.go:306` | +| `GET` | `/api/leaderboard/contributor/{username}/heraldry` | Public | Contributor Heraldry | `pkg/dashboard/api_contribute.go:338` | | `GET` | `/api/cards/player/{asset}` | Public | OpenAPI alias for a cacheable contributor social-card SVG (`asset` is `.svg`). | `pkg/dashboard/social_cards.go:112` | | `GET` | `/api/cards/achievement/{login}/{asset}` | Public | OpenAPI alias for a cacheable attained-achievement SVG (`asset` is `.svg`). | `pkg/dashboard/social_cards.go:113` | | `GET` | `/api/cards/leaderboard/{asset}` | Public | OpenAPI alias for a cacheable leaderboard-summary SVG (`contributors.svg`, `teams.svg`, or `swarm.svg`). | `pkg/dashboard/social_cards.go:114` | @@ -58,10 +58,10 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f | `GET` | `/share/player/{login}` | Public | Share landing page with Open Graph/Twitter metadata for a contributor card and link to the public dossier. | `pkg/dashboard/social_cards.go:115` | | `GET` | `/share/achievement/{login}/{achievementID}` | Public | Share landing page with metadata for an unlocked achievement card and link to the public dossier. | `pkg/dashboard/social_cards.go:116` | | `GET` | `/share/leaderboard/{board}` | Public | Share landing page with metadata for a public leaderboard card and link to live standings. | `pkg/dashboard/social_cards.go:117` | -| `PUT` | `/api/contribute/help-links` | Owner/read-write | Contribute Help Links | `pkg/dashboard/api_contribute.go:217` | -| `GET` | `/api/contribute/operators/message` | Public path; caller identity resolved server-side (401 anonymous, 403 without a profile) | Returns only the signed-in contributor's unacknowledged operator messages; no username/body field can select another recipient ([#8461](https://github.com/hivecommons/hive/issues/8461)). | `pkg/dashboard/api_contribute.go:252` | -| `POST` | `/api/contribute/operators/message` | Owner/read-write | Sends a sanitized, length-capped one-to-one operator note to a contributor profile, persists it until acknowledgement, and pushes it to matching live relay sockets only ([#8461](https://github.com/hivecommons/hive/issues/8461)). | `pkg/dashboard/api_contribute.go:253` | -| `POST` | `/api/contribute/operators/message/ack` | Public path; caller identity resolved server-side | Acknowledges the signed-in contributor's own message, optionally recording a short sanitized reply for operators. | `pkg/dashboard/api_contribute.go:254` | +| `PUT` | `/api/contribute/help-links` | Owner/read-write | Contribute Help Links | `pkg/dashboard/api_contribute.go:226` | +| `GET` | `/api/contribute/operators/message` | Public path; caller identity resolved server-side (401 anonymous, 403 without a profile) | Returns only the signed-in contributor's unacknowledged operator messages; no username/body field can select another recipient ([#8461](https://github.com/hivecommons/hive/issues/8461)). | `pkg/dashboard/api_contribute.go:261` | +| `POST` | `/api/contribute/operators/message` | Owner/read-write | Sends a sanitized, length-capped one-to-one operator note to a contributor profile, persists it until acknowledgement, and pushes it to matching live relay sockets only ([#8461](https://github.com/hivecommons/hive/issues/8461)). | `pkg/dashboard/api_contribute.go:262` | +| `POST` | `/api/contribute/operators/message/ack` | Public path; caller identity resolved server-side | Acknowledges the signed-in contributor's own message, optionally recording a short sanitized reply for operators. | `pkg/dashboard/api_contribute.go:263` | ### Issue claims (hivecommons/hive#8380) diff --git a/src/docs/api-reference/dashboard-misc.md b/src/docs/api-reference/dashboard-misc.md index 59e1fe61a8..d5691c9556 100644 --- a/src/docs/api-reference/dashboard-misc.md +++ b/src/docs/api-reference/dashboard-misc.md @@ -47,21 +47,21 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f | `PUT` | `/api/hive-id` | Owner only | Hive IDSet | `pkg/dashboard/api.go:431` | | `POST` | `/api/chat` | Dashboard auth/session | Chat | `pkg/dashboard/api.go:460` | | `GET` | `/api/auth/token` | Public | Auth Token | `pkg/dashboard/api.go:494` | -| `GET` | `/api/v1/` | GitHub token | Contributor v1 API dispatcher | `pkg/dashboard/api_contribute.go:310` | -| `POST` | `/api/v1/` | GitHub token | Contributor v1 API dispatcher | `pkg/dashboard/api_contribute.go:311` | -| `GET` | `/api/docs` | Dashboard auth/session | APIDocs | `pkg/dashboard/api_contribute.go:312` | -| `GET` | `/leaderboard` | Public | Leaderboard Page | `pkg/dashboard/api_contribute.go:314` | -| `GET` | `/api/leaderboard` | Public | Leaderboard API | `pkg/dashboard/api_contribute.go:315` | -| `GET` | `/api/leaderboard/teams` | Public | Team Leaderboards | `pkg/dashboard/api_contribute.go:316` | -| `GET` | `/api/leaderboard/style` | Public | Leaderboard Style | `pkg/dashboard/api_contribute.go:317` | +| `GET` | `/api/v1/` | GitHub token | Contributor v1 API dispatcher | `pkg/dashboard/api_contribute.go:319` | +| `POST` | `/api/v1/` | GitHub token | Contributor v1 API dispatcher | `pkg/dashboard/api_contribute.go:320` | +| `GET` | `/api/docs` | Dashboard auth/session | APIDocs | `pkg/dashboard/api_contribute.go:321` | +| `GET` | `/leaderboard` | Public | Leaderboard Page | `pkg/dashboard/api_contribute.go:323` | +| `GET` | `/api/leaderboard` | Public | Leaderboard API | `pkg/dashboard/api_contribute.go:324` | +| `GET` | `/api/leaderboard/teams` | Public | Team Leaderboards | `pkg/dashboard/api_contribute.go:325` | +| `GET` | `/api/leaderboard/style` | Public | Leaderboard Style | `pkg/dashboard/api_contribute.go:326` | | `GET` | `/api/leaderboard/battle-log` | Public | Scrubbed public Battle Log activity feed for leaderboard widgets. | `pkg/dashboard/battle_log.go:108` | | `GET` | `/api/leaderboard/hive-of-week` | Public | Featured weekly project metadata, configured render URLs (empty when none), gource source URL, and embed snippets. | `pkg/dashboard/battle_log.go:109` | | `GET` | `/api/leaderboard/gource-log` | Public | Gource custom log source for a project/week, derived from public hive event data. | `pkg/dashboard/battle_log.go:110` | | `POST` | `/api/leaderboard/hive-of-week/archive` | Owner only | Archive the selected project's weekly gource source log into knowledge; stores source only, never rendered video. | `pkg/dashboard/battle_log.go:111` | -| `GET` | `/api/leaderboard/contributor/{username}` | Public | Contributor Profile | `pkg/dashboard/api_contribute.go:324` | -| `GET` | `/api/hives` | Dashboard auth/session | Hives List | `pkg/dashboard/api_contribute.go:335` | -| `POST` | `/api/hives/register` | Dashboard auth/session | Hives Register | `pkg/dashboard/api_contribute.go:336` | -| `POST` | `/api/hives/{id}/heartbeat` | Dashboard auth/session | Hives Heartbeat | `pkg/dashboard/api_contribute.go:337` | -| `DELETE` | `/api/hives/{id}` | Owner only | Hives Delete | `pkg/dashboard/api_contribute.go:338` | -| `POST` | `/api/hives/onboard` | Dashboard auth/session | Hives Onboard | `pkg/dashboard/api_contribute.go:339` | +| `GET` | `/api/leaderboard/contributor/{username}` | Public | Contributor Profile | `pkg/dashboard/api_contribute.go:333` | +| `GET` | `/api/hives` | Dashboard auth/session | Hives List | `pkg/dashboard/api_contribute.go:344` | +| `POST` | `/api/hives/register` | Dashboard auth/session | Hives Register | `pkg/dashboard/api_contribute.go:345` | +| `POST` | `/api/hives/{id}/heartbeat` | Dashboard auth/session | Hives Heartbeat | `pkg/dashboard/api_contribute.go:346` | +| `DELETE` | `/api/hives/{id}` | Owner only | Hives Delete | `pkg/dashboard/api_contribute.go:347` | +| `POST` | `/api/hives/onboard` | Dashboard auth/session | Hives Onboard | `pkg/dashboard/api_contribute.go:348` | | `GET` | `/sso` | Public | SSO | `pkg/dashboard/server.go:1663` | From 0157cc912d41ab0c667659fc03b8f07143d074d0 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 31 Oct 2026 07:07:39 -0400 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=90=9B=20test:=20lift=20navCountDelta?= =?UTF-8?q?=20into=20the=20contributors=20tooltip=20node=20fixture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrew Anderson --- dashboard/test/config-tooltip.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dashboard/test/config-tooltip.test.js b/dashboard/test/config-tooltip.test.js index 0cfd1803a3..cdce459843 100644 --- a/dashboard/test/config-tooltip.test.js +++ b/dashboard/test/config-tooltip.test.js @@ -164,6 +164,9 @@ function harness() { 'let _configTooltipCloseTimer = 0;', ...HELPER_FUNCTIONS.map(extractFunction), ...['esc', 'sidebarPairBadgeText', 'setSidebarPairBadge', 'contributorsOnlineTitle', 'contributorsOnlineTooltip', 'updateContributorBadge'].map(extractFunction), + extractConst('NAV_COUNT_CUE_MS'), + 'const _navCountDeltas = new Map();', + extractFunction('navCountDelta'), 'let _cachedContributors = [];', 'function refreshSectionCardShell() {} function setSectionSummary() {} function contributorsSectionSummary() {}', extractListeners(), From 10b8032b98df4a1c7d2300a07a2e590d43785668 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 31 Oct 2026 07:23:36 -0400 Subject: [PATCH 5/5] fix: reuse contributor tooltip node; teach nav-count fixture createElement Signed-off-by: Andrew Anderson --- src/pkg/dashboard/nav_count_delta.test.js | 12 +++++++++--- src/pkg/dashboard/static-src/js/contributors.js | 13 +++++++++---- src/pkg/dashboard/static/index.html | 13 +++++++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/pkg/dashboard/nav_count_delta.test.js b/src/pkg/dashboard/nav_count_delta.test.js index ce25ebee22..048dd92582 100644 --- a/src/pkg/dashboard/nav_count_delta.test.js +++ b/src/pkg/dashboard/nav_count_delta.test.js @@ -21,14 +21,17 @@ function load() { const el = { id, attrs, textContent: '', hidden: false, title: '', setAttribute(k, v) { attrs[k] = String(v); }, removeAttribute(k) { delete attrs[k]; }, - querySelector() { return null; }, + children: [], + querySelector(sel) { return this.children.find(c => sel === '.' + c.className.split(' ').pop()) || null; }, + appendChild(child) { this.children.push(child); return child; }, classList: { toggle() {} }, }; elements.set(id, el); return el; } IDS.concat(['activity-monitor-panel']).forEach(element); - const document = { hidden: false, getElementById: id => elements.get(id) || null }; + const document = { hidden: false, getElementById: id => elements.get(id) || null, + createElement: tag => ({ tag, className: '', hidden: false, innerHTML: '' }) }; const ctx = vm.createContext({ document, window: {}, console, Number, setTimeout(cb, ms) { const id = ++nextTimer; timers.set(id, { cb, at: now + ms }); return id; }, clearTimeout(id) { timers.delete(id); }, @@ -67,10 +70,13 @@ function load() { function stageTrackerWaitingToast() {} function stageTrackerActedAgo() { return ''; } function setIfChanged(el, text) { el.innerHTML = text; } + var _configTooltipTrigger = null; + function positionConfigTooltip() {} + function esc(s) { return String(s); } `, ctx); for (const [file, names] of [ ['knowledge', ['sidebarPairBadgeText', 'setSidebarPairBadge', 'setSidebarCountBadge', 'kbTotalFactsFromStats', 'kbFactsLabel', 'kbSidebarFactCount', 'fetchKnowledgeStats']], - ['contributors', ['contributorsOnlineTitle', 'updateContributorBadge']], + ['contributors', ['contributorsOnlineTitle', 'contributorsOnlineTooltip', 'updateContributorBadge']], ['tracker-waiting', ['stageTrackerWaitingOnYou', 'stageTrackerWaitingTitle', 'stageTrackerWaitKindWords', 'stageTrackerRenderWaiting']], ['tracker-words-stage', ['stageTrackerDefaultFilter']], ['tracker-filter-render', ['renderStageTracker']], diff --git a/src/pkg/dashboard/static-src/js/contributors.js b/src/pkg/dashboard/static-src/js/contributors.js index eb1071f344..ebb4434688 100644 --- a/src/pkg/dashboard/static-src/js/contributors.js +++ b/src/pkg/dashboard/static-src/js/contributors.js @@ -517,11 +517,16 @@ if (sidebarBadge) setSidebarPairBadge(sidebarBadge, onlineCount, totalCount); navCountDelta(sidebarBadge, onlineCount, 'Contributors: ' + tip); if (sidebarBadge) { - const tooltip = document.createElement('span'); - tooltip.className = 'config-tooltip contributor-online-tooltip'; - tooltip.hidden = true; + // Reuse the tooltip node across refreshes so the pill does not grow + // one hidden span per poll. + let tooltip = sidebarBadge.querySelector('.contributor-online-tooltip'); + if (!tooltip) { + tooltip = document.createElement('span'); + tooltip.className = 'config-tooltip contributor-online-tooltip'; + tooltip.hidden = true; + sidebarBadge.appendChild(tooltip); + } tooltip.innerHTML = contributorsOnlineTooltip(pool); - sidebarBadge.appendChild(tooltip); if (_configTooltipTrigger === sidebarBadge) positionConfigTooltip(sidebarBadge); } setSectionSummary('contributors-section', contributorsSectionSummary(_cachedContributors || [], pool)); diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 553107c333..9f59abe610 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -42912,11 +42912,16 @@ if (sidebarBadge) setSidebarPairBadge(sidebarBadge, onlineCount, totalCount); navCountDelta(sidebarBadge, onlineCount, 'Contributors: ' + tip); if (sidebarBadge) { - const tooltip = document.createElement('span'); - tooltip.className = 'config-tooltip contributor-online-tooltip'; - tooltip.hidden = true; + // Reuse the tooltip node across refreshes so the pill does not grow + // one hidden span per poll. + let tooltip = sidebarBadge.querySelector('.contributor-online-tooltip'); + if (!tooltip) { + tooltip = document.createElement('span'); + tooltip.className = 'config-tooltip contributor-online-tooltip'; + tooltip.hidden = true; + sidebarBadge.appendChild(tooltip); + } tooltip.innerHTML = contributorsOnlineTooltip(pool); - sidebarBadge.appendChild(tooltip); if (_configTooltipTrigger === sidebarBadge) positionConfigTooltip(sidebarBadge); } setSectionSummary('contributors-section', contributorsSectionSummary(_cachedContributors || [], pool));