mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-03-30 14:45:52 +00:00
Conflict tooltips show only regional candidates, ignore global noise
This commit is contained in:
@@ -28,25 +28,27 @@ window.HopDisplay = (function() {
|
||||
const unreliable = entry.unreliable || false;
|
||||
const display = opts.hexMode ? h : (name ? escapeHtml(opts.truncate ? name.slice(0, opts.truncate) : name) : h);
|
||||
|
||||
// Build tooltip
|
||||
// Build tooltip — only show regional candidates (global is noise)
|
||||
let title = h;
|
||||
if (conflicts.length > 0) {
|
||||
const lines = conflicts.map(c => {
|
||||
const regional = conflicts.filter(c => c.regional);
|
||||
const shown = regional.length > 0 ? regional : conflicts; // fall back to all if no regional
|
||||
const lines = shown.map(c => {
|
||||
let line = c.name || c.pubkey?.slice(0, 12) || '?';
|
||||
if (c.distKm != null) line += ` (${c.distKm}km)`;
|
||||
if (c.filterMethod === 'geo') line += ' 📍';
|
||||
if (!c.regional) line += ' ⚑global';
|
||||
return line;
|
||||
});
|
||||
const regionLabel = totalRegional > 0 ? `${totalRegional} regional` : `${totalGlobal} global`;
|
||||
title = `${h} — ${regionLabel} match${conflicts.length > 1 ? 'es' : ''}:\n${lines.join('\n')}`;
|
||||
const label = regional.length > 0 ? `${regional.length} in region` : `${conflicts.length} global`;
|
||||
title = `${h} — ${label}:\n${lines.join('\n')}`;
|
||||
}
|
||||
if (unreliable) title += '\n✗ Unreliable — too far from neighbors';
|
||||
if (globalFallback) title += '\n⚑ No regional candidates — global fallback';
|
||||
if (globalFallback) title += '\n⚑ No regional candidates';
|
||||
|
||||
// Badge
|
||||
const warnBadge = conflicts.length > 1
|
||||
? `<span class="hop-warn" title="${escapeHtml(title)}">⚠${conflicts.length}</span>`
|
||||
// Badge — only count regional conflicts
|
||||
const regionalConflicts = conflicts.filter(c => c.regional);
|
||||
const badgeCount = regionalConflicts.length > 0 ? regionalConflicts.length : (globalFallback ? conflicts.length : 0);
|
||||
const warnBadge = badgeCount > 1
|
||||
? `<span class="hop-warn" title="${escapeHtml(title)}">⚠${badgeCount}</span>`
|
||||
: '';
|
||||
|
||||
const cls = [
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<script src="roles.js?v=1774325000"></script>
|
||||
<script src="region-filter.js?v=1774325000"></script>
|
||||
<script src="hop-resolver.js?v=1774221120"></script>
|
||||
<script src="hop-display.js?v=1774221628"></script>
|
||||
<script src="hop-display.js?v=1774221736"></script>
|
||||
<script src="app.js?v=1774126708"></script>
|
||||
<script src="home.js?v=1774042199"></script>
|
||||
<script src="packets.js?v=1774221628"></script>
|
||||
|
||||
Reference in New Issue
Block a user