Issue #19 Improve DX Cluster Exclusion (partial)

Modify the existing callsign exclusion to:
1. Only exclude DX stations, instead of both DE and DX
2. Treat the entered callsign as prefix, instead of matching any substring
e.g. excluding "VE" now excludes 'VE3ABC' but not 'K3VE'
pull/105/head
Rich Freedman 1 day ago
parent a3f753c0dd
commit 21f07d1cb2

@ -279,7 +279,7 @@ export const DXFilterManager = ({ filters, onFilterChange, isOpen, onClose }) =>
<div> <div>
<div style={{ marginBottom: '16px' }}> <div style={{ marginBottom: '16px' }}>
<div style={{ fontSize: '13px', fontWeight: '600', color: 'var(--text-primary)', marginBottom: '8px' }}> <div style={{ fontSize: '13px', fontWeight: '600', color: 'var(--text-primary)', marginBottom: '8px' }}>
Exclude List - Hide these callsigns Exclude List - Hide DX callsigns beginning with:
</div> </div>
<div style={{ display: 'flex', gap: '8px' }}> <div style={{ display: 'flex', gap: '8px' }}>
<input <input

@ -26,17 +26,16 @@ export const useDXCluster = (source = 'auto', filters = {}) => {
// Watchlist only mode - must match watchlist // Watchlist only mode - must match watchlist
if (filters.watchlistOnly && filters.watchlist?.length > 0) { if (filters.watchlistOnly && filters.watchlist?.length > 0) {
const matchesWatchlist = filters.watchlist.some(w => const matchesWatchlist = filters.watchlist.some(w =>
spot.call?.toUpperCase().includes(w.toUpperCase()) || spot.call?.toUpperCase().includes(w.toUpperCase())
spot.spotter?.toUpperCase().includes(w.toUpperCase())
); );
if (!matchesWatchlist) return false; if (!matchesWatchlist) return false;
} }
// Exclude list - hide matching calls // Exclude list - hide matching calls - match the call as a prefix
if (filters.excludeList?.length > 0) { if (filters.excludeList?.length > 0) {
const isExcluded = filters.excludeList.some(exc => const isExcluded = filters.excludeList.some(exc =>
spot.call?.toUpperCase().includes(exc.toUpperCase()) || spot.call?.toUpperCase().startsWith(exc.toUpperCase()) ||
spot.spotter?.toUpperCase().includes(exc.toUpperCase()) spot.spotter?.toUpperCase().startsWith(exc.toUpperCase())
); );
if (isExcluded) return false; if (isExcluded) return false;
} }

@ -242,8 +242,7 @@ export const filterDXPaths = (paths, filters) => {
// Exclude list - hide matching callsigns // Exclude list - hide matching callsigns
if (filters.excludeList?.length > 0) { if (filters.excludeList?.length > 0) {
const isExcluded = filters.excludeList.some(e => const isExcluded = filters.excludeList.some(e =>
path.dxCall?.toUpperCase().includes(e.toUpperCase()) || path.dxCall?.toUpperCase().startsWith(e.toUpperCase())
path.spotter?.toUpperCase().includes(e.toUpperCase())
); );
if (isExcluded) return false; if (isExcluded) return false;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.