Keep Context's follow, clicks, Radio, Cockpit entry and credits right

- Following comes only from the camera's own follow, never claimed ahead
  of it; vessels, which the camera does not follow, are flown to.
- A drag or a long press never selects, and only a clean click on open map
  closes the card; a card painted on the overlay is not open map.
- Closing the card lets go through its own layer only, as the person's
  action, leaving other layers' selections alone.
- Radio's panel, with its local SDR tuner, shows whether or not the Radio
  layer is on; Contacts' Cockpit entry hides only while the card offers its
  own.
- Expanded Context keeps the credits beside it right to left and with the
  minimal HUD.
- Context counts as closed until its panel says it is open; closed, the
  card's refresh and the view reading pause, and opening reads the view.
- The five-minute re-read fetches again past the caches, keeps what is
  shown meanwhile, and an empty brief is not kept.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-16 14:59:18 -08:00
1 parent 547687fecf
commit 57f9c03eaa
10 files changed
+599 -188

No files matched your search

+2 -2
View File
@@ -156,7 +156,7 @@ function setDocked(next) {
}
}
// Only an open panel reads what is picked and in view; closed, it does no work.
const contextOpen = computed(() => chromePanels.value['global-context-panel']?.collapsed !== true);
const contextOpen = computed(() => chromePanels.value['global-context-panel']?.collapsed === false);
watch(
() => chromePanels.value['global-context-panel']?.collapsed,
(collapsed) => {
@@ -232,7 +232,7 @@ watch(
</div>
<section id="context-flights-view" class="context-mode-view" role="tabpanel" aria-labelledby="global-context-flights-btn" :hidden="!ctx?.flightsActive">
<div class="global-context-actions" :aria-label="t('Contact Context actions')">
<button id="cockpit-entry" type="button" :hidden="!cockpit?.entryAvailable" aria-hidden="true" tabindex="-1">
<button id="cockpit-entry" type="button" :hidden="!cockpit?.entryAvailable">
<span class="material-symbols-outlined" aria-hidden="true">{{ entry.icon }}</span>
<span>{{ entry.label }}</span>
</button>
+8 -10
View File
@@ -53,18 +53,19 @@ const pickRadius = (index) => setContextRadiusKm(CONTEXT_RADIUS_STEPS[index]);
const firesOn = () =>
Boolean((omnibar.controls?.layers() || []).find((layer) => layer.id === HAZARD_LAYER.hotspots)?.enabled);
async function read(lat, lon) {
if (readAt && distanceKm(readAt, { lat, lon }) <= props.settleKm) return;
async function read(lat, lon, { force = false } = {}) {
if (!force && readAt && distanceKm(readAt, { lat, lon }) <= props.settleKm) return;
readAt = { lat, lon };
const mine = ++reading;
const mineHazards = ++readingHazards;
loading.value = true;
// A forced re-read keeps what is shown until the new reading lands.
if (!force) loading.value = true;
const [nextBrief, nextHazards] = await Promise.all([
regionalBrief(lat, lon, store.readBrief),
hazardsNear(lat, lon, radiusKm.value, { fires: firesOn() }).catch(() => []),
regionalBrief(lat, lon, store.readBrief, { force }),
hazardsNear(lat, lon, radiusKm.value, { fires: firesOn(), force }).catch(() => []),
]);
if (reading !== mine) return;
brief.value = nextBrief;
if (nextBrief || !force) brief.value = nextBrief;
// A radius change meanwhile has its own, newer hazard read.
if (readingHazards === mineHazards) hazards.value = nextHazards;
loading.value = false;
@@ -91,10 +92,7 @@ watch(radiusKm, (km) => void rereadHazards(km));
const REREAD_MS = 5 * 60_000;
let rereadTimer = 0;
onMounted(() => {
rereadTimer = setInterval(() => {
readAt = null;
void read(props.lat, props.lon);
}, REREAD_MS);
rereadTimer = setInterval(() => void read(props.lat, props.lon, { force: true }), REREAD_MS);
});
onBeforeUnmount(() => clearInterval(rereadTimer));
// Hazard rows are worded as they are read, so a new language reads them again.