Ads echo paths modal

This commit is contained in:
Jack Kingsman
2026-02-09 23:26:33 -08:00
parent 28069ab732
commit 6389cc656e
2 changed files with 30 additions and 1 deletions

View File

@@ -462,7 +462,26 @@ export function MessageList({
)}
</>
)}
{msg.outgoing && (msg.acked > 0 ? `${msg.acked > 1 ? msg.acked : ''}` : ' ?')}
{msg.outgoing && (msg.acked > 0
? msg.paths && msg.paths.length > 0
? <span
className="cursor-pointer hover:text-primary"
onClick={(e) => {
e.stopPropagation();
setSelectedPath({
paths: msg.paths!,
senderInfo: {
name: config?.name || 'Unknown',
publicKeyOrPrefix: config?.public_key || '',
lat: config?.lat ?? null,
lon: config?.lon ?? null,
},
});
}}
title="View echo paths"
>{`${msg.acked > 1 ? msg.acked : ''}`}</span>
: `${msg.acked > 1 ? msg.acked : ''}`
: ' ?')}
</div>
</div>
</div>

View File

@@ -10,6 +10,7 @@ import {
import { Button } from './ui/button';
import {
resolvePath,
parsePathHops,
calculateDistance,
isValidLocation,
formatDistance,
@@ -60,6 +61,15 @@ export function PathModal({ open, onClose, paths, senderInfo, contacts, config }
</DialogHeader>
<div className="flex-1 overflow-y-auto py-2 space-y-4">
{/* Raw path summary */}
<div className="text-xs font-mono text-muted-foreground/70 pb-2 border-b border-border">
{paths.map((p, index) => {
const hops = parsePathHops(p.path);
const rawPath = hops.length > 0 ? hops.join('->') : 'direct';
return <div key={index}>{rawPath}</div>;
})}
</div>
{resolvedPaths.map((pathData, index) => (
<div key={index}>
{!hasSinglePath && (