From 1b21983ce7562c186c2517d0a4e57c422a82f2ad Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Tue, 2 Jun 2026 23:41:56 -0700 Subject: [PATCH] =?UTF-8?q?Artist=20Map=20v2=20=E2=80=94=20Phase=202:=20ri?= =?UTF-8?q?cher=20real=20data=20on=20hover=20(connection=20counts)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Investigating 'each mode is different / not good enough' showed the engine is already shared across all three modes (watchlist/genre/explore) and already does LOD rendering, eased camera, and debounced zoom-rebuilds — so the inconsistency was perception driven mostly by the (now-fixed) lag, not separate engines. This phase surfaces more real data the map already has: the hover tooltip now shows each artist's live connection count (computed from the map edges), shown consistently across all three modes. Cheap (only recomputed when the hovered artist changes, after Phase 1's de-churn). Additive + safe. JS syntax clean. --- webui/static/discover.js | 6 ++++++ webui/static/style.css | 1 + 2 files changed, 7 insertions(+) diff --git a/webui/static/discover.js b/webui/static/discover.js index e3b0960e..1872ea5d 100644 --- a/webui/static/discover.js +++ b/webui/static/discover.js @@ -5754,12 +5754,18 @@ function _artMapShowTooltip(e, node) { const genres = (node.genres || []).slice(0, 3); const genreHTML = genres.length ? `
${genres.map(g => `${escapeHtml(g)}`).join('')}
` : ''; const typeLabel = node.type === 'watchlist' ? '★ Watchlist' : ''; + // Real connection count from the map's edges (cheap; only on hover change). + let conn = 0; + const edges = _artMap.edges || []; + for (const ed of edges) { if (ed.source === node.id || ed.target === node.id) conn++; } + const connHTML = conn ? `
${conn} connection${conn === 1 ? '' : 's'}
` : ''; tip.innerHTML = `
${img}
${escapeHtml(node.name)}
${typeLabel} + ${connHTML} ${genreHTML}
diff --git a/webui/static/style.css b/webui/static/style.css index 5ffeaa8b..f5b13454 100644 --- a/webui/static/style.css +++ b/webui/static/style.css @@ -34299,6 +34299,7 @@ div.artist-hero-badge { .artmap-tip-info { min-width: 0; } .artmap-tip-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .artmap-tip-badge { display: inline-block; font-size: 9px; font-weight: 700; color: #fbbf24; margin-top: 2px; } +.artmap-tip-conn { font-size: 10px; font-weight: 600; color: rgba(138,43,226,0.85); margin-top: 3px; } .artmap-tip-genres { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; } .artmap-tip-genres span { font-size: 9px; padding: 2px 6px; border-radius: 4px;