mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Fixes the 51 P0–P2 findings from the full review of the i18n branch and the issues found while checking every new string on screen in ru and es. - Translate errors and statuses that still reached ru/es in English: feed and tile errors, provider statuses, the ALPR chip, the traffic mode chip, voice plan step labels, fire feed values, receiver bands, scene save reasons and the Cesium attribution link. - Show preset city names in the UI language (src/ui/placeNames.js); data and everything sent to the model stay English. - Share layer names between the layer panel, HUD and voice card (src/ui/layerNames.js). - Keep long ru/es strings whole: voice card error lines, analyst titles, the voice tier status, the Nepal evidence button, the ALPR retry chip. English layout is unchanged. - Ask before a language switch drops unsaved work. - Catalog fixes: glossary terms (пуск, пресет), gender agreement and consistent "peticiones" in es, fewer calques in both languages. - Fix English text that was itself wrong (e.g. "Exit cockpit to fly to a weather", raw tool ids in voice plan steps). Catalogs: es/ru 2535 messages each, complete. Co-Authored-By: Claude Opus 5.5 <[email protected]>
103 lines
3.0 KiB
JavaScript
103 lines
3.0 KiB
JavaScript
export {
|
|
PARTIAL_RETENTION_MS,
|
|
SELECTED_PIN_REFRESHES,
|
|
AIS_FIRST_CONNECT_LABEL,
|
|
} from './recordPolicy.js';
|
|
import { VESSEL_LABEL_GRID_PX } from '../../data/vesselLabels.js';
|
|
import { msg } from '../../i18n/index.js';
|
|
|
|
export const FOCUS_EVIDENCE_DEV = import.meta.env?.DEV === true;
|
|
|
|
export const DEFAULT_RENDER_ROWS = 12000;
|
|
|
|
export const DEFAULT_ACTIVE_LABELS = 900;
|
|
|
|
export const REFRESH_MS = 60000;
|
|
|
|
/** Bounded wait for the first accepted vessel position in one enabled session. */
|
|
|
|
export const AIS_FIRST_CONNECT_GRACE_MS = 30000;
|
|
|
|
export const VISIBILITY_UPDATE_MS = 800;
|
|
|
|
/** Focus alpha alone samples faster inside the existing preRender pass. */
|
|
|
|
export const FOCUS_UPDATE_MS = 80;
|
|
|
|
export const LABEL_GRID_PX = VESSEL_LABEL_GRID_PX;
|
|
|
|
/**
|
|
* Minimum screen-space separation between accepted vessel cards (matches the
|
|
* FIRMS card declutter). The 118px grid alone under-spaces the wider canvas
|
|
* cards; the greedy pass below enforces true card-scale spacing.
|
|
*/
|
|
|
|
export const CARD_MIN_SEP_PX = 150;
|
|
|
|
/** Trail hue for the selected vessel (PRD F4, pinned to the AIS teal-green family). */
|
|
|
|
export const TRAIL_COLOR = '#39ffd5';
|
|
|
|
/** Slight lift (m) for trail vertices to avoid sea-surface z-fighting. */
|
|
|
|
export const TRAIL_HEIGHT_M = 3;
|
|
|
|
/**
|
|
* Lift (m) above the local sea surface (geoid) for vessel anchors — locked
|
|
* height-datum principle #1: never below the visible surface, slightly above
|
|
* is always fine (clears tide/mesh noise in the photoreal sea mesh).
|
|
*/
|
|
|
|
export const VESSEL_LIFT_M = 3;
|
|
|
|
/** Combined cap on trail vertices (server backfill + live accumulation). */
|
|
|
|
export const TRAIL_MAX_POINTS = 400;
|
|
|
|
/** Minimum movement (m) before a reconcile refresh appends a new trail point. */
|
|
|
|
export const TRAIL_MIN_MOVE_M = 25;
|
|
|
|
export const DEFAULT_AIS_RUNTIME = Object.freeze({
|
|
now: () => Date.now(),
|
|
setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
|
|
clearTimeout: (timer) => clearTimeout(timer),
|
|
});
|
|
|
|
/**
|
|
* Human-readable reasons for a non-'open' AISStream feed status, keyed to the
|
|
* server's `_aisStreamStatus` values (see vite.config.js). Surfaced verbatim in
|
|
* the layer chip so a dead feed reads "feed down" instead of a healthy-looking
|
|
* "just now · 0 vessels".
|
|
*/
|
|
|
|
export const AIS_STATUS_REASON = {
|
|
'missing-key': msg('AISSTREAM_API_KEY not set'),
|
|
unsupported: msg('live feed unsupported'),
|
|
connecting: msg('connecting to feed…'),
|
|
closed: msg('feed disconnected'),
|
|
error: msg('feed down'),
|
|
idle: msg('feed idle'),
|
|
};
|
|
|
|
/**
|
|
* Statuses in which fresh data is flowing. 'open' is the pre-watchdog spelling
|
|
* and is still accepted so a cached bundle and a restarted server never
|
|
* disagree about health.
|
|
*/
|
|
|
|
export const AIS_HEALTHY_STATUSES = new Set(['live', 'open']);
|
|
|
|
/**
|
|
* Server statuses meaning "the feed is not delivering right now". These are
|
|
* surfaced even while cached vessels are still drawn: rows retained from
|
|
* before the outage must never make a dead feed read as a healthy one.
|
|
*/
|
|
|
|
export const AIS_DEGRADED_STATUSES = new Set([
|
|
'stale',
|
|
'reconnecting',
|
|
'down',
|
|
'auth-failed',
|
|
]);
|