merge: mesh multiversion and transport pills
# Conflicts: # core/archipelago/src/mesh/listener/decode.rs # core/archipelago/src/mesh/meshtastic.rs
This commit is contained in:
@@ -78,6 +78,9 @@ export interface MeshMessage {
|
||||
timestamp: string
|
||||
delivered: boolean
|
||||
encrypted: boolean
|
||||
/// How the message traveled: "lora" (mesh radio), "fips", or "tor".
|
||||
/// Drives the per-message transport pill. Absent until known.
|
||||
transport?: string | null
|
||||
message_type?: MeshMessageTypeLabel
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
typed_payload?: Record<string, any> | null
|
||||
|
||||
@@ -1076,6 +1076,17 @@ function isEditedMessage(msg: MeshMessage): number | null {
|
||||
function isDeletedMessage(msg: MeshMessage): boolean {
|
||||
return msg.message_type === 'delete' || msg.typed_payload?.deleted === true
|
||||
}
|
||||
/// Short label for the per-message transport pill (Mesh / FIPS / Tor), or null
|
||||
/// when the transport isn't known. Covers both meshcore and meshtastic since
|
||||
/// the field lives on the shared MeshMessage.
|
||||
function transportLabel(msg: MeshMessage): string | null {
|
||||
switch (msg.transport) {
|
||||
case 'lora': return 'Mesh'
|
||||
case 'fips': return 'FIPS'
|
||||
case 'tor': return 'Tor'
|
||||
default: return null
|
||||
}
|
||||
}
|
||||
|
||||
// Read-receipt: after render, if the bottom message is from the peer (direction='received')
|
||||
// and has a MessageKey, fire mesh.send-read-receipt up to that seq. Debounced so scroll
|
||||
@@ -1798,6 +1809,7 @@ function isImageMime(mime?: string): boolean {
|
||||
<!-- Default: plain text -->
|
||||
<div v-else class="mesh-chat-bubble-text">{{ msg.plaintext }}</div>
|
||||
<div class="mesh-chat-bubble-meta">
|
||||
<span v-if="transportLabel(msg)" class="mesh-chat-transport" :class="'transport-' + msg.transport" :title="'Delivered over ' + transportLabel(msg)">{{ transportLabel(msg) }}</span>
|
||||
<span v-if="msg.encrypted" class="mesh-chat-e2e">E2E</span>
|
||||
<span v-if="isEditedMessage(msg) !== null" class="mesh-chat-edited">(edited)</span>
|
||||
<span v-if="msg.delivered && msg.direction === 'sent'" class="mesh-chat-ack">✓✓</span>
|
||||
|
||||
@@ -148,6 +148,11 @@
|
||||
.mesh-chat-bubble-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; justify-content: flex-end; }
|
||||
.mesh-chat-bubble-time { font-size: 0.65rem; color: rgba(255, 255, 255, 0.3); }
|
||||
.mesh-chat-e2e { font-size: 0.55rem; font-weight: 700; color: #4ade80; padding: 0 3px; border: 1px solid rgba(74, 222, 128, 0.3); border-radius: 3px; }
|
||||
/* Per-message transport pill (Mesh / FIPS / Tor), styled like the E2E badge. */
|
||||
.mesh-chat-transport { font-size: 0.55rem; font-weight: 700; padding: 0 3px; border-radius: 3px; border: 1px solid currentColor; opacity: 0.85; }
|
||||
.mesh-chat-transport.transport-lora { color: #f59e0b; } /* Mesh/LoRa — amber */
|
||||
.mesh-chat-transport.transport-fips { color: #a78bfa; } /* FIPS — violet */
|
||||
.mesh-chat-transport.transport-tor { color: #818cf8; } /* Tor — indigo */
|
||||
.mesh-chat-ack { font-size: 0.7rem; color: #3b82f6; }
|
||||
.mesh-chat-compose { padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, 0.06); flex-shrink: 0; }
|
||||
.mesh-chat-send-error { color: #ef4444; font-size: 0.75rem; margin-bottom: 6px; }
|
||||
|
||||
Reference in New Issue
Block a user