fix(ui): one section name, a chosen digital row, no MQTT chip
Three things reported together. Preferences said the section name twice: a small line above every panel repeated the heading right underneath it — "GENERAL" over "General" — while the sidebar next to them already shows which section is open, highlighted. Two lines and a highlight for one fact; the small line goes. The band matrix opens on the digital row the operator chooses. Its digital row has always rotated — DIGI, then each digital mode in their own list — but it always STARTED on DIGI, so somebody who only works FT8 clicked through to their own mode on every callsign. Settings ▸ General now says where the rotation starts, and the dropdown offers exactly the modes the matrix rotates through (the phone-mode rule is now shared rather than copied, so the two cannot drift). DIGI stays the default: it is the right answer for anyone working several digital modes. And the MQTT chip is gone from the status bar. That is the name of a message protocol, not of anything an operator has — a chip in the status bar has to say what it is about, and this one told nobody anything. What it carried is shown in the Chase New panel, which is the place that uses it; its poller went with it.
This commit is contained in:
@@ -60,7 +60,11 @@ const DEFAULT_BANDS: { tag: string; label: string }[] = [
|
||||
];
|
||||
const CLASSES = ['PH', 'CW', 'DIG'] as const;
|
||||
|
||||
const PHONE_MODES = new Set(['SSB','USB','LSB','AM','FM','DIGITALVOICE','PHONE']);
|
||||
export const PHONE_MODES = new Set(['SSB','USB','LSB','AM','FM','DIGITALVOICE','PHONE']);
|
||||
|
||||
// Which digital row the matrix opens on. Empty = DIG, the group of them all.
|
||||
// Set in Settings ▸ General; see the rotation below.
|
||||
export const MATRIX_DIGI_KEY = 'opslog.matrixDigiMode';
|
||||
function classMatchesMode(cls: string, mode: string): boolean {
|
||||
const u = (mode || '').toUpperCase();
|
||||
if (cls === 'PH') return PHONE_MODES.has(u);
|
||||
@@ -143,7 +147,17 @@ export function BandSlotGrid({ wb, busy, currentBand, currentMode, bands, modes,
|
||||
.filter((m) => m !== '' && m !== 'CW' && !PHONE_MODES.has(m)),
|
||||
[modes],
|
||||
);
|
||||
// Where the rotation STARTS. An operator who only ever works FT8 was shown
|
||||
// "DIG" every time and had to click to the mode they actually use, on every
|
||||
// callsign — so the row they want is the one it opens on. Empty (the default)
|
||||
// keeps DIG, which is right for anyone working several digital modes.
|
||||
const [digIdx, setDigIdx] = useState(0); // 0 = the DIG group itself
|
||||
useEffect(() => {
|
||||
const want = (localStorage.getItem(MATRIX_DIGI_KEY) || '').toUpperCase().trim();
|
||||
if (!want) { setDigIdx(0); return; }
|
||||
const i = digModes.indexOf(want);
|
||||
setDigIdx(i >= 0 ? i + 1 : 0);
|
||||
}, [digModes]);
|
||||
// A shorter mode list (the operator edited it) must not strand the rotation
|
||||
// on a row that no longer exists.
|
||||
const digPos = digModes.length ? digIdx % (digModes.length + 1) : 0;
|
||||
|
||||
Reference in New Issue
Block a user