From 70db798aeda4aabc9fca2cbb97b190194af6b2a9 Mon Sep 17 00:00:00 2001 From: you Date: Sun, 22 Mar 2026 23:24:02 +0000 Subject: [PATCH] Packet detail byte breakdown uses shared HopDisplay for path hops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces inline conflict rendering with HopDisplay.renderHop() — consistent regional-only tooltips everywhere. --- public/index.html | 2 +- public/packets.js | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/public/index.html b/public/index.html index cb142a9a..473548b7 100644 --- a/public/index.html +++ b/public/index.html @@ -86,7 +86,7 @@ - + diff --git a/public/packets.js b/public/packets.js index 3eb3f49a..394e31b0 100644 --- a/public/packets.js +++ b/public/packets.js @@ -1336,22 +1336,8 @@ const pathByte = parseInt(buf.slice(2, 4), 16); const hashSize = (pathByte >> 6) + 1; for (let i = 0; i < pathHops.length; i++) { - const hopEntry = hopNameCache[pathHops[i]]; - const hopName = hopEntry ? (typeof hopEntry === 'string' ? hopEntry : hopEntry.name) : null; - const hopPubkey = hopEntry?.pubkey || pathHops[i]; - const conflicts = hopEntry?.conflicts || []; - const distInfo = conflicts.length === 1 && conflicts[0].distKm != null - ? ` (${Math.round(conflicts[0].distKm)}km)` - : conflicts.length > 1 && conflicts.find(c => c.distKm != null) - ? ` (${Math.round(conflicts.find(c => c.distKm != null).distKm)}km)` - : ''; - const conflictInfo = conflicts.length > 1 - ? ` ⚠${conflicts.length}` - : ''; - const nameHtml = hopName - ? `${escapeHtml(hopName)}${distInfo}${conflictInfo}` - : ''; - const label = hopName ? `Hop ${i} — ${nameHtml}` : `Hop ${i}`; + const hopHtml = HopDisplay.renderHop(pathHops[i], hopNameCache[pathHops[i]]); + const label = `Hop ${i} — ${hopHtml}`; rows += fieldRow(off + i * hashSize, label, pathHops[i], ''); } off += hashSize * pathHops.length;