[fix](trx-frontend): refine map source and popup states
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -3397,9 +3397,9 @@ function renderMapLocatorChipRow(container, items, selectedSet, kind) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let helperText = "";
|
let helperText = "";
|
||||||
|
const isDefaultSourceState = kind === "source" && items.every((item) => mapFilter[item.key]);
|
||||||
if (kind === "source") {
|
if (kind === "source") {
|
||||||
const allVisible = items.every((item) => mapFilter[item.key]);
|
if (isDefaultSourceState) {
|
||||||
if (allVisible) {
|
|
||||||
helperText = "All sources visible by default";
|
helperText = "All sources visible by default";
|
||||||
}
|
}
|
||||||
} else if (!(selectedSet instanceof Set) || selectedSet.size === 0) {
|
} else if (!(selectedSet instanceof Set) || selectedSet.size === 0) {
|
||||||
@@ -3410,7 +3410,11 @@ function renderMapLocatorChipRow(container, items, selectedSet, kind) {
|
|||||||
btn.type = "button";
|
btn.type = "button";
|
||||||
btn.className = "map-locator-chip";
|
btn.className = "map-locator-chip";
|
||||||
const isActive = kind === "source" ? !!mapFilter[item.key] : selectedSet.has(item.key);
|
const isActive = kind === "source" ? !!mapFilter[item.key] : selectedSet.has(item.key);
|
||||||
if (!isActive) btn.classList.add("is-inactive");
|
if (kind === "source" && isDefaultSourceState) {
|
||||||
|
btn.classList.add("is-default");
|
||||||
|
} else if (!isActive) {
|
||||||
|
btn.classList.add("is-inactive");
|
||||||
|
}
|
||||||
btn.dataset.filterKind = kind;
|
btn.dataset.filterKind = kind;
|
||||||
btn.dataset.filterKey = item.key;
|
btn.dataset.filterKey = item.key;
|
||||||
btn.style.setProperty("--chip-color", item.color);
|
btn.style.setProperty("--chip-color", item.color);
|
||||||
|
|||||||
@@ -219,8 +219,15 @@ window.onServerFt8 = function(msg) {
|
|||||||
const raw = (msg.message || "").toString();
|
const raw = (msg.message || "").toString();
|
||||||
const grids = extractAllGrids(raw);
|
const grids = extractAllGrids(raw);
|
||||||
const station = extractLikelyCallsign(raw);
|
const station = extractLikelyCallsign(raw);
|
||||||
|
const baseHz = Number.isFinite(window.ft8BaseHz) ? Number(window.ft8BaseHz) : null;
|
||||||
|
const rfHz = Number.isFinite(msg.freq_hz) && Number.isFinite(baseHz)
|
||||||
|
? (baseHz + Number(msg.freq_hz))
|
||||||
|
: (Number.isFinite(msg.freq_hz) ? Number(msg.freq_hz) : null);
|
||||||
if (grids.length > 0 && window.ft8MapAddLocator) {
|
if (grids.length > 0 && window.ft8MapAddLocator) {
|
||||||
window.ft8MapAddLocator(raw, grids, "ft8", station, msg);
|
window.ft8MapAddLocator(raw, grids, "ft8", station, {
|
||||||
|
...msg,
|
||||||
|
freq_hz: rfHz,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
addFt8Message({
|
addFt8Message({
|
||||||
receiver: window.getDecodeRigMeta ? window.getDecodeRigMeta() : null,
|
receiver: window.getDecodeRigMeta ? window.getDecodeRigMeta() : null,
|
||||||
|
|||||||
@@ -1464,7 +1464,7 @@ small { color: var(--text-muted); }
|
|||||||
padding: 0.55rem 0.65rem;
|
padding: 0.55rem 0.65rem;
|
||||||
border: 1px solid color-mix(in srgb, var(--accent-yellow) 26%, var(--border-light));
|
border: 1px solid color-mix(in srgb, var(--accent-yellow) 26%, var(--border-light));
|
||||||
border-radius: 0.65rem;
|
border-radius: 0.65rem;
|
||||||
background: color-mix(in srgb, var(--card-bg) 94%, transparent);
|
background: color-mix(in srgb, var(--card-bg) 90%, transparent);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
|
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
|
||||||
}
|
}
|
||||||
@@ -1635,6 +1635,11 @@ small { color: var(--text-muted); }
|
|||||||
.map-locator-chip:hover {
|
.map-locator-chip:hover {
|
||||||
color: var(--text-heading);
|
color: var(--text-heading);
|
||||||
}
|
}
|
||||||
|
.map-locator-chip.is-default {
|
||||||
|
border-color: color-mix(in srgb, var(--border-light) 74%, transparent);
|
||||||
|
background: color-mix(in srgb, var(--input-bg) 94%, transparent);
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
.map-locator-chip.is-inactive {
|
.map-locator-chip.is-inactive {
|
||||||
opacity: 0.62;
|
opacity: 0.62;
|
||||||
border-color: color-mix(in srgb, var(--border-light) 68%, transparent);
|
border-color: color-mix(in srgb, var(--border-light) 68%, transparent);
|
||||||
|
|||||||
Reference in New Issue
Block a user