From 1b5b0c2e90998867bd81fc9a0f2ea4faf79f8101 Mon Sep 17 00:00:00 2001 From: rouggy Date: Tue, 21 Jul 2026 18:54:48 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20clicking=20the=20status-bar=20amplifier?= =?UTF-8?q?=20chip=20toggles=20OPERATE=20<->=20STANDBY=20(SPE/ACOM,=20opti?= =?UTF-8?q?mistic=20flip=20reconciled=20by=20the=20poll;=20disabled=20offl?= =?UTF-8?q?ine)=20=E2=80=94=20PGXL=20still=20opens=20Settings,=20it=20has?= =?UTF-8?q?=20no=20standby=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 32264ad..ad19450 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -43,7 +43,7 @@ import { GetAwardDefs, GetUIPref, GetActiveProfile, QuitApp, ReportLiveActivity, LiveLastQSOAgeSec, - GetPGXLSettings, GetPGXLStatus, GetSPEStatus, GetACOMStatus, + GetPGXLSettings, GetPGXLStatus, GetSPEStatus, GetACOMStatus, SPESetOperate, ACOMSetOperate, } from '../wailsjs/go/main/App'; import { Combobox } from '@/components/ui/combobox'; import { applyAwardRefs } from '@/lib/awardRefs'; @@ -5145,7 +5145,9 @@ export default function App() { onClick={() => { setSettingsSection('rotator'); setShowSettings(true); }} /> {/* Amplifier chip: green = OPERATE, orange = STANDBY, red = offline. - (PGXL has no standby notion here — green when connected.) */} + CLICK toggles OPERATE ↔ STANDBY (SPE/ACOM; optimistic flip, the 2s + poll reconciles). The PGXL has no standby command here — its chip + opens Settings instead, and shows green when connected. */} {ampCfg.enabled && (() => { const isPGXL = ampCfg.type === 'pgxl'; const name = isPGXL ? 'PGXL' @@ -5153,12 +5155,20 @@ export default function App() { : `SPE ${ampSt.model || ''}`.trim(); const dot = !ampSt.connected ? 'bg-danger' : (isPGXL || ampSt.operate) ? 'bg-success' : 'bg-warning'; const state = !ampSt.connected ? (ampSt.last_error || 'offline') : (isPGXL ? (ampSt.state || 'connected') : ampSt.operate ? 'OPERATE' : 'STANDBY'); + const toggle = () => { + if (isPGXL) { setSettingsSection('pgxl'); setShowSettings(true); return; } + const want = !ampSt.operate; + setAmpSt((s: any) => ({ ...s, operate: want })); + (ampCfg.type.startsWith('acom') ? ACOMSetOperate(want) : SPESetOperate(want)).catch(() => {}); + }; return (