Add 'View packet' link in channel chat messages

Include packetId in channel message API response, render as link
in message metadata row that navigates to #/packets/id/<id>.
This commit is contained in:
you
2026-03-18 23:19:37 +00:00
parent 88d757e27f
commit 5055135eb7
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -398,7 +398,7 @@
<div class="ch-msg-content">
<div class="ch-msg-sender ch-sender-link ch-tappable" style="color:${senderColor}" data-node="${safeId}">${escapeHtml(sender)}</div>
<div class="ch-msg-bubble">${displayText}</div>
<div class="ch-msg-meta">${meta.join(' · ')}</div>
<div class="ch-msg-meta">${meta.join(' · ')}${msg.packetId ? ` · <a href="#/packets/id/${msg.packetId}" class="ch-analyze-link">View packet →</a>` : ''}</div>
</div>
</div>`;
}).join('');
+1
View File
@@ -994,6 +994,7 @@ app.get('/api/channels/:hash/messages', (req, res) => {
encrypted: !decoded.text && !decoded.sender,
timestamp: pkt.timestamp,
sender_timestamp: decoded.sender_timestamp || null,
packetId: pkt.id,
repeats: 1,
observers: [pkt.observer_name || pkt.observer_id].filter(Boolean),
hops: decoded.path_len || (pkt.path_json ? JSON.parse(pkt.path_json).length : 0),