feat(ui): PSK Reporter chip in the status bar
Beside the rig and amplifier chips, before ON AIR, because it is the same kind of fact they report: a link that is either up or it is not. Clicking it opens the settings that control it, like the amplifier chips do. Shown ONLY while the opening watch is on. A permanently grey chip for a feature nobody enabled is clutter, and the bar is 28 px tall — every chip in it has to earn its width. Green once decodes are arriving, amber while connected but silent: those are different states and an operator wondering why no opening has been announced needs to tell them apart. The count itself is in the tooltip, not on the chip — it moves several times a second on an open band, and a number flickering in the corner of the eye is a distraction rather than information.
This commit is contained in:
@@ -51,6 +51,7 @@ import {
|
||||
ReportLiveActivity, LiveLastQSOAgeSec,
|
||||
GetAmpStatuses, AmpOperate,
|
||||
GetFlexState, FlexAmpOperate,
|
||||
GetPSKReporterStatus,
|
||||
} from '../wailsjs/go/main/App';
|
||||
import { Combobox } from '@/components/ui/combobox';
|
||||
import { applyAwardRefs } from '@/lib/awardRefs';
|
||||
@@ -1709,6 +1710,16 @@ export default function App() {
|
||||
const [showSettings, setShowSettings] = useState(false);
|
||||
// Re-read the "beam on map" toggle when Preferences closes (it's edited there).
|
||||
useEffect(() => { if (!showSettings) setShowBeamOnMap(localStorage.getItem('opslog.showBeamOnMap') !== '0'); }, [showSettings]);
|
||||
// PSK Reporter feed, for the status-bar chip. Polled slowly: the chip only
|
||||
// says up or down, and the count behind it is a tooltip.
|
||||
const [pskr, setPskr] = useState<any>(null);
|
||||
useEffect(() => {
|
||||
const load = () => { GetPSKReporterStatus().then(setPskr).catch(() => {}); };
|
||||
load();
|
||||
const t = window.setInterval(load, 10000);
|
||||
return () => window.clearInterval(t);
|
||||
}, []);
|
||||
|
||||
// "ON AIR" status-bar badge: mirrors the multi-op live status this operator
|
||||
// publishes — online (blinking) when a QSO was logged in the last 5 min, else
|
||||
// offline. Publishing is always on for a shared MySQL logbook (no user toggle:
|
||||
@@ -6854,6 +6865,26 @@ export default function App() {
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
{/* PSK Reporter, next to the hardware chips because it is the same
|
||||
kind of fact: a link that is either up or it is not. Shown ONLY
|
||||
when the opening watch is on — a permanently grey chip for a
|
||||
feature nobody enabled is clutter, and the bar is 28 px.
|
||||
|
||||
The decode count is in the tooltip rather than the chip: it moves
|
||||
several times a second on an open band, and a number flickering in
|
||||
the corner of the eye is not information, it is a distraction. */}
|
||||
{pskr?.running && (
|
||||
<button
|
||||
type="button"
|
||||
title={t('pskr.tip', { n: pskr.received ?? 0, bands: (pskr.bands ?? []).join(' ') })}
|
||||
onClick={() => { setSettingsSection('cluster'); setShowSettings(true); }}
|
||||
className="inline-flex items-center gap-1.5 px-2 h-5 rounded border text-[11px] transition-colors border-border hover:bg-muted cursor-pointer shrink-0"
|
||||
>
|
||||
<span className={cn('size-2 rounded-full',
|
||||
(pskr.received ?? 0) > 0 ? 'bg-success' : 'bg-warning')} />
|
||||
MQTT
|
||||
</button>
|
||||
)}
|
||||
{/* ON AIR badge: "did I log a QSO in the last 5 min" — meaningful on ANY
|
||||
logbook backend (only the live_status PUBLISHING is MySQL-specific),
|
||||
so it is always shown. Gating it on MySQL made it vanish for
|
||||
|
||||
@@ -15,7 +15,7 @@ const en: Dict = {
|
||||
// Menu bar
|
||||
'prop.title': 'Propagation', 'prop.geomag': 'Geomag', 'prop.refresh': 'Refresh space weather',
|
||||
'live.onAir': 'On air', 'live.offline': 'Offline',
|
||||
'live.onAirTip': 'On air — a QSO was logged in the last 5 minutes (published to the live status)',
|
||||
'pskr.tip': 'PSK Reporter — {n} decodes received on {bands}. Click for settings.', 'live.onAirTip': 'On air — a QSO was logged in the last 5 minutes (published to the live status)',
|
||||
'live.offlineTip': 'Offline — no QSO logged in the last 5 minutes',
|
||||
'live.stationsTitle': 'Stations on air', 'live.stationsEmpty': 'No station reporting yet.', 'live.stationsHide': 'Hide',
|
||||
'upd.available': 'OpsLog v{v} available', 'upd.current': "You're on v{v}.",
|
||||
@@ -451,7 +451,7 @@ const en: Dict = {
|
||||
const fr: Dict = {
|
||||
'prop.title': 'Propagation', 'prop.geomag': 'Géomag', 'prop.refresh': 'Actualiser la météo spatiale',
|
||||
'live.onAir': 'On air', 'live.offline': 'Hors ligne',
|
||||
'live.onAirTip': "On air — un QSO a été loggé dans les 5 dernières minutes (publié dans le statut live)",
|
||||
'pskr.tip': 'PSK Reporter — {n} décodages reçus sur {bands}. Cliquer pour les réglages.', 'live.onAirTip': "On air — un QSO a été loggé dans les 5 dernières minutes (publié dans le statut live)",
|
||||
'live.offlineTip': 'Hors ligne — aucun QSO loggé depuis 5 minutes',
|
||||
'live.stationsTitle': 'Stations on air', 'live.stationsEmpty': 'Aucune station ne reporte pour le moment.', 'live.stationsHide': 'Masquer',
|
||||
'rate.title': 'Rythme QSO (QSO/heure) — projeté sur les 10 / 60 dernières minutes',
|
||||
|
||||
Reference in New Issue
Block a user