fix: bug where contextual menu was disappearing quickly

This commit is contained in:
2026-06-21 20:31:54 +02:00
parent 5d9765be09
commit 725600c341
3 changed files with 11 additions and 13 deletions
BIN
View File
Binary file not shown.
+4 -5
View File
@@ -27,20 +27,19 @@ const UPLOAD_TARGETS: { service: string; label: string }[] = [
// Lightweight right-click menu for the QSO grids. AG Grid's native context // Lightweight right-click menu for the QSO grids. AG Grid's native context
// menu is an Enterprise feature, so this is a plain floating menu driven by // menu is an Enterprise feature, so this is a plain floating menu driven by
// onCellContextMenu. Closes on any outside click, scroll or Escape. // onCellContextMenu. Stays open until the user clicks outside, presses Escape,
// or picks a command. (We deliberately do NOT close on scroll/resize: the QSO
// list auto-refreshes and AG Grid fires internal scroll events on refresh,
// which used to dismiss the menu the instant it appeared.)
export function QSOContextMenu({ menu, onClose, onUpdateFromCty, onUpdateFromQRZ, onUpdateFromClublog, onSendTo, onSendRecording, onSendEQSL, onBulkEdit, onExportSelected, onExportFiltered }: Props) { export function QSOContextMenu({ menu, onClose, onUpdateFromCty, onUpdateFromQRZ, onUpdateFromClublog, onSendTo, onSendRecording, onSendEQSL, onBulkEdit, onExportSelected, onExportFiltered }: Props) {
useEffect(() => { useEffect(() => {
if (!menu) return; if (!menu) return;
const close = () => onClose(); const close = () => onClose();
const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); }; const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); };
window.addEventListener('mousedown', close); window.addEventListener('mousedown', close);
window.addEventListener('scroll', close, true);
window.addEventListener('resize', close);
window.addEventListener('keydown', onKey); window.addEventListener('keydown', onKey);
return () => { return () => {
window.removeEventListener('mousedown', close); window.removeEventListener('mousedown', close);
window.removeEventListener('scroll', close, true);
window.removeEventListener('resize', close);
window.removeEventListener('keydown', onKey); window.removeEventListener('keydown', onKey);
}; };
}, [menu, onClose]); }, [menu, onClose]);
+7 -8
View File
@@ -208,11 +208,11 @@ const TREE: TreeNode[] = [
{ {
kind: 'group', label: 'Hardware Configuration', icon: Server, defaultOpen: true, children: [ kind: 'group', label: 'Hardware Configuration', icon: Server, defaultOpen: true, children: [
{ kind: 'item', label: 'CAT interface', id: 'cat' }, { kind: 'item', label: 'CAT interface', id: 'cat' },
{ kind: 'item', label: 'Rotator', id: 'rotator' }, { kind: 'item', label: 'PstRotator', id: 'rotator' },
{ kind: 'item', label: 'CW Keyer', id: 'winkeyer' }, { kind: 'item', label: 'CW Keyer', id: 'winkeyer' },
{ kind: 'item', label: 'Antenna', id: 'antenna' }, { kind: 'item', label: 'UltraBeam', id: 'antenna' },
{ kind: 'item', label: 'Antenna Genius', id: 'antgenius' }, { kind: 'item', label: 'Antenna Genius', id: 'antgenius' },
{ kind: 'item', label: 'PowerGenius', id: 'pgxl' }, { kind: 'item', label: 'Power Genius', id: 'pgxl' },
{ kind: 'item', label: 'Audio devices', id: 'audio' }, { kind: 'item', label: 'Audio devices', id: 'audio' },
], ],
}, },
@@ -235,11 +235,11 @@ const SECTION_LABELS: Partial<Record<SectionId, string>> = {
udp: 'UDP integrations', udp: 'UDP integrations',
awards: 'Awards', awards: 'Awards',
cat: 'CAT interface', cat: 'CAT interface',
rotator: 'Rotator', rotator: 'PstRotator',
winkeyer: 'CW Keyer', winkeyer: 'CW Keyer',
antenna: 'Antenna', antenna: 'UltraBeam',
antgenius: 'Antenna Genius', antgenius: 'Antenna Genius',
pgxl: 'PowerGenius', pgxl: 'Power Genius',
audio: 'Audio devices', audio: 'Audio devices',
}; };
@@ -2066,8 +2066,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
return ( return (
<> <>
<SectionHeader <SectionHeader
title="PowerGenius XL" title="Power Genius XL"
hint="OpsLog reads the amp's operate state through the FlexRadio, but the fan mode is only reachable on the PowerGenius XL's own TCP control port. Enter its IP to add a fan-mode selector next to Operate in the FlexRadio panel."
/> />
<div className="space-y-4 max-w-xl"> <div className="space-y-4 max-w-xl">
<label className="flex items-center gap-2 text-sm cursor-pointer"> <label className="flex items-center gap-2 text-sm cursor-pointer">