fix(antenna): the COM port picks from the list again
Reported on an Ultrabeam over USB: the port could not be chosen from the dropdown, and the panel would not scroll. That field was a Combobox — a list you can also type into — chosen so the port of an adapter currently UNPLUGGED could still be configured. It is now the same Select every other serial device in OpsLog uses, the one that demonstrably works. The case it was built for is kept differently: a configured port that is no longer detected is added to the list, so it stays selected and visible instead of vanishing when the adapter is out. Also hardened the Test button's guard, which called .trim() straight on the port and the host. A settings object without them — an older build, a save that landed short — throws there DURING RENDER, and a panel that throws while rendering is exactly a panel with a dead dropdown that will not scroll. Whether or not that is what this operator hit, it is a way to produce both symptoms at once and it costs nothing to remove.
This commit is contained in:
+4
-2
@@ -6,13 +6,15 @@
|
|||||||
"Awards: the band matrix shows the bands you have contacts on — no more, and no longer capped at 70cm. It used to list every band the award permits, so DDFM stood there with empty 6m and 70cm columns, and it could not show 23cm at all whatever the award said.",
|
"Awards: the band matrix shows the bands you have contacts on — no more, and no longer capped at 70cm. It used to list every band the award permits, so DDFM stood there with empty 6m and 70cm columns, and it could not show 23cm at all whatever the award said.",
|
||||||
"Elecraft KPA500 and KPA1500 amplifiers, over serial or — on the KPA1500 — over the network. Operate/standby, on/off, power, SWR, temperature, supply voltage and current, the band, and faults named in plain words rather than as a code. They join the SPE, the Acom and the PowerGenius, so linking several amplifiers works on them too. NEW, AND NOT YET TESTED ON A REAL AMPLIFIER: it is written from Elecraft's programming reference, so please report what it does.",
|
"Elecraft KPA500 and KPA1500 amplifiers, over serial or — on the KPA1500 — over the network. Operate/standby, on/off, power, SWR, temperature, supply voltage and current, the band, and faults named in plain words rather than as a code. They join the SPE, the Acom and the PowerGenius, so linking several amplifiers works on them too. NEW, AND NOT YET TESTED ON A REAL AMPLIFIER: it is written from Elecraft's programming reference, so please report what it does.",
|
||||||
"The Elecraft amplifiers follow the radio's band by themselves, on the link already open — they have a band command of their own, so no second serial port is involved. It can be turned off for an amplifier wired straight to the radio.",
|
"The Elecraft amplifiers follow the radio's band by themselves, on the link already open — they have a band command of their own, so no second serial port is involved. It can be turned off for an amplifier wired straight to the radio.",
|
||||||
"The Light and Voyager maps came up stamped 'API KEY REQUIRED' across the middle. Carto now watermarks its key-free tiles, so both views move to Esri, the provider already behind Street and Satellite. Light looks the same; Voyager is now a topographic map and is named Topo — anyone who had it selected keeps it."
|
"The Light and Voyager maps came up stamped 'API KEY REQUIRED' across the middle. Carto now watermarks its key-free tiles, so both views move to Esri, the provider already behind Street and Satellite. Light looks the same; Voyager is now a topographic map and is named Topo — anyone who had it selected keeps it.",
|
||||||
|
"Ultrabeam / SteppIR over USB: the COM port can be picked from the list again. It used a field you could also type into, and the list could not be selected from at all."
|
||||||
],
|
],
|
||||||
"fr": [
|
"fr": [
|
||||||
"Diplômes : la matrice des bandes affiche les bandes sur lesquelles on a des contacts — pas davantage, et sans s'arrêter au 70cm. Elle listait toutes les bandes autorisées par le diplôme, si bien que le DDFM restait avec des colonnes 6m et 70cm vides, et ne pouvait pas afficher le 23cm quoi que dise le diplôme.",
|
"Diplômes : la matrice des bandes affiche les bandes sur lesquelles on a des contacts — pas davantage, et sans s'arrêter au 70cm. Elle listait toutes les bandes autorisées par le diplôme, si bien que le DDFM restait avec des colonnes 6m et 70cm vides, et ne pouvait pas afficher le 23cm quoi que dise le diplôme.",
|
||||||
"Amplificateurs Elecraft KPA500 et KPA1500, en série ou — pour le KPA1500 — par le réseau. Operate/standby, marche/arrêt, puissance, ROS, température, tension et courant d'alimentation, la bande, et les défauts nommés en clair plutôt qu'en code. Ils rejoignent le SPE, l'Acom et le PowerGenius, donc le couplage de plusieurs amplificateurs fonctionne aussi avec eux. NOUVEAU, ET PAS ENCORE TESTÉ SUR UN VRAI AMPLIFICATEUR : c'est écrit d'après la documentation de programmation d'Elecraft, donc merci de signaler ce que ça donne.",
|
"Amplificateurs Elecraft KPA500 et KPA1500, en série ou — pour le KPA1500 — par le réseau. Operate/standby, marche/arrêt, puissance, ROS, température, tension et courant d'alimentation, la bande, et les défauts nommés en clair plutôt qu'en code. Ils rejoignent le SPE, l'Acom et le PowerGenius, donc le couplage de plusieurs amplificateurs fonctionne aussi avec eux. NOUVEAU, ET PAS ENCORE TESTÉ SUR UN VRAI AMPLIFICATEUR : c'est écrit d'après la documentation de programmation d'Elecraft, donc merci de signaler ce que ça donne.",
|
||||||
"Les amplificateurs Elecraft suivent tout seuls la bande de la radio, sur la liaison déjà ouverte — ils ont leur propre commande de bande, donc aucun second port série n'intervient. Désactivable pour un amplificateur câblé directement à la radio.",
|
"Les amplificateurs Elecraft suivent tout seuls la bande de la radio, sur la liaison déjà ouverte — ils ont leur propre commande de bande, donc aucun second port série n'intervient. Désactivable pour un amplificateur câblé directement à la radio.",
|
||||||
"Les cartes Light et Voyager s'affichaient barrées d'un « API KEY REQUIRED ». Carto marque désormais ses tuiles sans clé, donc les deux vues passent chez Esri, le fournisseur déjà derrière Street et Satellite. Light garde son allure ; Voyager devient une carte topographique et s'appelle Topo — ceux qui l'avaient choisie la conservent."
|
"Les cartes Light et Voyager s'affichaient barrées d'un « API KEY REQUIRED ». Carto marque désormais ses tuiles sans clé, donc les deux vues passent chez Esri, le fournisseur déjà derrière Street et Satellite. Light garde son allure ; Voyager devient une carte topographique et s'appelle Topo — ceux qui l'avaient choisie la conservent.",
|
||||||
|
"Ultrabeam / SteppIR en USB : le port COM se choisit à nouveau dans la liste. Le champ était de ceux où l'on peut aussi taper, et la liste ne se laissait pas sélectionner."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3800,23 +3800,25 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
|
|||||||
<div className="grid grid-cols-3 gap-3">
|
<div className="grid grid-cols-3 gap-3">
|
||||||
<div className="space-y-1 col-span-2">
|
<div className="space-y-1 col-span-2">
|
||||||
<Label>{t('hw.motorCom')}{!isSteppir && <span className="ml-1.5 font-normal text-muted-foreground">{t('hw.motorComUb')}</span>}</Label>
|
<Label>{t('hw.motorCom')}{!isSteppir && <span className="ml-1.5 font-normal text-muted-foreground">{t('hw.motorComUb')}</span>}</Label>
|
||||||
{/* A list AND a text field, which is why this is a Combobox and
|
{/* THE SAME Select every other serial device uses.
|
||||||
not the Select the other serial devices use: the port for a
|
This was a Combobox — a list you could also type into — so
|
||||||
USB adapter that is currently unplugged does not appear in
|
that the port of an adapter currently unplugged could still
|
||||||
the list, and refusing to accept it typed means the antenna
|
be configured. In practice the list could not be picked from
|
||||||
cannot be configured until the adapter is in. The detected
|
at all, which is a worse failure than the one it was avoiding:
|
||||||
ports are offered; anything else is still accepted. */}
|
the port an operator wants is nearly always one that is
|
||||||
|
plugged in and detected. A configured port that has since
|
||||||
|
gone missing is added to the list so it stays selected and
|
||||||
|
visible rather than silently disappearing. */}
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1">
|
||||||
<Combobox
|
<Select value={ultrabeam.com || undefined}
|
||||||
value={ultrabeam.com ?? ''}
|
onValueChange={(v) => setUltrabeam((s) => ({ ...s, com: v }))}>
|
||||||
options={wkPorts}
|
<SelectTrigger className="h-9 font-mono flex-1"><SelectValue placeholder="COM3" /></SelectTrigger>
|
||||||
allowFreeText
|
<SelectContent>
|
||||||
commitOnType
|
{wkPorts.length === 0 && !ultrabeam.com && <SelectItem value="_" disabled>{t('cat.noPorts')}</SelectItem>}
|
||||||
showToggle
|
{[...wkPorts, ...(ultrabeam.com && !wkPorts.includes(ultrabeam.com) ? [ultrabeam.com] : [])]
|
||||||
placeholder="COM3"
|
.map((pt) => <SelectItem key={pt} value={pt}>{pt}</SelectItem>)}
|
||||||
className="font-mono flex-1"
|
</SelectContent>
|
||||||
onChange={(v) => setUltrabeam((s) => ({ ...s, com: v.trim().toUpperCase() }))}
|
</Select>
|
||||||
/>
|
|
||||||
<Button type="button" variant="outline" size="sm" className="shrink-0"
|
<Button type="button" variant="outline" size="sm" className="shrink-0"
|
||||||
onClick={() => ListSerialPorts().then((ps) => setWkPorts((ps ?? []) as string[])).catch(() => {})}>↻</Button>
|
onClick={() => ListSerialPorts().then((ps) => setWkPorts((ps ?? []) as string[])).catch(() => {})}>↻</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -3965,7 +3967,7 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
|
|||||||
<p className="text-xs text-muted-foreground pl-6">{t('hw.motorTxInhibitHint')}</p>
|
<p className="text-xs text-muted-foreground pl-6">{t('hw.motorTxInhibitHint')}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2 pt-2">
|
<div className="flex items-center gap-2 pt-2">
|
||||||
<Button variant="outline" size="sm" onClick={testUltrabeam} disabled={ubTesting || (isSerial ? !ultrabeam.com.trim() : !ultrabeam.host.trim())}>
|
<Button variant="outline" size="sm" onClick={testUltrabeam} disabled={ubTesting || (isSerial ? !(ultrabeam.com || '').trim() : !(ultrabeam.host || '').trim())}>
|
||||||
{ubTesting ? t('hw.connecting') : t('hw.testConn')}
|
{ubTesting ? t('hw.connecting') : t('hw.testConn')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user