mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
fix: prevent silent muting from hiding pager messages
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 <noreply@anthropic.com>
This commit is contained in:
@@ -1492,6 +1492,7 @@ const SignalCards = (function() {
|
|||||||
muted.push(address);
|
muted.push(address);
|
||||||
localStorage.setItem('mutedAddresses', JSON.stringify(muted));
|
localStorage.setItem('mutedAddresses', JSON.stringify(muted));
|
||||||
showToast(`Source ${address} hidden from view`);
|
showToast(`Source ${address} hidden from view`);
|
||||||
|
updateMutedIndicator();
|
||||||
|
|
||||||
// Hide existing cards with this address
|
// 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 => {
|
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);
|
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)
|
* Show location on map (for APRS)
|
||||||
*/
|
*/
|
||||||
@@ -2262,6 +2287,8 @@ const SignalCards = (function() {
|
|||||||
copyMessage,
|
copyMessage,
|
||||||
muteAddress,
|
muteAddress,
|
||||||
isAddressMuted,
|
isAddressMuted,
|
||||||
|
unmuteAll,
|
||||||
|
updateMutedIndicator,
|
||||||
showOnMap,
|
showOnMap,
|
||||||
showStationRawData,
|
showStationRawData,
|
||||||
showSignalDetails,
|
showSignalDetails,
|
||||||
|
|||||||
@@ -3663,7 +3663,11 @@
|
|||||||
const saved = localStorage.getItem('pagerFilters');
|
const saved = localStorage.getItem('pagerFilters');
|
||||||
if (saved) {
|
if (saved) {
|
||||||
try {
|
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) {
|
} catch (e) {
|
||||||
console.warn('Failed to load pager filters:', e);
|
console.warn('Failed to load pager filters:', e);
|
||||||
}
|
}
|
||||||
@@ -3964,6 +3968,7 @@
|
|||||||
|
|
||||||
// Load pager message filters
|
// Load pager message filters
|
||||||
loadPagerFilters();
|
loadPagerFilters();
|
||||||
|
if (typeof SignalCards !== 'undefined') SignalCards.updateMutedIndicator();
|
||||||
|
|
||||||
// Initialize dropdown nav active state
|
// Initialize dropdown nav active state
|
||||||
updateDropdownActiveState();
|
updateDropdownActiveState();
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<h3>Message Filters</h3>
|
<h3>Message Filters</h3>
|
||||||
<div class="checkbox-group" style="margin-bottom: 10px;">
|
<div class="checkbox-group" style="margin-bottom: 10px;">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" id="filterToneOnly" checked onchange="savePagerFilters()">
|
<input type="checkbox" id="filterToneOnly" onchange="savePagerFilters()">
|
||||||
Hide "Tone Only" messages
|
Hide "Tone Only" messages
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -73,6 +73,14 @@
|
|||||||
<div class="info-text" style="font-size: 10px; color: #666; margin-top: 5px;">
|
<div class="info-text" style="font-size: 10px; color: #666; margin-top: 5px;">
|
||||||
Messages matching these keywords will be hidden from display but still logged.
|
Messages matching these keywords will be hidden from display but still logged.
|
||||||
</div>
|
</div>
|
||||||
|
<div id="mutedAddressInfo" style="margin-top: 8px; display: none;">
|
||||||
|
<span style="font-size: 11px; color: var(--text-dim, #888);">
|
||||||
|
<span id="mutedAddressCount">0</span> muted source(s)
|
||||||
|
</span>
|
||||||
|
<button onclick="SignalCards.unmuteAll()" style="margin-left: 6px; font-size: 10px; padding: 2px 8px; cursor: pointer; background: transparent; border: 1px solid var(--border-color, #444); color: var(--text-secondary, #aaa); border-radius: 3px;">
|
||||||
|
Unmute All
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Antenna Guide -->
|
<!-- Antenna Guide -->
|
||||||
|
|||||||
Reference in New Issue
Block a user