From ac1667bd01936804d0acee458bb10d36e25e024f Mon Sep 17 00:00:00 2001 From: MarekWo Date: Mon, 2 Mar 2026 17:25:25 +0100 Subject: [PATCH] fix(ui): fall back to echo SNR when message SNR is missing meshcore library doesn't always provide SNR in CHANNEL_MSG_RECV events. Use the first echo path's SNR as fallback for inline display. Co-Authored-By: Claude Opus 4.6 --- app/static/js/app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/static/js/app.js b/app/static/js/app.js index e230bab..8d55a77 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -775,8 +775,11 @@ function createMessageElement(msg) { } let metaParts = []; - if (msg.snr !== undefined && msg.snr !== null) { - metaParts.push(`SNR: ${msg.snr.toFixed(1)} dB`); + // Use message SNR, or fall back to first echo path SNR + const displaySnr = (msg.snr !== undefined && msg.snr !== null) ? msg.snr + : (msg.echo_snrs && msg.echo_snrs.length > 0) ? msg.echo_snrs[0] : null; + if (displaySnr !== null) { + metaParts.push(`SNR: ${displaySnr.toFixed(1)} dB`); } if (msg.path_len !== undefined && msg.path_len !== null) { metaParts.push(`Hops: ${msg.path_len}`);