From ec62cd9083b8bcc5733d11d4c1399d92746adb7a Mon Sep 17 00:00:00 2001 From: ribs Date: Tue, 3 Mar 2026 15:59:42 -0800 Subject: [PATCH] fix: prevent silent muting from hiding pager messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Mute" button on pager cards persists muted addresses to localStorage with no visible indicator, making it easy to accidentally hide an address and forget about it. This caused flag fragment messages on RIC 1337 to silently disappear. - Add "X muted source(s) — Unmute All" indicator to sidebar - Stop persisting hideToneOnly filter across sessions so the default (show all) always applies on page load - Remove default checked state from Tone Only filter checkbox Co-Authored-By: Claude Opus 4.6 --- static/js/components/signal-cards.js | 27 +++++++++++++++++++++++++++ templates/index.html | 7 ++++++- templates/partials/modes/pager.html | 10 +++++++++- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/static/js/components/signal-cards.js b/static/js/components/signal-cards.js index 07e81f8..43575d6 100644 --- a/static/js/components/signal-cards.js +++ b/static/js/components/signal-cards.js @@ -1492,6 +1492,7 @@ const SignalCards = (function() { muted.push(address); localStorage.setItem('mutedAddresses', JSON.stringify(muted)); showToast(`Source ${address} hidden from view`); + updateMutedIndicator(); // Hide existing cards with this address document.querySelectorAll(`.signal-card[data-address="${address}"], .signal-card[data-callsign="${address}"], .signal-card[data-sensor-id="${address}"]`).forEach(card => { @@ -1510,6 +1511,30 @@ const SignalCards = (function() { return muted.includes(address); } + /** + * Unmute all addresses and refresh display + */ + function unmuteAll() { + localStorage.setItem('mutedAddresses', '[]'); + updateMutedIndicator(); + showToast('All sources unmuted'); + // Reload to re-display previously muted messages + location.reload(); + } + + /** + * Update the muted address count indicator in the sidebar + */ + function updateMutedIndicator() { + const muted = JSON.parse(localStorage.getItem('mutedAddresses') || '[]'); + const info = document.getElementById('mutedAddressInfo'); + const count = document.getElementById('mutedAddressCount'); + if (info && count) { + count.textContent = muted.length; + info.style.display = muted.length > 0 ? 'block' : 'none'; + } + } + /** * Show location on map (for APRS) */ @@ -2262,6 +2287,8 @@ const SignalCards = (function() { copyMessage, muteAddress, isAddressMuted, + unmuteAll, + updateMutedIndicator, showOnMap, showStationRawData, showSignalDetails, diff --git a/templates/index.html b/templates/index.html index f4493df..eb49f7e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3663,7 +3663,11 @@ const saved = localStorage.getItem('pagerFilters'); if (saved) { try { - pagerFilters = JSON.parse(saved); + const parsed = JSON.parse(saved); + // Only persist keywords across sessions. + // hideToneOnly defaults to false every session so users + // always see the full traffic stream unless they opt-in. + if (Array.isArray(parsed.keywords)) pagerFilters.keywords = parsed.keywords; } catch (e) { console.warn('Failed to load pager filters:', e); } @@ -3964,6 +3968,7 @@ // Load pager message filters loadPagerFilters(); + if (typeof SignalCards !== 'undefined') SignalCards.updateMutedIndicator(); // Initialize dropdown nav active state updateDropdownActiveState(); diff --git a/templates/partials/modes/pager.html b/templates/partials/modes/pager.html index 7d75119..dba62a4 100644 --- a/templates/partials/modes/pager.html +++ b/templates/partials/modes/pager.html @@ -62,7 +62,7 @@

Message Filters

@@ -73,6 +73,14 @@
Messages matching these keywords will be hidden from display but still logged.
+