fix: hash size badge colors — 1B orange, 2B pale green, 3B bright green

1-byte is worst (most collisions), 3-byte is best (least collisions).
Colors now reflect quality: orange → pale green → bright green.
This commit is contained in:
you
2026-03-23 16:50:12 +00:00
parent 3f5c0dc5a6
commit 727fdc5568
+3 -2
View File
@@ -185,8 +185,9 @@
if (n.hash_size_inconsistent && p.payload_type === 4 && p.raw_hex) {
const pb = parseInt(p.raw_hex.slice(2, 4), 16);
const hs = ((pb >> 6) & 0x3) + 1;
const isDefault = hs === n.hash_size;
hashSizeBadge = ` <span class="badge" style="background:${isDefault ? 'var(--surface-2)' : 'var(--status-yellow)'};color:${isDefault ? 'var(--text-muted)' : '#000'};font-size:9px;font-family:var(--mono)">${hs}B</span>`;
const hsColor = hs >= 3 ? '#16a34a' : hs === 2 ? '#86efac' : '#f97316';
const hsFg = hs === 2 ? '#064e3b' : '#fff';
hashSizeBadge = ` <span class="badge" style="background:${hsColor};color:${hsFg};font-size:9px;font-family:var(--mono)">${hs}B</span>`;
}
return `<div class="node-activity-item">
<span class="node-activity-time">${timeAgo(p.timestamp)}</span>