From 5abe4bd0c369762c4c8352acdc75483d707fda9a Mon Sep 17 00:00:00 2001 From: rouggy Date: Sat, 18 Jul 2026 19:28:55 +0200 Subject: [PATCH] fix: restore theme on restart + consistent spot pills + red DVK TX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit theme: self-heal the persisted theme after mount. The synchronous boot read only looks at localStorage, which is empty when the WebView cleared its storage or when syncPortablePrefs ran before the backend wired its settings store (GetUIPref returned "" with no error) — so a restart could silently land on the default light theme. ThemeProvider now re-reads the portable pref from the DB once the backend is up (retrying briefly to ride out a slow startup) and applies it, without clobbering a manual pick. ClusterGrid: the Call cell now uses a danger pill for NEW DXCC, consistent with the NEW BAND / NEW MODE pills, instead of a full-cell red fill. cellChip inherits the column's font size (no fixed 9px / height) so a pill around a callsign stays the same size as the plain callsigns beside it. DvkPanel: the voice-keyer TX indicator (LED + label) is red while transmitting, not orange. Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/components/ClusterGrid.tsx | 25 ++++++++++-------- frontend/src/components/DvkPanel.tsx | 4 +-- frontend/src/lib/theme.tsx | 34 ++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/ClusterGrid.tsx b/frontend/src/components/ClusterGrid.tsx index 44c4165..019e98f 100644 --- a/frontend/src/components/ClusterGrid.tsx +++ b/frontend/src/components/ClusterGrid.tsx @@ -120,12 +120,15 @@ function tok(name: string, text: string): Badge { function cellChip(value: any, name: string | null): any { const txt = value === undefined || value === null || value === '' ? '' : String(value); if (!name) return txt || ; + // Inherit the column's font size (no fixed 9px / height) so a pill around a + // callsign stays the same size as the plain callsigns next to it — just tinted + // and rounded, not shrunk. return ( {txt} ); } @@ -153,15 +156,15 @@ const makeColCatalog = (t: TFn): ColEntry[] => [ headerName: t('clg2.c.call'), field: 'dx_call' as any, width: 120, defaultVisible: true, cellClass: 'font-mono', - // Only STATUS calls get a colour: new DXCC entity → filled cell (no padded - // pill, so calls stay aligned), worked-call → blue. A plain spot inherits the - // theme's normal text colour (var(--foreground)) so callsigns blend in with - // the rest of the row across every theme instead of always shouting orange. - cellStyle: (p: any): any => { + // NEW DXCC → a danger pill around the call, consistent with the NEW BAND / + // NEW MODE pills (same look, same tokens). Worked-call stays blue bold text; + // a plain spot inherits the theme's normal text colour so callsigns blend in + // with the rest of the row instead of always shouting a colour. + cellRenderer: (p: any) => { const s = statusFor(p); - if (s?.status === 'new') return { backgroundColor: 'var(--danger-muted)', color: 'var(--danger-muted-foreground)', fontWeight: 700 }; - if (s?.worked_call) return { color: 'var(--info)', fontWeight: 700 }; - return { fontWeight: 700 }; + if (s?.status === 'new') return cellChip(p.value, 'danger'); + const color = s?.worked_call ? 'var(--info)' : undefined; + return {p.value ?? ''}; }, tooltipValueGetter: (p: any) => { const s = statusFor(p); diff --git a/frontend/src/components/DvkPanel.tsx b/frontend/src/components/DvkPanel.tsx index cc4330d..e3d359e 100644 --- a/frontend/src/components/DvkPanel.tsx +++ b/frontend/src/components/DvkPanel.tsx @@ -25,8 +25,8 @@ export function DvkPanel({ messages, status, onPlay, onStop, onClose }: Props) {
{t('dvkp.voiceKeyer')} - - {status.playing && tx...} + + {status.playing && TX}