mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
Merge origin/main into byrdit/cctv-visible-only-fetch
This commit is contained in:
commit
d19ae89630
445 files changed
+27359
-9232
No files matched your search
@@ -0,0 +1,428 @@
|
||||
import { registerWorldOverlayPaintLane } from '../../overlays/worldOverlay.js';
|
||||
import { fromDegrees } from '../../geo/ellipsoid.js';
|
||||
import {
|
||||
earthquakeContourRings,
|
||||
earthquakeContourScale,
|
||||
earthquakeContourShape,
|
||||
earthquakeRippleRings,
|
||||
EARTHQUAKE_RIPPLE_PERIOD_MS,
|
||||
} from '../../layers/earthquakes/model.js';
|
||||
|
||||
/** Points around each contour line: smooth at the largest disc on screen. */
|
||||
export const RIPPLE_RING_SEGMENTS = 96;
|
||||
/** An index contour's width, and every other line's. */
|
||||
const INDEX_WIDTH_PX = 2;
|
||||
const LINE_WIDTH_PX = 1.1;
|
||||
/**
|
||||
* The overlay lane the lines paint in: the magnitude labels' own. A lane's
|
||||
* custom painters run before its entries, so the lines sit under the labels
|
||||
* and under the selected quake's card.
|
||||
*/
|
||||
export const RIPPLE_PAINT_LANE = 'ambient-label';
|
||||
/**
|
||||
* The selected disc's fill, [offset, alpha] from the epicentre (0) to its
|
||||
* outer circle (1): strongest in the middle, fading out to nothing at the
|
||||
* edge.
|
||||
*/
|
||||
export const DISC_FADE = Object.freeze([
|
||||
[0, 0.42],
|
||||
[0.35, 0.26],
|
||||
[0.75, 0.1],
|
||||
[1, 0],
|
||||
]);
|
||||
/**
|
||||
* Each contour wave's fill, out to its own line: clear inside, tinting
|
||||
* toward the line; times the wave's own fade.
|
||||
*/
|
||||
export const WAVE_FADE = Object.freeze([
|
||||
[0, 0],
|
||||
[0.55, 0],
|
||||
[1, 0.2],
|
||||
]);
|
||||
|
||||
/**
|
||||
* `rgb(r,g,b)` (or `rgba`) as a function of alpha, for gradient stops; any
|
||||
* other colour keeps its own alpha.
|
||||
*/
|
||||
export function cssWithAlpha(color) {
|
||||
const m = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(String(color));
|
||||
if (!m) return () => color;
|
||||
const rgb = `${m[1]},${m[2]},${m[3]}`;
|
||||
return (alpha) => `rgba(${rgb},${Math.max(0, Math.min(1, alpha))})`;
|
||||
}
|
||||
|
||||
/**
|
||||
* How many times the lines run out to the edge after a quake is selected
|
||||
* before they rest as still contours and stop asking for frames: earthquakes
|
||||
* otherwise hold no render (docs/CURRENT-STATE.md, "Earthquake discs are
|
||||
* STATIC geometry"), and a quake can stay selected for hours.
|
||||
*/
|
||||
export const RIPPLE_ACTIVE_CYCLES = 3;
|
||||
|
||||
let reducedMotionQuery;
|
||||
/**
|
||||
* The viewer's reduced-motion setting, live: the media query is kept, so a
|
||||
* change mid-session is read at the next paint and tick.
|
||||
*/
|
||||
const reducedMotion = () => {
|
||||
try {
|
||||
reducedMotionQuery ??=
|
||||
globalThis.matchMedia?.('(prefers-reduced-motion: reduce)') ?? null;
|
||||
return reducedMotionQuery?.matches === true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/** How often the rings re-read the ground height under the quake. */
|
||||
const HEIGHT_READ_INTERVAL_MS = 500;
|
||||
/**
|
||||
* A ground height the rings accept, in metres: the Dead Sea shore to above
|
||||
* Everest. Anything else is a bad sample (a hit on something drawn above
|
||||
* the ground, or a broken tile), and the rings stay where they are.
|
||||
*/
|
||||
const groundHeightOk = (h) => Number.isFinite(h) && h >= -500 && h <= 9000;
|
||||
|
||||
/**
|
||||
* The selected earthquake's contour lines, painted on the world overlay:
|
||||
* wavy closed lines, shaped by the quake's id (earthquakeContourShape), run
|
||||
* from the marker out to the disc's edge and fade there, one after another,
|
||||
* for RIPPLE_ACTIVE_CYCLES runs after a quake is selected and only while it
|
||||
* is on screen, then rest as still contours. They never cross, and every third is
|
||||
* a heavier index contour, as on a topographic map. Nothing is drawn, and no
|
||||
* frame is asked for, while no quake is selected. With reduced motion the
|
||||
* lines hold still.
|
||||
*
|
||||
* A line is drawn in the tangent plane at the epicentre: at the largest
|
||||
* disc (M6, 64 km) it sits about 320 m above the curved ground at its edge
|
||||
* (64² / 2R), about 1.5 px off the drawn disc at the 220 km, -45° framing a
|
||||
* label click flies to (900 px tall, 35° field of view); less for smaller
|
||||
* quakes, as the offset grows with the square of the radius.
|
||||
* @param {object} [deps]
|
||||
* @param {Function} [deps.registerLane] `registerWorldOverlayPaintLane`.
|
||||
* @param {() => number} [deps.now] Steady clock, ms.
|
||||
* @param {(cb: Function) => number} [deps.requestFrame]
|
||||
* @param {(handle: number) => void} [deps.cancelFrame]
|
||||
* @param {() => boolean} [deps.prefersReducedMotion]
|
||||
* @returns {{show: Function, hide: Function, dispose: Function}}
|
||||
*/
|
||||
export function createEarthquakeRipples({
|
||||
registerLane = registerWorldOverlayPaintLane,
|
||||
now = () => globalThis.performance?.now?.() ?? Date.now(),
|
||||
requestFrame = (cb) => globalThis.requestAnimationFrame?.(cb) ?? null,
|
||||
cancelFrame = (handle) => globalThis.cancelAnimationFrame?.(handle),
|
||||
prefersReducedMotion = reducedMotion,
|
||||
} = {}) {
|
||||
let lane = null;
|
||||
let target = null;
|
||||
let frameHandle = null;
|
||||
// When the running lines settle into still contours (the selection's
|
||||
// bound), and whether the last paint found the quake on screen.
|
||||
let startedAt = 0;
|
||||
let settlesAt = 0;
|
||||
let onScreen = false;
|
||||
/** Whether the lines run now: in the window, and motion allowed. */
|
||||
const running = () => now() < settlesAt && !prefersReducedMotion();
|
||||
// Unit offsets around the line in the epicentre's tangent plane, packed
|
||||
// x, y, z per point: north·cos + east·sin.
|
||||
const offsets = new Float64Array((RIPPLE_RING_SEGMENTS + 1) * 3);
|
||||
const angles = new Float64Array(RIPPLE_RING_SEGMENTS + 1);
|
||||
for (let i = 0; i <= RIPPLE_RING_SEGMENTS; i++)
|
||||
angles[i] = (2 * Math.PI * i) / RIPPLE_RING_SEGMENTS;
|
||||
|
||||
// Screen points, reused every frame.
|
||||
const at = { x: 0, y: 0 };
|
||||
const centerAt = { x: 0, y: 0 };
|
||||
const eastAt = { x: 0, y: 0 };
|
||||
const northAt = { x: 0, y: 0 };
|
||||
|
||||
/** Project an ECEF point to CSS pixels; false when it is behind the eye. */
|
||||
function project(frame, px, py, pz, out) {
|
||||
const m = frame.viewProjectionMatrix;
|
||||
const w = m[3] * px + m[7] * py + m[11] * pz + m[15];
|
||||
if (w <= 0) return false;
|
||||
out.x =
|
||||
((m[0] * px + m[4] * py + m[8] * pz + m[12]) / w / 2 + 0.5) * frame.width;
|
||||
out.y =
|
||||
(0.5 - (m[1] * px + m[5] * py + m[9] * pz + m[13]) / w / 2) *
|
||||
frame.height;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace one closed line at `fraction` of the disc's radius (`shaped`:
|
||||
* as a contour, else the disc's own circle). True when all of it is in
|
||||
* front of the eye, so it can be filled.
|
||||
*/
|
||||
function trace(frame, fraction, shaped) {
|
||||
const { ctx } = frame;
|
||||
const center = target.center;
|
||||
const reach = fraction * target.radiusM;
|
||||
ctx.beginPath();
|
||||
let pen = false;
|
||||
let whole = true;
|
||||
for (let i = 0; i <= RIPPLE_RING_SEGMENTS; i++) {
|
||||
// The last point repeats the first angle, so the line closes.
|
||||
const r = shaped
|
||||
? reach * earthquakeContourScale(target.shape, angles[i], fraction)
|
||||
: reach;
|
||||
const visible = project(
|
||||
frame,
|
||||
center.x + offsets[i * 3] * r,
|
||||
center.y + offsets[i * 3 + 1] * r,
|
||||
center.z + offsets[i * 3 + 2] * r,
|
||||
at,
|
||||
);
|
||||
if (!visible) {
|
||||
pen = false;
|
||||
whole = false;
|
||||
continue;
|
||||
}
|
||||
if (pen) ctx.lineTo(at.x, at.y);
|
||||
else ctx.moveTo(at.x, at.y);
|
||||
pen = true;
|
||||
}
|
||||
return whole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill the traced path with a radial gradient laid on the ground: the
|
||||
* canvas places a path when it is traced and a gradient when it fills, so
|
||||
* under the disc's ground-to-screen transform the gradient's circle
|
||||
* becomes the disc's ellipse on screen while the path stays exact.
|
||||
* @param {Array<[number, number]>} stops [offset, alpha], out to `reach`.
|
||||
*/
|
||||
function fillGround(ctx, reach, stops) {
|
||||
ctx.save();
|
||||
ctx.transform(
|
||||
eastAt.x - centerAt.x,
|
||||
eastAt.y - centerAt.y,
|
||||
northAt.x - centerAt.x,
|
||||
northAt.y - centerAt.y,
|
||||
centerAt.x,
|
||||
centerAt.y,
|
||||
);
|
||||
const gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, reach);
|
||||
for (const [offset, alpha] of stops)
|
||||
gradient.addColorStop(offset, target.rgba(alpha));
|
||||
ctx.fillStyle = gradient;
|
||||
ctx.globalAlpha = 1;
|
||||
ctx.fill();
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether any of the disc is in the viewport: its centre's screen point,
|
||||
* padded by its larger screen radius (or, seen edge-on, the centre alone).
|
||||
*/
|
||||
function discOnScreen(frame, c, e, n) {
|
||||
if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return false;
|
||||
const pad = Math.max(
|
||||
Math.hypot(e.x - c.x, e.y - c.y) || 0,
|
||||
Math.hypot(n.x - c.x, n.y - c.y) || 0,
|
||||
);
|
||||
return (
|
||||
c.x + pad >= 0 &&
|
||||
c.x - pad <= frame.width &&
|
||||
c.y + pad >= 0 &&
|
||||
c.y - pad <= frame.height
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-read the ground height under the quake, at most twice a second while
|
||||
* painting: the ground loads and refines as the camera comes in, and the
|
||||
* rings move onto it once it differs by more than a metre.
|
||||
*/
|
||||
function settleHeight() {
|
||||
if (!target.heightAt) return;
|
||||
const at = now();
|
||||
if (at - target.heightReadAt < HEIGHT_READ_INTERVAL_MS) return;
|
||||
target.heightReadAt = at;
|
||||
let height = null;
|
||||
try {
|
||||
height = target.heightAt();
|
||||
} catch {
|
||||
height = null;
|
||||
}
|
||||
if (!groundHeightOk(height) || Math.abs(height - target.heightM) <= 1)
|
||||
return;
|
||||
target.heightM = height;
|
||||
target.center = fromDegrees(target.lon, target.lat, height);
|
||||
}
|
||||
|
||||
function paint(frame) {
|
||||
if (!target) return;
|
||||
const { ctx } = frame;
|
||||
settleHeight();
|
||||
const center = target.center;
|
||||
onScreen = false;
|
||||
if (frame.occluder?.isPointVisible?.(center) === false) return;
|
||||
const R = target.radiusM;
|
||||
// The disc's ground frame on screen: its centre, and a radius east and
|
||||
// north. Seen edge-on (or partly behind the eye) it is not filled.
|
||||
const centerOk = project(frame, center.x, center.y, center.z, centerAt);
|
||||
const eastOk = project(
|
||||
frame,
|
||||
center.x + target.east.x * R,
|
||||
center.y + target.east.y * R,
|
||||
center.z + target.east.z * R,
|
||||
eastAt,
|
||||
);
|
||||
const northOk = project(
|
||||
frame,
|
||||
center.x + target.north.x * R,
|
||||
center.y + target.north.y * R,
|
||||
center.z + target.north.z * R,
|
||||
northAt,
|
||||
);
|
||||
let fills = centerOk && eastOk && northOk;
|
||||
if (fills) {
|
||||
const area =
|
||||
(eastAt.x - centerAt.x) * (northAt.y - centerAt.y) -
|
||||
(eastAt.y - centerAt.y) * (northAt.x - centerAt.x);
|
||||
fills = Math.abs(area) > 1;
|
||||
}
|
||||
onScreen =
|
||||
centerOk &&
|
||||
discOnScreen(
|
||||
frame,
|
||||
centerAt,
|
||||
eastOk ? eastAt : centerAt,
|
||||
northOk ? northAt : centerAt,
|
||||
);
|
||||
// The disc: strongest at the epicentre, fading out to its outer circle.
|
||||
if (fills && trace(frame, 1, false)) fillGround(ctx, 1, DISC_FADE);
|
||||
const animate = running();
|
||||
const rings = animate
|
||||
? earthquakeRippleRings(now() - startedAt)
|
||||
: earthquakeContourRings();
|
||||
// Brought back into view while the window lasts: run again.
|
||||
if (animate && onScreen && frameHandle === null && lane)
|
||||
frameHandle = requestFrame(tick);
|
||||
ctx.strokeStyle = target.color;
|
||||
ctx.lineJoin = 'round';
|
||||
for (const { fraction, alpha, index } of rings) {
|
||||
if (!(alpha > 0.01)) continue;
|
||||
const whole = trace(frame, fraction, true);
|
||||
// Each wave: clear inside, tinting toward its own line, as it fades.
|
||||
if (fills && whole)
|
||||
fillGround(
|
||||
ctx,
|
||||
fraction,
|
||||
WAVE_FADE.map(([offset, a]) => [offset, a * alpha]),
|
||||
);
|
||||
ctx.lineWidth = index ? INDEX_WIDTH_PX : LINE_WIDTH_PX;
|
||||
ctx.globalAlpha = alpha;
|
||||
ctx.stroke();
|
||||
}
|
||||
ctx.globalAlpha = 1;
|
||||
}
|
||||
|
||||
/** Ask for one more frame while the lines run (one request at a time). */
|
||||
function tick() {
|
||||
frameHandle = null;
|
||||
if (!target || !lane) return;
|
||||
// Settled, or out of sight: one last paint draws the still contours
|
||||
// (or nothing), and no more frames are asked for. A paint that finds it
|
||||
// on screen again inside the window starts the frames again.
|
||||
if (!running() || !onScreen) {
|
||||
lane.requestPaint();
|
||||
return;
|
||||
}
|
||||
lane.requestPaint();
|
||||
frameHandle = requestFrame(tick);
|
||||
}
|
||||
|
||||
function stopFrames() {
|
||||
if (frameHandle !== null) cancelFrame(frameHandle);
|
||||
frameHandle = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the contour lines around one quake, replacing any other.
|
||||
* @param {{id: string, lon: number, lat: number, heightM?: number, heightAt?: () => number|null, radiusM: number, color: string}} next
|
||||
* @param {{restart?: boolean}} [options] `restart: false` updates the
|
||||
* same quake in place (a feed refresh) without running it again.
|
||||
*/
|
||||
function show(next, { restart = true } = {}) {
|
||||
if (
|
||||
!next ||
|
||||
!Number.isFinite(next.lon) ||
|
||||
!Number.isFinite(next.lat) ||
|
||||
!(next.radiusM > 0)
|
||||
) {
|
||||
hide();
|
||||
return;
|
||||
}
|
||||
const sameQuake = target?.id === next.id;
|
||||
const lon = (next.lon * Math.PI) / 180;
|
||||
const lat = (next.lat * Math.PI) / 180;
|
||||
const [sinLon, cosLon] = [Math.sin(lon), Math.cos(lon)];
|
||||
const [sinLat, cosLat] = [Math.sin(lat), Math.cos(lat)];
|
||||
for (let i = 0; i <= RIPPLE_RING_SEGMENTS; i++) {
|
||||
const [c, s] = [Math.cos(angles[i]), Math.sin(angles[i])];
|
||||
offsets[i * 3] = c * -sinLat * cosLon + s * -sinLon;
|
||||
offsets[i * 3 + 1] = c * -sinLat * sinLon + s * cosLon;
|
||||
offsets[i * 3 + 2] = c * cosLat;
|
||||
}
|
||||
target = {
|
||||
id: next.id,
|
||||
// On the ground the disc is draped on: the height known now, then
|
||||
// re-read while painting (see `settleHeight`), since a label's fly-to
|
||||
// starts from far away, before that ground has loaded.
|
||||
lon: next.lon,
|
||||
lat: next.lat,
|
||||
heightM: groundHeightOk(next.heightM) ? next.heightM : 0,
|
||||
heightAt: typeof next.heightAt === 'function' ? next.heightAt : null,
|
||||
heightReadAt: -Infinity,
|
||||
center: fromDegrees(
|
||||
next.lon,
|
||||
next.lat,
|
||||
groundHeightOk(next.heightM) ? next.heightM : 0,
|
||||
),
|
||||
radiusM: next.radiusM,
|
||||
color: next.color || 'rgb(255,165,0)',
|
||||
shape: earthquakeContourShape(next.id),
|
||||
rgba: cssWithAlpha(next.color || 'rgb(255,165,0)'),
|
||||
// Angle 0 is north and a quarter turn is east (see `offsets`).
|
||||
north: { x: offsets[0], y: offsets[1], z: offsets[2] },
|
||||
east: {
|
||||
x: offsets[(RIPPLE_RING_SEGMENTS / 4) * 3],
|
||||
y: offsets[(RIPPLE_RING_SEGMENTS / 4) * 3 + 1],
|
||||
z: offsets[(RIPPLE_RING_SEGMENTS / 4) * 3 + 2],
|
||||
},
|
||||
};
|
||||
if (restart || !sameQuake) {
|
||||
startedAt = now();
|
||||
settlesAt =
|
||||
startedAt + RIPPLE_ACTIVE_CYCLES * EARTHQUAKE_RIPPLE_PERIOD_MS;
|
||||
// Assume it is in view until a paint says otherwise.
|
||||
onScreen = true;
|
||||
}
|
||||
lane ??= registerLane(RIPPLE_PAINT_LANE, paint, {
|
||||
id: 'earthquake-ripples',
|
||||
});
|
||||
lane.setActive(true);
|
||||
lane.requestPaint();
|
||||
// A refresh while the disc is out of sight asks for no frame; a paint
|
||||
// that finds it on screen again starts them (a restart sets onScreen).
|
||||
if (running() && onScreen && frameHandle === null)
|
||||
frameHandle = requestFrame(tick);
|
||||
}
|
||||
|
||||
function hide() {
|
||||
stopFrames();
|
||||
if (!target) return;
|
||||
target = null;
|
||||
lane?.setActive(false);
|
||||
}
|
||||
|
||||
function dispose() {
|
||||
hide();
|
||||
lane?.unregister();
|
||||
lane = null;
|
||||
}
|
||||
|
||||
return { show, hide, dispose };
|
||||
}
|
||||
@@ -0,0 +1,452 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
DISC_FADE,
|
||||
cssWithAlpha,
|
||||
RIPPLE_ACTIVE_CYCLES,
|
||||
RIPPLE_PAINT_LANE,
|
||||
RIPPLE_RING_SEGMENTS,
|
||||
createEarthquakeRipples,
|
||||
} from './earthquakeRipples.js';
|
||||
import {
|
||||
EARTHQUAKE_RIPPLE_PERIOD_MS,
|
||||
EARTHQUAKE_RIPPLE_RINGS,
|
||||
} from '../../layers/earthquakes/model.js';
|
||||
import { fromDegrees } from '../../geo/ellipsoid.js';
|
||||
|
||||
/** A paint lane, frame clock and canvas the test steps by hand. */
|
||||
function harness({ reducedMotion = false } = {}) {
|
||||
let motionReduced = reducedMotion;
|
||||
const lanes = [];
|
||||
const frames = new Map();
|
||||
let nextFrame = 1;
|
||||
let clock = 0;
|
||||
const ripples = createEarthquakeRipples({
|
||||
registerLane(laneId, painter, options) {
|
||||
const lane = {
|
||||
laneId,
|
||||
painter,
|
||||
options,
|
||||
active: false,
|
||||
paints: 0,
|
||||
unregistered: false,
|
||||
setActive(next) {
|
||||
lane.active = next;
|
||||
},
|
||||
requestPaint() {
|
||||
lane.paints++;
|
||||
},
|
||||
unregister() {
|
||||
lane.unregistered = true;
|
||||
},
|
||||
};
|
||||
lanes.push(lane);
|
||||
return lane;
|
||||
},
|
||||
now: () => clock,
|
||||
requestFrame(cb) {
|
||||
const handle = nextFrame++;
|
||||
frames.set(handle, cb);
|
||||
return handle;
|
||||
},
|
||||
cancelFrame: (handle) => frames.delete(handle),
|
||||
prefersReducedMotion: () => motionReduced,
|
||||
});
|
||||
const strokes = [];
|
||||
const fills = [];
|
||||
let path = null;
|
||||
const ctx = {
|
||||
globalAlpha: 1,
|
||||
beginPath() {
|
||||
path = { moves: 0, lines: 0 };
|
||||
},
|
||||
moveTo() {
|
||||
path.moves++;
|
||||
},
|
||||
lineTo() {
|
||||
path.lines++;
|
||||
},
|
||||
stroke() {
|
||||
strokes.push({
|
||||
...path,
|
||||
alpha: ctx.globalAlpha,
|
||||
color: ctx.strokeStyle,
|
||||
width: ctx.lineWidth,
|
||||
});
|
||||
},
|
||||
// Fills record their path, gradient and the transform they fill under.
|
||||
saved: 0,
|
||||
transformed: null,
|
||||
save() {
|
||||
ctx.saved++;
|
||||
},
|
||||
restore() {
|
||||
ctx.saved--;
|
||||
ctx.transformed = null;
|
||||
},
|
||||
transform(...args) {
|
||||
ctx.transformed = args;
|
||||
},
|
||||
createRadialGradient(...circles) {
|
||||
const gradient = { circles, stops: [] };
|
||||
gradient.addColorStop = (offset, color) =>
|
||||
gradient.stops.push([offset, color]);
|
||||
return gradient;
|
||||
},
|
||||
fill() {
|
||||
fills.push({
|
||||
...path,
|
||||
gradient: ctx.fillStyle,
|
||||
transform: ctx.transformed,
|
||||
});
|
||||
},
|
||||
};
|
||||
// w = 1 everywhere: every point is in front of the eye.
|
||||
const matrix = new Float64Array(16);
|
||||
matrix[0] = 1e-7;
|
||||
matrix[5] = 1e-7;
|
||||
matrix[15] = 1;
|
||||
const frame = (visible = true) => ({
|
||||
ctx,
|
||||
width: 800,
|
||||
height: 600,
|
||||
viewProjectionMatrix: matrix,
|
||||
occluder: { isPointVisible: () => visible },
|
||||
});
|
||||
return {
|
||||
ripples,
|
||||
lanes,
|
||||
frames,
|
||||
strokes,
|
||||
fills,
|
||||
frame,
|
||||
matrix,
|
||||
setReducedMotion(next) {
|
||||
motionReduced = next;
|
||||
},
|
||||
advance(ms) {
|
||||
clock += ms;
|
||||
},
|
||||
/** Run the pending animation frames once. */
|
||||
step() {
|
||||
const pending = [...frames.entries()];
|
||||
frames.clear();
|
||||
for (const [, cb] of pending) cb();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const target = {
|
||||
id: 'ak1',
|
||||
lon: -153.3,
|
||||
lat: 60,
|
||||
radiusM: 32000,
|
||||
color: 'rgb(255,0,0)',
|
||||
};
|
||||
|
||||
test('nothing is registered or animated until a quake is selected', () => {
|
||||
const h = harness();
|
||||
assert.equal(h.lanes.length, 0);
|
||||
assert.equal(h.frames.size, 0);
|
||||
h.ripples.hide();
|
||||
assert.equal(h.frames.size, 0);
|
||||
});
|
||||
|
||||
test('a selected quake animates one ring set, one frame request at a time', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
const [lane] = h.lanes;
|
||||
assert.equal(lane.laneId, RIPPLE_PAINT_LANE);
|
||||
assert.equal(RIPPLE_PAINT_LANE, 'ambient-label', 'under the labels');
|
||||
assert.equal(lane.active, true);
|
||||
assert.equal(h.frames.size, 1);
|
||||
h.ripples.show({ ...target, id: 'ak2' });
|
||||
assert.equal(h.lanes.length, 1, 'the lane is reused');
|
||||
assert.equal(h.frames.size, 1, 'still one frame loop');
|
||||
const before = lane.paints;
|
||||
h.step();
|
||||
h.step();
|
||||
assert.equal(lane.paints, before + 2, 'one repaint per frame');
|
||||
assert.equal(h.frames.size, 1);
|
||||
|
||||
h.advance(600);
|
||||
lane.painter(h.frame());
|
||||
// At 600 ms every line is between the marker and the edge, so all draw.
|
||||
assert.equal(h.strokes.length, EARTHQUAKE_RIPPLE_RINGS);
|
||||
assert.deepEqual(
|
||||
h.strokes.map((stroke) => stroke.width),
|
||||
[2, 1.1, 1.1, 2, 1.1, 1.1],
|
||||
'every third line is an index contour',
|
||||
);
|
||||
for (const stroke of h.strokes) {
|
||||
assert.equal(stroke.moves, 1, 'one unbroken ring');
|
||||
assert.equal(stroke.lines, RIPPLE_RING_SEGMENTS);
|
||||
assert.equal(stroke.color, 'rgb(255,0,0)');
|
||||
assert.ok(stroke.alpha > 0 && stroke.alpha <= 1);
|
||||
}
|
||||
|
||||
h.ripples.hide();
|
||||
assert.equal(lane.active, false);
|
||||
assert.equal(h.frames.size, 0, 'no frames asked for once hidden');
|
||||
h.strokes.length = 0;
|
||||
lane.painter(h.frame());
|
||||
assert.equal(h.strokes.length, 0);
|
||||
});
|
||||
|
||||
test('rings are skipped behind the globe and broken behind the eye', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
h.advance(600);
|
||||
const [lane] = h.lanes;
|
||||
lane.painter(h.frame(false));
|
||||
assert.equal(h.strokes.length, 0, 'epicentre over the horizon');
|
||||
|
||||
// Points with negative x fall behind the eye: each ring breaks there.
|
||||
const frame = h.frame();
|
||||
frame.viewProjectionMatrix[3] = 1e-6;
|
||||
const center = fromDegrees(target.lon, target.lat);
|
||||
frame.viewProjectionMatrix[15] = -1e-6 * center.x;
|
||||
lane.painter(frame);
|
||||
assert.equal(h.strokes.length, EARTHQUAKE_RIPPLE_RINGS);
|
||||
for (const stroke of h.strokes)
|
||||
assert.ok(stroke.lines < RIPPLE_RING_SEGMENTS, 'part of each ring hidden');
|
||||
});
|
||||
|
||||
test('reduced motion draws still contour rings and asks for no frames', () => {
|
||||
const h = harness({ reducedMotion: true });
|
||||
h.ripples.show(target);
|
||||
assert.equal(h.frames.size, 0);
|
||||
assert.equal(h.lanes[0].paints, 1, 'painted once');
|
||||
h.lanes[0].painter(h.frame());
|
||||
assert.equal(h.strokes.length, EARTHQUAKE_RIPPLE_RINGS);
|
||||
assert.ok(h.strokes.every((stroke) => stroke.alpha === 0.7));
|
||||
});
|
||||
|
||||
test('an unusable target hides the rings; dispose releases the lane', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
h.ripples.show({ ...target, radiusM: 0 });
|
||||
assert.equal(h.lanes[0].active, false);
|
||||
assert.equal(h.frames.size, 0);
|
||||
h.ripples.dispose();
|
||||
assert.equal(h.lanes[0].unregistered, true);
|
||||
// Shown again after dispose, it registers a fresh lane.
|
||||
h.ripples.show(target);
|
||||
assert.equal(h.lanes.length, 2);
|
||||
h.ripples.dispose();
|
||||
});
|
||||
|
||||
test('contour lines are wavy, the same for a quake every time, and inside the disc', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
h.advance(600);
|
||||
// An identity-like projection: screen x, y follow ECEF y, z, so the
|
||||
// distance from the projected epicentre measures each point's radius.
|
||||
const frame = h.frame();
|
||||
const m = frame.viewProjectionMatrix;
|
||||
m[0] = 0;
|
||||
m[5] = 0;
|
||||
m[4] = 1e-6;
|
||||
m[9] = 1e-6;
|
||||
const points = [];
|
||||
const ctx = frame.ctx;
|
||||
const record = (x, y) => points.at(-1).push([x, y]);
|
||||
ctx.beginPath = () => points.push([]);
|
||||
ctx.moveTo = record;
|
||||
ctx.lineTo = record;
|
||||
ctx.stroke = () => {};
|
||||
h.lanes[0].painter(frame);
|
||||
const center = fromDegrees(target.lon, target.lat);
|
||||
const cx = (center.y * 1e-6 * 0.5 + 0.5) * 800;
|
||||
const cy = (0.5 - center.z * 1e-6 * 0.5) * 600;
|
||||
const spread = (line) => {
|
||||
const radii = line.map(([x, y]) => Math.hypot(x - cx, y - cy));
|
||||
return Math.max(...radii) / Math.min(...radii);
|
||||
};
|
||||
// The disc's outer circle first (filled, not stroked), then each line.
|
||||
assert.equal(points.length, EARTHQUAKE_RIPPLE_RINGS + 1);
|
||||
points.shift();
|
||||
assert.ok(
|
||||
points.every((line) => spread(line) > 1.05),
|
||||
'not circles: each line dents in and out',
|
||||
);
|
||||
for (const line of points) {
|
||||
const [first, last] = [line[0], line.at(-1)];
|
||||
assert.ok(
|
||||
Math.hypot(first[0] - last[0], first[1] - last[1]) < 1e-6,
|
||||
'closed',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('the disc fades out to its outer circle; each wave fills with a fade', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
h.advance(600);
|
||||
// A projection where east and north span the screen: the disc is seen
|
||||
// from above, so its ground frame can be filled.
|
||||
const frame = h.frame();
|
||||
const m = frame.viewProjectionMatrix;
|
||||
m[0] = 0;
|
||||
m[5] = 0;
|
||||
m[4] = 1e-6;
|
||||
m[9] = 1e-6;
|
||||
h.lanes[0].painter(frame);
|
||||
assert.equal(h.fills.length, 1 + EARTHQUAKE_RIPPLE_RINGS);
|
||||
const [disc, ...waves] = h.fills;
|
||||
assert.equal(disc.lines, RIPPLE_RING_SEGMENTS, 'the whole outer circle');
|
||||
assert.deepEqual(disc.gradient.circles, [0, 0, 0, 0, 0, 1]);
|
||||
assert.deepEqual(
|
||||
disc.gradient.stops,
|
||||
DISC_FADE.map(([offset, alpha]) => [offset, `rgba(255,0,0,${alpha})`]),
|
||||
);
|
||||
assert.equal(disc.gradient.stops.at(-1)[1], 'rgba(255,0,0,0)', 'fades out');
|
||||
assert.ok(disc.transform, 'filled under the ground-to-screen transform');
|
||||
assert.equal(h.fills.length, waves.length + 1);
|
||||
for (const wave of waves) {
|
||||
const reach = wave.gradient.circles[5];
|
||||
assert.ok(reach > 0 && reach < 1, 'out to its own line');
|
||||
assert.equal(wave.gradient.stops[0][1], 'rgba(255,0,0,0)', 'clear inside');
|
||||
}
|
||||
// The transforms were undone: nothing leaks into the labels' painting.
|
||||
assert.equal(frame.ctx.saved, 0);
|
||||
// Seen edge-on, the ground frame has no area: lines only, no fills.
|
||||
h.fills.length = 0;
|
||||
m[9] = 0;
|
||||
m[5] = 0;
|
||||
h.lanes[0].painter(frame);
|
||||
assert.equal(h.fills.length, 0);
|
||||
});
|
||||
|
||||
test('cssWithAlpha turns rgb into rgba stops', () => {
|
||||
assert.equal(cssWithAlpha('rgb(255,165,0)')(0.25), 'rgba(255,165,0,0.25)');
|
||||
assert.equal(cssWithAlpha('rgba(1, 2, 3, 0.5)')(2), 'rgba(1,2,3,1)');
|
||||
assert.equal(cssWithAlpha('red')(0.3), 'red');
|
||||
});
|
||||
|
||||
test('the lines run a bounded time after a selection, then rest without frames', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
const [lane] = h.lanes;
|
||||
const window = RIPPLE_ACTIVE_CYCLES * EARTHQUAKE_RIPPLE_PERIOD_MS;
|
||||
assert.ok(window <= 15_000, 'about a quarter of a minute at most');
|
||||
let frames = 0;
|
||||
for (let t = 0; t < window * 3; t += 16) {
|
||||
if (!h.frames.size) break;
|
||||
lane.painter(h.frame());
|
||||
h.advance(16);
|
||||
h.step();
|
||||
frames++;
|
||||
}
|
||||
assert.equal(h.frames.size, 0, 'no frame asked for once settled');
|
||||
assert.ok(frames <= Math.ceil(window / 16) + 2, `bounded: ${frames} frames`);
|
||||
// At rest the lines hold still as readable contours.
|
||||
h.strokes.length = 0;
|
||||
lane.painter(h.frame());
|
||||
assert.equal(h.strokes.length, EARTHQUAKE_RIPPLE_RINGS);
|
||||
assert.ok(h.strokes.every((stroke) => stroke.alpha === 0.7));
|
||||
// A parked camera repainting the overlay does not start them again.
|
||||
lane.painter(h.frame());
|
||||
assert.equal(h.frames.size, 0);
|
||||
// A new selection runs again.
|
||||
h.ripples.show({ ...target, id: 'ak2' });
|
||||
assert.equal(h.frames.size, 1);
|
||||
h.ripples.dispose();
|
||||
});
|
||||
|
||||
test('off screen the frames stop; back in view inside the window they resume', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
const [lane] = h.lanes;
|
||||
// Behind the globe.
|
||||
lane.painter(h.frame(false));
|
||||
const paints = lane.paints;
|
||||
h.step();
|
||||
assert.equal(h.frames.size, 0, 'stopped while out of sight');
|
||||
assert.equal(lane.paints, paints + 1, 'one last paint, then none');
|
||||
h.step();
|
||||
assert.equal(lane.paints, paints + 1);
|
||||
// Panned away: the disc is far off the viewport.
|
||||
h.ripples.show(target);
|
||||
const away = h.frame();
|
||||
away.viewProjectionMatrix[12] = 50;
|
||||
lane.painter(away);
|
||||
h.step();
|
||||
assert.equal(h.frames.size, 0);
|
||||
// The camera brings it back while the window lasts.
|
||||
away.viewProjectionMatrix[12] = 0;
|
||||
lane.painter(h.frame());
|
||||
assert.equal(h.frames.size, 1, 'resumed');
|
||||
h.ripples.dispose();
|
||||
});
|
||||
|
||||
test('turning reduced motion on mid-run stills the lines and stops the frames', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
const [lane] = h.lanes;
|
||||
lane.painter(h.frame());
|
||||
h.setReducedMotion(true);
|
||||
h.step();
|
||||
assert.equal(h.frames.size, 0);
|
||||
h.strokes.length = 0;
|
||||
lane.painter(h.frame());
|
||||
assert.ok(
|
||||
h.strokes.every((stroke) => stroke.alpha === 0.7),
|
||||
'still',
|
||||
);
|
||||
// Turned off again within the window: the next paint runs them again.
|
||||
h.setReducedMotion(false);
|
||||
lane.painter(h.frame());
|
||||
assert.equal(h.frames.size, 1);
|
||||
h.ripples.dispose();
|
||||
});
|
||||
|
||||
test('a refresh of the same quake does not run a settled selection again', () => {
|
||||
const h = harness();
|
||||
h.ripples.show(target);
|
||||
const [lane] = h.lanes;
|
||||
h.advance(RIPPLE_ACTIVE_CYCLES * EARTHQUAKE_RIPPLE_PERIOD_MS + 1);
|
||||
lane.painter(h.frame());
|
||||
h.step();
|
||||
assert.equal(h.frames.size, 0, 'settled');
|
||||
h.ripples.show({ ...target, radiusM: 40000 }, { restart: false });
|
||||
assert.equal(h.frames.size, 0, 'a refresh keeps it at rest');
|
||||
lane.painter(h.frame());
|
||||
assert.equal(h.frames.size, 0);
|
||||
// A different quake, or a user's restart, runs again.
|
||||
h.ripples.show({ ...target, id: 'other' }, { restart: false });
|
||||
assert.equal(h.frames.size, 1);
|
||||
h.ripples.dispose();
|
||||
});
|
||||
|
||||
// The rings sit on the ground the disc is draped on. A label's fly-to starts
|
||||
// far away, before that ground loads, so the painter reads the height again
|
||||
// while it paints and moves the rings onto it.
|
||||
test('the rings move onto the ground height once it loads', () => {
|
||||
const h = harness();
|
||||
let ground = null;
|
||||
h.ripples.show({ ...target, heightM: 0, heightAt: () => ground });
|
||||
h.advance(600);
|
||||
const [lane] = h.lanes;
|
||||
lane.painter(h.frame());
|
||||
const atSea = h.fills.at(-1).transform;
|
||||
h.fills.length = 0;
|
||||
ground = 4000;
|
||||
h.advance(600);
|
||||
lane.painter(h.frame());
|
||||
const onGround = h.fills.at(-1).transform;
|
||||
assert.notDeepEqual(onGround, atSea, 'the centre moved up onto the ground');
|
||||
// A change of a metre or less, or an impossible height, leaves them put.
|
||||
for (const next of [4000.5, 25000, -2000]) {
|
||||
ground = next;
|
||||
h.advance(600);
|
||||
lane.painter(h.frame());
|
||||
assert.deepEqual(h.fills.at(-1).transform, onGround, String(next));
|
||||
}
|
||||
// Reads are bounded: a second paint within the interval does not ask again.
|
||||
let reads = 0;
|
||||
h.ripples.show({ ...target, id: 'ak2', heightAt: () => (reads++, 4000) });
|
||||
lane.painter(h.frame());
|
||||
lane.painter(h.frame());
|
||||
assert.equal(reads, 1);
|
||||
});
|
||||
@@ -1,6 +1,49 @@
|
||||
import { createEarthquakesLayer } from '../../layers/earthquakes/index.js';
|
||||
import { overlayHost } from './overlayHost.js';
|
||||
/** Wire earthquake observations to the application overlay host. */
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import * as picking from '../../data/pickRegistry.js';
|
||||
import * as context from '../../data/contextStore.js';
|
||||
import { isPointerFree } from '../../data/inputOwnership.js';
|
||||
import { requestWorldFocus } from '../../worldFocus.js';
|
||||
import { createEarthquakeRipples } from './earthquakeRipples.js';
|
||||
import { heightsOf } from '../../queries/heights.js';
|
||||
import { formatDate, formatNumber, t } from '../../i18n/index.js';
|
||||
|
||||
const EVENT_TIME = Object.freeze({
|
||||
day: 'numeric',
|
||||
month: 'short',
|
||||
year: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
timeZone: 'UTC',
|
||||
timeZoneName: 'short',
|
||||
});
|
||||
|
||||
/** The clicked quake's card text, in the page's language. */
|
||||
export const earthquakeCardText = Object.freeze({
|
||||
t,
|
||||
formatTime: (time) => formatDate(time, EVENT_TIME),
|
||||
formatDepth: (km) => formatNumber(km, { maximumFractionDigits: 1 }),
|
||||
});
|
||||
|
||||
/**
|
||||
* Wire earthquake observations to the application overlay host, and its
|
||||
* discs to the globe's clicks: a clicked quake shows its detail card.
|
||||
*/
|
||||
export function createApplicationEarthquakes(options) {
|
||||
return createEarthquakesLayer({ overlayHost, ...options });
|
||||
return createEarthquakesLayer({
|
||||
overlayHost,
|
||||
input: (viewer) => inputFor(viewer),
|
||||
picking,
|
||||
context,
|
||||
pointer: { isPointerFree },
|
||||
openExternal: (url) => window.open(url, '_blank', 'noopener,noreferrer'),
|
||||
focus: { requestWorldFocus },
|
||||
ripples: createEarthquakeRipples(),
|
||||
// The loaded ground (terrain or tiles) the clamped disc is draped on.
|
||||
groundHeight: (viewer, lon, lat) =>
|
||||
viewer ? heightsOf(viewer).now({ lon, lat }) : null,
|
||||
text: earthquakeCardText,
|
||||
...options,
|
||||
});
|
||||
}
|
||||
@@ -2,11 +2,12 @@ import { createRocketLaunchesLayer } from '../../layers/launches/index.js';
|
||||
import * as geometry from '../../celestialRing.js';
|
||||
import * as overlays from '../../overlays/worldOverlay.js';
|
||||
import * as render from '../../renderGovernor.js';
|
||||
import * as picking from '../../data/pickRegistry.js';
|
||||
|
||||
/** Construct one layer using the application scene owners and a supplied source. */
|
||||
export function createApplicationLaunches({ source, satellites }) {
|
||||
return createRocketLaunchesLayer({
|
||||
source,
|
||||
services: { satellites, geometry, overlays, render },
|
||||
services: { satellites, geometry, overlays, render, picking },
|
||||
});
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
import { createSubmarineCableLayer } from '../../layers/submarineCables/index.js';
|
||||
import { overlayHost } from './overlayHost.js';
|
||||
import * as picking from '../../data/pickRegistry.js';
|
||||
/** Wire cable source geometry to the application overlay host. */
|
||||
export function createApplicationCables(options) {
|
||||
return createSubmarineCableLayer({
|
||||
overlayHost,
|
||||
picking,
|
||||
mapStackEventTarget: typeof window !== 'undefined' ? window : null,
|
||||
...options,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createApplicationOperations } from './operations.js';
|
||||
import { registerDataCredits } from '../data/dataCredits.js';
|
||||
import { mountCreditsView } from '../ui/creditsView.js';
|
||||
import { trackCreditLineHeight } from '../ui/creditLineHeight.js';
|
||||
import { MapStackController } from '../mapStackController.js';
|
||||
import { mapEngineFor } from '../maps/engine.js';
|
||||
import { initLogoGaze } from '../logoGaze.js';
|
||||
@@ -173,6 +174,8 @@ export async function createApplicationScene({
|
||||
// The credits, in the application's own line, unless the renderer shows
|
||||
// them in a display of its own.
|
||||
if (!hooks.ownCreditDisplay) defer(mountCreditsView(viewer));
|
||||
// The HUD corners above the line clear it when it wraps.
|
||||
defer(trackCreditLineHeight(document));
|
||||
loaderStatus.textContent =
|
||||
googleApiKey || googleTokens || cesiumToken
|
||||
? t('Loading Google 3D Tiles...')
|
||||
|
||||
@@ -403,10 +403,11 @@ test('vessel and fire layers announce valid clicks and never fly cameras', () =>
|
||||
'vessel click',
|
||||
);
|
||||
ordered(vesselClick, [
|
||||
'clickCard?.(event)',
|
||||
'selectAndFocusVessel(carded)',
|
||||
"isOwnedByOtherLayer('ais-live-vessels', pickedId)",
|
||||
'_vesselOverlayHost.hitTest?.(',
|
||||
'selectAndFocusVessel(record)',
|
||||
], 'vessel sibling ownership');
|
||||
], 'vessel card on top, then sibling ownership');
|
||||
const vesselFocus = body(
|
||||
vessels,
|
||||
/function selectAndFocusVessel\(record\) \{([\s\S]*?)\n \}/,
|
||||
@@ -419,8 +420,9 @@ test('vessel and fire layers announce valid clicks and never fly cameras', () =>
|
||||
'fire click',
|
||||
);
|
||||
ordered(fireClick, [
|
||||
'isOwnedByOtherLayer(id, pickedId)',
|
||||
'overlayHost.hitTest?.(',
|
||||
'clickCard?.(event)',
|
||||
'selectAndFocusFire(carded)',
|
||||
], 'fire sibling ownership');
|
||||
'isOwnedByOtherLayer(id, pickedId)',
|
||||
'clearFireSelection()',
|
||||
], 'fire card on top, then sibling ownership');
|
||||
});
|
||||
@@ -595,7 +595,7 @@ test('Cockpit Display portal retains both scroll owners across round trips', ()
|
||||
const portal = CockpitDisplayPortal.toString();
|
||||
assert.match(
|
||||
portal,
|
||||
/this\.standardScrollTop =\s*displayPanelScroller\(standardPanel\)\?\.scrollTop \|\| 0/,
|
||||
/this\.standardScrollTop = standardPanel\?\.scrollTop \|\| 0/,
|
||||
);
|
||||
assert.match(
|
||||
portal,
|
||||
@@ -603,7 +603,7 @@ test('Cockpit Display portal retains both scroll owners across round trips', ()
|
||||
);
|
||||
assert.match(
|
||||
portal,
|
||||
/if \(!this\.active\)[\s\S]*?this\.standardScrollTop =\s*displayPanelScroller\(standardPanel\)\.scrollTop/,
|
||||
/if \(!this\.active\)[\s\S]*?this\.standardScrollTop = standardPanel\.scrollTop/,
|
||||
);
|
||||
assert.match(
|
||||
portal,
|
||||
@@ -611,7 +611,7 @@ test('Cockpit Display portal retains both scroll owners across round trips', ()
|
||||
);
|
||||
assert.match(
|
||||
portal,
|
||||
/this\.cockpitPanel\.scrollTop = this\.cockpitScrollTop[\s\S]*?displayPanelScroller\(this\.standardPanel\)\.scrollTop =\s*this\.standardScrollTop/,
|
||||
/this\.cockpitPanel\.scrollTop = this\.cockpitScrollTop[\s\S]*?this\.standardPanel\.scrollTop = this\.standardScrollTop/,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -680,6 +680,7 @@ test('fresh Cockpit entry temporarily collapses map panels and exit restores the
|
||||
'scene-panel',
|
||||
'pp-toggles',
|
||||
'global-context-panel',
|
||||
'space-missions-panel',
|
||||
'radio-panel',
|
||||
]) {
|
||||
assert.match(
|
||||
@@ -1261,14 +1262,15 @@ test('Global Context uses its dedicated right rail without a duplicate Data Laye
|
||||
);
|
||||
assert.match(html, /id="global-context-panel"/);
|
||||
assert.match(html, /id="global-context-flights-btn"/);
|
||||
assert.match(html, /id="global-context-missions-btn"/);
|
||||
assert.doesNotMatch(html, /id="global-context-missions-btn"/);
|
||||
assert.match(html, /id="space-missions-panel"/);
|
||||
});
|
||||
|
||||
test('Global Context standby describes both chooser modes', () => {
|
||||
test('Global Context standby describes Contacts', () => {
|
||||
const match = html.match(/<div id="context-mode-standby"[\s\S]*?<\/div>/);
|
||||
assert.ok(match, 'Global Context standby is missing');
|
||||
assert.match(match[0], /CONTACTS — nearest planes · vessels · sites/);
|
||||
assert.match(match[0], /SPACE MISSIONS — launches & orbital assets/);
|
||||
assert.doesNotMatch(match[0], /SPACE MISSIONS/);
|
||||
});
|
||||
|
||||
test('cockpit briefing cycle control keeps its state as the accessible name', () => {
|
||||
|
||||
@@ -31,6 +31,7 @@ import {
|
||||
speedRulerStep,
|
||||
speedRulerTicks,
|
||||
} from './cockpitMath.js';
|
||||
import { bandBesideMidpointObstacles } from './ui/panelRailGeometry.js';
|
||||
|
||||
test('cockpit presentation updates are throttled independently of camera frames', () => {
|
||||
assert.equal(cockpitUiUpdateDue(1000, 0, 100), true);
|
||||
@@ -286,6 +287,143 @@ test('HUD rail layout constrains an oversized panel to the safe corridor', () =>
|
||||
assert.equal(layout.constrained, true);
|
||||
});
|
||||
|
||||
test('HUD rail layout keeps a short window clear of an obstacle across its midpoint', () => {
|
||||
// 480px window: midpoint 240. Each obstacle is neither wholly above nor
|
||||
// wholly below the midpoint, and must still limit the band.
|
||||
const above = resolveHudRailLayout({
|
||||
viewportHeight: 480,
|
||||
panelHeight: 120,
|
||||
laneLeft: 20,
|
||||
laneRight: 340,
|
||||
baseTop: 40,
|
||||
baseBottom: 460,
|
||||
gap: 10,
|
||||
obstacles: [{ left: 0, right: 400, top: 200, bottom: 300 }],
|
||||
});
|
||||
// Room above: 200 - 10 - 40 = 150; below: 460 - 310 = 150. A tie keeps the
|
||||
// band above the obstacle.
|
||||
assert.equal(above.safeTop, 40);
|
||||
assert.equal(above.safeBottom, 190);
|
||||
assert(above.top + Math.min(120, above.maxHeight) <= 190);
|
||||
|
||||
const below = resolveHudRailLayout({
|
||||
viewportHeight: 480,
|
||||
panelHeight: 120,
|
||||
laneLeft: 20,
|
||||
laneRight: 340,
|
||||
baseTop: 40,
|
||||
baseBottom: 460,
|
||||
gap: 10,
|
||||
obstacles: [{ left: 0, right: 400, top: 120, bottom: 260 }],
|
||||
});
|
||||
// Room above: 70; below: 190. The band goes under the obstacle.
|
||||
assert.equal(below.safeTop, 270);
|
||||
assert.equal(below.safeBottom, 460);
|
||||
assert(below.top >= 270);
|
||||
});
|
||||
|
||||
test('HUD rail layout leaves the band as it is when an obstacle across the midpoint leaves no room', () => {
|
||||
const layout = resolveHudRailLayout({
|
||||
viewportHeight: 480,
|
||||
panelHeight: 120,
|
||||
laneLeft: 20,
|
||||
laneRight: 340,
|
||||
baseTop: 100,
|
||||
baseBottom: 400,
|
||||
gap: 10,
|
||||
obstacles: [{ left: 0, right: 400, top: 80, bottom: 420 }],
|
||||
});
|
||||
assert.equal(layout.safeTop, 100);
|
||||
assert.equal(layout.safeBottom, 400);
|
||||
});
|
||||
|
||||
test('HUD rail layout reads several obstacles across the midpoint the same in any order', () => {
|
||||
const a = { left: 0, right: 400, top: 100, bottom: 260 };
|
||||
const b = { left: 0, right: 400, top: 200, bottom: 470 };
|
||||
const layoutWith = (obstacles) =>
|
||||
resolveHudRailLayout({
|
||||
viewportHeight: 480,
|
||||
panelHeight: 120,
|
||||
laneLeft: 20,
|
||||
laneRight: 340,
|
||||
baseTop: 40,
|
||||
baseBottom: 460,
|
||||
gap: 10,
|
||||
obstacles,
|
||||
});
|
||||
// Together they cover 100 to 470: the only room is above, 40 to 90.
|
||||
for (const layout of [layoutWith([a, b]), layoutWith([b, a])]) {
|
||||
assert.equal(layout.safeTop, 40);
|
||||
assert.equal(layout.safeBottom, 90);
|
||||
assert.equal(layout.maxHeight, 50);
|
||||
}
|
||||
});
|
||||
|
||||
test('HUD rail layout counts obstacles beside those across the midpoint', () => {
|
||||
const band = (obstacles) => {
|
||||
const layout = resolveHudRailLayout({
|
||||
viewportHeight: 480,
|
||||
panelHeight: 120,
|
||||
laneLeft: 20,
|
||||
laneRight: 340,
|
||||
baseTop: 40,
|
||||
baseBottom: 460,
|
||||
gap: 10,
|
||||
obstacles: obstacles.map(([top, bottom]) => ({
|
||||
left: 0,
|
||||
right: 400,
|
||||
top,
|
||||
bottom,
|
||||
})),
|
||||
});
|
||||
return [layout.safeTop, layout.safeBottom];
|
||||
};
|
||||
// One inside the span below the midpoint: 150px below the span, 50 above.
|
||||
assert.deepEqual(band([[100, 300], [250, 280]]), [310, 460]);
|
||||
// One touching the midpoint from below: 190px below, 100 above.
|
||||
assert.deepEqual(band([[150, 260], [240, 250]]), [270, 460]);
|
||||
// One inside the span above the midpoint: 150px above, 50 below.
|
||||
assert.deepEqual(band([[200, 400], [210, 230]]), [40, 190]);
|
||||
// A lower obstacle past the span limits the room below it: 100px between
|
||||
// them against 70 above, and with a taller one only 60, so above.
|
||||
assert.deepEqual(band([[120, 260], [380, 420]]), [270, 370]);
|
||||
assert.deepEqual(band([[120, 260], [340, 420]]), [40, 110]);
|
||||
// Neighbours exactly two gaps away leave no room between: one block, 100
|
||||
// to 400, and a tie (50px a side) goes above.
|
||||
assert.deepEqual(band([[100, 180], [200, 300], [320, 400]]), [40, 90]);
|
||||
// A neighbour exactly two gaps below joins it too: 150 to 300, 100px
|
||||
// above against 150 below.
|
||||
assert.deepEqual(band([[150, 250], [270, 300]]), [310, 460]);
|
||||
// A side under 8% of the window (38.4px) is no room: 30px above, none
|
||||
// below, so the band stays as it is.
|
||||
assert.deepEqual(band([[80, 455]]), [40, 460]);
|
||||
// Exactly the minimum is enough.
|
||||
const exact = bandBesideMidpointObstacles({
|
||||
midpoint: 240,
|
||||
top: 40,
|
||||
bottom: 460,
|
||||
obstacles: [{ top: 90, bottom: 465 }],
|
||||
gap: 10,
|
||||
minimum: 40,
|
||||
});
|
||||
assert.deepEqual([exact?.top, exact?.bottom], [40, 80]);
|
||||
});
|
||||
|
||||
test('HUD rail layout keeps a band beside a midpoint obstacle inside its own edges', () => {
|
||||
const layout = resolveHudRailLayout({
|
||||
viewportHeight: 480,
|
||||
panelHeight: 80,
|
||||
laneLeft: 20,
|
||||
laneRight: 340,
|
||||
baseTop: 350,
|
||||
baseBottom: 460,
|
||||
gap: 10,
|
||||
obstacles: [{ left: 0, right: 400, top: 100, bottom: 260 }],
|
||||
});
|
||||
assert.equal(layout.safeTop, 350);
|
||||
assert.equal(layout.safeBottom, 460);
|
||||
});
|
||||
|
||||
test('HUD rail layout can anchor controls to the start of the safe corridor', () => {
|
||||
const layout = resolveHudRailLayout({
|
||||
viewportHeight: 1000,
|
||||
|
||||
@@ -17,11 +17,6 @@
|
||||
* @param {number} [input.signalGap] Clearance above the briefing card.
|
||||
* @param {number} [input.minTopFloor] Absolute ceiling for the strip, in px.
|
||||
* @param {number} [input.minTopRatio] Viewport-relative ceiling, 0..1.
|
||||
* @param {boolean} [input.signalCollapsed] Whether the briefing card is collapsed.
|
||||
* @param {boolean} [input.utilityExpanded] Whether Display or Radio is expanded.
|
||||
* @param {number} [input.bottomInset] Reserved viewport space below an expanded panel.
|
||||
* @param {number} [input.signalHeight] Collapsed briefing header reserved below the utility.
|
||||
* @param {boolean} [input.reserveViewportLane] Theme relocates the briefing below the expanded utility.
|
||||
* @returns {{ top: number, maxHeight: number }}
|
||||
*/
|
||||
export function resolveCockpitUtilityAnchor({
|
||||
@@ -34,29 +29,13 @@ export function resolveCockpitUtilityAnchor({
|
||||
signalGap = 8,
|
||||
minTopFloor = 96,
|
||||
minTopRatio = 0.12,
|
||||
signalCollapsed = false,
|
||||
utilityExpanded = false,
|
||||
bottomInset = 80,
|
||||
signalHeight = 0,
|
||||
reserveViewportLane = false,
|
||||
}) {
|
||||
const viewport = Math.max(0, Number(viewportHeight) || 0);
|
||||
const minTop = Math.max(minTopFloor, viewport * minTopRatio);
|
||||
const anchoredTop = Math.max(minTop, (Number(recBottom) || 0) + recGap);
|
||||
const strip = Math.max(0, Number(stripHeight) || 0);
|
||||
const signal = Number(signalTop);
|
||||
const expandedLaneBottom = Math.max(
|
||||
0,
|
||||
viewport -
|
||||
Math.max(0, Number(bottomInset) || 0) -
|
||||
Math.max(0, Number(signalHeight) || 0),
|
||||
);
|
||||
const lowerBound =
|
||||
reserveViewportLane && signalCollapsed && utilityExpanded
|
||||
? expandedLaneBottom
|
||||
: Number.isFinite(signal)
|
||||
? signal
|
||||
: viewport;
|
||||
const lowerBound = Number.isFinite(signal) ? signal : viewport;
|
||||
const clearedTop = lowerBound - signalGap - strip;
|
||||
const top = Math.max(minTop, Math.min(anchoredTop, clearedTop));
|
||||
const floor = Math.max(0, Number(collapsedHeight) || 0) || 50;
|
||||
@@ -100,25 +79,3 @@ export function resolveCockpitUtilityLayout({
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/** Shared Cyber panel slot, with footer controls above the lower frame (83vh). */
|
||||
export function resolveCyberCockpitPanelLane({
|
||||
viewportHeight,
|
||||
top,
|
||||
launcherHeight = 60,
|
||||
signalHeight = 44,
|
||||
contactHeight = 64,
|
||||
}) {
|
||||
const gap = 8;
|
||||
const footerHeight = Math.max(
|
||||
contactHeight + gap,
|
||||
launcherHeight + signalHeight + gap * 2,
|
||||
);
|
||||
const bottom = viewportHeight * 0.82;
|
||||
const panelHeight = Math.max(120, bottom - top - footerHeight);
|
||||
return {
|
||||
panelHeight,
|
||||
utilityHeight: panelHeight + gap + launcherHeight,
|
||||
signalTop: top + panelHeight + launcherHeight + gap * 2,
|
||||
};
|
||||
}
|
||||
@@ -4,58 +4,11 @@ import assert from 'node:assert/strict';
|
||||
import {
|
||||
resolveCockpitUtilityAnchor,
|
||||
resolveCockpitUtilityLayout,
|
||||
resolveCyberCockpitPanelLane,
|
||||
} from './cockpitUtilityLayout.js';
|
||||
|
||||
// 1512x790, the height the strip used to collide with the briefing card at.
|
||||
const desktop = { viewportHeight: 790, stripHeight: 107, collapsedHeight: 50 };
|
||||
|
||||
test('Cyber shared panel slot reserves both footer lanes above the decorative frame', () => {
|
||||
for (const viewportHeight of [600, 673, 713, 986, 1376]) {
|
||||
for (const signalHeight of [44, 76]) {
|
||||
for (const contactHeight of [44, 84, 120]) {
|
||||
const top = Math.max(164, Math.min(204, viewportHeight * 0.19));
|
||||
const lane = resolveCyberCockpitPanelLane({ viewportHeight, top, signalHeight, contactHeight });
|
||||
assert.ok(lane.panelHeight >= 120);
|
||||
assert.ok(top + lane.panelHeight + 8 + contactHeight <= viewportHeight * 0.82 + .01);
|
||||
assert.ok(lane.signalTop + signalHeight <= viewportHeight * 0.82 + .01);
|
||||
assert.equal(lane.signalTop, top + lane.utilityHeight + 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('Cyber keeps the Data Layers top while reserving briefing clearance', () => {
|
||||
for (const viewportHeight of [673, 713, 986, 1376]) {
|
||||
const leftTop = Math.max(164, Math.min(204, viewportHeight * 0.19));
|
||||
const collapsed = resolveCockpitUtilityAnchor({
|
||||
viewportHeight, stripHeight: 128, collapsedHeight: 60, recBottom: 0,
|
||||
signalTop: leftTop + 128 + 28, minTopFloor: leftTop, minTopRatio: 0,
|
||||
});
|
||||
assert.equal(collapsed.top, leftTop);
|
||||
assert.ok(collapsed.maxHeight >= 128);
|
||||
const expanded = resolveCockpitUtilityAnchor({
|
||||
viewportHeight, stripHeight: 700, collapsedHeight: 60, recBottom: 0,
|
||||
signalTop: 255, minTopFloor: leftTop, minTopRatio: 0,
|
||||
signalCollapsed: true, utilityExpanded: true, reserveViewportLane: true, signalHeight: 44,
|
||||
});
|
||||
assert.equal(expanded.top, leftTop);
|
||||
assert.equal(expanded.top + expanded.maxHeight + 8 + 44 + 80, viewportHeight);
|
||||
}
|
||||
});
|
||||
|
||||
test('expanded utilities reserve the visible collapsed briefing header at every desktop height', () => {
|
||||
for (const viewportHeight of [640, 720, 987, 1376]) {
|
||||
for (const signalHeight of [48, 76, 100]) {
|
||||
const { top, maxHeight } = resolveCockpitUtilityAnchor({
|
||||
...desktop, viewportHeight, recBottom: 0, signalTop: 255,
|
||||
signalCollapsed: true, utilityExpanded: true, signalHeight, reserveViewportLane: true,
|
||||
});
|
||||
assert.equal(top + maxHeight + 8, viewportHeight - 80 - signalHeight);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('the strip hangs 12px under the REC readout when the briefing card leaves room', () => {
|
||||
const { top } = resolveCockpitUtilityAnchor({ ...desktop, recBottom: 148.1, signalTop: 420 });
|
||||
assert.equal(Number(top.toFixed(1)), 160.1);
|
||||
@@ -101,34 +54,11 @@ test('a missing REC readout leaves the strip on the viewport ceiling', () => {
|
||||
assert.equal(top, 96);
|
||||
});
|
||||
|
||||
test('an expanded utility claims the vertical lane released by a collapsed briefing', () => {
|
||||
const { top, maxHeight } = resolveCockpitUtilityAnchor({
|
||||
...desktop,
|
||||
recBottom: 148.1,
|
||||
signalTop: 265.4,
|
||||
signalCollapsed: true,
|
||||
utilityExpanded: true,
|
||||
reserveViewportLane: true,
|
||||
});
|
||||
assert.equal(Number(top.toFixed(1)), 160.1);
|
||||
assert.equal(Number(maxHeight.toFixed(1)), 541.9);
|
||||
});
|
||||
|
||||
test('non-relocating themes preserve the visible briefing boundary even when collapsed', () => {
|
||||
test('the visible briefing card bounds the utility strip, collapsed or not', () => {
|
||||
const { top, maxHeight } = resolveCockpitUtilityAnchor({
|
||||
...desktop, recBottom: 148.1, signalTop: 265.4,
|
||||
signalCollapsed: true, utilityExpanded: true,
|
||||
});
|
||||
assert.equal(Number((top + maxHeight).toFixed(1)), 257.4);
|
||||
});
|
||||
|
||||
test('a collapsed briefing still bounds the utility strip until a panel expands', () => {
|
||||
const { maxHeight } = resolveCockpitUtilityAnchor({
|
||||
...desktop,
|
||||
recBottom: 148.1,
|
||||
signalTop: 265.4,
|
||||
signalCollapsed: true,
|
||||
});
|
||||
assert.equal(Number(maxHeight.toFixed(1)), 107);
|
||||
});
|
||||
|
||||
|
||||
+19
-106
@@ -1,5 +1,3 @@
|
||||
import { msg } from './i18n/marker.js';
|
||||
|
||||
const CONTEXT_DEPENDENCIES = Object.freeze({
|
||||
flights: new Set([
|
||||
'military-awareness',
|
||||
@@ -8,15 +6,18 @@ const CONTEXT_DEPENDENCIES = Object.freeze({
|
||||
'ais-live-vessels',
|
||||
'military-installations',
|
||||
]),
|
||||
'space-missions': new Set(['rocket-launches', 'satellites']),
|
||||
});
|
||||
const CONTEXT_COMPANIONS = new Set(['radio']);
|
||||
/** The Space Missions refusal, with the blocked layer's name as {layer}. */
|
||||
export const SPACE_MISSIONS_LAYER_BLOCK_REASON = msg(
|
||||
'Space Missions isolates replay data. Exit the mode to enable {layer}.',
|
||||
);
|
||||
const [BLOCK_REASON_PREFIX, BLOCK_REASON_SUFFIX] =
|
||||
SPACE_MISSIONS_LAYER_BLOCK_REASON.split('{layer}');
|
||||
/**
|
||||
* Layers Context never touches: Space Missions and the Satellites layer it
|
||||
* depends on. Contacts neither switches them off on entry nor restores them
|
||||
* on exit, so they run beside it in either order and keep their own state
|
||||
* (the mission controller owns the Satellites dependency).
|
||||
*/
|
||||
export const CONTEXT_INDEPENDENT_LAYER_IDS = Object.freeze([
|
||||
'rocket-launches',
|
||||
'satellites',
|
||||
]);
|
||||
/** Return whether an origin represents a direct user choice on this route. */
|
||||
export function isExplicitUserIntentOrigin(origin, layerId = null) {
|
||||
return origin === 'user' || origin === 'voice';
|
||||
@@ -27,7 +28,8 @@ export function recordContextRestoreExplicitChange({ restoreState, change }) {
|
||||
if (
|
||||
!restoreState?.enabledLayerIds ||
|
||||
change?.type !== 'visibility' ||
|
||||
!isExplicitUserIntentOrigin(change.origin, change.layerId)
|
||||
!isExplicitUserIntentOrigin(change.origin, change.layerId) ||
|
||||
CONTEXT_INDEPENDENT_LAYER_IDS.includes(change.layerId)
|
||||
)
|
||||
return false;
|
||||
if (!restoreState.explicitLayerStates)
|
||||
@@ -121,10 +123,7 @@ export async function settleUserFacingContextAction({
|
||||
* one into `userAdded` makes exit restoration re-enable the mode layer the
|
||||
* user just turned off.
|
||||
*/
|
||||
export const CONTEXT_ENTRY_LAYER_IDS = Object.freeze([
|
||||
'military-awareness',
|
||||
'rocket-launches',
|
||||
]);
|
||||
export const CONTEXT_ENTRY_LAYER_IDS = Object.freeze(['military-awareness']);
|
||||
|
||||
/**
|
||||
* Leave a Context transaction: publish the settled coordination flag, then
|
||||
@@ -193,7 +192,8 @@ export function shouldExitContextForLayerChange({
|
||||
change?.type !== 'visibility' ||
|
||||
!isExplicitUserIntentOrigin(change.origin, change.layerId) ||
|
||||
change.layerId === 'military-awareness' ||
|
||||
CONTEXT_COMPANIONS.has(change.layerId)
|
||||
CONTEXT_COMPANIONS.has(change.layerId) ||
|
||||
CONTEXT_INDEPENDENT_LAYER_IDS.includes(change.layerId)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -215,6 +215,7 @@ export function contextAllowedLayerIds(contextMode) {
|
||||
return new Set([
|
||||
...(CONTEXT_DEPENDENCIES[contextMode] || ['military-awareness']),
|
||||
...CONTEXT_COMPANIONS,
|
||||
...CONTEXT_INDEPENDENT_LAYER_IDS,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -235,21 +236,6 @@ export function shouldCaptureContextSession(change) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether one explicit mission intent superseded an in-flight Clear All
|
||||
* reservation and therefore needs deferred Context adoption.
|
||||
*/
|
||||
export function shouldDeferContextEntryDuringClear({ change, clearInFlight }) {
|
||||
return Boolean(
|
||||
clearInFlight &&
|
||||
change?.type === 'visibility-requested' &&
|
||||
change.layerId === 'rocket-launches' &&
|
||||
change.enabled === true &&
|
||||
isExplicitUserIntentOrigin(change.origin, change.layerId) &&
|
||||
Number.isInteger(change.intentEpoch),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bookkeep a user-owned layer change against the active Context session so
|
||||
* exit restoration can honor layers the user added mid-session. Two rules
|
||||
@@ -273,7 +259,8 @@ export function recordContextSessionUserChange({
|
||||
if (
|
||||
!snapshot?.userAdded ||
|
||||
change?.type !== 'visibility' ||
|
||||
!isExplicitUserIntentOrigin(change.origin, change.layerId)
|
||||
!isExplicitUserIntentOrigin(change.origin, change.layerId) ||
|
||||
CONTEXT_INDEPENDENT_LAYER_IDS.includes(change.layerId)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -319,83 +306,10 @@ export function contextSnapshotLayerIds(
|
||||
) {
|
||||
const snapshot = new Set(restoringLayerIds || currentEnabledLayerIds || []);
|
||||
for (const layerId of excludeLayerIds || []) snapshot.delete(layerId);
|
||||
for (const layerId of CONTEXT_INDEPENDENT_LAYER_IDS) snapshot.delete(layerId);
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Block layers that would mix unrelated live/current data into Space Missions.
|
||||
* The manager calls this before lifecycle work so a refused layer never starts.
|
||||
* @param {object} input Current mode and requested visibility transition.
|
||||
* @param {string|null} input.contextMode Active Context mode.
|
||||
* @param {object|null} input.change Requested visibility transition.
|
||||
* @param {string|null} [input.layerName] User-facing layer name.
|
||||
* @returns {string|null} Honest user-facing refusal reason, or null when allowed.
|
||||
*/
|
||||
export function contextLayerEnableBlockReason({
|
||||
contextMode,
|
||||
change,
|
||||
layerName = null,
|
||||
}) {
|
||||
if (
|
||||
contextMode !== 'space-missions' ||
|
||||
change?.enabled !== true ||
|
||||
contextAllowedLayerIds('space-missions').has(change.layerId)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
const label = String(layerName || change.layerId || 'that layer');
|
||||
return SPACE_MISSIONS_LAYER_BLOCK_REASON.replace('{layer}', label);
|
||||
}
|
||||
|
||||
/**
|
||||
* The layer name from a Space Missions refusal, so the UI can rebuild the
|
||||
* sentence in its language.
|
||||
* @param {string} reason
|
||||
* @returns {{layer: string}|null} The blocked layer's name, or null when the
|
||||
* reason is not a Space Missions refusal.
|
||||
*/
|
||||
export function parseContextLayerBlockReason(reason) {
|
||||
if (
|
||||
typeof reason !== 'string' ||
|
||||
!reason.startsWith(BLOCK_REASON_PREFIX) ||
|
||||
!reason.endsWith(BLOCK_REASON_SUFFIX) ||
|
||||
reason.length <= BLOCK_REASON_PREFIX.length + BLOCK_REASON_SUFFIX.length
|
||||
)
|
||||
return null;
|
||||
return {
|
||||
layer: reason.slice(
|
||||
BLOCK_REASON_PREFIX.length,
|
||||
reason.length - BLOCK_REASON_SUFFIX.length,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve who owns a cancelled direct Space Missions entry. A newer ON keeps
|
||||
* the entry shell reserved for its replacement transaction; every other
|
||||
* cancellation must roll back the isolated pre-entry session.
|
||||
*
|
||||
* @param {object} input Cancellation and current manager intent state.
|
||||
* @param {object|null} input.change Manager visibility notification.
|
||||
* @returns {'ignore'|'replacement'|'restore'} Cancellation disposition.
|
||||
*/
|
||||
export function spaceMissionEntryCancellationDisposition({ change }) {
|
||||
if (
|
||||
change?.type !== 'visibility-cancelled' ||
|
||||
change.layerId !== 'rocket-launches' ||
|
||||
change.enabled !== true
|
||||
)
|
||||
return 'ignore';
|
||||
if (
|
||||
change.cancellationReason === 'superseded' &&
|
||||
Number.isInteger(change.successorIntentEpoch) &&
|
||||
change.successorIntentEpoch > change.intentEpoch &&
|
||||
change.successorEnabled === true
|
||||
)
|
||||
return 'replacement';
|
||||
return 'restore';
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the pre-entry layer snapshot with layers the user enabled during the
|
||||
* Context session so both survive restoration.
|
||||
@@ -510,7 +424,6 @@ export function subjectEntryAllowed({
|
||||
*/
|
||||
export const CONTEXT_MODE_VOICE_NAMES = Object.freeze({
|
||||
flights: 'contacts',
|
||||
'space-missions': 'space-missions',
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
+63
-111
@@ -5,7 +5,6 @@ import {
|
||||
orbitEntryAllowed,
|
||||
cockpitEntryAllowed,
|
||||
contextAllowedLayerIds,
|
||||
contextLayerEnableBlockReason,
|
||||
contextRestoreLayerIds,
|
||||
isExplicitUserIntentOrigin,
|
||||
mergeContextTransitionErrors,
|
||||
@@ -17,9 +16,7 @@ import {
|
||||
settleContextIntentReplay,
|
||||
settleUserFacingContextAction,
|
||||
shouldCaptureContextSession,
|
||||
shouldDeferContextEntryDuringClear,
|
||||
shouldExitContextForLayerChange,
|
||||
spaceMissionEntryCancellationDisposition,
|
||||
} from './contextModePolicy.js';
|
||||
|
||||
test('Context transition errors preserve primary identity and aggregate failed layers', () => {
|
||||
@@ -119,11 +116,6 @@ test('user-enabled layers are additive and do not exit Context', () => {
|
||||
globalContextEnabled: true,
|
||||
change: userEnable('earthquakes'),
|
||||
}), false);
|
||||
assert.equal(shouldExitContextForLayerChange({
|
||||
contextMode: 'space-missions',
|
||||
globalContextEnabled: false,
|
||||
change: userEnable('traffic'),
|
||||
}), false);
|
||||
assert.equal(shouldExitContextForLayerChange({
|
||||
contextMode: null,
|
||||
globalContextEnabled: true,
|
||||
@@ -133,48 +125,16 @@ test('user-enabled layers are additive and do not exit Context', () => {
|
||||
|
||||
test('programmatic Context dependencies and direct mode setup remain allowed', () => {
|
||||
assert.equal(shouldExitContextForLayerChange({
|
||||
contextMode: 'space-missions',
|
||||
contextMode: 'flights',
|
||||
globalContextEnabled: true,
|
||||
change: { ...userEnable('satellites'), origin: 'programmatic' },
|
||||
change: { ...userEnable('military'), enabled: false, origin: 'programmatic' },
|
||||
}), false);
|
||||
});
|
||||
|
||||
test('Space Missions cancellation retains only a newer authoritative ON entry', () => {
|
||||
const cancelledEntry = {
|
||||
type: 'visibility-cancelled',
|
||||
layerId: 'rocket-launches',
|
||||
enabled: true,
|
||||
intentEpoch: 8,
|
||||
cancellationReason: 'superseded',
|
||||
successorIntentEpoch: 9,
|
||||
successorEnabled: true,
|
||||
successorOrigin: 'programmatic',
|
||||
};
|
||||
assert.equal(spaceMissionEntryCancellationDisposition({
|
||||
change: cancelledEntry,
|
||||
}), 'replacement');
|
||||
assert.equal(spaceMissionEntryCancellationDisposition({
|
||||
change: { ...cancelledEntry, successorEnabled: false },
|
||||
}), 'restore', 'a newer OFF releases the entry shell');
|
||||
assert.equal(spaceMissionEntryCancellationDisposition({
|
||||
change: {
|
||||
...cancelledEntry,
|
||||
cancellationReason: 'caller-abort',
|
||||
successorIntentEpoch: undefined,
|
||||
successorEnabled: undefined,
|
||||
},
|
||||
}), 'restore', 'caller abort at the same epoch restores the isolated session');
|
||||
assert.equal(spaceMissionEntryCancellationDisposition({
|
||||
change: { ...cancelledEntry, enabled: false },
|
||||
currentIntentEpoch: 9,
|
||||
effectivelyEnabled: true,
|
||||
}), 'ignore');
|
||||
});
|
||||
|
||||
test('only explicit user-owned shell enables capture a Context restoration snapshot', () => {
|
||||
const userMissionEnable = {
|
||||
type: 'visibility-requested',
|
||||
layerId: 'rocket-launches',
|
||||
layerId: 'military-awareness',
|
||||
enabled: true,
|
||||
origin: 'user',
|
||||
};
|
||||
@@ -186,40 +146,25 @@ test('only explicit user-owned shell enables capture a Context restoration snaps
|
||||
assert.equal(shouldCaptureContextSession({ ...userMissionEnable, origin: 'context-restore' }), false);
|
||||
assert.equal(shouldCaptureContextSession({ ...userMissionEnable, enabled: false }), false);
|
||||
assert.equal(shouldCaptureContextSession({ ...userMissionEnable, layerId: 'satellites' }), false);
|
||||
assert.equal(
|
||||
shouldCaptureContextSession({ ...userMissionEnable, layerId: 'rocket-launches' }),
|
||||
false,
|
||||
'Space Missions is an ordinary layer, not a Context entry',
|
||||
);
|
||||
});
|
||||
|
||||
test('voice dependency OFF exits Space Missions like the equivalent UI action', () => {
|
||||
test('voice dependency OFF exits Contacts like the equivalent UI action', () => {
|
||||
assert.equal(shouldExitContextForLayerChange({
|
||||
contextMode: 'space-missions',
|
||||
contextMode: 'flights',
|
||||
globalContextEnabled: false,
|
||||
change: { type: 'visibility', layerId: 'satellites', enabled: false, origin: 'voice' },
|
||||
change: { type: 'visibility', layerId: 'flights', enabled: false, origin: 'voice' },
|
||||
}), true);
|
||||
});
|
||||
|
||||
test('only a newer explicit mission request is deferred during Clear All', () => {
|
||||
const change = {
|
||||
type: 'visibility-requested',
|
||||
layerId: 'rocket-launches',
|
||||
enabled: true,
|
||||
origin: 'voice',
|
||||
intentEpoch: 12,
|
||||
};
|
||||
assert.equal(shouldDeferContextEntryDuringClear({ change, clearInFlight: true }), true);
|
||||
assert.equal(shouldDeferContextEntryDuringClear({ change, clearInFlight: false }), false);
|
||||
assert.equal(shouldDeferContextEntryDuringClear({
|
||||
change: { ...change, origin: 'programmatic' },
|
||||
clearInFlight: true,
|
||||
}), false);
|
||||
assert.equal(shouldDeferContextEntryDuringClear({
|
||||
change: { ...change, enabled: false },
|
||||
clearInFlight: true,
|
||||
}), false);
|
||||
});
|
||||
|
||||
test('a rapid re-entry snapshots the settled restore target, not partial manager state', () => {
|
||||
assert.deepEqual(
|
||||
[...contextSnapshotLayerIds(
|
||||
new Set(['rocket-launches', 'earthquakes']),
|
||||
new Set(['cctv', 'earthquakes']),
|
||||
new Set(['flights', 'traffic']),
|
||||
)],
|
||||
['flights', 'traffic'],
|
||||
@@ -230,31 +175,15 @@ test('a rapid re-entry snapshots the settled restore target, not partial manager
|
||||
);
|
||||
assert.deepEqual(
|
||||
[...contextSnapshotLayerIds(
|
||||
new Set(['rocket-launches', 'satellites']),
|
||||
new Set(['military-awareness', 'cctv']),
|
||||
null,
|
||||
['rocket-launches'],
|
||||
['military-awareness'],
|
||||
)],
|
||||
['satellites'],
|
||||
['cctv'],
|
||||
'the synchronous entry intent is not part of the pre-entry snapshot',
|
||||
);
|
||||
});
|
||||
|
||||
test('Space Missions blocks unrelated layer enables before replay data can mix', () => {
|
||||
const change = { layerId: 'flights', enabled: true, origin: 'user' };
|
||||
assert.match(
|
||||
contextLayerEnableBlockReason({ contextMode: 'space-missions', change, layerName: 'Live Flights' }),
|
||||
/Exit the mode to enable Live Flights/,
|
||||
);
|
||||
assert.equal(contextLayerEnableBlockReason({
|
||||
contextMode: 'space-missions',
|
||||
change: { ...change, layerId: 'satellites' },
|
||||
}), null);
|
||||
assert.equal(contextLayerEnableBlockReason({
|
||||
contextMode: 'flights',
|
||||
change,
|
||||
}), null, 'live cockpit keeps additive user layers');
|
||||
});
|
||||
|
||||
test('the Global Context shell and layers selected while Context is off remain allowed', () => {
|
||||
assert.equal(shouldExitContextForLayerChange({
|
||||
contextMode: null,
|
||||
@@ -275,14 +204,38 @@ test('manually disabling a mode dependency exits that Context bundle', () => {
|
||||
change: { ...userEnable('military'), enabled: false },
|
||||
}), true);
|
||||
assert.equal(shouldExitContextForLayerChange({
|
||||
contextMode: 'space-missions',
|
||||
contextMode: 'flights',
|
||||
globalContextEnabled: false,
|
||||
change: { ...userEnable('satellites'), enabled: false },
|
||||
}), true);
|
||||
}), false, 'Satellites is not a Contacts dependency');
|
||||
});
|
||||
|
||||
test('Context never isolates, snapshots, restores or bookkeeps Space Missions and Satellites', () => {
|
||||
for (const layerId of ['rocket-launches', 'satellites']) {
|
||||
assert.equal(contextAllowedLayerIds('flights').has(layerId), true);
|
||||
const snapshot = { userAdded: new Set(), userRemoved: new Set() };
|
||||
for (const enabled of [true, false]) {
|
||||
assert.equal(recordContextSessionUserChange({
|
||||
snapshot,
|
||||
change: { type: 'visibility', origin: 'user', layerId, enabled },
|
||||
effectiveContextMode: 'flights',
|
||||
}), false);
|
||||
const restoreState = { enabledLayerIds: new Set() };
|
||||
assert.equal(recordContextRestoreExplicitChange({
|
||||
restoreState,
|
||||
change: { type: 'visibility', origin: 'user', layerId, enabled },
|
||||
}), false);
|
||||
}
|
||||
assert.equal(snapshot.userAdded.size + snapshot.userRemoved.size, 0);
|
||||
}
|
||||
assert.deepEqual(
|
||||
[...contextSnapshotLayerIds(new Set(['rocket-launches', 'satellites', 'cctv']))],
|
||||
['cctv'],
|
||||
);
|
||||
});
|
||||
|
||||
test('Radio remains an independent companion across Context transitions', () => {
|
||||
for (const contextMode of ['flights', 'space-missions']) {
|
||||
for (const contextMode of ['flights', null]) {
|
||||
for (const enabled of [true, false]) {
|
||||
assert.equal(shouldExitContextForLayerChange({
|
||||
contextMode,
|
||||
@@ -292,21 +245,17 @@ test('Radio remains an independent companion across Context transitions', () =>
|
||||
}
|
||||
assert.equal(contextAllowedLayerIds(contextMode).has('radio'), true);
|
||||
}
|
||||
assert.equal(contextLayerEnableBlockReason({
|
||||
contextMode: 'space-missions',
|
||||
change: { type: 'visibility', origin: 'user', layerId: 'radio', enabled: true },
|
||||
layerName: 'Radio',
|
||||
}), null);
|
||||
});
|
||||
|
||||
test('each Context mode exposes only its shell and dependencies', () => {
|
||||
assert.deepEqual(
|
||||
[...contextAllowedLayerIds(null)],
|
||||
['military-awareness', 'radio'],
|
||||
['military-awareness', 'radio', 'rocket-launches', 'satellites'],
|
||||
);
|
||||
assert.deepEqual(
|
||||
[...contextAllowedLayerIds('space-missions')],
|
||||
['rocket-launches', 'satellites', 'radio'],
|
||||
['military-awareness', 'radio', 'rocket-launches', 'satellites'],
|
||||
'Space Missions is not a Context mode',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -332,7 +281,7 @@ test('Context restoration honors an explicit companion disable', () => {
|
||||
});
|
||||
|
||||
test('the latest explicit Radio state wins across a Context session', () => {
|
||||
for (const effectiveContextMode of [null, 'flights', 'space-missions']) {
|
||||
for (const effectiveContextMode of [null, 'flights']) {
|
||||
for (const origin of ['user', 'voice']) {
|
||||
const snapshot = { userAdded: new Set(), userRemoved: new Set() };
|
||||
const record = (enabled) => recordContextSessionUserChange({
|
||||
@@ -368,7 +317,7 @@ test('only direct UI and voice origins count as explicit Context intent', () =>
|
||||
assert.equal(recordContextSessionUserChange({
|
||||
snapshot,
|
||||
change: { type: 'visibility', origin, layerId: 'radio', enabled: true },
|
||||
effectiveContextMode: 'space-missions',
|
||||
effectiveContextMode: 'flights',
|
||||
}), false);
|
||||
assert.equal(snapshot.userAdded.size, 0);
|
||||
}
|
||||
@@ -526,16 +475,8 @@ test('the teardown guard re-publishes on the way out, so a mid-flight exit is no
|
||||
|
||||
test('the session-starting entry layer is never bookkept as user-added (chip ON→OFF restores exactly)', () => {
|
||||
const snapshot = { enabledLayerIds: new Set(['flights', 'ais-live-vessels']), userAdded: new Set() };
|
||||
// The exact left-panel regression: the rockets enable event lands while the
|
||||
// mode is still being entered (or even null); it must not survive its own exit.
|
||||
for (const effectiveContextMode of ['space-missions', null]) {
|
||||
recordContextSessionUserChange({
|
||||
snapshot,
|
||||
change: { type: 'visibility', layerId: 'rocket-launches', enabled: true, origin: 'user' },
|
||||
effectiveContextMode,
|
||||
});
|
||||
assert.equal(snapshot.userAdded.has('rocket-launches'), false);
|
||||
}
|
||||
// The entry layer's enable event lands while the mode is still being
|
||||
// entered; it must not survive its own exit.
|
||||
recordContextSessionUserChange({
|
||||
snapshot,
|
||||
change: { type: 'visibility', layerId: 'military-awareness', enabled: true, origin: 'user' },
|
||||
@@ -559,10 +500,21 @@ test('mid-session user additions are recorded, removed on disable, and judged ag
|
||||
// A dependency of the mode being ENTERED is not a user addition.
|
||||
recordContextSessionUserChange({
|
||||
snapshot,
|
||||
change: { type: 'visibility', layerId: 'satellites', enabled: true, origin: 'user' },
|
||||
effectiveContextMode: 'space-missions',
|
||||
change: { type: 'visibility', layerId: 'military', enabled: true, origin: 'user' },
|
||||
effectiveContextMode: 'flights',
|
||||
});
|
||||
assert.equal(snapshot.userAdded.has('satellites'), false);
|
||||
assert.equal(snapshot.userAdded.has('military'), false);
|
||||
// Space Missions is not Context's: it is never bookkept.
|
||||
recordContextSessionUserChange({
|
||||
snapshot,
|
||||
change: { type: 'visibility', layerId: 'rocket-launches', enabled: true, origin: 'user' },
|
||||
effectiveContextMode: 'flights',
|
||||
});
|
||||
assert.equal(
|
||||
snapshot.userAdded.has('rocket-launches'),
|
||||
false,
|
||||
'Space Missions is not Context state',
|
||||
);
|
||||
// Disabling a recorded addition removes it before any exit restore reads it.
|
||||
recordContextSessionUserChange({
|
||||
snapshot,
|
||||
|
||||
@@ -13,10 +13,7 @@ const radioControlsSource = readRadioSource(new URL('./ui/radioControls.js', imp
|
||||
// - session bookkeeping ran AFTER the exit early-return, so the compensating
|
||||
// userAdded.delete never ran on the left-panel chip exit and restoration
|
||||
// resurrected the mission layer the user just disabled;
|
||||
// - the effective mode was read AFTER the entering flag was cleared, so the
|
||||
// entry layer's own enable event was judged against a null mode;
|
||||
// - a failed Space Missions START from the chip route cleared siblings with
|
||||
// no rollback;
|
||||
// - a failed direct Contacts START cleared siblings with no rollback;
|
||||
// - the right-rail entry ignored the activation result entirely.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
@@ -33,25 +30,20 @@ test('context handler: session bookkeeping runs before the exit early-return', (
|
||||
assert.ok(record < exit, 'bookkeeping must precede the exit check');
|
||||
});
|
||||
|
||||
test('context handler: effective mode is read before the entering flag is cleared', () => {
|
||||
const effective = handler.indexOf('this._contextModeEntering || this._contextMode');
|
||||
const clear = handler.indexOf('this._contextModeEntering = null');
|
||||
assert.ok(effective > 0, 'effective-mode read present');
|
||||
assert.ok(clear > 0, 'entering-flag clear present');
|
||||
assert.ok(effective < clear, 'effective mode must be captured first');
|
||||
test('Space Missions is an ordinary layer the Context handler never enters', () => {
|
||||
assert.doesNotMatch(handler, /'space-missions'/);
|
||||
assert.doesNotMatch(handler, /_contextModeEntering = /);
|
||||
const attach = connectContextManager.toString();
|
||||
assert.doesNotMatch(attach, /rocket-launches|space-missions/);
|
||||
});
|
||||
|
||||
test('cancelled Space Missions entry resolves ownership before settled bookkeeping', () => {
|
||||
test('a cancelled visibility request returns before settled bookkeeping', () => {
|
||||
const cancelled = handler.indexOf("change?.type === 'visibility-cancelled'");
|
||||
const bookkeeping = handler.indexOf('recordContextSessionUserChange(');
|
||||
assert.ok(cancelled > 0, 'cancellation branch present');
|
||||
assert.ok(cancelled < bookkeeping, 'cancellation returns before settled session bookkeeping');
|
||||
const branch = handler.slice(cancelled, handler.indexOf("change?.type === 'visibility-blocked'"));
|
||||
assert.match(branch, /spaceMissionEntryCancellationDisposition\(\{/);
|
||||
assert.match(branch, /cancellationDisposition === 'replacement'[\s\S]*?_contextModeEntering = 'space-missions'[\s\S]*?entryIntent\.intentEpoch === change\.intentEpoch[\s\S]*?_contextModeReplacementIntent = \{[\s\S]*?intentEpoch: change\.successorIntentEpoch/);
|
||||
assert.match(branch, /cancellationDisposition === 'restore'[\s\S]*?_contextModeEntering = null/);
|
||||
assert.match(branch, /_restoreContextSessionAfterLayerSettles\(/);
|
||||
assert.match(branch, /return;/);
|
||||
assert.match(branch, /this\._syncContextModeButtons\(\);\s*return;/);
|
||||
});
|
||||
|
||||
test('direct Context entry captures on the synchronous request boundary', () => {
|
||||
@@ -60,18 +52,29 @@ test('direct Context entry captures on the synchronous request boundary', () =>
|
||||
attach,
|
||||
/subscribeVisibilityRequests\(\(change\) => \{[\s\S]*?shouldCaptureContextSession\(change\)/,
|
||||
);
|
||||
assert.match(
|
||||
attach,
|
||||
/_captureContextSessionSnapshot\(\{\s*excludeLayerIds:\s*\[change\.layerId\],?\s*\}\)/,
|
||||
);
|
||||
});
|
||||
|
||||
test('Clear All defers a newer explicit mission guard until its batch settles', () => {
|
||||
const attach = connectContextManager.toString();
|
||||
assert.match(attach, /shouldDeferContextEntryDuringClear\(\{/);
|
||||
assert.match(attach, /_contextModeDeferredEntryIntent = \{/);
|
||||
assert.match(attach, /await this\._clearSelectedLayersManagerPromise/);
|
||||
assert.match(attach, /await this\._clearLayersOutsideContextMode\(entryMode/);
|
||||
test('only a direct Contacts entry request snapshots the layers', () => {
|
||||
let request;
|
||||
const controls = new ContextControls({
|
||||
elements: {},
|
||||
installations: {},
|
||||
actions: { getCockpit: () => null },
|
||||
});
|
||||
const captures = [];
|
||||
controls._captureContextSessionSnapshot = (options) => captures.push(options);
|
||||
controls._syncContextModeButtons = () => {};
|
||||
controls.connect({
|
||||
subscribe: () => () => {},
|
||||
subscribeVisibilityRequests(listener) {
|
||||
request = listener;
|
||||
return () => {};
|
||||
},
|
||||
});
|
||||
for (const layerId of ['rocket-launches', 'military-awareness'])
|
||||
request({ type: 'visibility-requested', layerId, enabled: true, origin: 'user', intentEpoch: 1 });
|
||||
controls.stop();
|
||||
assert.deepEqual(captures, [{ excludeLayerIds: ['military-awareness'] }]);
|
||||
});
|
||||
|
||||
test('context restore replays explicit companion intent after the stale restore queue drains', () => {
|
||||
@@ -91,7 +94,7 @@ test('context restore settles the Contacts coordinator before dependency fanout'
|
||||
assert.ok(settle > 0, 'Contacts coordinator settlement is present');
|
||||
assert.ok(coordinatorOff > settle, 'Contacts OFF is awaited');
|
||||
assert.ok(fanout > coordinatorOff, 'snapshot fanout starts after Contacts settles');
|
||||
assert.match(restore, /excludeLayerIds: settleContactsCoordinator[\s\S]*?contactsCoordinatorId/);
|
||||
assert.match(restore, /excludeLayerIds: \[[\s\S]*?CONTEXT_INDEPENDENT_LAYER_IDS[\s\S]*?settleContactsCoordinator \? \[contactsCoordinatorId\]/);
|
||||
});
|
||||
|
||||
test('Clear All during the Contacts settle stops the snapshot coming back', () => {
|
||||
@@ -116,7 +119,7 @@ test('context handler: either failed direct Context-shell start rolls the sessio
|
||||
handler.indexOf("change?.type === 'visibility-failed'"),
|
||||
handler.indexOf("change?.type === 'visibility-will-change'"),
|
||||
);
|
||||
assert.match(failedBranch, /\['military-awareness', 'rocket-launches'\]\.includes\(change\.layerId\)/);
|
||||
assert.match(failedBranch, /change\.layerId === 'military-awareness' &&/);
|
||||
assert.match(
|
||||
failedBranch,
|
||||
/_restoreContextSessionAfterLayerSettles\(\s*change\.layerId,\s*\{\s*notificationToken,?\s*\},?\s*\)/,
|
||||
@@ -154,14 +157,14 @@ test('wrapped visibility blocks leave the accessible toast to the wrapper token
|
||||
|
||||
test('every user-facing Context exit route settles through the failure surface', () => {
|
||||
const initPanel = _initGlobalContextPanel.toString();
|
||||
assert.equal((initPanel.match(/void this\._runUserFacingContextAction/g) || []).length, 3);
|
||||
assert.equal((initPanel.match(/void this\._runUserFacingContextAction/g) || []).length, 2);
|
||||
assert.doesNotMatch(initPanel, /falseIsFailure:\s*false/);
|
||||
assert.doesNotMatch(initPanel, /void this\._selectContextMode/);
|
||||
|
||||
const deactivationCalls = [...handler.matchAll(
|
||||
/void this\._trackContextLayerReaction\(\s*this\._runUserFacingContextAction\(\(notificationToken\) =>\s*this\._deactivateContextForLayerChange\(\{ notificationToken \}\),?\s*\),?\s*\)/g,
|
||||
)];
|
||||
assert.equal(deactivationCalls.length, 4, 'dependency and primary layer exits share the caught restore path');
|
||||
assert.equal(deactivationCalls.length, 3, 'dependency and primary layer exits share the caught restore path');
|
||||
assert.doesNotMatch(handler, /void this\._deactivateContextForLayerChange\(\)/);
|
||||
});
|
||||
|
||||
@@ -193,10 +196,7 @@ test('right-rail context entry is transactional: activation result gates the mod
|
||||
const failureBlock = select.slice(activation);
|
||||
assert.match(failureBlock, /activated = await activationIntent\.promise/);
|
||||
assert.match(failureBlock, /catch \(error\) \{\s*activationError = error;/);
|
||||
assert.match(failureBlock, /_contextModeReplacementIntent\?\.generation === generation/);
|
||||
assert.match(failureBlock, /await this\._dataManager\._waitForVisibilityIntent\?\.\(/);
|
||||
assert.match(failureBlock, /outcome\?\.intentEpoch === replacementIntent\.intentEpoch[\s\S]*?outcome\.succeeded === true/);
|
||||
assert.match(failureBlock, /outcome\?\.cancellationReason === 'superseded'[\s\S]*?outcome\.successorEnabled === true[\s\S]*?outcome\.successorIntentEpoch > replacementIntent\.intentEpoch/);
|
||||
assert.match(failureBlock, /activationError\s*\|\|\s*activated === false\s*\|\|\s*!this\._dataManager\.isEnabled\(entryLayerId\)/);
|
||||
assert.match(failureBlock, /cancelledAndSettled\s*=\s*terminalIntentOutcome\?\.succeeded === false/);
|
||||
assert.match(failureBlock, /\['caller-abort', 'resource-abort', 'superseded'\]/);
|
||||
@@ -216,9 +216,11 @@ test('Context entry awaits isolation and direct shell routes isolate in the visi
|
||||
// rests on Context OFF; the honesty lives in the REPORT, not in a racy
|
||||
// attempt to put the prior mode back (see the note above
|
||||
// _restoreContextSessionAfterLayerSettles).
|
||||
const capture = select.indexOf('this._captureContextSessionSnapshot(');
|
||||
assert.ok(capture > 0, 'Context snapshot capture is missing');
|
||||
const crossMode = select.slice(
|
||||
select.indexOf('const crossModeSwitch = Boolean('),
|
||||
select.indexOf('this._captureContextSessionSnapshot();'),
|
||||
capture,
|
||||
);
|
||||
assert.ok(crossMode, 'cross-mode teardown block is missing');
|
||||
assert.doesNotMatch(crossMode, /if \(signal\?\.aborted\)[\s\S]*?await this\._restoreContextSession/);
|
||||
@@ -242,10 +244,10 @@ test('Context entry awaits isolation and direct shell routes isolate in the visi
|
||||
assert.match(ContextControls.prototype.stop.toString(), /this\._contextModeGeneration\+\+/);
|
||||
|
||||
const guard = connectContextManager.toString();
|
||||
assert.match(guard, /\['military-awareness', 'rocket-launches'\]\.includes\(change\.layerId\)/);
|
||||
assert.match(guard, /change\.layerId !== 'military-awareness'/);
|
||||
assert.match(guard, /const notificationToken\s*=\s*change\.notificationToken\s*\|\|\s*Symbol\('direct-context-shell-entry'\)/);
|
||||
assert.match(guard, /this\._userFacingContextNotificationTokens\.add\(notificationToken\)/);
|
||||
assert.match(guard, /await this\._clearLayersOutsideContextMode\(entryMode,\s*\{\s*notificationToken,?\s*\}\)/);
|
||||
assert.match(guard, /await this\._clearLayersOutsideContextMode\(null,\s*\{\s*notificationToken,?\s*\}\)/);
|
||||
assert.match(
|
||||
guard,
|
||||
/await this\._restoreContextSession\(\{\s*excludeLayerIds: \[change\.layerId\],\s*notificationToken,\s*\}\)/,
|
||||
|
||||
@@ -2,7 +2,9 @@ import { renderApplicationHtml } from './testSupport/applicationHtml.mjs';
|
||||
import { readStylesheet } from './testSupport/readStylesheet.mjs';
|
||||
import { _selectContextMode } from './ui/contextTransactions.js';
|
||||
import { _initGlobalContextPanel } from './ui/contextBindings.js';
|
||||
import { ContextControls } from './ui/contextControls.js';
|
||||
import { clearSelectedLayers } from './ui/contextActions.js';
|
||||
import { PANEL_RAIL_ITEMS } from './ui/panelRailCatalog.js';
|
||||
import { readFileSync as readRadioSource } from 'node:fs';
|
||||
const radioBindings = readRadioSource(
|
||||
new URL('./ui/radioBindings.js', import.meta.url),
|
||||
@@ -21,43 +23,24 @@ const html = await renderApplicationHtml(
|
||||
);
|
||||
const css = readStylesheet(new URL('../style.css', import.meta.url));
|
||||
|
||||
test('Contacts and Space Missions both participate in the ordinary Tab sequence', () => {
|
||||
for (const id of [
|
||||
'global-context-flights-btn',
|
||||
'global-context-missions-btn',
|
||||
]) {
|
||||
const button = html.match(
|
||||
new RegExp(`<button id="${id}"[\\s\\S]*?</button>`),
|
||||
);
|
||||
assert.ok(button, `${id} is missing`);
|
||||
assert.match(button[0], /role="tab"/);
|
||||
assert.match(button[0], /tabindex="0"/);
|
||||
}
|
||||
|
||||
// The view keeps both tabs' tabindex static and never disables them; the
|
||||
// transition itself is covered over happy-dom in ui/contextPanel.test.mjs.
|
||||
for (const id of [
|
||||
'global-context-flights-btn',
|
||||
'global-context-missions-btn',
|
||||
]) {
|
||||
const tag = contextView.match(new RegExp(`<button id="${id}"[^>]*>`))?.[0];
|
||||
assert.ok(tag, `${id} is missing from the view`);
|
||||
assert.doesNotMatch(tag, /:tabindex|:disabled|\sdisabled/);
|
||||
}
|
||||
test('Contacts stays in the keyboard sequence and Space Missions owns its rail item', () => {
|
||||
const button = html.match(
|
||||
/<button id="global-context-flights-btn"[\s\S]*?<\/button>/,
|
||||
)?.[0];
|
||||
assert.ok(button, 'Contacts control is missing');
|
||||
assert.match(button, /role="tab"/);
|
||||
assert.match(button, /tabindex="0"/);
|
||||
const tag = contextView.match(/<button id="global-context-flights-btn"[^>]*>/)?.[0];
|
||||
assert.ok(tag, 'Contacts control is missing from the view');
|
||||
assert.doesNotMatch(tag, /:tabindex|:disabled|\sdisabled/);
|
||||
assert.doesNotMatch(html, /id="global-context-missions-btn"/);
|
||||
assert.match(html, /id="space-missions-panel"[^>]*data-panel-id="space-missions-panel"/);
|
||||
assert.equal(PANEL_RAIL_ITEMS['space-missions-panel'].icon, 'rocket_launch');
|
||||
});
|
||||
|
||||
test('Context activation and Clear All never native-disable tabs and guard repeated clicks', () => {
|
||||
const init = _initGlobalContextPanel.toString();
|
||||
const select = _selectContextMode.toString();
|
||||
const clear = clearSelectedLayers.toString();
|
||||
assert.equal(
|
||||
(
|
||||
init.match(
|
||||
/if \(\s*this\.destroyed\s*\|\|\s*this\._contextModeChanging\s*\|\|\s*this\._clearSelectedLayersPromise\s*\)\s*return;/g,
|
||||
) || []
|
||||
).length,
|
||||
2,
|
||||
);
|
||||
assert.doesNotMatch(
|
||||
select,
|
||||
/_globalContext(?:Flights|Missions)Btn\.disabled\s*=\s*true/,
|
||||
@@ -68,17 +51,29 @@ test('Context activation and Clear All never native-disable tabs and guard repea
|
||||
);
|
||||
});
|
||||
|
||||
test('Context tablist retains Left, Right, Home, and End keyboard navigation', () => {
|
||||
const initSource = _initGlobalContextPanel.toString();
|
||||
assert.match(initSource, /event\.key === 'ArrowRight'/);
|
||||
assert.match(initSource, /event\.key === 'ArrowLeft'/);
|
||||
assert.match(initSource, /event\.key === 'Home'/);
|
||||
assert.match(initSource, /event\.key === 'End'/);
|
||||
assert.match(
|
||||
initSource,
|
||||
/contextTabs\[nextIndex\]\.focus\(\{ preventScroll: true \}\)/,
|
||||
);
|
||||
assert.match(initSource, /contextTabs\[nextIndex\]\.click\(\)/);
|
||||
test('a Contacts click while Context is busy is ignored', () => {
|
||||
const button = new EventTarget();
|
||||
const controls = new ContextControls({
|
||||
elements: { _globalContextFlightsBtn: button },
|
||||
installations: {},
|
||||
actions: { getCockpit: () => null, claimVisualAuthority() {} },
|
||||
});
|
||||
const runs = [];
|
||||
controls._runUserFacingContextAction = (operation) => {
|
||||
runs.push(operation);
|
||||
return Promise.resolve(false);
|
||||
};
|
||||
const click = () => button.dispatchEvent(new Event('click'));
|
||||
controls._contextModeChanging = true;
|
||||
click();
|
||||
controls._contextModeChanging = false;
|
||||
controls._clearSelectedLayersPromise = Promise.resolve();
|
||||
click();
|
||||
assert.equal(runs.length, 0, 'a transition or Clear All in flight drops it');
|
||||
controls._clearSelectedLayersPromise = null;
|
||||
click();
|
||||
assert.equal(runs.length, 1, 'an idle panel takes the click');
|
||||
controls.stop();
|
||||
});
|
||||
|
||||
test('Context tabs draw a visible keyboard-focus outline including active tabs', () => {
|
||||
@@ -102,7 +97,6 @@ test('Context tabs draw a visible keyboard-focus outline including active tabs',
|
||||
});
|
||||
|
||||
test('Context async action buttons remain focused while busy', () => {
|
||||
const init = _initGlobalContextPanel.toString();
|
||||
const radio = radioBindings.slice(
|
||||
radioBindings.indexOf('const toggleRadio = async (trigger) => {'),
|
||||
radioBindings.indexOf('this._storeToken = this.store?.connect?.('),
|
||||
@@ -113,6 +107,7 @@ test('Context async action buttons remain focused while busy', () => {
|
||||
);
|
||||
const clear = clearSelectedLayers.toString();
|
||||
|
||||
const init = _initGlobalContextPanel.toString();
|
||||
assert.match(init, /if \(this\._installationsSearchBusy\) return;/);
|
||||
assert.doesNotMatch(init, /\.disabled\s*=\s*true/);
|
||||
const search = contextView.match(
|
||||
@@ -220,7 +215,7 @@ test('Context reads as one segmented control with legible type and no halo', ()
|
||||
// open Context title legible; no Context-only rule dims it again.
|
||||
assert.equal(
|
||||
rule(
|
||||
":root:not([data-ui-theme='cyber']) #global-context-panel:not(.collapsed) .panel-title",
|
||||
":root #global-context-panel:not(.collapsed) .panel-title",
|
||||
),
|
||||
'',
|
||||
);
|
||||
|
||||
+288
-38
@@ -6,6 +6,12 @@ import test from 'node:test';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
// The Omnibar's desktop footer (src/ui/styles/omnibar-dock.css) is part of
|
||||
// the cascade below like every other stylesheet; its rules carry the
|
||||
// Omnibar scope, so they are modelled as a layout of their own.
|
||||
const omnibarCss = readStylesheet(
|
||||
path.join(ROOT, 'src/ui/styles/omnibar-dock.css'),
|
||||
);
|
||||
const css = readStylesheet(path.join(ROOT, 'style.css'));
|
||||
|
||||
/*
|
||||
@@ -125,11 +131,56 @@ function specificity(selector) {
|
||||
return [ids, classes, types];
|
||||
}
|
||||
|
||||
/** Flatten style.css into rules carrying their raw media stack. */
|
||||
/** Collapse whitespace and the padding inside brackets of a selector. */
|
||||
const tidySelector = (part) =>
|
||||
part
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim()
|
||||
.replace(/\(\s+/g, '(')
|
||||
.replace(/\s+\)/g, ')');
|
||||
|
||||
/**
|
||||
* A nested selector resolved against its parent rule's selectors, as CSS
|
||||
* nesting does: `&` stands for the parent, and a selector without one is a
|
||||
* descendant of it.
|
||||
*/
|
||||
function nestSelectors(parents, head) {
|
||||
const own = splitTopLevel(head, ',').map(tidySelector).filter(Boolean);
|
||||
if (!parents) return own;
|
||||
return parents.flatMap((parent) =>
|
||||
own.map((part) =>
|
||||
part.includes('&') ? part.replaceAll('&', parent) : `${parent} ${part}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flatten style.css into rules carrying their raw media stack. Nested style
|
||||
* rules (CSS nesting) and media queries nested in a rule are resolved to
|
||||
* full selectors, so a nested rule is modelled like any other.
|
||||
*/
|
||||
function flattenRules(source) {
|
||||
const src = source.replace(/\/\*[\s\S]*?\*\//g, '');
|
||||
const rules = [];
|
||||
const mediaStack = [];
|
||||
// Open blocks, innermost last: media queries and style rules.
|
||||
const stack = [];
|
||||
const mediaStack = () =>
|
||||
stack.filter((frame) => frame.media).map((frame) => frame.media);
|
||||
const parentRule = () =>
|
||||
[...stack].reverse().find((frame) => frame.rule)?.rule || null;
|
||||
const declare = (text) => {
|
||||
const rule = parentRule();
|
||||
const trimmed = text.trim();
|
||||
if (!rule || !trimmed) return;
|
||||
const colon = trimmed.indexOf(':');
|
||||
if (colon < 0) return;
|
||||
const value = trimmed.slice(colon + 1).trim();
|
||||
rule.decls.push({
|
||||
prop: trimmed.slice(0, colon).trim().toLowerCase(),
|
||||
value: value.replace(/\s*!important$/i, '').trim(),
|
||||
important: /!important\s*$/i.test(value),
|
||||
});
|
||||
};
|
||||
let index = 0;
|
||||
let prelude = '';
|
||||
while (index < src.length) {
|
||||
@@ -137,14 +188,13 @@ function flattenRules(source) {
|
||||
if (char === '{') {
|
||||
const head = prelude.replace(/\s+/g, ' ').trim();
|
||||
prelude = '';
|
||||
index += 1;
|
||||
if (head.startsWith('@media')) {
|
||||
mediaStack.push(head.slice('@media'.length).trim());
|
||||
index += 1;
|
||||
stack.push({ media: head.slice('@media'.length).trim() });
|
||||
continue;
|
||||
}
|
||||
if (head.startsWith('@')) {
|
||||
let level = 1;
|
||||
index += 1;
|
||||
while (index < src.length && level > 0) {
|
||||
if (src[index] === '{') level += 1;
|
||||
else if (src[index] === '}') level -= 1;
|
||||
@@ -152,43 +202,34 @@ function flattenRules(source) {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
const close = src.indexOf('}', index);
|
||||
assert.ok(close > index, `unterminated rule block for "${head}"`);
|
||||
const decls = [];
|
||||
for (const raw of src.slice(index + 1, close).split(';')) {
|
||||
const text = raw.trim();
|
||||
if (!text) continue;
|
||||
const colon = text.indexOf(':');
|
||||
if (colon < 0) continue;
|
||||
const value = text.slice(colon + 1).trim();
|
||||
decls.push({
|
||||
prop: text.slice(0, colon).trim().toLowerCase(),
|
||||
value: value.replace(/\s*!important$/i, '').trim(),
|
||||
important: /!important\s*$/i.test(value),
|
||||
});
|
||||
}
|
||||
rules.push({
|
||||
const rule = {
|
||||
order: rules.length,
|
||||
media: [...mediaStack],
|
||||
parts: splitTopLevel(head, ',')
|
||||
.map((part) =>
|
||||
part.trim().replace(/\(\s+/g, '(').replace(/\s+\)/g, ')'),
|
||||
)
|
||||
.filter(Boolean),
|
||||
decls,
|
||||
});
|
||||
index = close + 1;
|
||||
media: mediaStack(),
|
||||
parts: nestSelectors(parentRule()?.parts, head),
|
||||
decls: [],
|
||||
};
|
||||
rules.push(rule);
|
||||
stack.push({ rule });
|
||||
continue;
|
||||
}
|
||||
if (char === ';') {
|
||||
declare(prelude);
|
||||
prelude = '';
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
if (char === '}') {
|
||||
mediaStack.pop();
|
||||
// The last declaration of a block may omit its semicolon.
|
||||
declare(prelude);
|
||||
prelude = '';
|
||||
stack.pop();
|
||||
index += 1;
|
||||
continue;
|
||||
}
|
||||
prelude += char;
|
||||
index += 1;
|
||||
}
|
||||
assert.equal(stack.length, 0, 'unbalanced braces in style.css');
|
||||
return rules;
|
||||
}
|
||||
|
||||
@@ -227,6 +268,29 @@ const RECOGNIZED = new Set([
|
||||
]);
|
||||
|
||||
const DOCKED_RAIL = 'body.context-docked #right-context-rail';
|
||||
|
||||
// The desktop Omnibar layout: the scope its stylesheet nests every rule in.
|
||||
// It applies on the desktop shell (above the 720px phone breakpoint) while
|
||||
// the Omnibar and the voice control share the dock; outside it the legacy
|
||||
// layout below governs.
|
||||
const OMNIBAR_SCOPE =
|
||||
'body:not(.mobile-shell):not(.cockpit-mode):not(.scene-playback-mode):not(.ui-clean-view):not(.recording-mode):where(:has(#gev-omnibar):has(#command-dock > #gev-voice-control))';
|
||||
const OMNIBAR = Object.freeze({
|
||||
dock: `${OMNIBAR_SCOPE} #command-dock`,
|
||||
credit: `${OMNIBAR_SCOPE} :is(#cesium-credits, #gev-credits)`,
|
||||
minimalCredit: `${OMNIBAR_SCOPE}:has(#intel-hud[data-variant='minimal'].active) :is(#cesium-credits, #gev-credits)`,
|
||||
minimalRail: `${OMNIBAR_SCOPE}:not(.context-docked):has(#intel-hud[data-variant='minimal'].active) #right-context-rail`,
|
||||
trays: `${OMNIBAR_SCOPE} #command-dock > :is(#location-bar, #control-panel)`,
|
||||
});
|
||||
// What each Omnibar-scope rule may set on a modelled box; the Omnibar
|
||||
// clearance test resolves every one of them through the full cascade.
|
||||
const OMNIBAR_RECOGNIZED = new Map([
|
||||
[OMNIBAR.dock, new Set(['top', 'bottom', 'height', 'min-height'])],
|
||||
[OMNIBAR.credit, new Set(['bottom'])],
|
||||
[OMNIBAR.minimalCredit, new Set(['bottom'])],
|
||||
[OMNIBAR.minimalRail, new Set(['max-height'])],
|
||||
]);
|
||||
const OMNIBAR_MIN_WIDTH = 721;
|
||||
const ELEMENT_KEYS = [
|
||||
'#cesium-credits',
|
||||
'#command-dock',
|
||||
@@ -300,8 +364,11 @@ function ownBoxEntries() {
|
||||
// So is Stories, with GEV's chrome stepped aside; storiesCredit.test.mjs
|
||||
// pins its attribution placement.
|
||||
if (
|
||||
/^body\.stories-mode:not\(#gs-a\):not\(#gs-b\) #(cesium|gev)-credits$/.test(part)
|
||||
) continue;
|
||||
/^body\.stories-mode:not\(#gs-a\):not\(#gs-b\) #(cesium|gev)-credits$/.test(
|
||||
part,
|
||||
)
|
||||
)
|
||||
continue;
|
||||
entries.push({ rule, part });
|
||||
}
|
||||
}
|
||||
@@ -372,12 +439,21 @@ function resolve(candidates, prop, width, label) {
|
||||
/** Evaluate a length. Anything the model cannot resolve exactly fails loudly. */
|
||||
function toPx(value, viewportHeight, where) {
|
||||
const trimmed = value.trim();
|
||||
// The larger of its lengths, each resolved the same way.
|
||||
if (/^max\(.*\)$/.test(trimmed))
|
||||
return Math.max(
|
||||
...splitTopLevel(trimmed.slice(4, -1), ',').map((part) =>
|
||||
toPx(part, viewportHeight, where),
|
||||
),
|
||||
);
|
||||
const inner = /^calc\(/.test(trimmed) ? trimmed.slice(5, -1) : trimmed;
|
||||
assert.doesNotMatch(
|
||||
inner,
|
||||
/\bcalc\(/,
|
||||
`nested calc() in ${where}: "${value}"`,
|
||||
);
|
||||
// A calc() is a whole term of its own, resolved below; nowhere else.
|
||||
for (const term of splitTopLevel(inner, '+'))
|
||||
assert.doesNotMatch(
|
||||
term.trim().replace(/^calc\(.*\)$/, ''),
|
||||
/\bcalc\(/,
|
||||
`nested calc() in ${where}: "${value}"`,
|
||||
);
|
||||
assert.doesNotMatch(
|
||||
inner,
|
||||
/\b(min|max|clamp|env|attr|round|mod)\(/,
|
||||
@@ -398,6 +474,18 @@ function toPx(value, viewportHeight, where) {
|
||||
const term = raw.trim();
|
||||
if (!term) continue;
|
||||
if (term === '100%') continue; // the tray's own panel height, added separately
|
||||
// A calc() of its own, as a term ("calc(var(--omnibar-credits-clear) +
|
||||
// 2px)" once substituted).
|
||||
if (/^calc\(.*\)$/.test(term)) {
|
||||
total += toPx(term, viewportHeight, where);
|
||||
continue;
|
||||
}
|
||||
// The credit line's own height (src/ui/creditLineHeight.js), at the
|
||||
// height this pin models it at.
|
||||
if (/^var\(--credit-line-height\b/.test(term)) {
|
||||
total += CREDIT_HEIGHT_PX;
|
||||
continue;
|
||||
}
|
||||
if (term.startsWith('var(')) {
|
||||
const name = term.slice(4, term.lastIndexOf(')')).split(',')[0].trim();
|
||||
assert.ok(
|
||||
@@ -521,6 +609,22 @@ test('the model refuses every cascade construct it cannot resolve', () => {
|
||||
// Expanded Context covers the right edge top to bottom; the credit row
|
||||
// stops short of it instead (the docked-Context test below).
|
||||
if (part === DOCKED_RAIL) continue;
|
||||
if (part.startsWith(OMNIBAR_SCOPE)) {
|
||||
const allowed = OMNIBAR_RECOGNIZED.get(part);
|
||||
for (const decl of guarded) {
|
||||
if (!allowed?.has(decl.prop))
|
||||
complaints.push(
|
||||
`unrecognized Omnibar rule positions a modelled element: "${part}" (${decl.prop})`,
|
||||
);
|
||||
if (decl.important)
|
||||
complaints.push(`!important on ${decl.prop} of "${part}"`);
|
||||
}
|
||||
if (rule.media.length)
|
||||
complaints.push(
|
||||
`media query on Omnibar rule "${part}": ${rule.media.join(' && ')}`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
if (!RECOGNIZED.has(part)) {
|
||||
complaints.push(
|
||||
`unrecognized selector positions a modelled element: "${part}" (${guarded.map((d) => d.prop).join(', ')})`,
|
||||
@@ -771,6 +875,152 @@ test('right rail measurement cannot persist into a painted attribution layout',
|
||||
|
||||
// ── Clearance ───────────────────────────────────────────────────────────────
|
||||
|
||||
/** A custom property's value as the Omnibar scope declares it. */
|
||||
function omnibarVar(name) {
|
||||
const decls = RULES.filter((rule) => rule.parts.includes(OMNIBAR_SCOPE))
|
||||
.flatMap((rule) => rule.decls)
|
||||
.filter((decl) => decl.prop === name);
|
||||
assert.equal(
|
||||
decls.length,
|
||||
1,
|
||||
`${name} is declared once in the Omnibar scope`,
|
||||
);
|
||||
return decls[0].value;
|
||||
}
|
||||
|
||||
/** A length in the Omnibar layout, with its scope's own custom properties. */
|
||||
function omnibarPx(value, viewportHeight, where) {
|
||||
// The scope's properties may name each other ("--omnibar-dock-bottom"
|
||||
// clears "--omnibar-credits-clear"): substitute until none is left.
|
||||
let substituted = value;
|
||||
for (let pass = 0; /var\(--omnibar-/.test(substituted); pass += 1) {
|
||||
assert.ok(
|
||||
pass < 8,
|
||||
`Omnibar properties name each other in a loop: ${value}`,
|
||||
);
|
||||
substituted = substituted.replace(/var\((--omnibar-[\w-]+)\)/g, (_, name) =>
|
||||
omnibarVar(name),
|
||||
);
|
||||
}
|
||||
return toPx(substituted, viewportHeight, where);
|
||||
}
|
||||
|
||||
test('Omnibar reserves a non-overlapping desktop footer at native credit sizing', () => {
|
||||
// The Omnibar layout resolves through the same cascade as the legacy one:
|
||||
// every legacy rule that could still match competes with the scope's.
|
||||
const trayOpen = [
|
||||
'#command-dock:has(#location-bar:not(.collapsed))',
|
||||
'#command-dock:has(#control-panel:not(.collapsed))',
|
||||
];
|
||||
assert.equal(
|
||||
omnibarVar('--world-timeline-lift'),
|
||||
'0px',
|
||||
'the Omnibar layout holds the timeline lift at 0',
|
||||
);
|
||||
for (const width of WIDTHS.filter((w) => w >= OMNIBAR_MIN_WIDTH)) {
|
||||
for (const height of HEIGHTS) {
|
||||
for (const minimal of [false, true]) {
|
||||
const dock = resolve(
|
||||
['#command-dock', ...trayOpen, OMNIBAR.dock],
|
||||
'bottom',
|
||||
width,
|
||||
'Omnibar dock',
|
||||
);
|
||||
assert.equal(
|
||||
dock.part,
|
||||
OMNIBAR.dock,
|
||||
`the Omnibar owns the dock at ${width}px`,
|
||||
);
|
||||
// Its top and height too: a legacy top or height winning here would
|
||||
// move or stretch the dock the clearance below is measured from.
|
||||
for (const [prop, value] of [
|
||||
['top', 'auto'],
|
||||
['height', '56px'],
|
||||
]) {
|
||||
const own = resolve(
|
||||
['#command-dock', ...trayOpen, OMNIBAR.dock],
|
||||
prop,
|
||||
width,
|
||||
`Omnibar dock ${prop}`,
|
||||
);
|
||||
assert.equal(
|
||||
own.part,
|
||||
OMNIBAR.dock,
|
||||
`the Omnibar owns the dock ${prop} at ${width}px`,
|
||||
);
|
||||
assert.equal(
|
||||
own.decl.value,
|
||||
value,
|
||||
`Omnibar dock ${prop} at ${width}px`,
|
||||
);
|
||||
}
|
||||
const credit = resolve(
|
||||
[
|
||||
...CREDIT_SELECTORS,
|
||||
OMNIBAR.credit,
|
||||
...(minimal ? [MINIMAL_HUD_CREDIT, OMNIBAR.minimalCredit] : []),
|
||||
],
|
||||
'bottom',
|
||||
width,
|
||||
'Omnibar credit',
|
||||
);
|
||||
assert.ok(
|
||||
credit.part.startsWith(OMNIBAR_SCOPE),
|
||||
`the Omnibar owns the credit row at ${width}px`,
|
||||
);
|
||||
const dockBottom = omnibarPx(
|
||||
dock.decl.value,
|
||||
height,
|
||||
'Omnibar dock bottom',
|
||||
);
|
||||
const creditTop =
|
||||
omnibarPx(credit.decl.value, height, 'Omnibar credit bottom') +
|
||||
CREDIT_HEIGHT_PX;
|
||||
assert.ok(
|
||||
dockBottom - creditTop >= MIN_CLEARANCE_PX,
|
||||
`at ${width}x${height}${minimal ? ' (minimal HUD)' : ''} the Omnibar dock (${dockBottom}px) must clear the credit line (${creditTop}px)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
// No legacy tray opens over the credit: both are hidden in this layout,
|
||||
// and no rule elsewhere forces them back.
|
||||
const trays = RULES.find((rule) => rule.parts.includes(OMNIBAR.trays));
|
||||
assert.ok(trays, 'the Omnibar layout hides the legacy trays');
|
||||
assert.equal(
|
||||
trays.decls.find((decl) => decl.prop === 'display')?.value,
|
||||
'none',
|
||||
);
|
||||
for (const rule of RULES) {
|
||||
for (const part of rule.parts) {
|
||||
if (!/#(location-bar|control-panel)$/.test(lastCompound(part))) continue;
|
||||
assert.ok(
|
||||
!rule.decls.some((decl) => decl.prop === 'display' && decl.important),
|
||||
`"${part}" forces a hidden tray back with !important`,
|
||||
);
|
||||
}
|
||||
}
|
||||
// The minimal-HUD rail cap only shortens the rail, which is anchored at
|
||||
// its top, so it can only add room above the credit.
|
||||
const rail = RULES.find((rule) => rule.parts.includes(OMNIBAR.minimalRail));
|
||||
const cap = rail.decls.find(
|
||||
(decl) => decl.prop === '--omnibar-minimal-rail-height',
|
||||
);
|
||||
assert.match(
|
||||
cap?.value || '',
|
||||
/^min\(\s*var\(--right-stack-max-height, 70vh\),/,
|
||||
);
|
||||
assert.equal(
|
||||
rail.decls.find((decl) => decl.prop === 'max-height')?.value,
|
||||
'var(--omnibar-minimal-rail-height)',
|
||||
);
|
||||
assert.doesNotMatch(
|
||||
omnibarCss,
|
||||
/\.cesium-widget-credits|\.cesium-credit-logoContainer|\.cesium-credit-textContainer/,
|
||||
'the footer uses the original credit text and logo sizing',
|
||||
);
|
||||
});
|
||||
|
||||
test('every open dock tray clears the required credit at every modelled viewport', () => {
|
||||
// Below 900px the tray widens to nearly the viewport and lands on the
|
||||
// bottom-left corner where the credit lives. The clearance is NOT one fixed
|
||||
|
||||
+8
-6
@@ -527,10 +527,15 @@ export function cyberSonarLabelIntensity(
|
||||
return labelDimFactor + (1 - labelDimFactor) * normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sonar is an opt-in visual style over any HUD layout: it is on only after
|
||||
* the Display panel's Sonar toggle, a voice request or a legacy Cyber link
|
||||
* turns it on.
|
||||
*/
|
||||
export function isCyberSonarEnabled(
|
||||
root = globalThis.document?.documentElement,
|
||||
) {
|
||||
return root?.dataset?.cyberSonar !== 'off';
|
||||
return root?.dataset?.cyberSonar === 'on';
|
||||
}
|
||||
|
||||
export function setCyberSonarEnabled(
|
||||
@@ -539,9 +544,7 @@ export function setCyberSonarEnabled(
|
||||
) {
|
||||
if (!root?.dataset) return false;
|
||||
root.dataset.cyberSonar = enabled ? 'on' : 'off';
|
||||
if (root.dataset.uiTheme === 'cyber') {
|
||||
applyCyberSonarThemePhase(root, enabled);
|
||||
}
|
||||
applyCyberSonarThemePhase(root, enabled);
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@@ -566,7 +569,6 @@ export function isCyberSonarActive({
|
||||
globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ??
|
||||
false;
|
||||
return !!(
|
||||
root?.dataset?.uiTheme === 'cyber' &&
|
||||
isCyberSonarEnabled(root) &&
|
||||
(hudActive ?? hud?.classList?.contains?.('active')) &&
|
||||
!body?.classList?.contains?.('cockpit-mode') &&
|
||||
@@ -583,7 +585,7 @@ export function isCyberMapThemeActive({
|
||||
if (hud === undefined)
|
||||
hud = globalThis.document?.getElementById?.('intel-hud');
|
||||
return !!(
|
||||
root?.dataset?.uiTheme === 'cyber' &&
|
||||
isCyberSonarEnabled(root) &&
|
||||
(hudActive ?? hud?.classList?.contains?.('active')) &&
|
||||
!body?.classList?.contains?.('cockpit-mode')
|
||||
);
|
||||
|
||||
+13
-9
@@ -39,7 +39,7 @@ test('production-transformed sonar defaults retain the document method receiver'
|
||||
const previous = Object.getOwnPropertyDescriptor(globalThis, 'document');
|
||||
const hud = { classList: { contains: (name) => name === 'active' } };
|
||||
const document = {
|
||||
documentElement: { dataset: { uiTheme: 'cyber' } },
|
||||
documentElement: { dataset: { cyberSonar: 'on' } },
|
||||
body: { classList: { contains: () => false } },
|
||||
getElementById(id) {
|
||||
assert.equal(this, document);
|
||||
@@ -57,7 +57,7 @@ test('production-transformed sonar defaults retain the document method receiver'
|
||||
assert.ok(
|
||||
Number.isFinite(compiled.createCyberSonarSampler(800, 600).at(400, 300)),
|
||||
);
|
||||
document.documentElement.dataset.uiTheme = 'tactical';
|
||||
document.documentElement.dataset.cyberSonar = 'off';
|
||||
assert.equal(compiled.isCyberSonarActive(), false);
|
||||
assert.equal(compiled.isCyberMapThemeActive(), false);
|
||||
} finally {
|
||||
@@ -139,8 +139,8 @@ test('the sweep brightens contacts inside its sector and dims the remainder', ()
|
||||
);
|
||||
});
|
||||
|
||||
test('the sonar activates only for a visible Cyber map HUD with motion enabled', () => {
|
||||
const root = { dataset: { uiTheme: 'cyber' } };
|
||||
test('the sonar activates only while on, over a visible map HUD with motion enabled', () => {
|
||||
const root = { dataset: { cyberSonar: 'on' } };
|
||||
const classes = (...values) => ({
|
||||
contains: (value) => values.includes(value),
|
||||
});
|
||||
@@ -220,14 +220,18 @@ test('the opacity setting controls every contact floor and preserves brighter la
|
||||
);
|
||||
});
|
||||
|
||||
test('the sonar control defaults on and records explicit operator state', () => {
|
||||
test('the sonar control defaults off and records explicit operator state', () => {
|
||||
const root = { dataset: {} };
|
||||
assert.equal(isCyberSonarEnabled(root), false);
|
||||
// The removed Cyber theme no longer turns it on.
|
||||
root.dataset.uiTheme = 'cyber';
|
||||
assert.equal(isCyberSonarEnabled(root), false);
|
||||
assert.equal(setCyberSonarEnabled(true, root), true);
|
||||
assert.equal(root.dataset.cyberSonar, 'on');
|
||||
assert.equal(isCyberSonarEnabled(root), true);
|
||||
assert.equal(setCyberSonarEnabled(false, root), false);
|
||||
assert.equal(root.dataset.cyberSonar, 'off');
|
||||
assert.equal(isCyberSonarEnabled(root), false);
|
||||
assert.equal(setCyberSonarEnabled(true, root), true);
|
||||
assert.equal(root.dataset.cyberSonar, 'on');
|
||||
});
|
||||
|
||||
test('real Cesium points and billboards recover after repeated low/high opacity cycles', () => {
|
||||
@@ -349,10 +353,10 @@ test('the sweep corrects delayed starts and reacquires restarted animations with
|
||||
assert.doesNotThrow(() => syncCyberSonarAnimation({}));
|
||||
});
|
||||
|
||||
test('the selected Cyber theme seeds and releases the compositor sweep phase', () => {
|
||||
test('turning Sonar on seeds and releases the compositor sweep phase', () => {
|
||||
const values = new Map();
|
||||
const root = {
|
||||
dataset: {},
|
||||
dataset: { cyberSonar: 'on' },
|
||||
style: {
|
||||
setProperty: (name, value) => values.set(name, value),
|
||||
removeProperty: (name) => values.delete(name),
|
||||
|
||||
@@ -45,7 +45,7 @@ test('frame sampler matches reference without per-contact settings access', () =
|
||||
});
|
||||
|
||||
test('removed CSS mode cannot disable GPU contacts; unsupported renderers fail closed', () => {
|
||||
const root = { dataset: { uiTheme: 'cyber' }, style: { setProperty() {} } };
|
||||
const root = { dataset: { cyberSonar: 'on' }, style: { setProperty() {} } };
|
||||
const options = {
|
||||
root,
|
||||
body: { classList: { contains: () => false } },
|
||||
@@ -97,7 +97,7 @@ function fixture({ modulation = true, lists = true } = {}) {
|
||||
document: globalThis.document,
|
||||
matchMedia: globalThis.matchMedia,
|
||||
};
|
||||
const root = { dataset: { uiTheme: 'cyber', cyberSonar: 'on' } };
|
||||
const root = { dataset: { cyberSonar: 'on' } };
|
||||
const status = { textContent: '' };
|
||||
const state = { cockpit: false, reducedMotion: false };
|
||||
globalThis.document = {
|
||||
@@ -232,36 +232,47 @@ test('the sweep sets its sector on drawing ticks and at the cadence, and changes
|
||||
f.tick(false);
|
||||
assert.equal(f.sets.length, 4, 'a resize sets it at once');
|
||||
assert.deepEqual(f.sets[3].center, { x: 300, y: 400 });
|
||||
f.root.dataset.cyberSonar = 'off';
|
||||
f.root.dataset.cyberSonarOpacity = '50';
|
||||
f.tick(false);
|
||||
assert.equal(f.sets[4].radius, 0, 'Sonar OFF rests every contact');
|
||||
assert.equal(f.sets.length, 5, 'a setting change sets it at once');
|
||||
assert.equal(
|
||||
f.sets[4].floor,
|
||||
0.5,
|
||||
'while sweeping the floor is the opacity',
|
||||
);
|
||||
f.state.reducedMotion = true;
|
||||
f.tick(false);
|
||||
assert.equal(f.sets[5].radius, 0, 'reduced motion rests the sweep');
|
||||
assert.equal(f.sets[5].floor, 0.5 + 0.5 * 0.46, 'at rest it lifts');
|
||||
clock += 1000;
|
||||
f.tick(true);
|
||||
f.tick(false);
|
||||
assert.equal(f.sets.length, 5, 'at rest only changes set it');
|
||||
f.root.dataset.cyberSonarOpacity = '50';
|
||||
f.tick(false);
|
||||
assert.equal(f.sets.length, 6);
|
||||
assert.equal(f.sets[5].floor, 0.5 + 0.5 * 0.46);
|
||||
assert.equal(f.sets.length, 6, 'at rest only changes set it');
|
||||
f.state.reducedMotion = false;
|
||||
f.state.cockpit = true;
|
||||
f.tick(false);
|
||||
assert.equal(f.sets[6], null, 'out of the map theme it clears');
|
||||
assert.equal(f.sets[6], null, 'out of the map it clears');
|
||||
f.tick(true);
|
||||
assert.equal(f.sets.length, 7, 'cleared once');
|
||||
f.state.cockpit = false;
|
||||
f.root.dataset.cyberSonar = 'off';
|
||||
f.tick(false);
|
||||
assert.equal(f.sets.length, 7, 'Sonar OFF leaves contacts untreated');
|
||||
f.root.dataset.cyberSonar = 'on';
|
||||
f.state.reducedMotion = true;
|
||||
f.tick(false);
|
||||
assert.equal(f.sets[7].radius, 0, 'reduced motion rests the sweep');
|
||||
f.state.reducedMotion = false;
|
||||
f.root.dataset.uiTheme = 'tactical';
|
||||
assert.ok(f.sets[7]?.radius > 0, 'Sonar ON sweeps at once');
|
||||
f.root.dataset.cyberSonar = 'off';
|
||||
f.tick(false);
|
||||
assert.equal(f.sets[8], null, 'another HUD style clears it');
|
||||
assert.equal(f.sets[8], null, 'Sonar OFF clears it');
|
||||
f.tick(true);
|
||||
assert.equal(f.sets.length, 9);
|
||||
// The removed Cyber theme attribute alone does nothing.
|
||||
f.root.dataset.uiTheme = 'cyber';
|
||||
f.tick(false);
|
||||
assert.ok(f.sets[9]?.radius > 0, 'back in Cyber it sweeps at once');
|
||||
assert.equal(f.sets.length, 9);
|
||||
f.root.dataset.cyberSonar = 'on';
|
||||
f.tick(false);
|
||||
assert.ok(f.sets[9]?.radius > 0, 'back on, it sweeps at once');
|
||||
assert.deepEqual(f.requests, [], 'the scene itself never asks for frames');
|
||||
dispose();
|
||||
assert.equal(f.sets[10], null, 'disposal clears it');
|
||||
|
||||
@@ -32,7 +32,12 @@ import aisLiveVesselsLayer from './aisLiveVessels.js';
|
||||
import { registerEntityContext, selectEntityContext } from './contextStore.js';
|
||||
import { WORLD_FOCUS_REQUEST_EVENT } from '../worldFocus.js';
|
||||
import { ensureGeoidReady, geoidHeight } from './geoid.js';
|
||||
import { registerPickOwner, unregisterPickOwner } from './pickRegistry.js';
|
||||
import {
|
||||
isUnderOtherCard,
|
||||
registerPickOwner,
|
||||
setClickCardHitTest,
|
||||
unregisterPickOwner,
|
||||
} from './pickRegistry.js';
|
||||
import { applyVesselOverlayPolicy } from './vesselLabels.js';
|
||||
import { fakeInput } from '../input/testDoubles.mjs';
|
||||
import { layerFeedState } from './manager.js';
|
||||
@@ -490,7 +495,7 @@ test('first accepted position ends grace and warm data survives later open silen
|
||||
const clock = makeFakeAisRuntime(7000);
|
||||
const record = makeRecord();
|
||||
_setAisRuntimeForTest(clock.runtime);
|
||||
_setVesselOverlayHostForTest({
|
||||
useVesselHost({
|
||||
setEntries() {},
|
||||
setVisible() {},
|
||||
clearSource() {},
|
||||
@@ -540,7 +545,7 @@ test('first accepted position ends grace and warm data survives later open silen
|
||||
assert.equal(feed.error, 'awaiting usable AIS positions…');
|
||||
} finally {
|
||||
_setVesselStateForTest({ enabled: false });
|
||||
_setVesselOverlayHostForTest();
|
||||
useVesselHost();
|
||||
_setAisRuntimeForTest();
|
||||
}
|
||||
});
|
||||
@@ -1012,7 +1017,12 @@ function makeCesiumEvent() {
|
||||
};
|
||||
}
|
||||
|
||||
function installWireHarness(picked, stateOverrides = {}) {
|
||||
function installWireHarness(
|
||||
picked,
|
||||
stateOverrides = {},
|
||||
sceneExtras = {},
|
||||
firstClick = null,
|
||||
) {
|
||||
const hadWindow = Object.hasOwn(globalThis, 'window');
|
||||
const hadDocument = Object.hasOwn(globalThis, 'document');
|
||||
const priorWindow = globalThis.window;
|
||||
@@ -1038,9 +1048,11 @@ function installWireHarness(picked, stateOverrides = {}) {
|
||||
},
|
||||
};
|
||||
const viewer = {
|
||||
scene: { pick: () => picked },
|
||||
scene: { pick: () => picked, ...sceneExtras },
|
||||
};
|
||||
const input = fakeInput(viewer);
|
||||
// A subscriber that runs before the layer's own (an aircraft layer).
|
||||
if (firstClick) input.input.onClick(firstClick);
|
||||
// The camera port other layers follow through, with no pose to read; its
|
||||
// followChanged event counts who listens.
|
||||
const followChanged = makeCesiumEvent();
|
||||
@@ -1666,7 +1678,7 @@ test('vessel host publication preserves the shipped grid winner and separation s
|
||||
},
|
||||
},
|
||||
});
|
||||
_setVesselOverlayHostForTest({
|
||||
useVesselHost({
|
||||
setEntries(sourceId, entries, options) {
|
||||
publications.push({ sourceId, entries, options });
|
||||
},
|
||||
@@ -1690,7 +1702,7 @@ test('vessel host publication preserves the shipped grid winner and separation s
|
||||
} finally {
|
||||
unbind();
|
||||
_setVesselStateForTest({ enabled: false });
|
||||
_setVesselOverlayHostForTest();
|
||||
useVesselHost();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1717,7 +1729,7 @@ test('vessel real layer lifecycle publishes protected selection and leaves no st
|
||||
globalThis.window.addEventListener('gev:world-request-focus', (event) => {
|
||||
focusRequests.push(event.detail);
|
||||
});
|
||||
_setVesselOverlayHostForTest(host);
|
||||
useVesselHost(host);
|
||||
_setVesselStateForTest({
|
||||
viewer: {
|
||||
get canvas() {
|
||||
@@ -1766,7 +1778,7 @@ test('vessel real layer lifecycle publishes protected selection and leaves no st
|
||||
);
|
||||
} finally {
|
||||
_setVesselStateForTest({ enabled: false });
|
||||
_setVesselOverlayHostForTest();
|
||||
useVesselHost();
|
||||
if (hadWindow) globalThis.window = priorWindow;
|
||||
else delete globalThis.window;
|
||||
globalThis.document = priorDocument;
|
||||
@@ -1872,17 +1884,31 @@ test('vessel interaction wire: a vessel with an id and no MMSI is selected by cl
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Hand the vessel layer an overlay host, and answer the pick registry's
|
||||
* card-on-top question from the same host, as the application does.
|
||||
*/
|
||||
function useVesselHost(host) {
|
||||
_setVesselOverlayHostForTest(host);
|
||||
setClickCardHitTest(host ? (x, y) => host.hitTest(x, y) : null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overlay-host recorder whose hitTest answers with one card id. The real host
|
||||
* only publishes rects for `interactive` entries, so a stub returning a hit is
|
||||
* the same contract a painted, actionable card presents.
|
||||
*/
|
||||
function hostWithCardHit(entryId) {
|
||||
function hostWithCardHit(entryId, topHit) {
|
||||
return {
|
||||
setEntries() {},
|
||||
setVisible() {},
|
||||
clearSource() {},
|
||||
hitTest: () => (entryId ? { sourceId: 'ais-live-vessels', entryId } : null),
|
||||
hitTest: (_x, _y, { sourceId } = {}) =>
|
||||
!sourceId && topHit
|
||||
? topHit
|
||||
: entryId
|
||||
? { sourceId: 'ais-live-vessels', entryId }
|
||||
: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1898,9 +1924,7 @@ test('vessel interaction wire: clicking a card selects and transfers, like the s
|
||||
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
|
||||
requests.push(event.detail),
|
||||
);
|
||||
_setVesselOverlayHostForTest(
|
||||
hostWithCardHit(`vessel:${harness.record.mmsi}`),
|
||||
);
|
||||
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(
|
||||
@@ -1911,7 +1935,7 @@ test('vessel interaction wire: clicking a card selects and transfers, like the s
|
||||
assert.equal(requests[0].kind, 'vessel');
|
||||
assert.equal(requests[0].id, harness.record.mmsi);
|
||||
} finally {
|
||||
_setVesselOverlayHostForTest(null);
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
}
|
||||
});
|
||||
@@ -1926,9 +1950,7 @@ test('vessel interaction wire: clicking the selected vessel card refocuses exact
|
||||
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
|
||||
requests.push(event.detail),
|
||||
);
|
||||
_setVesselOverlayHostForTest(
|
||||
hostWithCardHit(`vessel:${harness.record.mmsi}`),
|
||||
);
|
||||
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(
|
||||
@@ -1939,11 +1961,36 @@ test('vessel interaction wire: clicking the selected vessel card refocuses exact
|
||||
assert.equal(requests[0].id, harness.record.mmsi);
|
||||
assert.equal(harness.trail.clearCalls, 0);
|
||||
} finally {
|
||||
_setVesselOverlayHostForTest(null);
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
// Another layer's card on top takes the click from the vessel card under it
|
||||
// and from a vessel icon under it alike.
|
||||
test('vessel interaction wire: a covered card and a covered vessel pick both yield', () => {
|
||||
for (const ownPick of [false, true]) {
|
||||
const harness = installWireHarness(ownPick ? { id: makeRecord().mmsi } : null);
|
||||
const requests = [];
|
||||
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
|
||||
requests.push(event.detail),
|
||||
);
|
||||
useVesselHost(
|
||||
hostWithCardHit(`vessel:${harness.record.mmsi}`, {
|
||||
sourceId: 'earthquakes', entryId: 'quake:cover',
|
||||
}),
|
||||
);
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(requests.length, 0, `own pick: ${ownPick}`);
|
||||
assert.equal(aisLiveVesselsLayer.getSelectedInfo()?.mmsi, harness.record.mmsi);
|
||||
} finally {
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('vessel interaction wire: an unknown card id preserves selection and never flies', () => {
|
||||
const harness = installWireHarness({
|
||||
primitive: {},
|
||||
@@ -1955,7 +2002,7 @@ test('vessel interaction wire: an unknown card id preserves selection and never
|
||||
requests.push(event.detail),
|
||||
);
|
||||
// An evicted vessel's card id resolves to no live record.
|
||||
_setVesselOverlayHostForTest(hostWithCardHit('vessel:999999999'));
|
||||
useVesselHost(hostWithCardHit('vessel:999999999'));
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(
|
||||
@@ -1964,37 +2011,135 @@ test('vessel interaction wire: an unknown card id preserves selection and never
|
||||
);
|
||||
assert.equal(requests.length, 0);
|
||||
} finally {
|
||||
_setVesselOverlayHostForTest(null);
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('vessel interaction wire: a sibling-owned pick wins without selection mutation', () => {
|
||||
// Another layer is already acting on this click; two camera commands is the
|
||||
// worse failure, so the card is not consulted.
|
||||
test('vessel interaction wire: the vessel card on top wins over a sibling-owned pick', () => {
|
||||
// The card painted on top takes the click; the sibling (an aircraft)
|
||||
// stands aside under it, so there is one camera command, not two.
|
||||
registerPickOwner('flights', (pickedId) => pickedId === 'a1b2c3');
|
||||
const harness = installWireHarness({ id: 'a1b2c3' });
|
||||
const requests = [];
|
||||
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
|
||||
requests.push(event.detail),
|
||||
);
|
||||
_setVesselOverlayHostForTest(
|
||||
hostWithCardHit(`vessel:${harness.record.mmsi}`),
|
||||
);
|
||||
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(
|
||||
aisLiveVesselsLayer.getSelectedInfo()?.mmsi,
|
||||
harness.record.mmsi,
|
||||
);
|
||||
assert.equal(requests.length, 0);
|
||||
assert.equal(requests.length, 1);
|
||||
} finally {
|
||||
_setVesselOverlayHostForTest(null);
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
unregisterPickOwner('flights');
|
||||
}
|
||||
});
|
||||
|
||||
// The aircraft layer runs first. Under the vessel's card it stands aside, so
|
||||
// the card takes the click: one action.
|
||||
test('vessel interaction wire: a card over an aircraft takes the click; the aircraft does not track', (t) => {
|
||||
let tracked = null;
|
||||
registerPickOwner('test-planes', (pickedId) => pickedId === 'plane:9');
|
||||
t.after(() => unregisterPickOwner('test-planes'));
|
||||
const harness = installWireHarness(
|
||||
{ id: 'plane:9' },
|
||||
{ selectedRecord: null },
|
||||
{},
|
||||
(event) => {
|
||||
if (isUnderOtherCard(event)) return;
|
||||
if (event.hit?.id === 'plane:9') tracked = 'plane:9';
|
||||
},
|
||||
);
|
||||
const requests = [];
|
||||
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
|
||||
requests.push(event.detail),
|
||||
);
|
||||
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(tracked, null, 'the aircraft does not track');
|
||||
assert.equal(requests.length, 1, 'the vessel card acts');
|
||||
assert.equal(
|
||||
aisLiveVesselsLayer.getSelectedInfo()?.mmsi,
|
||||
harness.record.mmsi,
|
||||
);
|
||||
} finally {
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
// A trail acts for nobody: the vessel's card painted over it still selects,
|
||||
// and a bare trail pick stays a no-op that keeps the selection.
|
||||
test('vessel interaction wire: a card over a trail selects; a bare trail is a no-op', () => {
|
||||
for (const carded of [true, false]) {
|
||||
const harness = installWireHarness(
|
||||
{ id: 'gev-trail:fl-a1b2c3:head' },
|
||||
{ selectedRecord: null },
|
||||
);
|
||||
const requests = [];
|
||||
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
|
||||
requests.push(event.detail),
|
||||
);
|
||||
useVesselHost(
|
||||
hostWithCardHit(carded ? `vessel:${harness.record.mmsi}` : null),
|
||||
);
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(requests.length, carded ? 1 : 0, `card: ${carded}`);
|
||||
assert.equal(
|
||||
aisLiveVesselsLayer.getSelectedInfo()?.mmsi ?? null,
|
||||
carded ? harness.record.mmsi : null,
|
||||
);
|
||||
} finally {
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// A coarse tap on the vessel's card over a fire, nearby or exact: the card on
|
||||
// top keeps the tap.
|
||||
test('vessel interaction wire: the card keeps a tap over a nearby or exact fire', (t) => {
|
||||
const previous = globalThis.matchMedia;
|
||||
globalThis.matchMedia = () => ({ matches: true });
|
||||
t.after(() => {
|
||||
if (previous) globalThis.matchMedia = previous;
|
||||
else delete globalThis.matchMedia;
|
||||
});
|
||||
const fire = 'fire:near-miss';
|
||||
registerPickOwner('test-exact-fires', (pickedId) => pickedId === fire);
|
||||
t.after(() => unregisterPickOwner('test-exact-fires'));
|
||||
for (const exact of [false, true]) {
|
||||
const harness = installWireHarness(
|
||||
exact ? { id: fire } : null,
|
||||
{ selectedRecord: null },
|
||||
{ drillPick: () => [{ id: fire }] },
|
||||
);
|
||||
const requests = [];
|
||||
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
|
||||
requests.push(event.detail),
|
||||
);
|
||||
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(requests.length, 1, `exact fire: ${exact}`);
|
||||
assert.equal(
|
||||
aisLiveVesselsLayer.getSelectedInfo()?.mmsi,
|
||||
harness.record.mmsi,
|
||||
);
|
||||
} finally {
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (const card of ['live', 'stale', 'absent', 'covered']) {
|
||||
test(`vessel interaction wire: ${card} foreground card over registered cyclone`, () => {
|
||||
const id = 'cyclone:fixture:cone:0';
|
||||
@@ -2020,7 +2165,7 @@ for (const card of ['live', 'stale', 'absent', 'covered']) {
|
||||
);
|
||||
return { sourceId: 'cctv', entryId: 'vessel:999999999' };
|
||||
};
|
||||
_setVesselOverlayHostForTest(host);
|
||||
useVesselHost(host);
|
||||
try {
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
assert.equal(
|
||||
@@ -2029,7 +2174,7 @@ for (const card of ['live', 'stale', 'absent', 'covered']) {
|
||||
);
|
||||
assert.equal(requests.length, card === 'live' ? 1 : 0);
|
||||
} finally {
|
||||
_setVesselOverlayHostForTest(null);
|
||||
useVesselHost(null);
|
||||
harness.cleanup();
|
||||
unregisterPickOwner('weather-cyclones');
|
||||
}
|
||||
|
||||
@@ -2959,11 +2959,12 @@ export function createBhoteKoshiEventLayer({
|
||||
: Number.isFinite(clientY) && bounds
|
||||
? clientY - bounds.top
|
||||
: Number.NaN;
|
||||
const hit = overlayHost.hitTest?.(x, y, {
|
||||
sourceId: BHOTE_KOSHI_OVERLAY_SOURCE_ID,
|
||||
filter: (entry) => String(entry?.id || '').startsWith('evidence-card-'),
|
||||
});
|
||||
if (typeof hit?.entry?.activate !== 'function') return;
|
||||
// Only the card painted on top acts: an evidence card covered by
|
||||
// another layer's card or label leaves the click to that card.
|
||||
const hit = overlayHost.hitTest?.(x, y);
|
||||
if (hit?.sourceId !== BHOTE_KOSHI_OVERLAY_SOURCE_ID) return;
|
||||
if (!String(hit.entry?.id || '').startsWith('evidence-card-')) return;
|
||||
if (typeof hit.entry.activate !== 'function') return;
|
||||
hit.entry.activate();
|
||||
}
|
||||
|
||||
|
||||
@@ -2114,6 +2114,7 @@ test('Debris-Dammed Lake card opens its source and is armed for approved local v
|
||||
};
|
||||
const viewer = eventViewer();
|
||||
let activeCard = null;
|
||||
let coveredBy = null;
|
||||
const layer = createBhoteKoshiEventLayer({
|
||||
eventLoader: async () => event,
|
||||
imagerySpecFactory: async (url) => ({ url }),
|
||||
@@ -2131,9 +2132,11 @@ test('Debris-Dammed Lake card opens its source and is armed for approved local v
|
||||
},
|
||||
setVisible() {},
|
||||
clearSource() {},
|
||||
// As the host does: unfiltered, the topmost entry.
|
||||
hitTest(_x, _y, options) {
|
||||
if (coveredBy && !options?.sourceId) return coveredBy;
|
||||
if (!activeCard || options?.filter?.(activeCard) === false) return null;
|
||||
return { entry: activeCard };
|
||||
return { sourceId: 'bhote-koshi-witnesses', entry: activeCard };
|
||||
},
|
||||
},
|
||||
renderHost: { request() {}, hold() {}, release() {} },
|
||||
@@ -2160,6 +2163,11 @@ test('Debris-Dammed Lake card opens its source and is armed for approved local v
|
||||
} finally {
|
||||
releasePointer(lease);
|
||||
}
|
||||
// Another layer's card painted over the evidence card takes the click.
|
||||
coveredBy = { sourceId: 'earthquake-card', entryId: 'earthquake-card:q' };
|
||||
viewer._test.canvas.dispatch('click', { offsetX: 640, offsetY: 420 });
|
||||
assert.equal(opened.length, 0, 'a covered evidence card does not open');
|
||||
coveredBy = null;
|
||||
viewer._test.canvas.dispatch('click', { offsetX: 640, offsetY: 420 });
|
||||
assert.deepEqual(opened, [[
|
||||
event.evidenceSpine[1].media.sourceUrl,
|
||||
|
||||
@@ -2,6 +2,9 @@ import {
|
||||
clearOverlaySource,
|
||||
setOverlayEntries,
|
||||
} from '../overlays/worldOverlay.js';
|
||||
import { inputFor } from '../input/dispatcher.js';
|
||||
import { clickCard } from './pickRegistry.js';
|
||||
import { isTrackingSelectionGesture } from './trackingClickGesture.js';
|
||||
import { governorRequestRender } from '../renderGovernor.js';
|
||||
import { drawOf, findCamera } from '../render/rendererOf.js';
|
||||
import { hexColor } from '../render/color.js';
|
||||
@@ -279,8 +282,11 @@ export function createBhoteKoshiLocatorLayer({
|
||||
cancelFrame = (handle) => cancelAnimationFrame(handle),
|
||||
scheduleDelay = (callback, delayMs) => setTimeout(callback, delayMs),
|
||||
cancelDelay = (handle) => clearTimeout(handle),
|
||||
input = inputFor,
|
||||
} = {}) {
|
||||
let _viewer = null;
|
||||
// The globe click that opens an actionable callout of ours on top.
|
||||
let _removeClick = null;
|
||||
const _serial = ++layerSerial;
|
||||
// Whether the layer draws: from enable until it is let go.
|
||||
let _drawing = false;
|
||||
@@ -1107,6 +1113,7 @@ export function createBhoteKoshiLocatorLayer({
|
||||
renderPresentation();
|
||||
registerDynamicCredit(viewer, BHOTE_KOSHI_LOCATOR_CREDIT);
|
||||
showOsmCredit(viewer, BHOTE_KOSHI_LOCATOR_LAYER_ID);
|
||||
installCalloutClick(viewer);
|
||||
requestRender('bhote-koshi-locator-callout');
|
||||
|
||||
try {
|
||||
@@ -1141,8 +1148,34 @@ export function createBhoteKoshiLocatorLayer({
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An actionable callout of ours (the trigger record's) is a card painted
|
||||
* over the globe: a click on it opens its source, as its keyboard action
|
||||
* does. Like the other cards, it leaves a drag alone and, on top, takes the
|
||||
* click over whatever is drawn under it.
|
||||
*/
|
||||
function installCalloutClick(viewer) {
|
||||
if (_removeClick) return;
|
||||
let clicks = null;
|
||||
try {
|
||||
clicks = input?.(viewer) ?? null;
|
||||
} catch {
|
||||
clicks = null;
|
||||
}
|
||||
_removeClick =
|
||||
clicks?.onClick?.((event) => {
|
||||
if (!_enabled || !isTrackingSelectionGesture(event.gesture)) return;
|
||||
// The card painted on top, read once per click so every layer agrees.
|
||||
const top = clickCard(event);
|
||||
if (top?.sourceId !== BHOTE_KOSHI_LOCATOR_OVERLAY_SOURCE_ID) return;
|
||||
if (typeof top.entry?.activate === 'function') top.entry.activate();
|
||||
}) ?? null;
|
||||
}
|
||||
|
||||
async function disable() {
|
||||
hideOsmCredit(_viewer, BHOTE_KOSHI_LOCATOR_LAYER_ID);
|
||||
_removeClick?.();
|
||||
_removeClick = null;
|
||||
_enabled = false;
|
||||
_boundaryReady = false;
|
||||
_boundaryResolved = false;
|
||||
|
||||
@@ -11,6 +11,11 @@ import {
|
||||
import { BHOTE_KOSHI_FLOOD_PATH } from './bhoteKoshiFloodPath.js';
|
||||
import * as Cesium from 'cesium';
|
||||
import { setLocale } from '../i18n/index.js';
|
||||
import {
|
||||
registerPickOwner,
|
||||
setClickCardHitTest,
|
||||
unregisterPickOwner,
|
||||
} from './pickRegistry.js';
|
||||
import { SceneDirector } from '../scenes/director.js';
|
||||
import { createPlaybackClock } from '../director/clock.js';
|
||||
import { createDefaultScenePacks } from '../scenes/packs/defaults.js';
|
||||
@@ -1049,3 +1054,74 @@ test('Bhote Koshi locator layers draw sets of their own, and halos only as they
|
||||
assert.equal(await second.disable(), true);
|
||||
assert.equal(viewer._test.live().length, 0);
|
||||
});
|
||||
|
||||
// The trigger record's callout is an actionable card: the layers under it
|
||||
// stand aside for it, so a click on it opens its source, as its keyboard
|
||||
// action does; anything else on top is left alone.
|
||||
test('a click on the locator callout runs its action', async () => {
|
||||
const viewer = viewerFixture();
|
||||
let onClick = null;
|
||||
let top = null;
|
||||
const activated = [];
|
||||
const layer = createBhoteKoshiLocatorLayer({
|
||||
overlayHost: overlayHostFixture(),
|
||||
requestRender() {},
|
||||
...nonRunningAnimation(),
|
||||
input: () => ({
|
||||
onClick(callback) {
|
||||
onClick = callback;
|
||||
return () => {
|
||||
onClick = null;
|
||||
};
|
||||
},
|
||||
}),
|
||||
});
|
||||
// The card on top at a click, as the host answers the pick registry.
|
||||
setClickCardHitTest(() => top);
|
||||
await layer.init(viewer);
|
||||
await layer.enable(viewer);
|
||||
const click = (extra = {}) =>
|
||||
onClick?.({
|
||||
screenPosition: { x: 5, y: 5 },
|
||||
gesture: { travelPx: 0, durationMs: 80 },
|
||||
topHit: null,
|
||||
hit: null,
|
||||
...extra,
|
||||
});
|
||||
top = {
|
||||
sourceId: BHOTE_KOSHI_LOCATOR_OVERLAY_SOURCE_ID,
|
||||
entryId: 'bhote-koshi-trigger-record-callout',
|
||||
entry: { activate: () => activated.push('trigger') },
|
||||
};
|
||||
click();
|
||||
assert.deepEqual(activated, ['trigger']);
|
||||
top = {
|
||||
sourceId: 'earthquake-card',
|
||||
entry: { activate: () => activated.push('other') },
|
||||
};
|
||||
click();
|
||||
assert.deepEqual(activated, ['trigger'], 'another layer on top is its own');
|
||||
// A drag that ends on it is not a click on it.
|
||||
top = {
|
||||
sourceId: BHOTE_KOSHI_LOCATOR_OVERLAY_SOURCE_ID,
|
||||
entry: { activate: () => activated.push('trigger') },
|
||||
};
|
||||
click({ gesture: { travelPx: 30, durationMs: 80 } });
|
||||
assert.deepEqual(activated, ['trigger'], 'a drag does not open it');
|
||||
// On top, it takes the click over an aircraft or a camera under it, exact
|
||||
// or a touch contact: those layers stand aside under a card.
|
||||
registerPickOwner('test-planes', (id) => id === 'plane:1');
|
||||
try {
|
||||
const plane = { set: 'planes:1', id: 'plane:1' };
|
||||
const cam = { set: 'cams:1', id: 'cam:1' };
|
||||
click({ topHit: plane, hit: plane });
|
||||
click({ topHit: null, hit: plane });
|
||||
click({ topHit: cam, hit: cam });
|
||||
assert.equal(activated.length, 4, 'the callout on top acts each time');
|
||||
} finally {
|
||||
unregisterPickOwner('test-planes');
|
||||
setClickCardHitTest(null);
|
||||
}
|
||||
await layer.disable();
|
||||
assert.equal(onClick, null, 'disable removes the click handler');
|
||||
});
|
||||
+4
-11
@@ -1020,11 +1020,7 @@ test('CCTV repeated in-world clicks dispatch focus only for the one real activat
|
||||
);
|
||||
assert.match(
|
||||
componentFunctionSource(cctvLayer.init),
|
||||
/_cctvOverlayHost\.hitTest/,
|
||||
);
|
||||
assert.match(
|
||||
componentFunctionSource(cctvLayer.init),
|
||||
/sourceId: CCTV_OVERLAY_SOURCE_ID/,
|
||||
/clickCard\?\.\(event\)/,
|
||||
);
|
||||
assert.match(
|
||||
componentFunctionSource(cctvLayer.init),
|
||||
@@ -1032,7 +1028,7 @@ test('CCTV repeated in-world clicks dispatch focus only for the one real activat
|
||||
);
|
||||
assert.match(
|
||||
componentFunctionSource(cctvLayer.init),
|
||||
/activateCctvCameraFromWorldClick\(cardId, setActiveCamera\)/,
|
||||
/activateCctvCameraFromWorldClick\(\s*top\.entryId,/,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1157,11 +1153,8 @@ test('CCTV empty-click gate excludes every identified scene object, ADJUST, and
|
||||
);
|
||||
|
||||
const initSource = componentFunctionSource(cctvLayer.init);
|
||||
assert.ok(
|
||||
initSource.indexOf('if (pickedId !== null) return') <
|
||||
initSource.indexOf('_cctvOverlayHost.hitTest'),
|
||||
'every identified sibling must win before an overlapping CCTV card hit test',
|
||||
);
|
||||
// The real init-bound click route, including identified-object barriers,
|
||||
// is exercised in layers/cctv/lifecycle.test.mjs.
|
||||
assert.match(initSource, /activeCameraId: _activeCameraId/);
|
||||
assert.match(initSource, /calibrationMode: _calibrationMode/);
|
||||
});
|
||||
|
||||
@@ -53,7 +53,7 @@ test('the echo bracket pulses outward from the contact bracket and fades', (t) =
|
||||
assert.ok(half.spreadPx > echo.spreadPx * 0.5);
|
||||
assert.ok(half.spreadPx < echo.spreadPx);
|
||||
assert.ok(half.band < STEPS && half.band >= 1);
|
||||
// The bracket's own dimming (keyhole fade, Cyber sonar sweep) carries
|
||||
// The bracket's own dimming (keyhole fade, sonar sweep) carries
|
||||
// over, and the echo is never drawn brighter than its bracket: a bracket
|
||||
// too dim for even one band draws no echo.
|
||||
assert.equal(at(arrival, 0.25).band, 2);
|
||||
|
||||
@@ -941,13 +941,13 @@ test('a Global Context echo bracket is drawn outside its contact bracket and dim
|
||||
}
|
||||
});
|
||||
|
||||
test('under the Cyber sonar sweep an echo is never brighter than its own bracket', () => {
|
||||
test('under the sonar sweep an echo is never brighter than its own bracket', () => {
|
||||
const env = installEnvironment();
|
||||
// The cyber theme with its HUD open turns the contact sonar on; its sweep
|
||||
// dims brackets it is not passing over.
|
||||
// Sonar on with its HUD open turns the contact sonar on; its sweep dims
|
||||
// brackets it is not passing over.
|
||||
env.document.documentElement = {
|
||||
// The lowest sweep floor, so dimmed brackets drop a whole alpha band.
|
||||
dataset: { uiTheme: 'cyber', cyberSonarOpacity: '35' },
|
||||
dataset: { cyberSonar: 'on', cyberSonarOpacity: '35' },
|
||||
style: { setProperty() {}, removeProperty() {} },
|
||||
};
|
||||
const hud = env.document.createElement('div');
|
||||
|
||||
@@ -28,6 +28,8 @@ import {
|
||||
createApplicationDirectionsLayer,
|
||||
} from './directions.js';
|
||||
import { GROUND_FLOOR_LIFT_M } from './groundFloor.js';
|
||||
import { isOwnedByOtherLayer, setClickCardHitTest } from './pickRegistry.js';
|
||||
import { fakeInput } from '../input/testDoubles.mjs';
|
||||
import { instructionFor } from './routeSteps.js';
|
||||
import { setLocale } from '../i18n/index.js';
|
||||
import {
|
||||
@@ -465,6 +467,65 @@ function ownershipFixture(t) {
|
||||
});
|
||||
}
|
||||
|
||||
// Directions owns its route, markers and steps while enabled: none of them
|
||||
// is empty space to other layers.
|
||||
test('enabled, directions owns its picks', (t) => {
|
||||
ownershipFixture(t);
|
||||
const viewer = {
|
||||
scene: {
|
||||
pick: () => null,
|
||||
canvas: { clientWidth: 100, clientHeight: 100 },
|
||||
},
|
||||
};
|
||||
const input = fakeInput(viewer);
|
||||
t.after(() => input.destroy());
|
||||
directionsLayer.enable(viewer);
|
||||
try {
|
||||
for (const id of [
|
||||
'directions:route',
|
||||
'directions:marker:a',
|
||||
'directions:step:3',
|
||||
])
|
||||
assert.equal(isOwnedByOtherLayer('earthquakes', id), true, id);
|
||||
} finally {
|
||||
directionsLayer.disable(viewer);
|
||||
}
|
||||
assert.equal(isOwnedByOtherLayer('earthquakes', 'directions:route'), false);
|
||||
});
|
||||
|
||||
// The card or label painted on top takes the click: directions does not even
|
||||
// pick under another layer's card, so no step is selected or cleared there.
|
||||
test("another layer's card over directions keeps the click", (t) => {
|
||||
ownershipFixture(t);
|
||||
let picks = 0;
|
||||
const viewer = {
|
||||
scene: {
|
||||
pick: () => {
|
||||
picks++;
|
||||
return null;
|
||||
},
|
||||
canvas: { clientWidth: 100, clientHeight: 100 },
|
||||
},
|
||||
};
|
||||
const input = fakeInput(viewer);
|
||||
let top = { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' };
|
||||
setClickCardHitTest(() => top);
|
||||
t.after(() => {
|
||||
setClickCardHitTest(null);
|
||||
input.destroy();
|
||||
});
|
||||
directionsLayer.enable(viewer);
|
||||
try {
|
||||
input.tap({ x: 10, y: 10 });
|
||||
assert.equal(picks, 0, 'covered: the scene under the card is not picked');
|
||||
top = null;
|
||||
input.tap({ x: 10, y: 10 });
|
||||
assert.ok(picks > 0, 'open map: the click reaches the scene');
|
||||
} finally {
|
||||
directionsLayer.disable(viewer);
|
||||
}
|
||||
});
|
||||
|
||||
test('placing an endpoint takes the pointer, and every exit path gives it back', (t) => {
|
||||
ownershipFixture(t);
|
||||
|
||||
|
||||
@@ -11,7 +11,12 @@ import {
|
||||
buildCellCard,
|
||||
} from './firmsHeatmap.js';
|
||||
import { fireDetectionKey } from './firmsLabels.js';
|
||||
import { registerPickOwner, unregisterPickOwner } from './pickRegistry.js';
|
||||
import {
|
||||
isUnderOtherCard,
|
||||
registerPickOwner,
|
||||
setClickCardHitTest,
|
||||
unregisterPickOwner,
|
||||
} from './pickRegistry.js';
|
||||
import { getSelectedEntityContext } from './contextStore.js';
|
||||
import { setLocale } from '../i18n/index.js';
|
||||
import { shownEntityLabel } from '../voice/speech.js';
|
||||
@@ -25,6 +30,8 @@ import { fakeDrawPort } from '../testSupport/fakeDrawPort.mjs';
|
||||
import { fakeGlobePort } from '../testSupport/fakeGlobePort.mjs';
|
||||
import { bindRenderer } from '../render/rendererOf.js';
|
||||
import { HEAT_REBUILD_MS } from '../layers/firms/policy.js';
|
||||
import { registerStyleStages } from '../styles/styleStages.js';
|
||||
import { sensorPickPosition } from '../input/sensorPick.js';
|
||||
|
||||
const LAYER_SOURCE = readLayerSource(
|
||||
path.join(path.dirname(fileURLToPath(import.meta.url)), 'firmsHeatmap.js'),
|
||||
@@ -58,10 +65,13 @@ function harness({
|
||||
fires = [makeFire()],
|
||||
picked = null,
|
||||
cardHit = null,
|
||||
topCard = null,
|
||||
cameraPosition = null,
|
||||
withDataSource = false,
|
||||
withGlobe = false,
|
||||
feed = null,
|
||||
drilled = null,
|
||||
firstClick = null,
|
||||
} = {}) {
|
||||
const hadWindow = Object.hasOwn(globalThis, 'window');
|
||||
const priorWindow = globalThis.window;
|
||||
@@ -77,16 +87,24 @@ function harness({
|
||||
};
|
||||
|
||||
const published = [];
|
||||
const overlayHost = {
|
||||
setEntries: (sourceId, entries) => published.push(...entries),
|
||||
setVisible() {},
|
||||
clearSource() {},
|
||||
hitTest: (_x, _y, { sourceId } = {}) =>
|
||||
!sourceId && topCard
|
||||
? topCard
|
||||
: cardHit
|
||||
? { sourceId: 'firms', entryId: cardHit }
|
||||
: null,
|
||||
};
|
||||
// The card on top at a click, as the host answers the pick registry.
|
||||
setClickCardHitTest((x, y) => overlayHost.hitTest(x, y));
|
||||
const layer = createFirmsHeatmapLayer({
|
||||
...(feed ? { feed } : {}),
|
||||
id: 'firms-test',
|
||||
name: 'Fires',
|
||||
overlayHost: {
|
||||
setEntries: (sourceId, entries) => published.push(...entries),
|
||||
setVisible() {},
|
||||
clearSource() {},
|
||||
hitTest: () => (cardHit ? { sourceId: 'firms', entryId: cardHit } : null),
|
||||
},
|
||||
overlayHost,
|
||||
});
|
||||
|
||||
const draw = fakeDrawPort();
|
||||
@@ -106,6 +124,7 @@ function harness({
|
||||
const viewer = {
|
||||
scene: {
|
||||
pick,
|
||||
...(drilled ? { drillPick: () => drilled } : {}),
|
||||
canvas: { clientWidth: 1280, clientHeight: 800 },
|
||||
camera: cameraPosition ? { positionWC: cameraPosition } : undefined,
|
||||
globe: { ellipsoid: Cesium.Ellipsoid.WGS84 },
|
||||
@@ -129,6 +148,8 @@ function harness({
|
||||
if (!withGlobe)
|
||||
layer.attachShellServices({ imageryHost: () => ({ kind: 'none' }) });
|
||||
const input = fakeInput(viewer);
|
||||
// A subscriber that runs before the layer's own (an aircraft layer).
|
||||
if (firstClick) input.input.onClick(firstClick);
|
||||
// The LOD rebuild (and with it the context-registration sweep) is inert
|
||||
// without a data source, so tests that drive a real refresh need one.
|
||||
if (withDataSource) layer.init(viewer);
|
||||
@@ -153,7 +174,14 @@ function harness({
|
||||
(record) => record.kind === 'icons' && !record.disposed,
|
||||
),
|
||||
click: () => input.click({ x: 400, y: 300 }),
|
||||
cover: (hit) => {
|
||||
topCard = hit;
|
||||
},
|
||||
setPicked: (next) => {
|
||||
picked = next;
|
||||
},
|
||||
cleanup() {
|
||||
setClickCardHitTest(null);
|
||||
Cesium.SceneTransforms.worldToWindowCoordinates = priorProjection;
|
||||
if (hadWindow) globalThis.window = priorWindow;
|
||||
else delete globalThis.window;
|
||||
@@ -308,8 +336,16 @@ test('far-side detections cannot consume the bounded ambient-card cohort', () =>
|
||||
|
||||
test('clicking a fire sprite selects it and requests the camera transfer', () => {
|
||||
const fire = makeFire();
|
||||
const h = harness({ fires: [fire], picked: glowPick('firms-7') });
|
||||
const h = harness({
|
||||
fires: [fire],
|
||||
picked: glowPick('firms-7'),
|
||||
topCard: { sourceId: 'earthquakes', entryId: 'quake:cover' },
|
||||
});
|
||||
try {
|
||||
// Under another layer's card the sprite is that card's click.
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 0, 'covered: the card takes it');
|
||||
h.cover(null);
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 1);
|
||||
assert.equal(h.requests[0].kind, 'fire');
|
||||
@@ -355,6 +391,34 @@ test('clicking a fire CARD behaves exactly like clicking its sprite', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('a covered fire card does not act, and keeps an existing selection', () => {
|
||||
const fire = makeFire();
|
||||
const h = harness({
|
||||
fires: [fire],
|
||||
cardHit: `fire:${fireDetectionKey(fire)}`,
|
||||
});
|
||||
try {
|
||||
// Covered by another layer's card from the start: nothing selects or flies.
|
||||
h.cover({ sourceId: 'earthquakes', entryId: 'quake:cover' });
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 0);
|
||||
assert.equal(h.layer.getSelectedInfo(), null);
|
||||
// Uncovered, the card selects; covered again, the click is the other
|
||||
// layer's and leaves that selection alone.
|
||||
h.cover(null);
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 1);
|
||||
const selected = h.layer.getSelectedInfo();
|
||||
assert.ok(selected);
|
||||
h.cover({ sourceId: 'earthquakes', entryId: 'quake:cover' });
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 1);
|
||||
assert.deepEqual(h.layer.getSelectedInfo(), selected);
|
||||
} finally {
|
||||
h.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
// The voice model reads these labels as data (track_entity, get_entity_context,
|
||||
// pointer_context); the voice card translates them where it shows them.
|
||||
test('fire labels stay English data in a translated interface', () => {
|
||||
@@ -386,9 +450,9 @@ test('a click on neither sprite nor card clears without moving the camera', () =
|
||||
}
|
||||
});
|
||||
|
||||
// Sibling layers surface heterogeneous pick shapes. Reading `picked.id`
|
||||
// directly recognized only bare strings, so an AIS sprite (or satellite, or
|
||||
// entity) under a fire card let BOTH layers issue a camera command.
|
||||
// Sibling layers surface heterogeneous pick shapes. Whatever is drawn under
|
||||
// it, the fire card painted on top takes the click (those layers stand aside
|
||||
// under another layer's card, so one click does one thing).
|
||||
const SIBLING_PICKS = [
|
||||
['flights', 'a1b2c3', { id: 'a1b2c3' }],
|
||||
['flights', 'a1b2c3', { primitive: { id: 'a1b2c3' } }],
|
||||
@@ -398,7 +462,7 @@ const SIBLING_PICKS = [
|
||||
];
|
||||
|
||||
for (const [layerId, ownedId, picked] of SIBLING_PICKS) {
|
||||
test(`a ${layerId} pick shaped ${JSON.stringify(picked)} wins over a card hit`, () => {
|
||||
test(`a fire card wins over a ${layerId} pick shaped ${JSON.stringify(picked)}`, () => {
|
||||
const fire = makeFire();
|
||||
registerPickOwner(layerId, (pickedId) => pickedId === ownedId);
|
||||
const h = harness({
|
||||
@@ -408,11 +472,7 @@ for (const [layerId, ownedId, picked] of SIBLING_PICKS) {
|
||||
});
|
||||
try {
|
||||
h.click();
|
||||
assert.equal(
|
||||
h.requests.length,
|
||||
0,
|
||||
`the ${layerId} layer is already acting on this click`,
|
||||
);
|
||||
assert.equal(h.requests.length, 1, 'the card on top acts');
|
||||
} finally {
|
||||
h.cleanup();
|
||||
unregisterPickOwner(layerId);
|
||||
@@ -420,6 +480,135 @@ for (const [layerId, ownedId, picked] of SIBLING_PICKS) {
|
||||
});
|
||||
}
|
||||
|
||||
// A passive owner's pick (a directions route, a flight trail) acts for nobody:
|
||||
// a fire card over it still takes the click, and with no card the pick is
|
||||
// still not empty space, so the selection stays.
|
||||
test('a fire card acts over a passive pick; the bare pick leaves the selection', () => {
|
||||
const fire = makeFire();
|
||||
registerPickOwner('test-route', (pickedId) => pickedId === 'route:line');
|
||||
const carded = harness({
|
||||
fires: [fire],
|
||||
picked: { id: 'route:line' },
|
||||
cardHit: `fire:${fireDetectionKey(fire)}`,
|
||||
});
|
||||
try {
|
||||
carded.click();
|
||||
assert.equal(carded.requests.length, 1, 'the card acts over the route');
|
||||
assert.ok(carded.layer.getSelectedInfo());
|
||||
} finally {
|
||||
carded.cleanup();
|
||||
}
|
||||
const bare = harness({ fires: [fire], picked: { id: 'route:line' } });
|
||||
try {
|
||||
bare.click();
|
||||
assert.equal(bare.requests.length, 0);
|
||||
assert.equal(
|
||||
bare.layer.getSelectedInfo(),
|
||||
null,
|
||||
'nothing to clear or pick',
|
||||
);
|
||||
} finally {
|
||||
bare.cleanup();
|
||||
unregisterPickOwner('test-route');
|
||||
}
|
||||
});
|
||||
|
||||
// A coarse tap on a fire card finds an aircraft nearby through the shared
|
||||
// touch contact. The card on top takes it; the aircraft layer stands aside.
|
||||
test('a fire card takes a tap over a touch contact its layer acts on', (t) => {
|
||||
const previous = globalThis.matchMedia;
|
||||
globalThis.matchMedia = () => ({ matches: true });
|
||||
t.after(() => {
|
||||
if (previous) globalThis.matchMedia = previous;
|
||||
else delete globalThis.matchMedia;
|
||||
});
|
||||
const fire = makeFire();
|
||||
registerPickOwner('test-planes', (pickedId) => pickedId === 'plane:1');
|
||||
t.after(() => unregisterPickOwner('test-planes'));
|
||||
const h = harness({
|
||||
fires: [fire],
|
||||
drilled: [{ id: 'plane:1' }],
|
||||
cardHit: `fire:${fireDetectionKey(fire)}`,
|
||||
});
|
||||
try {
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 1, 'the card takes the tap');
|
||||
assert.ok(h.layer.getSelectedInfo());
|
||||
} finally {
|
||||
h.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
// A touch contact whose layer acts only on exact hits does not take the tap
|
||||
// from our card; with no card, a coarse tap near an aircraft still clears.
|
||||
test('a fire card keeps a tap whose contact does not act; bare taps still clear', (t) => {
|
||||
const previous = globalThis.matchMedia;
|
||||
globalThis.matchMedia = () => ({ matches: true });
|
||||
t.after(() => {
|
||||
if (previous) globalThis.matchMedia = previous;
|
||||
else delete globalThis.matchMedia;
|
||||
});
|
||||
const fire = makeFire();
|
||||
registerPickOwner('test-cameras', (pickedId) => pickedId === 'cam:1');
|
||||
registerPickOwner('test-planes', (pickedId) => pickedId === 'plane:1');
|
||||
t.after(() => {
|
||||
unregisterPickOwner('test-cameras');
|
||||
unregisterPickOwner('test-planes');
|
||||
});
|
||||
const carded = harness({
|
||||
fires: [fire],
|
||||
drilled: [{ id: 'cam:1' }],
|
||||
cardHit: `fire:${fireDetectionKey(fire)}`,
|
||||
});
|
||||
try {
|
||||
carded.click();
|
||||
assert.equal(carded.requests.length, 1, 'the card acts');
|
||||
} finally {
|
||||
carded.cleanup();
|
||||
}
|
||||
const bare = harness({
|
||||
fires: [fire],
|
||||
picked: glowPick('firms-7'),
|
||||
drilled: [{ id: 'plane:1' }],
|
||||
});
|
||||
try {
|
||||
bare.click();
|
||||
assert.ok(bare.layer.getSelectedInfo(), 'a fire is selected');
|
||||
// Nothing exact now; the touch contact is an aircraft, with no card.
|
||||
bare.setPicked(null);
|
||||
bare.click();
|
||||
assert.equal(bare.layer.getSelectedInfo(), null, 'the bare tap clears');
|
||||
} finally {
|
||||
bare.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
// The aircraft layer runs first. Under the fire card painted over its plane
|
||||
// it stands aside, so the card takes the click: one action, in either order.
|
||||
test('a fire card over an aircraft takes the click; the aircraft does not track', (t) => {
|
||||
const fire = makeFire();
|
||||
let tracked = null;
|
||||
registerPickOwner('test-planes', (pickedId) => pickedId === 'plane:9');
|
||||
t.after(() => unregisterPickOwner('test-planes'));
|
||||
const h = harness({
|
||||
fires: [fire],
|
||||
picked: { id: 'plane:9' },
|
||||
cardHit: `fire:${fireDetectionKey(fire)}`,
|
||||
firstClick: (event) => {
|
||||
if (isUnderOtherCard(event)) return;
|
||||
if (event.hit?.id === 'plane:9') tracked = 'plane:9';
|
||||
},
|
||||
});
|
||||
try {
|
||||
h.click();
|
||||
assert.equal(tracked, null, 'the aircraft does not track');
|
||||
assert.equal(h.requests.length, 1, 'the fire card acts');
|
||||
assert.ok(h.layer.getSelectedInfo());
|
||||
} finally {
|
||||
h.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('a stale card id resolves to nothing instead of an arbitrary fire', () => {
|
||||
const h = harness({
|
||||
picked: { primitive: {}, content: {}, featureId: 0 },
|
||||
@@ -649,6 +838,16 @@ test('far zoom drapes one heatmap and the hand-off cross-fades it with the marke
|
||||
assert.equal(added[0].alpha, 0.5);
|
||||
assert.equal(glow(1).alpha, 0.5, 'rebuilt markers get the fade');
|
||||
|
||||
// An application drawing the detections in their place hides both.
|
||||
h.layer.setMarkerStandIn({ hitTest: () => null });
|
||||
assert.equal(added[0].show, false, 'a stand-in hides the heatmap');
|
||||
assert.equal(markers().show, false, 'and the markers');
|
||||
h.layer._renderLodForTest('global');
|
||||
assert.equal(added[0].show, false, 'through a rebuild too');
|
||||
h.layer.setMarkerStandIn(null);
|
||||
assert.equal(added[0].show, true);
|
||||
assert.equal(markers().show, true);
|
||||
|
||||
h.layer.disable();
|
||||
assert.equal(added[0].show, false, 'disable hides the heatmap');
|
||||
|
||||
@@ -660,3 +859,161 @@ test('far zoom drapes one heatmap and the hand-off cross-fades it with the marke
|
||||
restoreDocument();
|
||||
}
|
||||
});
|
||||
|
||||
test('a click on a fire an application draws in place of the markers selects it as a marker click does', () => {
|
||||
const fire = makeFire();
|
||||
const other = makeFire({ index: 8, lat: 31.2, lon: -97.9, frp: 40 });
|
||||
// The application's records come from the same source, adapted on their own.
|
||||
let answer = { ...fire };
|
||||
const asked = [];
|
||||
const h = harness({ fires: [fire, other], picked: glowPick('firms-8') });
|
||||
try {
|
||||
h.layer.setMarkerStandIn({
|
||||
hitTest: (screen) => {
|
||||
asked.push(screen);
|
||||
return answer;
|
||||
},
|
||||
});
|
||||
assert.equal(h.icons().show, false, 'the glows are hidden');
|
||||
h.published.length = 0;
|
||||
h.click();
|
||||
assert.deepEqual(asked, [{ x: 400, y: 300 }]);
|
||||
assert.equal(h.requests.length, 1, 'the camera moves as for a marker');
|
||||
assert.equal(h.requests[0].kind, 'fire');
|
||||
assert.equal(
|
||||
h.requests[0].id,
|
||||
fireDetectionKey(fire),
|
||||
'the stand-in decides, not the hidden glow under the click',
|
||||
);
|
||||
assert.equal('rangeM' in h.requests[0], false, 'the usual fire framing');
|
||||
assert.equal(h.layer.getSelectedInfo().id, fireDetectionKey(fire));
|
||||
assert.equal(getSelectedEntityContext().label, 'Fire · FRP 1520 MW');
|
||||
assert.deepEqual(
|
||||
h.published.map((entry) => entry.id),
|
||||
[`selected-fire:${fireDetectionKey(fire)}`],
|
||||
"only the selected fire's card shows",
|
||||
);
|
||||
|
||||
// Nothing of the application's under the click: empty space.
|
||||
answer = null;
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 1, 'no camera move');
|
||||
assert.equal(h.layer.getSelectedInfo(), null, 'the selection is cleared');
|
||||
} finally {
|
||||
h.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('a stand-in that draws a fire larger says how far the camera stands from it', () => {
|
||||
const fire = makeFire();
|
||||
const asked = [];
|
||||
let range = 24_000;
|
||||
const h = harness({ fires: [fire] });
|
||||
try {
|
||||
h.layer.setMarkerStandIn({
|
||||
hitTest: () => ({ ...fire }),
|
||||
focusRangeM: (record) => {
|
||||
asked.push(fireDetectionKey(record));
|
||||
return range;
|
||||
},
|
||||
});
|
||||
h.click();
|
||||
assert.deepEqual(asked, [fireDetectionKey(fire)]);
|
||||
assert.equal(h.requests.at(-1).rangeM, 24_000);
|
||||
// No range for this fire: the usual fire framing.
|
||||
range = null;
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 2);
|
||||
assert.equal('rangeM' in h.requests.at(-1), false);
|
||||
} finally {
|
||||
h.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('a stand-in hit on a fire the layer does not show selects nothing', () => {
|
||||
const fire = makeFire();
|
||||
const h = harness({ fires: [fire] });
|
||||
try {
|
||||
h.layer.setMarkerStandIn({
|
||||
hitTest: () => makeFire({ lat: 12.5, lon: 40.1 }),
|
||||
});
|
||||
h.click();
|
||||
assert.equal(h.requests.length, 0);
|
||||
assert.equal(h.layer.getSelectedInfo(), null);
|
||||
} finally {
|
||||
h.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('taking the stand-in away brings the markers and their cards back and keeps the selection', () => {
|
||||
const fire = makeFire();
|
||||
const h = harness({
|
||||
fires: [fire],
|
||||
// Near enough for the markers rather than the heatmap.
|
||||
cameraPosition: Cesium.Cartesian3.fromDegrees(fire.lon, fire.lat, 500_000),
|
||||
});
|
||||
try {
|
||||
h.layer.setMarkerStandIn({ hitTest: () => fire });
|
||||
assert.equal(h.icons().show, false);
|
||||
h.click();
|
||||
h.layer.setMarkerStandIn(null);
|
||||
assert.equal(h.icons().show, true);
|
||||
assert.equal(h.layer.getSelectedInfo().id, fireDetectionKey(fire));
|
||||
const ids = h.published.map((entry) => entry.id);
|
||||
assert.ok(ids.includes(`selected-fire:${fireDetectionKey(fire)}`));
|
||||
} finally {
|
||||
h.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('the stand-in is asked where a marker is picked: the click as the sensor style draws it', () => {
|
||||
const fire = makeFire();
|
||||
const asked = [];
|
||||
const h = harness({ fires: [fire] });
|
||||
try {
|
||||
registerStyleStages(h.viewer.scene, {
|
||||
surveillance: {
|
||||
enabled: true,
|
||||
uniforms: { intensity: 1, pixelation: 4 },
|
||||
},
|
||||
});
|
||||
h.layer.setMarkerStandIn({
|
||||
hitTest: (screen) => {
|
||||
asked.push(screen);
|
||||
return fire;
|
||||
},
|
||||
});
|
||||
h.click();
|
||||
const expected = sensorPickPosition(
|
||||
h.viewer.scene,
|
||||
{ x: 400, y: 300 },
|
||||
h.viewer.scene.canvas,
|
||||
);
|
||||
assert.notDeepEqual([expected.x, expected.y], [400, 300]);
|
||||
assert.deepEqual([asked[0].x, asked[0].y], [expected.x, expected.y]);
|
||||
} finally {
|
||||
h.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("a sibling layer's item over a stand-in fire wins the click", () => {
|
||||
const fire = makeFire();
|
||||
let asked = 0;
|
||||
registerPickOwner('flights', (pickedId) => pickedId === 'a1b2c3');
|
||||
const h = harness({ fires: [fire], picked: { id: 'a1b2c3' } });
|
||||
try {
|
||||
h.layer.setMarkerStandIn({
|
||||
hitTest: () => {
|
||||
asked++;
|
||||
return fire;
|
||||
},
|
||||
});
|
||||
h.click();
|
||||
assert.equal(asked, 0, 'the stand-in is not asked');
|
||||
assert.equal(h.requests.length, 0, 'no camera move');
|
||||
assert.equal(h.layer.getSelectedInfo(), null);
|
||||
} finally {
|
||||
h.cleanup();
|
||||
unregisterPickOwner('flights');
|
||||
}
|
||||
});
|
||||
@@ -1827,6 +1827,44 @@ export class LayerLifecycle {
|
||||
await entry.toggleChain.catch(() => {});
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait until a layer's lifecycle queue is idle, following any request that
|
||||
* joins it while waiting, but no longer than `timeoutMs` or `signal` allows.
|
||||
* @param {string} layerId Layer id.
|
||||
* @param {{signal?: AbortSignal, timeoutMs?: number}} [options]
|
||||
* @returns {Promise<boolean>} true once idle; false on timeout or abort.
|
||||
*/
|
||||
async waitForLayerIdle(layerId, { signal, timeoutMs = 30000 } = {}) {
|
||||
const entry = this.layers.get(layerId);
|
||||
if (!entry) return true;
|
||||
if (signal?.aborted) return false;
|
||||
let timer = null;
|
||||
let onAbort = null;
|
||||
const givenUp = new Promise((resolve) => {
|
||||
timer = setTimeout(() => resolve(false), timeoutMs);
|
||||
onAbort = () => resolve(false);
|
||||
signal?.addEventListener('abort', onAbort, { once: true });
|
||||
});
|
||||
try {
|
||||
let pending;
|
||||
do {
|
||||
pending = entry.toggleChain;
|
||||
const idle = await Promise.race([
|
||||
pending.then(
|
||||
() => true,
|
||||
() => true,
|
||||
),
|
||||
givenUp,
|
||||
]);
|
||||
if (!idle) return false;
|
||||
} while (pending !== entry.toggleChain);
|
||||
return true;
|
||||
} finally {
|
||||
clearTimeout(timer);
|
||||
signal?.removeEventListener('abort', onAbort);
|
||||
}
|
||||
}
|
||||
|
||||
_reserveLayerParamsIntent(layerId, params, origin = 'programmatic') {
|
||||
const entry = this.layers.get(layerId);
|
||||
if (
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
import { createInfrastructureOverlayEntry } from './infrastructureOverlayEntry.js';
|
||||
import { createGeojsonPins } from './geojsonPins.js';
|
||||
import { inputFor as defaultInputFor } from '../input/dispatcher.js';
|
||||
import { isUnderOtherCard } from './pickRegistry.js';
|
||||
import {
|
||||
selectInfraLod,
|
||||
applyInfraEvictionGrace,
|
||||
@@ -1114,6 +1115,9 @@ export function createLocalGeoJsonLayer(
|
||||
const input = inputFor(viewer);
|
||||
_clickSubscription = input.onClick((event) => {
|
||||
if (!_enabled || !_drawn) return;
|
||||
// Another layer's card or label on top takes the click: the
|
||||
// item under it neither acts nor reads as empty space.
|
||||
if (isUnderOtherCard(event)) return;
|
||||
const hit = event.drawHit;
|
||||
if (!hit || !hit.set.startsWith(`${setPrefix}:`)) return;
|
||||
const part = _drawn.parts.get(hit.id);
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from './localGeojsonCore.js';
|
||||
import { localGeoJsonServices } from '../app/localGeojsonServices.js';
|
||||
import { getContextStore } from './contextStore.js';
|
||||
import { setClickCardHitTest } from './pickRegistry.js';
|
||||
import { readEntityRecord } from './entityRecords.js';
|
||||
import { bindFakeGroundRenderer } from '../testSupport/fakeGroundRenderer.mjs';
|
||||
const feature = (id, geometry, properties = { name: `Feature ${id}` }) => ({
|
||||
@@ -161,6 +162,24 @@ test('polygons fill the ground, lines drape, points stand on pins, all shown', a
|
||||
assert.equal(record?.label, 'Feature p');
|
||||
});
|
||||
|
||||
// The card or label painted on top takes the click: a feature under another
|
||||
// layer's card is not selected.
|
||||
test("another layer's card over a drawn part keeps the click", async (t) => {
|
||||
const env = await enabledLayer(t, [
|
||||
feature('p', { type: 'Polygon', coordinates: square(0, 0) }),
|
||||
]);
|
||||
let top = { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' };
|
||||
setClickCardHitTest(() => top);
|
||||
t.after(() => setClickCardHitTest(null));
|
||||
const fills = env.fake.set('fills');
|
||||
const at = { x: 5, y: 5 };
|
||||
env.click({ screenPosition: at, drawHit: { set: fills.spec.id, id: 'p' } });
|
||||
assert.equal(env.fake.flights.length, 0, 'covered: not selected');
|
||||
top = null;
|
||||
env.click({ screenPosition: at, drawHit: { set: fills.spec.id, id: 'p' } });
|
||||
assert.equal(env.fake.flights.length, 1);
|
||||
});
|
||||
|
||||
test('a click on a drawn part selects its feature and flies above it', async (t) => {
|
||||
const env = await enabledLayer(t, [
|
||||
feature('p', { type: 'Polygon', coordinates: square(0, 0) }),
|
||||
|
||||
@@ -36,7 +36,13 @@ places without an English label.
|
||||
The build runs one query at a time with pauses and honours the service's
|
||||
Retry-After; it takes about ten minutes. It fails if a short list of
|
||||
well-known cities is missing from the result, or a known grouping gets in.
|
||||
`meta.built` keeps its earlier date when the rows are unchanged.
|
||||
|
||||
**Limits:** populations are whatever Wikidata states and differ in date and
|
||||
definition between places (city proper, municipality, urban district). Some
|
||||
districts and suburbs appear as their own rows.
|
||||
|
||||
**Finding a place by name:** `findPlace` takes the nearest place of the name
|
||||
within 150 km of the view, else the largest city of the name. When asked,
|
||||
the smaller places of `../wikidata_places` near the view count too, so a
|
||||
village in view comes before a bigger namesake far away.
|
||||
@@ -1,8 +1,11 @@
|
||||
# Wikidata places detail tiles
|
||||
|
||||
Smaller towns and villages, below the cut-off of the cities pack
|
||||
(`../wikidata_cities`), for "places nearby" around one picked or named spot. Read by `placesNear` in `src/data/wikidataCities.js`. The app reads
|
||||
these files; it does not call Wikidata or any place service for them.
|
||||
(`../wikidata_cities`), for "places nearby" around one picked or named spot. Read by `placesNear` in `src/data/wikidataCities.js`, and by `findPlace`
|
||||
when asked to look for a small place by name near the view: a place of that
|
||||
name in view, or close to it, comes before a bigger city of the name far
|
||||
away. The app reads these files; it does not call Wikidata or any place
|
||||
service for them.
|
||||
|
||||
| File | Contents |
|
||||
|------|----------|
|
||||
@@ -17,7 +20,12 @@ entry in the index.
|
||||
**Loading:** nothing here loads with the app. A lookup reads `files.js` and
|
||||
the index once, then only the tiles its search box touches (one for a short
|
||||
radius well inside a tile, more near tile edges and for wider searches),
|
||||
once each; at most 64 tiles are kept in memory, the least recently used
|
||||
once each. A lookup reaches 500 km at most (`PLACE_TILE_KM`; the search box
|
||||
asks for 150 km at most), so one asked for a wider radius reads only the
|
||||
tiles around its centre: at most one
|
||||
tile past the centre's own on each side, a few more columns toward the
|
||||
poles, and never all 732. Cities still count to the full radius. At most
|
||||
64 tiles are kept in memory, the least recently used
|
||||
dropped first. Rows whose name has no letter (one row, `380` in Nicaragua) are
|
||||
dropped when a tile is read.
|
||||
|
||||
@@ -39,7 +47,10 @@ names from Wikidata (CC0)" as a courtesy once a name from the pack is shown.
|
||||
`node scripts/build-wikidata-cities.mjs --tiles --min-population 1000 --max-population 15000`.
|
||||
It writes only to this folder (tiles, `index.json`, `files.js`, through
|
||||
`scripts/wikidataPlaceTiles.mjs`) and leaves `../wikidata_cities` alone. It
|
||||
runs one query at a time with pauses and takes a long while.
|
||||
runs one query at a time with pauses and takes a long while. The new files
|
||||
are all written before tiles that the new build has no rows for are
|
||||
removed, and `meta.built` keeps its earlier date when no tile and
|
||||
nothing else in `index.json` changed.
|
||||
|
||||
**Reproducibility:** the step from rows to files is checked offline:
|
||||
`src/tooling/wikidataPlaceTiles.test.mjs` sorts the shipped rows as the
|
||||
|
||||
@@ -1503,6 +1503,43 @@ test('waitForLayerSettled defers reconciliation until the captured queue complet
|
||||
await mgr.destroyAll();
|
||||
});
|
||||
|
||||
test('waitForLayerIdle follows queued requests and gives up at its bound', async () => {
|
||||
const mgr = new DataLayerManager({});
|
||||
const gates = [];
|
||||
const layer = makeSlowLayer('satellites', { updateInterval: 0 });
|
||||
layer.module.enable = () => new Promise((resolve) => { gates.push(resolve); });
|
||||
mgr.register(layer.module);
|
||||
assert.equal(await mgr.waitForLayerIdle('satellites'), true, 'idle at once');
|
||||
assert.equal(await mgr.waitForLayerIdle('unknown-layer'), true);
|
||||
|
||||
const first = mgr.setEnabled('satellites', true);
|
||||
while (!gates.length) await new Promise((resolve) => setTimeout(resolve, 1));
|
||||
let idle = null;
|
||||
const waiting = mgr.waitForLayerIdle('satellites', { timeoutMs: 1000 })
|
||||
.then((value) => { idle = value; });
|
||||
// A request that joins the queue while waiting is waited for too.
|
||||
const second = mgr.setEnabled('satellites', false);
|
||||
gates[0]();
|
||||
await Promise.all([first, second, waiting]);
|
||||
assert.equal(idle, true);
|
||||
|
||||
// A queue that never drains returns false at the deadline or on abort.
|
||||
const hung = mgr.setEnabled('satellites', true);
|
||||
assert.equal(await mgr.waitForLayerIdle('satellites', { timeoutMs: 20 }), false);
|
||||
const controller = new AbortController();
|
||||
const aborted = mgr.waitForLayerIdle('satellites', { signal: controller.signal });
|
||||
controller.abort();
|
||||
assert.equal(await aborted, false);
|
||||
assert.equal(
|
||||
await mgr.waitForLayerIdle('satellites', { signal: controller.signal }),
|
||||
false,
|
||||
'an already aborted signal returns at once',
|
||||
);
|
||||
for (const release of gates) release();
|
||||
await hung;
|
||||
await mgr.destroyAll();
|
||||
});
|
||||
|
||||
test('programmatic Context enables neither create nor replace a restoration snapshot', async () => {
|
||||
const mgr = new DataLayerManager({});
|
||||
const missions = makeSlowLayer('rocket-launches', { updateInterval: 0 });
|
||||
@@ -1854,10 +1891,10 @@ test('pre-transition subscribers capture the exact enabled set before user chang
|
||||
|
||||
test('absolute Context entry intent is excluded from its own pre-entry restore snapshot', async () => {
|
||||
const mgr = new DataLayerManager({});
|
||||
const missions = makeSlowLayer('rocket-launches', { updateInterval: 0 });
|
||||
const satellites = makeSlowLayer('satellites', { updateInterval: 0 });
|
||||
mgr.register(missions.module);
|
||||
mgr.register(satellites.module);
|
||||
const contacts = makeSlowLayer('military-awareness', { updateInterval: 0 });
|
||||
const flights = makeSlowLayer('flights', { updateInterval: 0 });
|
||||
mgr.register(contacts.module);
|
||||
mgr.register(flights.module);
|
||||
let snapshot = null;
|
||||
mgr.subscribe((change) => {
|
||||
if (shouldCaptureContextSession(change)) {
|
||||
@@ -1869,13 +1906,13 @@ test('absolute Context entry intent is excluded from its own pre-entry restore s
|
||||
}
|
||||
});
|
||||
|
||||
await mgr.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
await mgr.setEnabled('military-awareness', true, { origin: 'user' });
|
||||
assert.deepEqual([...snapshot], []);
|
||||
await mgr.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await mgr.setEnabled('military-awareness', false, { origin: 'user' });
|
||||
await mgr.restoreEnabledLayerIds(snapshot, { origin: 'context-restore' });
|
||||
|
||||
assert.equal(mgr.isEnabled('rocket-launches'), false);
|
||||
assert.equal(mgr.isEnabled('satellites'), false);
|
||||
assert.equal(mgr.isEnabled('military-awareness'), false);
|
||||
assert.equal(mgr.isEnabled('flights'), false);
|
||||
await mgr.destroyAll();
|
||||
});
|
||||
|
||||
|
||||
@@ -145,3 +145,59 @@ export function pickContact(query, position, options = {}) {
|
||||
}
|
||||
return picked;
|
||||
}
|
||||
|
||||
/**
|
||||
* The world overlay's hit test: the topmost interactive card or label painted
|
||||
* at CSS-pixel coordinates, or null. Set by the overlay host while it runs.
|
||||
* @type {((x: number, y: number) => {sourceId: string, entryId: string}|null)|null}
|
||||
*/
|
||||
let _overlayHitTest = null;
|
||||
/** @type {WeakMap<object, {sourceId: string, entryId: string}|null>} */
|
||||
const clickCards = new WeakMap();
|
||||
|
||||
/**
|
||||
* Sets (or with null, clears) the hit test that names the card or label
|
||||
* painted at a click. The world-overlay host sets it while it runs.
|
||||
* @param {((x: number, y: number) => object|null)|null} hitTest
|
||||
* @returns {void}
|
||||
*/
|
||||
export function setClickCardHitTest(hitTest) {
|
||||
_overlayHitTest = typeof hitTest === 'function' ? hitTest : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The topmost interactive card or label painted at a click, read once per
|
||||
* click so every handler of it sees the same one whatever ran first.
|
||||
* @param {{screenPosition?: {x: number, y: number}}|null|undefined} click
|
||||
* @returns {{sourceId: string, entryId: string}|null}
|
||||
*/
|
||||
export function clickCard(click) {
|
||||
if (!click || typeof click !== 'object') return null;
|
||||
if (clickCards.has(click)) return clickCards.get(click);
|
||||
const at = click.screenPosition;
|
||||
let card = null;
|
||||
try {
|
||||
card = _overlayHitTest?.(at?.x, at?.y) ?? null;
|
||||
} catch {
|
||||
// a broken hit test must never break click handling
|
||||
}
|
||||
clickCards.set(click, card);
|
||||
return card;
|
||||
}
|
||||
|
||||
/**
|
||||
* True when another layer's card or label is painted on top at a click. The
|
||||
* card on top takes the click: a scene item under it does not act, and is
|
||||
* not empty space either, so the layer leaves its selection alone.
|
||||
* @param {object} click The shared dispatcher event.
|
||||
* @param {Iterable<string>} [ownSourceIds] The asking layer's overlay
|
||||
* sources: its own card on top is its click.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isUnderOtherCard(click, ownSourceIds = []) {
|
||||
const card = clickCard(click);
|
||||
if (!card) return false;
|
||||
for (const sourceId of ownSourceIds)
|
||||
if (card.sourceId === sourceId) return false;
|
||||
return true;
|
||||
}
|
||||
@@ -17,6 +17,9 @@ import {
|
||||
isOwnedByOtherLayer,
|
||||
resolvePickId,
|
||||
pickContact,
|
||||
clickCard,
|
||||
isUnderOtherCard,
|
||||
setClickCardHitTest,
|
||||
} from './pickRegistry.js';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -197,3 +200,40 @@ test('touch picking tolerates a failing drill and preserves empty sky', (t) => {
|
||||
])
|
||||
assert.equal(pickContact(query(null, drillPick), { x: 1, y: 1 }), null);
|
||||
});
|
||||
|
||||
test("the card on top is read once per click, and only another layer's card counts", () => {
|
||||
let top = { sourceId: 'quake-card', entryId: 'q1' };
|
||||
let reads = 0;
|
||||
setClickCardHitTest((x, y) => {
|
||||
reads++;
|
||||
assert.deepEqual([x, y], [4, 5]);
|
||||
return top;
|
||||
});
|
||||
try {
|
||||
const click = { screenPosition: { x: 4, y: 5 } };
|
||||
assert.equal(isUnderOtherCard(click, ['vessel-card']), true);
|
||||
assert.equal(isUnderOtherCard(click, ['quake-card']), false, 'own card');
|
||||
// A card published later in the same click does not change it.
|
||||
top = { sourceId: 'vessel-card', entryId: 'v1' };
|
||||
assert.equal(clickCard(click).sourceId, 'quake-card');
|
||||
assert.equal(reads, 1);
|
||||
assert.equal(isUnderOtherCard({ screenPosition: { x: 4, y: 5 } }), true);
|
||||
top = null;
|
||||
assert.equal(isUnderOtherCard({ screenPosition: { x: 4, y: 5 } }), false);
|
||||
} finally {
|
||||
setClickCardHitTest(null);
|
||||
}
|
||||
assert.equal(
|
||||
isUnderOtherCard({ screenPosition: { x: 4, y: 5 } }),
|
||||
false,
|
||||
'no host',
|
||||
);
|
||||
setClickCardHitTest(() => {
|
||||
throw new Error('broken');
|
||||
});
|
||||
try {
|
||||
assert.equal(clickCard({ screenPosition: { x: 1, y: 1 } }), null);
|
||||
} finally {
|
||||
setClickCardHitTest(null);
|
||||
}
|
||||
});
|
||||
+50
-25
@@ -217,6 +217,15 @@ const TILE_DEG = 5;
|
||||
* far more than one lookup touches, and bounds what a long session keeps.
|
||||
*/
|
||||
const MAX_TILES = 64;
|
||||
/**
|
||||
* How far out small places are looked for, in km. 500 km is under the 556 km
|
||||
* that 5 degrees of latitude span, so a lookup's tile box reaches at most one
|
||||
* tile past the point's own on each side: 3 rows, and 3 columns at the
|
||||
* equator (more toward the poles, where tiles narrow). A lookup asked for a
|
||||
* wider radius, up to the whole globe, still reads only those tiles; cities
|
||||
* count to its full radius.
|
||||
*/
|
||||
export const PLACE_TILE_KM = 500;
|
||||
const NAMED = /\p{L}/u;
|
||||
const tiles = new Map();
|
||||
let loadTileIndex;
|
||||
@@ -248,9 +257,11 @@ async function readPlaceTiles(latitude, longitude, radiusKm, fetchImpl) {
|
||||
readPlacePack(INDEX_URL(), fetchImpl),
|
||||
);
|
||||
const index = await loadTileIndex();
|
||||
const keys = tileKeysAround(latitude, longitude, radiusKm).filter(
|
||||
(key) => index.tiles[key],
|
||||
);
|
||||
const keys = tileKeysAround(
|
||||
latitude,
|
||||
longitude,
|
||||
Math.min(radiusKm, PLACE_TILE_KM),
|
||||
).filter((key) => index.tiles[key]);
|
||||
// A tile that cannot be read is left out: the places of the others,
|
||||
// and the cities, are still the answer.
|
||||
const settled = await Promise.allSettled(
|
||||
@@ -281,7 +292,10 @@ async function readPlacePack(url, fetchImpl) {
|
||||
return response.json();
|
||||
}
|
||||
|
||||
/** Named cities and smaller places around one point, nearest first. */
|
||||
/**
|
||||
* Named cities and smaller places around one point, nearest first. Smaller
|
||||
* places are looked for within PLACE_TILE_KM only.
|
||||
*/
|
||||
export async function placesNear(
|
||||
{ latitude, longitude, radiusKm = 10, limit = 6 },
|
||||
fetchImpl = (...args) => globalThis.fetch(...args),
|
||||
@@ -325,7 +339,14 @@ export async function placesNear(
|
||||
const found = [
|
||||
...cities.filter((city) => city.distanceKm <= radius),
|
||||
...detail
|
||||
.flatMap((source) => citiesWithin(source, latitude, longitude, radius))
|
||||
.flatMap((source) =>
|
||||
citiesWithin(
|
||||
source,
|
||||
latitude,
|
||||
longitude,
|
||||
Math.min(radius, PLACE_TILE_KM),
|
||||
),
|
||||
)
|
||||
.filter((place) => !twinOfCity(place)),
|
||||
];
|
||||
const seen = new Set();
|
||||
@@ -339,12 +360,13 @@ export async function placesNear(
|
||||
const TWIN_KM = 3;
|
||||
|
||||
/**
|
||||
* The city with this name, or null. A qualifier after a comma that names a
|
||||
* country ("Paris, France", "Paris, US") keeps only cities there, and finds
|
||||
* The place with this name, or null. A qualifier after a comma that names a
|
||||
* country ("Paris, France", "Paris, US") keeps only places there, and finds
|
||||
* nothing when none is; one that names no country ("Paris, Texas") is
|
||||
* ignored. A city of that name within `radiusKm` of `near` (the view) wins,
|
||||
* the nearest first, else the largest city of that name anywhere. Omnibar
|
||||
* can also ask for a smaller place nearby when the cities pack has no match.
|
||||
* ignored. A place of that name within `radiusKm` of `near` (the view) wins,
|
||||
* the nearest first, else the largest city of that name anywhere. With
|
||||
* `includeSmallPlaces`, the smaller places of the detail tiles near the view
|
||||
* count too: a village in view comes before a far bigger city of its name.
|
||||
*/
|
||||
export async function findPlace(
|
||||
name,
|
||||
@@ -360,20 +382,6 @@ export async function findPlace(
|
||||
const cities = (names.get(wanted) || []).filter(
|
||||
(row) => !country || row[4] === country,
|
||||
);
|
||||
if (!cities.length) {
|
||||
if (!includeSmallPlaces || !near) return null;
|
||||
const nearby = await placesNear(
|
||||
{ ...near, radiusKm, limit: Infinity },
|
||||
fetchImpl,
|
||||
);
|
||||
return (
|
||||
nearby.find(
|
||||
(place) =>
|
||||
foldName(place.name) === wanted &&
|
||||
(!country || place.country === country),
|
||||
) ?? null
|
||||
);
|
||||
}
|
||||
if (Number.isFinite(near?.latitude) && Number.isFinite(near?.longitude)) {
|
||||
let best = null;
|
||||
for (const row of cities) {
|
||||
@@ -381,7 +389,24 @@ export async function findPlace(
|
||||
if (km <= radiusKm && (!best || km < best.distanceKm))
|
||||
best = toCity(row, km);
|
||||
}
|
||||
if (includeSmallPlaces) {
|
||||
const nearby = await placesNear(
|
||||
{
|
||||
latitude: near.latitude,
|
||||
longitude: near.longitude,
|
||||
radiusKm,
|
||||
limit: Infinity,
|
||||
},
|
||||
fetchImpl,
|
||||
);
|
||||
const small = nearby.find(
|
||||
(place) =>
|
||||
foldName(place.name) === wanted &&
|
||||
(!country || place.country === country),
|
||||
);
|
||||
if (small && (!best || small.distanceKm < best.distanceKm)) best = small;
|
||||
}
|
||||
if (best) return best;
|
||||
}
|
||||
return toCity(cities[0], 0);
|
||||
return cities.length ? toCity(cities[0], 0) : null;
|
||||
}
|
||||
@@ -96,6 +96,66 @@ test('findPlace takes a country qualifier and prefers a namesake in view', async
|
||||
);
|
||||
});
|
||||
|
||||
test('a small place in view comes before a far bigger city of its name', async () => {
|
||||
const module = await import(`./wikidataCities.js?small-${Date.now()}`);
|
||||
// A village called Paris near Austin, in the 30_-100 detail tile.
|
||||
const village = ['Paris', 30.4, -97.6, 1200, 'US', 'Q-village'];
|
||||
const fetchImpl = async (url) => {
|
||||
const file = url.pathname.split('/').at(-1);
|
||||
const body =
|
||||
file === 'cities.json'
|
||||
? { meta: {}, rows: PARIS }
|
||||
: file === 'index.json'
|
||||
? { tiles: { '30_-100': 1 } }
|
||||
: { rows: file === '30_-100.json' ? [village] : [] };
|
||||
return { ok: true, json: async () => body };
|
||||
};
|
||||
const find = (name, near) =>
|
||||
module.findPlace(name, { near, includeSmallPlaces: true }, fetchImpl);
|
||||
const austin = { latitude: 30.27, longitude: -97.74 };
|
||||
assert.equal((await find('Paris', austin)).wikidata, 'Q-village');
|
||||
assert.ok((await find('Paris', austin)).distanceKm < 20);
|
||||
// A bigger namesake inside a wider search: the nearer village still wins.
|
||||
assert.equal(
|
||||
(
|
||||
await module.findPlace(
|
||||
'Paris',
|
||||
{ near: austin, radiusKm: 600, includeSmallPlaces: true },
|
||||
fetchImpl,
|
||||
)
|
||||
).wikidata,
|
||||
'Q-village',
|
||||
);
|
||||
// Only when small places are asked for.
|
||||
assert.equal(
|
||||
(await module.findPlace('Paris', { near: austin }, fetchImpl)).wikidata,
|
||||
'Q90',
|
||||
);
|
||||
// A qualifier still decides.
|
||||
assert.equal((await find('Paris, France', austin)).wikidata, 'Q90');
|
||||
// Nowhere near the village: the largest city of the name.
|
||||
assert.equal(
|
||||
(await find('Paris', { latitude: 0, longitude: 0 })).wikidata,
|
||||
'Q90',
|
||||
);
|
||||
assert.equal(
|
||||
(await module.findPlace('Paris', {}, fetchImpl)).wikidata,
|
||||
'Q90',
|
||||
);
|
||||
// Paris, Texas is nearer a view over it than the village is.
|
||||
const texas = { latitude: 33.6, longitude: -95.6 };
|
||||
assert.equal(
|
||||
(
|
||||
await module.findPlace(
|
||||
'Paris',
|
||||
{ near: texas, radiusKm: 600, includeSmallPlaces: true },
|
||||
fetchImpl,
|
||||
)
|
||||
).wikidata,
|
||||
'Q830149',
|
||||
);
|
||||
});
|
||||
|
||||
test('a circle that reaches a pole spans every longitude', () => {
|
||||
assert.equal(lonHalfSpan(89, 150), 180);
|
||||
assert.ok(lonHalfSpan(60, 150) < 3);
|
||||
@@ -232,3 +292,50 @@ test('a tile that cannot be read leaves the other places and the cities', async
|
||||
assert.ok(near.some((place) => place.name === 'Austin'));
|
||||
assert.ok(near.some((place) => place.longitude > -95));
|
||||
});
|
||||
|
||||
test('a lookup asked for the whole globe reads only the tiles near its centre', async () => {
|
||||
const { placesNear, PLACE_TILE_KM } =
|
||||
await import('./wikidataCities.js?globe');
|
||||
const fetched = [];
|
||||
const fetchPack = async (url) => {
|
||||
fetched.push(url.pathname.split('/').at(-1));
|
||||
return new Response(await readFile(url));
|
||||
};
|
||||
const near = await placesNear(
|
||||
{ latitude: 30.27, longitude: -97.74, radiusKm: 20000, limit: 50 },
|
||||
fetchPack,
|
||||
);
|
||||
const tileReads = fetched
|
||||
.filter((name) => /^-?\d+_-?\d+\.json$/.test(name))
|
||||
.sort();
|
||||
// 500 km around Austin: latitude 25.8 to 34.8, longitude -103 to -92.5.
|
||||
assert.equal(PLACE_TILE_KM, 500);
|
||||
assert.deepEqual(tileReads, [
|
||||
'25_-100.json',
|
||||
'25_-105.json',
|
||||
'25_-95.json',
|
||||
'30_-100.json',
|
||||
'30_-105.json',
|
||||
'30_-95.json',
|
||||
]);
|
||||
assert.equal(near.length, 50);
|
||||
assert.ok(near.every((place) => place.distanceKm <= PLACE_TILE_KM));
|
||||
// Cities still count to the full radius.
|
||||
const far = await placesNear(
|
||||
{ latitude: 30.27, longitude: -97.74, radiusKm: 20000, limit: Infinity },
|
||||
fetchPack,
|
||||
);
|
||||
assert.ok(far.some((place) => place.wikidata === 'Q90'));
|
||||
// Places from the tiles it read stop at 500 km too: Tahoka, Texas
|
||||
// (Q982084), a town of about 2,500, is 500.6 km away.
|
||||
assert.ok(!far.some((place) => place.wikidata === 'Q982084'));
|
||||
assert.ok(
|
||||
far
|
||||
.filter((place) => place.distanceKm > PLACE_TILE_KM)
|
||||
.every((place) => place.population >= 15000),
|
||||
);
|
||||
assert.equal(
|
||||
fetched.filter((name) => /^-?\d+_-?\d+\.json$/.test(name)).length,
|
||||
tileReads.length,
|
||||
);
|
||||
});
|
||||
@@ -36,7 +36,7 @@ function visual(value, path, legacy) {
|
||||
const specs = {
|
||||
bloom: { enabled: 'boolean', intensity: [-100, 10000], version: [1, 100] },
|
||||
sharpen: { enabled: 'boolean', intensity: [0, 100] },
|
||||
hud: { visible: 'boolean', variant: 'string' },
|
||||
hud: { visible: 'boolean', variant: 'string', sonar: 'boolean' },
|
||||
detection: {
|
||||
mode: 'string',
|
||||
density: [0, 100],
|
||||
|
||||
@@ -168,3 +168,30 @@ test('captured scope and extended detection edits survive migration', () => {
|
||||
project.scenes[0].shots[0].visual.detection,
|
||||
);
|
||||
});
|
||||
|
||||
test('a shot keeps Sonar beside its HUD layout; one without it reads as before', () => {
|
||||
const project = fixture();
|
||||
const shot = project.scenes[0].shots[0];
|
||||
shot.visual = { hud: { visible: true, variant: 'minimal', sonar: true } };
|
||||
const read = (p) =>
|
||||
normalizeProject(parseSceneDocument(JSON.stringify(p))).scenes[0].shots[0]
|
||||
.visual.hud;
|
||||
assert.deepEqual(read(project), {
|
||||
visible: true,
|
||||
variant: 'minimal',
|
||||
sonar: true,
|
||||
});
|
||||
// Older shots name no Sonar: the layout alone, Cyber included, as before.
|
||||
for (const variant of ['minimal', 'cyber']) {
|
||||
shot.visual = { hud: { visible: true, variant } };
|
||||
assert.deepEqual(read(project), { visible: true, variant });
|
||||
}
|
||||
// Off is the meaning of an absent field, so it is not kept.
|
||||
shot.visual = { hud: { variant: 'minimal', sonar: false } };
|
||||
assert.equal(Object.hasOwn(read(project), 'sonar'), false);
|
||||
shot.visual = { hud: { variant: 'minimal', sonar: 'on' } };
|
||||
assert.throws(
|
||||
() => validateSceneDocument(project),
|
||||
/\$\.scenes\[0\]\.shots\[0\]\.visual\.hud\.sonar/,
|
||||
);
|
||||
});
|
||||
+14
-4
@@ -26,7 +26,17 @@ export function environmentalLabel(choice = ENVIRONMENTAL_LABEL_CHOICE) {
|
||||
return { title: t(key) };
|
||||
}
|
||||
|
||||
/** The status line between missions. */
|
||||
export const FIRST_RUN_TIP = msg(
|
||||
'Tip: the GEV MIC button in the dock lets you talk to the map.',
|
||||
);
|
||||
/**
|
||||
* The outbound links the first-run card offers.
|
||||
* @type {Readonly<Record<string, string>>}
|
||||
*/
|
||||
export const FIRST_RUN_LINKS = Object.freeze({
|
||||
/** The open-source repository. */
|
||||
source: 'https://github.com/bilawalsidhu/gods-eye-view',
|
||||
youtube: 'https://www.youtube.com/@bilawalsidhu',
|
||||
x: 'https://x.com/bilawalsidhu',
|
||||
instagram: 'https://www.instagram.com/bilawal.ai',
|
||||
linkedin: 'https://www.linkedin.com/in/bilawalsidhu',
|
||||
website: 'https://bilawal.ai',
|
||||
halfpixel: 'https://halfpixel.ai',
|
||||
});
|
||||
+38
-53
@@ -23,13 +23,12 @@ import { createSurfaceKeyboard } from './ui/surfaceKeyboard.js';
|
||||
|
||||
import { t, msg } from './i18n/index.js';
|
||||
import { EXCLUSIVE_SURFACE_CLASSES } from './exclusiveSurfaces.js';
|
||||
import { FIRST_RUN_TIP, environmentalLabel } from './firstRunCopy.js';
|
||||
import { environmentalLabel } from './firstRunCopy.js';
|
||||
import { useFirstRunStore } from './ui/stores/firstRun.js';
|
||||
import { applicationPinia } from './ui/vueRuntime.js';
|
||||
|
||||
export {
|
||||
ENVIRONMENTAL_LABEL_CHOICE,
|
||||
FIRST_RUN_TIP,
|
||||
environmentalLabel,
|
||||
} from './firstRunCopy.js';
|
||||
|
||||
@@ -53,11 +52,12 @@ export const FIRST_RUN_SESSION_KEY = 'gev:first-run-mission-session:v1';
|
||||
* TOUCHED, DURABLE layer enables for the mission's OWN layers, at
|
||||
* `origin: 'user'` — identical to clicking those rows.
|
||||
* Choosing ENVIRONMENTAL *is* choosing those layers.
|
||||
* TOUCHED, DURABLE the Context panel reveal, but only for the two
|
||||
* Context missions, exactly as the visible Contacts /
|
||||
* Space Missions tabs do it. The globe missions open no
|
||||
* panel at all — nothing there needs explaining, and a
|
||||
* panel-collapse write is a pref nobody chose.
|
||||
* TOUCHED, DURABLE the Space Missions panel, which opens as it does when
|
||||
* its layer is switched on from its Data Layers row.
|
||||
* No mission reveals the Context panel, and the globe
|
||||
* missions open no panel at all — nothing there needs
|
||||
* explaining, and a panel-collapse write is a pref
|
||||
* nobody chose.
|
||||
* TOUCHED, SESSION the camera. Never persisted by anything.
|
||||
* NOT TOUCHED detection mode + density. The reasonable-defaults
|
||||
* landing owns the DENSE/75 start, and Contacts owns
|
||||
@@ -66,8 +66,8 @@ export const FIRST_RUN_SESSION_KEY = 'gev:first-run-mission-session:v1';
|
||||
* NOT TOUCHED `_detectionUserOverridden`. Setting it would mean "the
|
||||
* operator hand-edited detection" and would silently
|
||||
* kill the CRT/NVG/FLIR auto-preset contract for the
|
||||
* whole session. Missions run through setContextMode and
|
||||
* DataManager.setEnabled, neither of which writes it.
|
||||
* whole session. Missions run through
|
||||
* DataManager.setEnabled, which does not write it.
|
||||
* NOT TOUCHED detection allocation (`gev:detection-allocation:v1`),
|
||||
* 3D aircraft models, scope feather. All are defaults or
|
||||
* separate durable prefs the visitor did not choose here.
|
||||
@@ -75,21 +75,17 @@ export const FIRST_RUN_SESSION_KEY = 'gev:first-run-mission-session:v1';
|
||||
* `_setModels3dMode`, which default to origin 'user' and
|
||||
* would persist a 3D choice nobody made.
|
||||
*
|
||||
* The two Context missions deliberately reuse `styleManager.setContextMode`, the
|
||||
* same facade the visible tabs and voice use, so Contacts detection ownership,
|
||||
* layer isolation and rollback stay in exactly one place.
|
||||
* Every mission is an ordinary layer choice, switched on like clicking its row,
|
||||
* so no mission enters a Context mode.
|
||||
*/
|
||||
|
||||
/** @type {Readonly<Record<string, object>>} */
|
||||
export const FIRST_RUN_MISSIONS = Object.freeze({
|
||||
contacts: Object.freeze({
|
||||
kind: 'context',
|
||||
contextMode: 'contacts',
|
||||
busyKey: msg('Starting live contacts…'),
|
||||
}),
|
||||
'space-missions': Object.freeze({
|
||||
kind: 'context',
|
||||
contextMode: 'space-missions',
|
||||
// An ordinary layer with its own panel: no camera flight, and its panel
|
||||
// opens as it does for a click on its Data Layers row.
|
||||
kind: 'layer',
|
||||
layerIds: Object.freeze(['rocket-launches']),
|
||||
busyKey: msg('Opening space missions…'),
|
||||
}),
|
||||
environmental: Object.freeze({
|
||||
@@ -246,28 +242,27 @@ export function rememberFirstRunSessionDismissed(sessionStorageRef) {
|
||||
*
|
||||
* @param {string} choice Key of FIRST_RUN_MISSIONS.
|
||||
* @param {object} deps
|
||||
* @param {(mode: string) => Promise<object>} deps.setContextMode
|
||||
* @param {(layerId: string) => Promise<boolean>} deps.setLayerEnabled
|
||||
* @param {() => Promise<any>} deps.flyToGlobe
|
||||
* @returns {Promise<{ok: boolean, choice: string, result?: object, failedLayerIds?: string[]}>}
|
||||
* @returns {Promise<{ok: boolean, choice: string, failedLayerIds?: string[]}>}
|
||||
*/
|
||||
export async function runFirstRunChoice(
|
||||
choice,
|
||||
{ setContextMode, setLayerEnabled, flyToGlobe },
|
||||
{ setLayerEnabled, flyToGlobe },
|
||||
) {
|
||||
const mission = FIRST_RUN_MISSIONS[choice];
|
||||
if (!mission) return { ok: false, choice };
|
||||
if (mission.kind === 'none') return { ok: true, choice };
|
||||
if (mission.kind === 'context') {
|
||||
const result = await setContextMode(mission.contextMode);
|
||||
return { ok: Boolean(result?.ok), choice, result };
|
||||
}
|
||||
// Globe missions: start the pull-out and the layer work together so the
|
||||
// camera is already moving while the feeds spin up. The flight is framing,
|
||||
// not the mission — a stalled or superseded flight never fails the tile.
|
||||
const flight = Promise.resolve()
|
||||
.then(() => flyToGlobe())
|
||||
.catch(() => null);
|
||||
// Layer missions keep the camera where it is.
|
||||
const flight =
|
||||
mission.kind === 'globe'
|
||||
? Promise.resolve()
|
||||
.then(() => flyToGlobe())
|
||||
.catch(() => null)
|
||||
: null;
|
||||
const outcomes = await Promise.all(
|
||||
mission.layerIds.map(async (layerId) => {
|
||||
try {
|
||||
@@ -336,16 +331,14 @@ export function initFirstRunExperience({
|
||||
closing: false,
|
||||
state: null,
|
||||
busy: null,
|
||||
status: t(FIRST_RUN_TIP),
|
||||
// Empty until a mission reports progress or an error.
|
||||
status: '',
|
||||
// The tile name is owner-switchable from one constant, so paint it from
|
||||
// the module rather than trusting the markup to match.
|
||||
environmentalTitle: environmentalLabel().title,
|
||||
environmentalSub: t(
|
||||
'Live earthquakes and active fires, from USGS and NASA',
|
||||
),
|
||||
description: t(
|
||||
'It feels like a forbidden cockpit—then you realize the sources are public and the data is real.',
|
||||
),
|
||||
scrollable: null,
|
||||
};
|
||||
let signature = '';
|
||||
@@ -371,7 +364,6 @@ export function initFirstRunExperience({
|
||||
}
|
||||
present({});
|
||||
|
||||
const defaultStatus = view.status;
|
||||
// An error or refused save stays on the status line until the next choice.
|
||||
let stickyStatus = false;
|
||||
let busy = false;
|
||||
@@ -431,10 +423,14 @@ export function initFirstRunExperience({
|
||||
globalThis.removeEventListener?.('resize', onViewportResize);
|
||||
surfaceObserver?.disconnect();
|
||||
const remove = () => {
|
||||
root.removeEventListener('transitionend', onTransitionEnd);
|
||||
store.connect(null);
|
||||
present({ removed: true });
|
||||
};
|
||||
root.addEventListener('transitionend', remove, { once: true });
|
||||
const onTransitionEnd = (event) => {
|
||||
if (event.target === root) remove();
|
||||
};
|
||||
root.addEventListener('transitionend', onTransitionEnd);
|
||||
// `transitionend` never fires under prefers-reduced-motion (no transition),
|
||||
// so a bounded fallback is what actually removes the node there.
|
||||
globalThis.setTimeout?.(remove, 400);
|
||||
@@ -451,7 +447,7 @@ export function initFirstRunExperience({
|
||||
const patch = { state: next ? 'loading' : 'ready', busy: String(next) };
|
||||
if (next)
|
||||
patch.status = t(FIRST_RUN_MISSIONS[choice]?.busyKey || msg('Working…'));
|
||||
else if (!stickyStatus) patch.status = defaultStatus;
|
||||
else if (!stickyStatus) patch.status = '';
|
||||
present(patch);
|
||||
};
|
||||
|
||||
@@ -463,19 +459,6 @@ export function initFirstRunExperience({
|
||||
let outcome = null;
|
||||
try {
|
||||
outcome = await runFirstRunChoice(choice, {
|
||||
setContextMode: async (mode) => {
|
||||
const result = await styleManager.setContextMode(mode);
|
||||
if (result?.ok) {
|
||||
// setContextMode is also a voice/internal facade and deliberately
|
||||
// does not decide panel chrome. This first-run click is an explicit
|
||||
// visual choice, so reveal the result exactly as the visible
|
||||
// Contacts / Space Missions tabs do.
|
||||
styleManager.setPanelCollapsed?.('global-context-panel', false, {
|
||||
explicit: true,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
},
|
||||
// `origin: 'user'` on purpose: a mission tile is a real person choosing
|
||||
// these layers, so it persists exactly as clicking those rows would.
|
||||
setLayerEnabled: (layerId) =>
|
||||
@@ -492,9 +475,7 @@ export function initFirstRunExperience({
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
const failed = outcome?.failedLayerIds?.length
|
||||
? outcome.failedLayerIds
|
||||
: outcome?.result?.failedLayerIds;
|
||||
const failed = outcome?.failedLayerIds;
|
||||
const detail =
|
||||
Array.isArray(failed) && failed.length ? ` (${failed.join(', ')})` : '';
|
||||
stickyStatus = true;
|
||||
@@ -532,6 +513,9 @@ export function initFirstRunExperience({
|
||||
isActive: () => !closing && isTopmost(),
|
||||
onEscape: () => dismiss(),
|
||||
fallbackFocus: () => documentRef.body,
|
||||
// The card sits beside a usable map: Tab from the search bar or any
|
||||
// other control follows the page's order instead of jumping back in.
|
||||
claimOutsideFocus: false,
|
||||
});
|
||||
|
||||
store.connect({
|
||||
@@ -539,6 +523,7 @@ export function initFirstRunExperience({
|
||||
// The same dismissal as ESC, for screens without a keyboard.
|
||||
dismiss: () => dismiss(),
|
||||
suppress: onSuppressChange,
|
||||
refreshLayout: () => syncScrollAffordance(),
|
||||
});
|
||||
// Capture phase: the app binds its own global hotkeys (including bare letters
|
||||
// that cycle detection and styles), and the launcher owns the keyboard first.
|
||||
@@ -564,7 +549,7 @@ export function initFirstRunExperience({
|
||||
present({ visible: true });
|
||||
syncScrollAffordance();
|
||||
root
|
||||
.querySelector('[data-first-run-choice]')
|
||||
.querySelector('[data-first-run-primary]')
|
||||
?.focus?.({ preventScroll: true });
|
||||
});
|
||||
};
|
||||
|
||||
+171
-114
@@ -537,20 +537,13 @@ test('the launcher yields on engage and waits when a surface is already up', ()
|
||||
// ── Per-mission behavior ─────────────────────────────────────────────────────
|
||||
|
||||
function missionSpy({
|
||||
contextOk = true,
|
||||
layerResult = () => true,
|
||||
globe = async () => ({ ok: true }),
|
||||
} = {}) {
|
||||
const calls = { contextModes: [], layerIds: [], globeFlights: 0 };
|
||||
const calls = { layerIds: [], globeFlights: 0 };
|
||||
return {
|
||||
calls,
|
||||
deps: {
|
||||
setContextMode: async (mode) => {
|
||||
calls.contextModes.push(mode);
|
||||
return contextOk
|
||||
? { ok: true, mode }
|
||||
: { ok: false, failedLayerIds: ['rocket-launches'] };
|
||||
},
|
||||
setLayerEnabled: async (layerId) => {
|
||||
calls.layerIds.push(layerId);
|
||||
return layerResult(layerId);
|
||||
@@ -563,14 +556,14 @@ function missionSpy({
|
||||
};
|
||||
}
|
||||
|
||||
test('the menu is the four owner-ordered missions', () => {
|
||||
test('the menu is the three owner-ordered missions', () => {
|
||||
// INFRASTRUCTURE was removed after the owner playtested it: enabling all
|
||||
// three bundled layers at once put ~5,700 entities on a full-earth view and
|
||||
// tanked the frame rate. The layers stay reachable by hand and by voice; what
|
||||
// went is the one-click globe-scale dump. Restoring the tile needs the
|
||||
// globe-LOD declutter first.
|
||||
// globe-LOD declutter first. Live Contacts was dropped from the product, so
|
||||
// it is not offered as a starting mission either.
|
||||
assert.deepEqual(Object.keys(FIRST_RUN_MISSIONS), [
|
||||
'contacts',
|
||||
'space-missions',
|
||||
'environmental',
|
||||
'explore',
|
||||
@@ -580,21 +573,24 @@ test('the menu is the four owner-ordered missions', () => {
|
||||
undefined,
|
||||
'the infrastructure mission must be gone, not dormant',
|
||||
);
|
||||
assert.equal(
|
||||
FIRST_RUN_MISSIONS.contacts,
|
||||
undefined,
|
||||
'the contacts mission must be gone, not dormant',
|
||||
);
|
||||
});
|
||||
|
||||
test('Live Contacts and Space Missions go through the one setContextMode facade', async () => {
|
||||
for (const [choice, mode] of [
|
||||
['contacts', 'contacts'],
|
||||
['space-missions', 'space-missions'],
|
||||
]) {
|
||||
const spy = missionSpy();
|
||||
const outcome = await runFirstRunChoice(choice, spy.deps);
|
||||
assert.equal(outcome.ok, true);
|
||||
assert.deepEqual(spy.calls.contextModes, [mode]);
|
||||
// A Context mission owns no layers and no camera of its own — the facade does.
|
||||
assert.deepEqual(spy.calls.layerIds, []);
|
||||
assert.equal(spy.calls.globeFlights, 0);
|
||||
}
|
||||
test('Space Missions switches on its layer like a row click, without a flight', async () => {
|
||||
const spy = missionSpy();
|
||||
const outcome = await runFirstRunChoice('space-missions', spy.deps);
|
||||
assert.equal(outcome.ok, true);
|
||||
assert.deepEqual(spy.calls.layerIds, ['rocket-launches']);
|
||||
assert.equal(spy.calls.globeFlights, 0, 'the layer frames the globe itself');
|
||||
|
||||
const refused = missionSpy({ layerResult: () => false });
|
||||
const failed = await runFirstRunChoice('space-missions', refused.deps);
|
||||
assert.equal(failed.ok, false);
|
||||
assert.deepEqual(failed.failedLayerIds, ['rocket-launches']);
|
||||
});
|
||||
|
||||
test('Environmental enables BOTH its feeds and pulls out to the globe', async () => {
|
||||
@@ -667,24 +663,9 @@ test('a refused layer fails the mission by name, and a stalled flight never does
|
||||
test('Explore manually touches nothing at all, and an unknown choice is inert', async () => {
|
||||
const spy = missionSpy();
|
||||
assert.equal((await runFirstRunChoice('explore', spy.deps)).ok, true);
|
||||
assert.deepEqual(spy.calls, {
|
||||
contextModes: [],
|
||||
layerIds: [],
|
||||
globeFlights: 0,
|
||||
});
|
||||
assert.deepEqual(spy.calls, { layerIds: [], globeFlights: 0 });
|
||||
assert.equal((await runFirstRunChoice('nope', spy.deps)).ok, false);
|
||||
assert.deepEqual(spy.calls, {
|
||||
contextModes: [],
|
||||
layerIds: [],
|
||||
globeFlights: 0,
|
||||
});
|
||||
});
|
||||
|
||||
test('a failed Context mission reports the layers the facade named', async () => {
|
||||
const spy = missionSpy({ contextOk: false });
|
||||
const outcome = await runFirstRunChoice('space-missions', spy.deps);
|
||||
assert.equal(outcome.ok, false);
|
||||
assert.deepEqual(outcome.result.failedLayerIds, ['rocket-launches']);
|
||||
assert.deepEqual(spy.calls, { layerIds: [], globeFlights: 0 });
|
||||
});
|
||||
|
||||
test('the fires/quakes tile name is switchable from one constant', () => {
|
||||
@@ -735,22 +716,10 @@ test('no mission writes a preference the visitor did not choose by picking it',
|
||||
);
|
||||
}
|
||||
|
||||
// The only durable panel write is the Context reveal, and only on the Context
|
||||
// missions — the globe missions open no panel at all.
|
||||
const panelWrites = code.match(/setPanelCollapsed/g) || [];
|
||||
assert.equal(
|
||||
panelWrites.length,
|
||||
1,
|
||||
'exactly one panel reveal, on the Context path',
|
||||
);
|
||||
const contextPath = code.slice(
|
||||
code.indexOf('setContextMode: async (mode)'),
|
||||
code.indexOf('setLayerEnabled:'),
|
||||
);
|
||||
assert.match(
|
||||
contextPath,
|
||||
/result\?\.ok[\s\S]*?setPanelCollapsed\?\.\('global-context-panel', false, \{\s*explicit: true,?\s*\}\)/,
|
||||
);
|
||||
// No mission writes panel chrome: the globe missions open no panel at all,
|
||||
// and Space Missions' panel opens the way its layer row's switch opens it.
|
||||
assert.doesNotMatch(code, /setPanelCollapsed/);
|
||||
assert.doesNotMatch(code, /setContextMode/);
|
||||
});
|
||||
|
||||
test('the decision table is written down where the next editor will read it', () => {
|
||||
@@ -787,55 +756,21 @@ test('markup, startup ordering and accessibility remain pinned', async () => {
|
||||
html,
|
||||
/id="first-run-launcher" role="dialog"[^>]*aria-labelledby="first-run-title"[^>]*hidden/,
|
||||
);
|
||||
assert.equal((html.match(/data-first-run-choice=/g) || []).length, 4);
|
||||
assert.equal((html.match(/data-first-run-choice=/g) || []).length, 0);
|
||||
assert.match(html, /data-first-run-next/);
|
||||
assert.ok(
|
||||
html.includes(
|
||||
'<p id="first-run-description">It feels like a forbidden cockpit—then you realize the sources are public and the data is real.</p>',
|
||||
),
|
||||
'the maintainer-authored first-run line stays verbatim',
|
||||
);
|
||||
assert.match(
|
||||
html,
|
||||
/data-first-run-status[^>]*role="status"[^>]*aria-live="polite"/,
|
||||
);
|
||||
assert.match(html, /<input type="checkbox" data-first-run-suppress\s*\/?>/);
|
||||
assert.match(html, /<strong data-first-run-environmental-title>/);
|
||||
// Subcopy must name BOTH feeds the tile turns on — a tile that promised only
|
||||
// half of what it does is the defect this replaced. Only the VISIBLE <small>
|
||||
// text counts; the comment beside it naturally says the words too.
|
||||
const envTile = html.slice(
|
||||
html.indexOf('data-first-run-choice="environmental"'),
|
||||
);
|
||||
const visible = envTile.slice(
|
||||
envTile.indexOf('<small>'),
|
||||
envTile.indexOf('</small>'),
|
||||
);
|
||||
assert.match(visible, /earthquakes/i);
|
||||
assert.match(
|
||||
visible,
|
||||
/fires?/i,
|
||||
'the tile must promise the fires it enables',
|
||||
);
|
||||
|
||||
// The card's one persuasive line is OWNER-AUTHORED and pinned verbatim,
|
||||
// unspaced em dash included. This is copy, not prose to be improved in a
|
||||
// passing edit — changing it needs the owner, not a nicer-sounding rewrite.
|
||||
assert.ok(
|
||||
html.includes(
|
||||
'<p id="first-run-description">It feels like a forbidden cockpit' +
|
||||
'—then you realize the sources are public and the data is real.</p>',
|
||||
),
|
||||
'the owner-authored first-run line must ship exactly as written',
|
||||
);
|
||||
|
||||
// Menu order is the owner's, read straight off the markup.
|
||||
const order = [...html.matchAll(/data-first-run-choice="([a-z-]+)"/g)].map(
|
||||
(match) => match[1],
|
||||
);
|
||||
assert.deepEqual(order, [
|
||||
'contacts',
|
||||
'space-missions',
|
||||
'environmental',
|
||||
'explore',
|
||||
]);
|
||||
assert.doesNotMatch(
|
||||
html,
|
||||
/data-first-run-choice="infrastructure"/,
|
||||
'the removed tile must leave no markup behind',
|
||||
/<input type="checkbox" class="ui-checkbox__input" data-first-run-suppress\s*\/?>/,
|
||||
);
|
||||
|
||||
assert.match(startup, /styleManager\.initialRestorePromise/);
|
||||
@@ -891,40 +826,156 @@ test('markup, startup ordering and accessibility remain pinned', async () => {
|
||||
assert.match(choicesBlock, /overflow-y: auto;/);
|
||||
});
|
||||
|
||||
test('the header text keeps clear of the centred step dots', () => {
|
||||
const css = fs.readFileSync(
|
||||
new URL('./ui/styles/first-run.css', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
// Above 620px the dots are absolutely centred over the header row, so the
|
||||
// kicker and Skip must stop short of them; long locales then wrap.
|
||||
assert.match(css, /\.first-run-dots \{\s*position: absolute;\s*left: 50%;/);
|
||||
assert.match(
|
||||
css,
|
||||
/@media \(min-width: 621px\) \{\s*\.first-run-kicker,\s*\.first-run-dismiss \{\s*max-width: calc\(50% - 2\.4rem\);\s*\}\s*\}/,
|
||||
);
|
||||
assert.match(
|
||||
css,
|
||||
/@media \(max-width: 620px\) \{\s*\.first-run-dots \{\s*position: static;/,
|
||||
);
|
||||
});
|
||||
|
||||
test('reduced motion stops every first-run animation, however specific', () => {
|
||||
const css = fs.readFileSync(
|
||||
new URL('./ui/styles/first-run.css', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
// Every rule that starts an infinite animation must be matched by a
|
||||
// reduced-motion rule at least as specific, or the animation keeps running.
|
||||
const reduced = [
|
||||
...css.matchAll(
|
||||
/@media \(prefers-reduced-motion: reduce\) \{([\s\S]*?)\n\}/g,
|
||||
),
|
||||
]
|
||||
.map((m) => m[1])
|
||||
.join('\n');
|
||||
const squash = (selector) => selector.replace(/\s+/g, ' ').trim();
|
||||
const reducedSelectors = new Set(
|
||||
[...reduced.matchAll(/([^{}]+)\{[^}]*animation: none/g)].flatMap((m) =>
|
||||
m[1].split(/,(?![^(]*\))/).map(squash),
|
||||
),
|
||||
);
|
||||
const animated = [
|
||||
...css.matchAll(/([^{}@]+)\{[^}]*animation: [^;]*infinite/g),
|
||||
]
|
||||
.flatMap((m) => m[1].split(/,(?![^(]*\))/).map(squash))
|
||||
.filter((selector) => !selector.startsWith('/*'));
|
||||
assert.ok(animated.length > 5, 'found the animated rules');
|
||||
const covered = (selector) => {
|
||||
if (reducedSelectors.has(selector)) return true;
|
||||
// An :is() group in the reduced block covers each of its members.
|
||||
return [...reducedSelectors].some((reducedSelector) => {
|
||||
const group = reducedSelector.match(/^(.*) :is\(([^)]*)\)$/);
|
||||
return (
|
||||
group &&
|
||||
group[2]
|
||||
.split(',')
|
||||
.map((part) => `${group[1]} ${part.trim()}`)
|
||||
.includes(selector)
|
||||
);
|
||||
});
|
||||
};
|
||||
const missing = animated.filter((selector) => !covered(selector));
|
||||
assert.deepEqual(missing, [], 'animations reduced motion leaves running');
|
||||
});
|
||||
|
||||
test('the welcome backdrop tints the globe without blurring it', () => {
|
||||
const css = fs.readFileSync(
|
||||
new URL('./ui/styles/first-run.css', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
const backdrop = css.match(/\.first-run-backdrop \{([^}]*)\}/)?.[1] || '';
|
||||
assert.match(backdrop, /background: rgba\(3, 8, 14, 0\.28\);/);
|
||||
assert.match(backdrop, /pointer-events: none;/, 'click-through');
|
||||
assert.doesNotMatch(backdrop, /backdrop-filter/);
|
||||
});
|
||||
|
||||
test('every outbound first-run link opens without opener or referrer', () => {
|
||||
const view = fs.readFileSync(
|
||||
new URL('./ui/views/WelcomeView.vue', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
const links = view.match(/<a [^>]*target="_blank"[^>]*>/g) || [];
|
||||
assert.ok(links.length >= 7, 'the source and Halfpixel chips are outbound');
|
||||
for (const link of links) {
|
||||
assert.match(link, /rel="noopener noreferrer"/, link);
|
||||
}
|
||||
});
|
||||
|
||||
test('the Stories announcement waits behind the welcome card', () => {
|
||||
const css = fs.readFileSync(
|
||||
new URL('./ui/styles/first-run.css', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
// Hidden, not consumed: the popup keeps its unseen state and appears once
|
||||
// the card is dismissed.
|
||||
assert.match(
|
||||
css,
|
||||
/body:has\(#first-run-launcher\) #gev-stories #hPop,\s*body\.first-run-opening-stories #gev-stories #hPop \{\s*visibility: hidden;\s*pointer-events: none;\s*\}/,
|
||||
);
|
||||
// The selector only works while Stories still renders the popup as #hPop
|
||||
// inside #gev-stories.
|
||||
const stories = fs.readFileSync(
|
||||
new URL('./ui/views/StoriesView.vue', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
const root = stories.indexOf('<div id="gev-stories"');
|
||||
const popup = stories.indexOf('id="hPop"');
|
||||
assert.ok(root >= 0, 'StoriesView renders #gev-stories');
|
||||
assert.ok(popup > root, 'StoriesView renders #hPop inside #gev-stories');
|
||||
});
|
||||
|
||||
test('the card closes without a keyboard: the ESC hint is a button, kept on phones', async () => {
|
||||
const html = await renderApplicationHtml(
|
||||
fs.readFileSync(new URL('../index.html', import.meta.url), 'utf8'),
|
||||
);
|
||||
// The whole stylesheet, so a hide rule added in any other file is caught too.
|
||||
const css = readStylesheet(new URL('../style.css', import.meta.url));
|
||||
const footer = html.slice(
|
||||
html.indexOf('class="first-run-footer"'),
|
||||
html.indexOf('data-first-run-status'),
|
||||
const header = html.slice(
|
||||
html.indexOf('class="first-run-header"'),
|
||||
html.indexOf('id="first-run-title"'),
|
||||
);
|
||||
assert.match(
|
||||
footer,
|
||||
/<button type="button" class="first-run-dismiss" data-first-run-dismiss>/,
|
||||
header,
|
||||
/<button type="button" class="[^"]*\bfirst-run-dismiss\b[^"]*" data-first-run-dismiss>/,
|
||||
);
|
||||
assert.match(footer, />ESC to dismiss</);
|
||||
assert.match(footer, />DISMISS</);
|
||||
assert.match(header, />SKIP · ESC</);
|
||||
assert.match(header, />SKIP</);
|
||||
// It closes the way ESC does, through the one dismiss path, so the session
|
||||
// flag and focus handling are the same: firstRunLauncherView.test.mjs.
|
||||
// Phones used to hide the hint, leaving no way out but picking a mission.
|
||||
assert.doesNotMatch(css, /first-run-footer > span:last-child/);
|
||||
assert.doesNotMatch(css, /\.first-run-dismiss\s*\{[^}]*display:\s*none/);
|
||||
// A 44px touch target that does not add to the footer row's height.
|
||||
// A 44px touch target that does not add to the header row's height.
|
||||
assert.match(
|
||||
css,
|
||||
/\.first-run-dismiss::before \{[^}]*position: absolute;[^}]*height: 44px;/,
|
||||
);
|
||||
assert.doesNotMatch(css, /\.first-run-dismiss \{[^}]*min-height/);
|
||||
// Touch screens read DISMISS rather than a key they do not have.
|
||||
// Touch screens read SKIP rather than a key they do not have.
|
||||
assert.match(
|
||||
css,
|
||||
/@media \(hover: none\) and \(pointer: coarse\) \{\s*\.first-run-dismiss-key \{\s*display: none;/,
|
||||
);
|
||||
});
|
||||
|
||||
test('a short landscape phone keeps the card inside the viewport', () => {
|
||||
const css = readStylesheet(new URL('../style.css', import.meta.url));
|
||||
// Above the tab bar, never taller than the space left between it and the top.
|
||||
assert.match(
|
||||
css,
|
||||
/body\.mobile-shell #first-run-launcher \{[^}]*bottom: 5\.8rem;[^}]*max-height: calc\(100dvh - 6\.55rem\);/,
|
||||
);
|
||||
});
|
||||
|
||||
test('the launcher keeps focus, restores it, and never disables the focused button', () => {
|
||||
const module = fs.readFileSync(
|
||||
new URL('./firstRunExperience.js', import.meta.url),
|
||||
@@ -934,7 +985,8 @@ test('the launcher keeps focus, restores it, and never disables the focused butt
|
||||
// drops the keyboard to <body> and strands the visitor outside the launcher
|
||||
// (firstRunLauncherView.test.mjs renders it).
|
||||
assert.doesNotMatch(module, /\.disabled = /);
|
||||
// Tab is confined to the launcher, and ESC always releases it.
|
||||
// Tab cycles inside the launcher once focus is in it, and ESC always
|
||||
// releases it.
|
||||
const keyboard = fs.readFileSync(
|
||||
new URL('./ui/surfaceKeyboard.js', import.meta.url),
|
||||
'utf8',
|
||||
@@ -998,9 +1050,9 @@ test('the voice TOOL SCHEMA matches the pinned contract — the mission mapping
|
||||
);
|
||||
const hudLayout = legacyTools.find((tool) => tool.name === 'set_hud')
|
||||
.parameters.properties.layout;
|
||||
assert.deepEqual(hudLayout.enum, ['tactical', 'minimal', 'cyber']);
|
||||
// Cyber deliberately adds one layout and Operator was retired; first-run
|
||||
// missions still change no tools.
|
||||
assert.deepEqual(hudLayout.enum, ['tactical', 'minimal']);
|
||||
// Operator and then Cyber were retired; first-run missions still change
|
||||
// no tools.
|
||||
hudLayout.enum = ['tactical', 'operator', 'minimal'];
|
||||
const cameraMotion = legacyTools.find((tool) => tool.name === 'move_camera')
|
||||
.parameters.properties.motion;
|
||||
@@ -1033,6 +1085,11 @@ test('the voice TOOL SCHEMA matches the pinned contract — the mission mapping
|
||||
delete camera.pitchDeg;
|
||||
camera.direction.description =
|
||||
'Required for pan/tilt/rotate; orbit/rotate_globe default right.';
|
||||
// The Space Missions panel is a later, separate set_panel_open target.
|
||||
const panels = legacyTools.find((tool) => tool.name === 'set_panel_open')
|
||||
.parameters.properties.panelId;
|
||||
assert.ok(panels.enum.includes('space-missions-panel'));
|
||||
panels.enum = panels.enum.filter((id) => id !== 'space-missions-panel');
|
||||
const block = JSON.stringify(legacyTools);
|
||||
// Re-derived for the voice layer manifest (generated layer enums, alias and
|
||||
// field hints), point-and-ask's pointer/referent arguments and the prompt
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
initFirstRunExperience,
|
||||
} from './firstRunExperience.js';
|
||||
import { useFirstRunStore } from './ui/stores/firstRun.js';
|
||||
import { useStoriesStore } from './ui/stores/stories.js';
|
||||
import WelcomeView from './ui/views/WelcomeView.vue';
|
||||
|
||||
function memoryStorage(key, { refuse = false } = {}) {
|
||||
@@ -31,7 +32,14 @@ function memoryStorage(key, { refuse = false } = {}) {
|
||||
}
|
||||
|
||||
/** The welcome view and an initialized launcher, revealed and painted. */
|
||||
async function launch(t, { styleManager = {}, refuse = false } = {}) {
|
||||
async function launch(
|
||||
t,
|
||||
{
|
||||
styleManager = {},
|
||||
dataManager = { setEnabled: async () => true },
|
||||
refuse = false,
|
||||
} = {},
|
||||
) {
|
||||
document.body.replaceChildren();
|
||||
// Where focus was before the launcher opened.
|
||||
const opener = document.body.appendChild(document.createElement('button'));
|
||||
@@ -47,7 +55,7 @@ async function launch(t, { styleManager = {}, refuse = false } = {}) {
|
||||
const sessionStorageRef = memoryStorage(FIRST_RUN_SESSION_KEY);
|
||||
const launcher = initFirstRunExperience({
|
||||
styleManager,
|
||||
dataManager: { setEnabled: async () => true },
|
||||
dataManager,
|
||||
documentRef: document,
|
||||
storage,
|
||||
sessionStorageRef,
|
||||
@@ -68,7 +76,31 @@ async function launch(t, { styleManager = {}, refuse = false } = {}) {
|
||||
Object.defineProperty(list, 'clientHeight', { get: () => box.clientHeight });
|
||||
for (const frame of frames.splice(0)) frame();
|
||||
await nextTick();
|
||||
return { launcher, root, list, box, opener, storage, sessionStorageRef };
|
||||
return {
|
||||
launcher,
|
||||
pinia,
|
||||
root,
|
||||
list,
|
||||
box,
|
||||
opener,
|
||||
storage,
|
||||
sessionStorageRef,
|
||||
frames,
|
||||
};
|
||||
}
|
||||
|
||||
async function move(root, frames, selector = '[data-first-run-next]') {
|
||||
root.querySelector(selector).click();
|
||||
await settle(frames);
|
||||
}
|
||||
|
||||
async function settle(frames) {
|
||||
for (let i = 0; i < 4; i++) {
|
||||
await nextTick();
|
||||
for (const frame of frames.splice(0)) frame();
|
||||
await new Promise((resolve) => setTimeout(resolve));
|
||||
}
|
||||
await nextTick();
|
||||
}
|
||||
|
||||
test('the card is hidden until initialized, then revealed with its copy', async (t) => {
|
||||
@@ -81,57 +113,185 @@ test('the card is hidden until initialized, then revealed with its copy', async
|
||||
assert.equal(hidden.className, '');
|
||||
app.unmount();
|
||||
|
||||
const { root, list } = await launch(t);
|
||||
const { root, list, frames } = await launch(t);
|
||||
assert.equal(root.hidden, false);
|
||||
assert.equal(root.classList.contains('visible'), true);
|
||||
assert.equal(root.hasAttribute('aria-hidden'), false);
|
||||
assert.equal(list.dataset.scrollable, 'true');
|
||||
assert.equal(
|
||||
root.querySelector('[data-first-run-status]').textContent,
|
||||
'Tip: the GEV MIC button in the dock lets you talk to the map.',
|
||||
assert.equal(root.querySelector('[data-first-run-status]').textContent, '');
|
||||
assert.equal(root.querySelector('[data-first-run-choice]'), null);
|
||||
assert.ok(
|
||||
document.activeElement === root.querySelector('[data-first-run-primary]'),
|
||||
);
|
||||
await move(root, frames);
|
||||
assert.deepEqual(
|
||||
[...root.querySelectorAll('[data-first-run-start]')].map(
|
||||
(node) => node.dataset.firstRunStart,
|
||||
),
|
||||
['space-missions', 'environmental', 'explore'],
|
||||
);
|
||||
const environmental = root.querySelector(
|
||||
'[data-first-run-start="environmental"]',
|
||||
);
|
||||
assert.equal(
|
||||
root.querySelector('[data-first-run-environmental-title]').textContent,
|
||||
environmental.querySelector('strong').textContent,
|
||||
'ENVIRONMENTAL',
|
||||
);
|
||||
assert.ok(
|
||||
document.activeElement === root.querySelector('[data-first-run-choice]'),
|
||||
'the first mission has focus',
|
||||
assert.match(
|
||||
environmental.querySelector('small').textContent,
|
||||
/earthquakes.*fires/i,
|
||||
);
|
||||
assert.equal(
|
||||
root
|
||||
.querySelector('[data-first-run-start="explore"]')
|
||||
.getAttribute('aria-pressed'),
|
||||
'true',
|
||||
);
|
||||
assert.ok(
|
||||
document.activeElement === root.querySelector('[data-first-run-primary]'),
|
||||
);
|
||||
});
|
||||
|
||||
test('a quick second click on NEXT moves on, and never launches', async (t) => {
|
||||
let calls = 0;
|
||||
const { root, frames } = await launch(t, {
|
||||
dataManager: {
|
||||
setEnabled: async () => {
|
||||
calls++;
|
||||
return true;
|
||||
},
|
||||
},
|
||||
});
|
||||
const primary = root.querySelector('[data-first-run-primary]');
|
||||
const press = (detail) => {
|
||||
primary.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true }));
|
||||
primary.dispatchEvent(new MouseEvent('click', { bubbles: true, detail }));
|
||||
};
|
||||
press(1);
|
||||
await settle(frames);
|
||||
assert.ok(root.querySelector('[data-first-run-start]'), 'on the second step');
|
||||
// The second click of a double click, after the step settled, moves on.
|
||||
press(2);
|
||||
await settle(frames);
|
||||
assert.equal(primary.dataset.firstRunChoice, 'explore', 'on the last step');
|
||||
press(2);
|
||||
await settle(frames);
|
||||
assert.equal(calls, 0);
|
||||
assert.equal(root.dataset.state ?? null, null, 'a double click never starts');
|
||||
press(1);
|
||||
await settle(frames);
|
||||
assert.ok(root.dataset.state, 'a single click starts');
|
||||
});
|
||||
|
||||
test('a busy mission marks the choices aria-disabled, never disabled', async (t) => {
|
||||
let finish;
|
||||
const { root } = await launch(t, {
|
||||
styleManager: {
|
||||
setContextMode: () => new Promise((resolve) => (finish = resolve)),
|
||||
let calls = 0;
|
||||
const { root, frames } = await launch(t, {
|
||||
dataManager: {
|
||||
setEnabled: () => {
|
||||
calls++;
|
||||
return new Promise((resolve) => (finish = resolve));
|
||||
},
|
||||
},
|
||||
});
|
||||
const contacts = root.querySelector('[data-first-run-choice="contacts"]');
|
||||
contacts.focus();
|
||||
contacts.click();
|
||||
await move(root, frames);
|
||||
root.querySelector('[data-first-run-start="space-missions"]').click();
|
||||
await nextTick();
|
||||
const primary = root.querySelector('[data-first-run-next]');
|
||||
primary.click();
|
||||
await nextTick();
|
||||
const enter = root.querySelector('[data-first-run-primary]');
|
||||
assert.equal(
|
||||
enter,
|
||||
primary,
|
||||
'one persistent button keeps native click counting and focus',
|
||||
);
|
||||
assert.equal(enter.dataset.firstRunChoice, 'space-missions');
|
||||
enter.click();
|
||||
assert.equal(
|
||||
calls,
|
||||
0,
|
||||
'the new action cannot launch during the step transition',
|
||||
);
|
||||
// A press begun during the transition and released after it runs nothing.
|
||||
enter.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true }));
|
||||
await settle(frames);
|
||||
enter.dispatchEvent(new MouseEvent('click', { bubbles: true, detail: 1 }));
|
||||
assert.equal(calls, 0, 'a press held through the step change never launches');
|
||||
assert.ok(
|
||||
document.activeElement === enter,
|
||||
'the primary action retains focus',
|
||||
);
|
||||
assert.deepEqual(enter.getAttribute('aria-describedby').split(' '), [
|
||||
'first-run-title',
|
||||
'first-run-description',
|
||||
]);
|
||||
const announcement = root.querySelector('.first-run-step-announcement');
|
||||
assert.equal(announcement.getAttribute('aria-live'), 'polite');
|
||||
assert.equal(announcement.getAttribute('aria-atomic'), 'true');
|
||||
assert.equal(
|
||||
announcement.textContent,
|
||||
root.querySelector('#first-run-title').textContent,
|
||||
);
|
||||
for (const id of enter.getAttribute('aria-describedby').split(' ')) {
|
||||
assert.ok(root.querySelector(`#${id}`).textContent.trim());
|
||||
}
|
||||
enter.dispatchEvent(new MouseEvent('click', { bubbles: true, detail: 2 }));
|
||||
assert.equal(calls, 0, 'a second click from Next never confirms a mission');
|
||||
const repeated = new KeyboardEvent('keydown', {
|
||||
key: 'Enter',
|
||||
repeat: true,
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
});
|
||||
enter.dispatchEvent(repeated);
|
||||
assert.equal(repeated.defaultPrevented, true);
|
||||
// A fresh keyboard/assistive click has detail 0 and remains supported.
|
||||
enter.click();
|
||||
assert.equal(calls, 1);
|
||||
await nextTick();
|
||||
assert.equal(root.dataset.state, 'loading');
|
||||
assert.equal(root.getAttribute('aria-busy'), 'true');
|
||||
for (const button of root.querySelectorAll('[data-first-run-choice]')) {
|
||||
assert.equal(button.getAttribute('aria-disabled'), 'true');
|
||||
assert.equal(button.disabled, false);
|
||||
}
|
||||
assert.ok(document.activeElement === contacts, 'focus stays on the choice');
|
||||
assert.equal(enter.getAttribute('aria-disabled'), 'true');
|
||||
assert.equal(enter.disabled, false);
|
||||
assert.ok(document.activeElement === enter, 'focus stays on the action');
|
||||
assert.equal(
|
||||
root.querySelector('[data-first-run-status]').textContent,
|
||||
'Starting live contacts…',
|
||||
'Opening space missions…',
|
||||
);
|
||||
root.querySelector('.first-run-back').click();
|
||||
await nextTick();
|
||||
assert.equal(
|
||||
root.querySelector('[data-first-run-next]'),
|
||||
null,
|
||||
'Back is inert while busy',
|
||||
);
|
||||
enter.click();
|
||||
assert.equal(calls, 1, 'a busy action cannot start a second request');
|
||||
// A failed mission says so and stays on the card.
|
||||
finish({ ok: false });
|
||||
finish(false);
|
||||
await new Promise((resolve) => setTimeout(resolve));
|
||||
await nextTick();
|
||||
assert.equal(root.dataset.state, 'ready');
|
||||
assert.equal(contacts.getAttribute('aria-disabled'), 'false');
|
||||
assert.equal(enter.getAttribute('aria-disabled'), 'false');
|
||||
assert.match(
|
||||
root.querySelector('[data-first-run-status]').textContent,
|
||||
/^Could not open that mission/,
|
||||
);
|
||||
await move(root, frames, '.first-run-back');
|
||||
assert.equal(
|
||||
root
|
||||
.querySelector('[data-first-run-start="space-missions"]')
|
||||
.getAttribute('aria-pressed'),
|
||||
'true',
|
||||
);
|
||||
root.querySelector('.first-run-back').focus();
|
||||
await move(root, frames, '.first-run-back');
|
||||
assert.equal(root.querySelector('.first-run-back'), null);
|
||||
assert.ok(
|
||||
document.activeElement === root.querySelector('[data-first-run-primary]'),
|
||||
'focus moves when Back is removed',
|
||||
);
|
||||
});
|
||||
|
||||
test('a refused write takes the tick back and says why', async (t) => {
|
||||
@@ -156,25 +316,106 @@ test('a saved tick stays ticked', async (t) => {
|
||||
assert.equal(storage.read(), 'suppressed');
|
||||
});
|
||||
|
||||
test('the DISMISS button closes the card the way ESC does', async (t) => {
|
||||
test('the SKIP button closes the card the way ESC does', async (t) => {
|
||||
const { root, sessionStorageRef } = await launch(t);
|
||||
root.querySelector('[data-first-run-dismiss]').click();
|
||||
await nextTick();
|
||||
assert.equal(root.classList.contains('visible'), false);
|
||||
assert.equal(root.getAttribute('aria-hidden'), 'true');
|
||||
assert.notEqual(sessionStorageRef.read(), null, 'dismissed for the session');
|
||||
root
|
||||
.querySelector('.first-run-step')
|
||||
.dispatchEvent(new Event('transitionend', { bubbles: true }));
|
||||
await nextTick();
|
||||
assert.equal(
|
||||
document.getElementById('first-run-launcher'),
|
||||
root,
|
||||
'child transitions do not finish dismissal',
|
||||
);
|
||||
root.dispatchEvent(new Event('transitionend'));
|
||||
await nextTick();
|
||||
assert.equal(document.getElementById('first-run-launcher') === null, true);
|
||||
});
|
||||
|
||||
test('BROWSE STORIES closes the card and opens Stories in place', async (t) => {
|
||||
const { root, pinia, frames, sessionStorageRef } = await launch(t);
|
||||
const stories = useStoriesStore(pinia);
|
||||
let opened = 0;
|
||||
let finishLoading;
|
||||
stories.connect({
|
||||
open: () => {
|
||||
opened++;
|
||||
return new Promise((resolve) => (finishLoading = resolve));
|
||||
},
|
||||
});
|
||||
await move(root, frames);
|
||||
await move(root, frames);
|
||||
const button = root.querySelector('[data-first-run-stories]');
|
||||
assert.ok(button, 'the Stories card offers its button on the last step');
|
||||
assert.equal(button.tagName, 'BUTTON', 'opens in the app, not a new tab');
|
||||
assert.equal(button.hasAttribute('href'), false);
|
||||
button.click();
|
||||
await nextTick();
|
||||
assert.equal(opened, 1, 'Stories opened once');
|
||||
assert.equal(root.classList.contains('visible'), false, 'the card closed');
|
||||
assert.notEqual(sessionStorageRef.read(), null, 'dismissed for the session');
|
||||
assert.equal(
|
||||
document.body.classList.contains('first-run-opening-stories'),
|
||||
true,
|
||||
'the Stories announcement stays hidden while Stories loads',
|
||||
);
|
||||
finishLoading();
|
||||
await new Promise((resolve) => setTimeout(resolve));
|
||||
assert.equal(
|
||||
document.body.classList.contains('first-run-opening-stories'),
|
||||
false,
|
||||
'and may show again once Stories has opened (or failed to)',
|
||||
);
|
||||
button.dispatchEvent(new MouseEvent('click', { detail: 1 }));
|
||||
await nextTick();
|
||||
assert.equal(opened, 1, 'a closing card cannot open Stories again');
|
||||
});
|
||||
|
||||
test('BROWSE STORIES keeps the welcome up when Stories refuses to open', async (t) => {
|
||||
const { root, pinia, frames, sessionStorageRef } = await launch(t);
|
||||
const stories = useStoriesStore(pinia);
|
||||
stories.connect({ open: () => false });
|
||||
await move(root, frames);
|
||||
await move(root, frames);
|
||||
root.querySelector('[data-first-run-stories]').click();
|
||||
await nextTick();
|
||||
assert.equal(root.classList.contains('visible'), true, 'the card stays');
|
||||
assert.equal(sessionStorageRef.read(), null, 'not dismissed');
|
||||
assert.equal(
|
||||
document.body.classList.contains('first-run-opening-stories'),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test('the Stories card is left out where Stories is not offered', async (t) => {
|
||||
const { root, pinia, frames } = await launch(t);
|
||||
const stories = useStoriesStore(pinia);
|
||||
stories.available = false;
|
||||
await move(root, frames);
|
||||
await move(root, frames);
|
||||
assert.equal(root.querySelector('.first-run-stories'), null);
|
||||
assert.equal(root.querySelector('[data-first-run-stories]'), null);
|
||||
});
|
||||
|
||||
test('the scroll fade clears when the tiles fit after a resize', async (t) => {
|
||||
const { list, box } = await launch(t);
|
||||
const { root, list, box, frames } = await launch(t);
|
||||
assert.equal(list.dataset.scrollable, 'true');
|
||||
box.scrollHeight = 200;
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
await nextTick();
|
||||
assert.equal(list.dataset.scrollable, 'false');
|
||||
box.scrollHeight = 400;
|
||||
await move(root, frames);
|
||||
assert.equal(
|
||||
list.dataset.scrollable,
|
||||
'true',
|
||||
'new step refreshes overflow without a resize',
|
||||
);
|
||||
});
|
||||
|
||||
test('ESC closes the card, returns focus, and removes it without a transition', async (t) => {
|
||||
|
||||
+4
-10
@@ -14,7 +14,7 @@ import { applicationServices } from './services/application.js';
|
||||
* on independent fixed cadences.
|
||||
*
|
||||
* The HUD auto-activates when a military-style shader (NVG, FLIR, CRT) is
|
||||
* selected and supports the layout variants: tactical, minimal, cyber.
|
||||
* selected and supports the layout variants: tactical, minimal.
|
||||
*
|
||||
* Color theming is driven by the active shader mode via CSS custom properties.
|
||||
*/
|
||||
@@ -50,11 +50,7 @@ import {
|
||||
provenanceLine,
|
||||
provenanceTag,
|
||||
} from './data/layerSnapshot.js';
|
||||
import {
|
||||
applyHudUiTheme,
|
||||
DEFAULT_HUD_LAYOUT,
|
||||
normalizeHudLayout,
|
||||
} from './hudLayouts.js';
|
||||
import { DEFAULT_HUD_LAYOUT, normalizeHudLayout } from './hudLayouts.js';
|
||||
import {
|
||||
formatNumber,
|
||||
getLocale,
|
||||
@@ -1168,14 +1164,12 @@ export class IntelHUD {
|
||||
|
||||
/**
|
||||
* Switch the HUD layout variant. Falls back to `'tactical'` if the
|
||||
* name is unrecognized. Cyber also applies a coordinated skin to the full
|
||||
* application shell; leaving Cyber restores the standard shell tokens.
|
||||
* @param {string} variantName - One of `'tactical'`, `'minimal'`, `'cyber'`.
|
||||
* name is unrecognized.
|
||||
* @param {string} variantName - One of `'tactical'`, `'minimal'`.
|
||||
*/
|
||||
setVariant(variantName) {
|
||||
this._variant = normalizeHudLayout(variantName);
|
||||
this._present({ variant: this._variant });
|
||||
applyHudUiTheme(document.documentElement, this._variant);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,8 @@ test('HUD sliders and location search have descriptive explicit names', () => {
|
||||
test('the first-run checkbox keeps its native visible label', () => {
|
||||
// The span may carry a data-i18n extraction attribute; the native wrapping
|
||||
// label contract is what this guards.
|
||||
assert.match(html, /<label\b[^>]*class="first-run-suppress"[^>]*>\s*<input type="checkbox" data-first-run-suppress\s*\/?>\s*<span\b[^>]*>Don't show this again<\/span>\s*<\/label>/);
|
||||
// UiCheckbox leaves Vue's placeholder comment where its unused slot would be.
|
||||
assert.match(html, /<label\b[^>]*class="ui-checkbox first-run-suppress"[^>]*>(?:\s*<!--v-if-->)?\s*<input type="checkbox" class="ui-checkbox__input" data-first-run-suppress\s*\/?>\s*<span\b[^>]*>Don't show this again<\/span>(?:\s*<!--v-if-->)?\s*<\/label>/);
|
||||
});
|
||||
|
||||
test('generated style sliders use the visible parameter label as their name', () => {
|
||||
|
||||
@@ -1,2 +1,9 @@
|
||||
/** Browser-free layout vocabulary shared by UI and server-side voice tools. */
|
||||
export const HUD_LAYOUTS = Object.freeze(['tactical', 'minimal', 'cyber']);
|
||||
export const HUD_LAYOUTS = Object.freeze(['tactical', 'minimal']);
|
||||
|
||||
/**
|
||||
* Removed layouts that old share links, scenes and saved views may still
|
||||
* name. Cyber became the Sonar visual style: it opens in Tactical with
|
||||
* Sonar on.
|
||||
*/
|
||||
export const LEGACY_SONAR_HUD_LAYOUTS = Object.freeze(['cyber']);
|
||||
+6
-43
@@ -1,18 +1,10 @@
|
||||
import { applyCyberSonarThemePhase } from './cyberSonar.js';
|
||||
import { syncRadioPanelPlacement } from './ui/radioPanelPlacement.js';
|
||||
import { HUD_LAYOUTS } from './hudLayoutPolicy.js';
|
||||
export { HUD_LAYOUTS } from './hudLayoutPolicy.js';
|
||||
import { HUD_LAYOUTS, LEGACY_SONAR_HUD_LAYOUTS } from './hudLayoutPolicy.js';
|
||||
export { HUD_LAYOUTS, LEGACY_SONAR_HUD_LAYOUTS } from './hudLayoutPolicy.js';
|
||||
|
||||
/** Canonical HUD layouts shared by the UI, voice schema and HUD renderer. */
|
||||
|
||||
export const DEFAULT_HUD_LAYOUT = 'tactical';
|
||||
|
||||
/** Visual treatment applied only when an operator explicitly enters Cyber. */
|
||||
export const CYBER_VISUAL_DEFAULTS = Object.freeze({
|
||||
style: 'thermal',
|
||||
ironbow: 0.42,
|
||||
});
|
||||
|
||||
const HUD_LAYOUT_SET = new Set(HUD_LAYOUTS);
|
||||
|
||||
/** @param {unknown} value */
|
||||
@@ -27,38 +19,9 @@ export function normalizeHudLayout(value) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the opt-in visual defaults for an explicit layout transition.
|
||||
* Restores and repeated Cyber selections return null so they never overwrite
|
||||
* a shared link or a user's subsequent FLIR tuning.
|
||||
* Whether a layout name is a removed layout that now means "Sonar on".
|
||||
* @param {unknown} value
|
||||
*/
|
||||
export function cyberVisualDefaultsForHudTransition(
|
||||
previousLayout,
|
||||
nextLayout,
|
||||
{ explicit = false } = {},
|
||||
) {
|
||||
if (!explicit) return null;
|
||||
if (normalizeHudLayout(previousLayout) === 'cyber') return null;
|
||||
if (normalizeHudLayout(nextLayout) !== 'cyber') return null;
|
||||
return CYBER_VISUAL_DEFAULTS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Keep the global shell skin derived from the selected HUD layout. The data
|
||||
* attribute lives on <html> so theme tokens are available to every UI surface.
|
||||
* @param {HTMLElement|{dataset?: Record<string, string>}|null|undefined} root
|
||||
* @param {unknown} layout
|
||||
* @returns {'cyber'|null}
|
||||
*/
|
||||
export function applyHudUiTheme(root, layout) {
|
||||
if (!root?.dataset) return null;
|
||||
if (normalizeHudLayout(layout) === 'cyber') {
|
||||
root.dataset.uiTheme = 'cyber';
|
||||
applyCyberSonarThemePhase(root, true);
|
||||
syncRadioPanelPlacement(root.ownerDocument);
|
||||
return 'cyber';
|
||||
}
|
||||
delete root.dataset.uiTheme;
|
||||
applyCyberSonarThemePhase(root, false);
|
||||
syncRadioPanelPlacement(root.ownerDocument);
|
||||
return null;
|
||||
export function isLegacySonarHudLayout(value) {
|
||||
return LEGACY_SONAR_HUD_LAYOUTS.includes(String(value ?? '').toLowerCase());
|
||||
}
|
||||
+81
-17
@@ -159,8 +159,6 @@
|
||||
"REFRESHING LIVE DATA": "جارٍ تحديث البيانات المباشرة",
|
||||
"Close data attribution": "إغلاق إسناد البيانات",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "مركز التحكم · أول تشغيل",
|
||||
"Choose your first view": "اختر عرضك الأول",
|
||||
"LIVE CONTACTS": "تتبّع الأهداف المباشر",
|
||||
"Don't show this again": "لا تعرض هذا مرة أخرى",
|
||||
"POWER UP": "تشغيل",
|
||||
"GROUND STATION · PROVIDER SETTINGS": "المحطة الأرضية · إعدادات المزوّدين",
|
||||
@@ -168,13 +166,10 @@
|
||||
"SAVE KEYS": "حفظ المفاتيح",
|
||||
"Saving…": "جارٍ الحفظ…",
|
||||
"It feels like a forbidden cockpit—then you realize the sources are public and the data is real.": "يبدو الأمر كقمرة قيادة محظورة — ثم تدرك أن المصادر عامة والبيانات حقيقية.",
|
||||
"Aircraft, vessels and nearby intelligence": "طائرات وسفن ومعلومات استخباراتية قريبة",
|
||||
"SPACE MISSIONS": "المهام الفضائية",
|
||||
"Launches, spacecraft and orbital context": "عمليات إطلاق ومركبات فضائية وسياق مداري",
|
||||
"EXPLORE MANUALLY": "استكشاف يدوي",
|
||||
"Begin with a clean globe": "ابدأ بكرة أرضية نظيفة",
|
||||
"ESC to dismiss": "اضغط ESC للإغلاق",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "نصيحة: يتيح لك زر GEV MIC في الشريط السفلي التحدث إلى الخريطة.",
|
||||
"Close key setup": "إغلاق إعداد المفاتيح",
|
||||
"The globe already flies keyless. Every key below switches on another real feed — paste one and it's saved into this app's local configuration, then the server restarts itself. Server-side keys stay on this machine; Google Maps and Cesium ion run in the browser and must be provider-restricted. Keys you configured elsewhere are shown but never touched.": "تعمل الكرة الأرضية بلا مفاتيح أصلًا. كل مفتاح أدناه يفعّل مصدرًا حقيقيًا إضافيًا: الصق مفتاحًا فيُحفظ في إعدادات هذا التطبيق المحلية، ثم يعيد الخادم تشغيل نفسه. تبقى مفاتيح الخادم على هذا الجهاز، أما Google Maps وCesium ion فتعملان في المتصفح ويجب تقييدهما بحسب المزوّد. المفاتيح التي أعددتها في مكان آخر تظهر دون أن تُمَسّ.",
|
||||
"ESC to close": "اضغط ESC للإغلاق",
|
||||
@@ -186,7 +181,6 @@
|
||||
"IMPORT": "استيراد",
|
||||
"RUN LOG": "سجل التشغيل",
|
||||
"Ready": "جاهز",
|
||||
"Starting live contacts…": "جارٍ بدء تتبّع الأهداف المباشر…",
|
||||
"Opening space missions…": "جارٍ فتح المهام الفضائية…",
|
||||
"Scanning active events…": "جارٍ مسح الأحداث النشطة…",
|
||||
"Working…": "جارٍ العمل…",
|
||||
@@ -260,7 +254,6 @@
|
||||
"Running {index}/{total}: {scene} / {shot}": "جارٍ التشغيل {index} من {total}: {scene} / {shot}",
|
||||
"Scene run complete": "اكتمل تشغيل المشهد",
|
||||
"Error: {message}": "خطأ: {message}",
|
||||
"Could not exit {mode} — scene layers may be refused": "تعذّر الخروج من {mode} — قد تُرفض طبقات المشهد",
|
||||
"REMOVE": "إزالة",
|
||||
"Remove {title} from this app's saved keys": "إزالة {title} من مفاتيح هذا التطبيق المحفوظة",
|
||||
"Needs {envVars} — add it in Provider Settings": "يحتاج إلى {envVars} — أضفه في «إعدادات المزوّدين»",
|
||||
@@ -610,7 +603,6 @@
|
||||
"Space Missions": "المهام الفضائية",
|
||||
"{mode} could not start because another layer did not stop cleanly": "تعذّر بدء {mode} لأن طبقة أخرى لم تتوقف بشكل سليم",
|
||||
"Contacts could not complete the requested transition; try again": "تعذّر على وضع «الأهداف» إكمال الانتقال المطلوب؛ أعد المحاولة",
|
||||
"Space Missions could not complete the requested transition; try again": "تعذّر على وضع «المهام الفضائية» إكمال الانتقال المطلوب؛ أعد المحاولة",
|
||||
"Nearby installations could not be refreshed; try again": "تعذّر تحديث المنشآت القريبة؛ أعد المحاولة",
|
||||
"Context could not restore every layer; try again": "تعذّر على السياق استعادة كل الطبقات؛ أعد المحاولة",
|
||||
"Zoom in to search mapped installations": "قرّب الخريطة للبحث في المنشآت المرسومة",
|
||||
@@ -626,8 +618,6 @@
|
||||
"CCTV layer unavailable": "طبقة CCTV غير متاحة",
|
||||
"MAP": "خريطة",
|
||||
"CONTACTS — nearest planes · vessels · sites": "الأهداف — أقرب الطائرات · السفن · المواقع",
|
||||
"SPACE MISSIONS — launches & orbital assets": "المهام الفضائية — عمليات الإطلاق والأصول المدارية",
|
||||
"Space Missions cancellation could not restore the previous layer state": "تعذّرت استعادة حالة الطبقة السابقة عند إلغاء وضع المهام الفضائية",
|
||||
"Collapse Cockpit display options": "طي خيارات عرض القمرة",
|
||||
"Collapse Cockpit Radio controls": "طي عناصر تحكم الراديو في القمرة",
|
||||
"SYNC": "مزامنة",
|
||||
@@ -691,6 +681,16 @@
|
||||
"UNAVAILABLE": "غير متاح",
|
||||
"Live Flights": "تتبّع الرحلات المباشر",
|
||||
"Earthquakes (24h)": "الزلازل (24 ساعة)",
|
||||
"earthquake|Minor": "طفيف",
|
||||
"earthquake|Light": "خفيف",
|
||||
"earthquake|Moderate": "معتدل",
|
||||
"earthquake|Strong": "قوي",
|
||||
"earthquake|Major": "كبير",
|
||||
"earthquake|Great": "هائل",
|
||||
"earthquake|Shallow": "ضحل",
|
||||
"earthquake|Intermediate": "متوسط العمق",
|
||||
"earthquake|Deep": "عميق",
|
||||
"{km} km deep": "على عمق {km} كم",
|
||||
"No selected data layers": "لا توجد طبقات بيانات محددة",
|
||||
"Cleared {count} data layers": {
|
||||
"zero": "لم تُمسح أي طبقة بيانات ({count})",
|
||||
@@ -1132,7 +1132,6 @@
|
||||
"Could not place the shape: {error}": "تعذّر وضع الشكل: {error}",
|
||||
"Board cleared.": "تم مسح اللوحة.",
|
||||
"{label} · Detailed outline unavailable": "{label} · المخطط التفصيلي غير متاح",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "وضع المهام الفضائية يعزل بيانات إعادة العرض. اخرج من الوضع لتفعيل طبقة «{layer}».",
|
||||
"Data attribution": "إسناد البيانات",
|
||||
"Data provided by:": "البيانات مقدَّمة من:",
|
||||
"Light aircraft": "طائرة خفيفة",
|
||||
@@ -2204,6 +2203,7 @@
|
||||
"Exit cockpit to fly to a target": "اخرج من القمرة للانتقال إلى هدف",
|
||||
"Exit cockpit to fly to a vessel": "اخرج من القمرة للانتقال إلى سفينة",
|
||||
"Exit cockpit to fly to a fire": "اخرج من القمرة للانتقال إلى حريق",
|
||||
"Exit cockpit to fly to an earthquake": "اخرج من القمرة للانتقال إلى زلزال",
|
||||
"Exit cockpit to fly to a route": "اخرج من القمرة للانتقال إلى مسار",
|
||||
"Exit cockpit to fly to a file": "اخرج من القمرة للانتقال إلى ملف",
|
||||
"Exit cockpit to fly to a scene": "اخرج من القمرة للانتقال إلى مشهد",
|
||||
@@ -3276,7 +3276,7 @@
|
||||
"Control cockpit": "التحكم في القمرة",
|
||||
"Change visual style": "تغيير النمط البصري",
|
||||
"Adjust HUD": "ضبط HUD",
|
||||
"Adjust cyber sonar": "ضبط السونار السيبراني",
|
||||
"Adjust sonar": "ضبط السونار",
|
||||
"Adjust detection overlay": "ضبط طبقة الكشف",
|
||||
"Change map stack": "تغيير حزمة الخرائط",
|
||||
"Adjust post-processing": "ضبط المعالجة اللاحقة",
|
||||
@@ -3366,9 +3366,8 @@
|
||||
"SEEK ▶": "بحث ▶",
|
||||
"SDR VOL": "صوت SDR",
|
||||
"Local SDR volume": "مستوى صوت SDR المحلي",
|
||||
"Cyber": "سيبراني",
|
||||
"Sonar": "السونار",
|
||||
"Cyber sonar contact scanner": "ماسح الأهداف بالسونار السيبراني",
|
||||
"Sonar contact scanner": "ماسح الأهداف بالسونار",
|
||||
"Rings": "الحلقات",
|
||||
"Sonar ring count": "عدد حلقات السونار",
|
||||
"Range": "المدى",
|
||||
@@ -3376,7 +3375,7 @@
|
||||
"Power": "القوة",
|
||||
"Sonar intensity": "شدة السونار",
|
||||
"Opacity": "العتامة",
|
||||
"Cyber contact and label opacity": "عتامة الأهداف والتسميات في النمط السيبراني",
|
||||
"Sonar contact and label opacity": "عتامة الأهداف والتسميات للسونار",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "الحد الأدنى لعتامة نقاط الخريطة والأيقونات والنماذج والأقواس والتسميات بين مرّات السونار",
|
||||
"Sector": "القطاع",
|
||||
"Sonar sector width": "عرض قطاع السونار",
|
||||
@@ -3680,6 +3679,8 @@
|
||||
"Source: {value}": "المصدر: {value}",
|
||||
"Click the card to open EMODnet ↗": "انقر على البطاقة لفتح EMODnet ↗",
|
||||
"Click the card to open the source ↗": "انقر على البطاقة لفتح المصدر ↗",
|
||||
"Open the source for {title}, {details}": "فتح مصدر «{title}»، {details}",
|
||||
"Focus earthquake {title}, {details}": "التركيز على الزلزال {title}، {details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata غير متاح؛ يُعرض EMODnet فقط",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet غير متاح؛ يُعرض Wikidata فقط",
|
||||
"Shipwrecks unavailable": "بيانات حطام السفن غير متاحة",
|
||||
@@ -4569,7 +4570,7 @@
|
||||
"Show settings": "عرض الإعدادات",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "اختر نمطًا: عادي أو CRT أو NVG أو FLIR أو أنمي أو نوار (المفاتيح 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "اختر خريطة الأساس ضمن مصدر الخريطة: Google 3D أو Bing أو Esri أو OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "فعّل شاشة العرض الأمامية أو أوقفها هنا. يتيح التخطيط اختيار تكتيكي أو مبسّط أو سيبراني",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "فعّل شاشة العرض الأمامية أو أوقفها هنا. يتيح التخطيط اختيار تكتيكي أو مبسّط",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "يؤطر المنظار العرض داخل دائرة. ينعّم التنعيم حافة الدائرة، ويحدد التعتيم درجة قتامة المنطقة خارجها.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "تخفي الواجهة النظيفة اللوحات والقراءات لإظهار العرض بوضوح",
|
||||
"Press search, then type part of a layer name or source": "اضغط على البحث، ثم اكتب جزءًا من اسم الطبقة أو مصدرها",
|
||||
@@ -4654,6 +4655,7 @@
|
||||
"Turn off": "إيقاف",
|
||||
"Command": "أمر",
|
||||
"No layers are on": "لا توجد طبقات مفعّلة",
|
||||
"No other layers are on": "لا توجد طبقات أخرى مفعّلة",
|
||||
"No matching layers": "لا توجد طبقات مطابقة",
|
||||
"Show me {thing} settings": "عرض إعدادات {thing}",
|
||||
"Show me how: {thing}": "طريقة الاستخدام: {thing}",
|
||||
@@ -4675,5 +4677,67 @@
|
||||
"other": "عرض {what} في {place} ({count} عنصر)"
|
||||
},
|
||||
"Go there": "انتقل إلى هناك",
|
||||
"Open draw options": "فتح خيارات الرسم"
|
||||
"Open draw options": "فتح خيارات الرسم",
|
||||
"{what} in {place}: {count} items": {
|
||||
"zero": "{what} في {place}: {count} عنصر",
|
||||
"one": "{what} في {place}: {count} عنصر",
|
||||
"two": "{what} في {place}: {count} عنصران",
|
||||
"few": "{what} في {place}: {count} عناصر",
|
||||
"many": "{what} في {place}: {count} عنصرًا",
|
||||
"other": "{what} في {place}: {count} عنصر"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"zero": "{count} عنصر في العرض",
|
||||
"one": "{count} عنصر في العرض",
|
||||
"two": "{count} عنصران في العرض",
|
||||
"few": "{count} عناصر في العرض",
|
||||
"many": "{count} عنصرًا في العرض",
|
||||
"other": "{count} عنصر في العرض"
|
||||
},
|
||||
"Selected · near {name}": "محدّد · قرب {name}",
|
||||
"Near {name}": "بالقرب من {name}",
|
||||
"Stop drawing": "إيقاف الرسم",
|
||||
"{place} · landmarks": "{place} · معالم",
|
||||
"In {place}": "داخل {place}",
|
||||
"Near {place}": "بالقرب من {place}",
|
||||
"Unable to complete this action: {reason}": "تعذر إكمال هذا الإجراء: {reason}",
|
||||
"Unable to complete this action. Please try again.": "تعذر إكمال هذا الإجراء. يرجى المحاولة مرة أخرى.",
|
||||
"{layer} M{mag}+": "{layer} بقوة M{mag} فأكثر",
|
||||
"Search places, layers and things on the map, or ask GEV": "ابحث عن أماكن وطبقات وعناصر على الخريطة، أو اسأل GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "ابحث عن أماكن وطبقات ورحلات جوية… أو اسأل GEV · > للأوامر",
|
||||
"No matching command": "لا يوجد أمر مطابق",
|
||||
"Looks private, so nothing is searched or sent": "يبدو خاصًا، لذا لا يُبحث عنه ولا يُرسل",
|
||||
"Bilawal on YouTube": "بلاول على YouTube",
|
||||
"BROWSE STORIES": "تصفح القصص",
|
||||
"ENTER GOD MODE": "ادخل وضع الإله",
|
||||
"Go deeper": "تعمّق أكثر",
|
||||
"The studio behind GEV": "الاستوديو الذي يقف خلف GEV",
|
||||
"Visual presets": "الأنماط البصرية",
|
||||
"Open source. Self-host, fork, add a layer.": "مفتوح المصدر. استضفه بنفسك، أنشئ نسخة، أضف طبقة.",
|
||||
"Choose your mode": "اختر الوضع",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "منظار القمر الصناعي التجسسي: عرض دائري، واجهة تكتيكية، كاميرا سينمائية. للاستكشاف.",
|
||||
"Welcome to God's Eye View": "مرحبًا بك في God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "عرض أنظف وأسهل قراءة يُظهر فيه كل رقم مصدره. للبحث وإعداد التقارير.",
|
||||
"Keyhole HUD": "واجهة المنظار",
|
||||
"Analyst": "المحلل",
|
||||
"God": "الإله",
|
||||
"COMING SOON": "قريبًا",
|
||||
"More from Halfpixel": "المزيد من Halfpixel",
|
||||
"Start with": "ابدأ بـ",
|
||||
"FUN": "ممتع",
|
||||
"Where do you want to start?": "من أين تريد أن تبدأ؟",
|
||||
"Three things to know": "ثلاثة أمور يجب معرفتها",
|
||||
"Pick one to begin with. You can change everything later.": "اختر واحدة لتبدأ بها. يمكنك تغيير كل شيء لاحقًا.",
|
||||
"That is all you need to get going.": "هذا كل ما تحتاج إليه للبدء.",
|
||||
"SKIP · ESC": "تخطّي · ESC",
|
||||
"SKIP": "تخطّي",
|
||||
"Search places": "البحث عن أماكن",
|
||||
"Type a place into the search bar.": "اكتب اسم مكان في شريط البحث.",
|
||||
"Turn on layers": "تشغيل الطبقات",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "شغّل الطبقات لرؤية الرحلات الجوية والسفن والكاميرات والطقس والمزيد.",
|
||||
"Click anything": "انقر على أي عنصر",
|
||||
"Select a map item to see its details.": "اختر عنصرًا على الخريطة لرؤية تفاصيله.",
|
||||
"Bilawal on {site}": "بلال على {site}",
|
||||
"Bilawal's website": "موقع بلال الإلكتروني",
|
||||
"BACK": "رجوع"
|
||||
}
|
||||
+73
-17
@@ -155,7 +155,6 @@
|
||||
"ENVIRONMENTAL": "UMWELT",
|
||||
"EARTH WATCH": "ERDBEOBACHTUNG",
|
||||
"ACTIVE EVENTS": "AKTIVE EREIGNISSE",
|
||||
"Starting live contacts…": "Live-Kontakte werden gestartet…",
|
||||
"Opening space missions…": "Raummissionen werden geöffnet…",
|
||||
"Scanning active events…": "Aktive Ereignisse werden gescannt…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "Live-Erdbeben und aktive Brände, von USGS und NASA",
|
||||
@@ -452,7 +451,6 @@
|
||||
"Camera unavailable — exit cockpit first": "Kamera nicht verfügbar: zuerst Cockpit verlassen",
|
||||
"No shots to run": "Keine Aufnahmen zum Abspielen",
|
||||
"Project exported": "Projekt exportiert",
|
||||
"Could not exit {mode} — scene layers may be refused": "{mode} konnte nicht beendet werden: Szenenebenen werden eventuell abgelehnt",
|
||||
"Running {index}/{total}: {scene} / {shot}": "Läuft {index}/{total}: {scene} / {shot}",
|
||||
"Scene run complete": "Szenenlauf abgeschlossen",
|
||||
"Global Flights Radar": "Globales Flugradar",
|
||||
@@ -466,7 +464,6 @@
|
||||
"VISUAL PRESETS": "VISUELLE PRESETS",
|
||||
"LOCATION": "STANDORT",
|
||||
"CONTACTS — nearest planes · vessels · sites": "KONTAKTE: nächstgelegene Flugzeuge · Schiffe · Standorte",
|
||||
"SPACE MISSIONS — launches & orbital assets": "RAUMMISSIONEN: Starts & Orbit-Objekte",
|
||||
"LIVE SIGNALS": "LIVE-SIGNALE",
|
||||
"Contacts could not complete the requested transition; try again": "Kontakte konnten den gewünschten Wechsel nicht abschließen; erneut versuchen",
|
||||
"CCTV layer unavailable": "CCTV-Ebene nicht verfügbar",
|
||||
@@ -637,10 +634,8 @@
|
||||
"other": "{count} Datenebenen ausgeschaltet"
|
||||
},
|
||||
"Selected data layers could not be cleared": "Ausgewählte Datenebenen konnten nicht ausgeschaltet werden",
|
||||
"Space Missions could not complete the requested transition; try again": "Raummissionen konnten den gewünschten Wechsel nicht abschließen; erneut versuchen",
|
||||
"Nearby installations refreshed": "Anlagen in der Nähe aktualisiert",
|
||||
"Nearby installations could not be refreshed; try again": "Anlagen in der Nähe konnten nicht aktualisiert werden; erneut versuchen",
|
||||
"Space Missions cancellation could not restore the previous layer state": "Abbruch der Raummissionen konnte den vorherigen Ebenenstatus nicht wiederherstellen",
|
||||
"That layer is unavailable in the current Context mode": "Diese Ebene ist im aktuellen Kontextmodus nicht verfügbar",
|
||||
"{layerId} could not {action} cleanly": "{layerId} konnte nicht sauber {action}",
|
||||
"start": "starten",
|
||||
@@ -651,6 +646,16 @@
|
||||
"Live Flights": "Live-Flüge",
|
||||
"Military Flights": "Militärflüge",
|
||||
"Earthquakes (24h)": "Erdbeben (24 h)",
|
||||
"earthquake|Minor": "Schwach",
|
||||
"earthquake|Light": "Leicht",
|
||||
"earthquake|Moderate": "Mittel",
|
||||
"earthquake|Strong": "Stark",
|
||||
"earthquake|Major": "Schwer",
|
||||
"earthquake|Great": "Gewaltig",
|
||||
"earthquake|Shallow": "Flach",
|
||||
"earthquake|Intermediate": "Mitteltief",
|
||||
"earthquake|Deep": "Tief",
|
||||
"{km} km deep": "{km} km tief",
|
||||
"Satellites": "Satelliten",
|
||||
"Place names": "Ortsnamen",
|
||||
"Space Missions (30d)": "Raummissionen (30 T)",
|
||||
@@ -1041,15 +1046,10 @@
|
||||
"Copy share link": "Link zum Teilen kopieren",
|
||||
"Reset camera and return to full globe view": "Kamera zurücksetzen und zur Vollglobus-Ansicht zurückkehren",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "MISSION CONTROL · ERSTER START",
|
||||
"Choose your first view": "Erste Ansicht wählen",
|
||||
"LIVE CONTACTS": "LIVE-KONTAKTE",
|
||||
"Aircraft, vessels and nearby intelligence": "Flugzeuge, Schiffe und Lagebild der Umgebung",
|
||||
"Launches, spacecraft and orbital context": "Starts, Raumfahrzeuge und Orbit-Kontext",
|
||||
"EXPLORE MANUALLY": "MANUELL ERKUNDEN",
|
||||
"Begin with a clean globe": "Mit einem leeren Globus beginnen",
|
||||
"Don't show this again": "Nicht mehr anzeigen",
|
||||
"ESC to dismiss": "ESC zum Schließen",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "Tipp: Mit der Mikrofontaste im Dock lässt sich die Karte per Sprache steuern.",
|
||||
"Pick a shape, then click the map.": "Form wählen, dann auf die Karte klicken.",
|
||||
"Enter to place the pin, Esc to cancel.": "Enter setzt den Pin, Esc bricht ab.",
|
||||
"Click where the pin goes.": "Auf die Stelle für den Pin klicken.",
|
||||
@@ -1067,7 +1067,6 @@
|
||||
"Could not place the shape: {error}": "Form konnte nicht platziert werden: {error}",
|
||||
"Board cleared.": "Zeichenfläche geleert.",
|
||||
"{label} · Detailed outline unavailable": "{label} · Detaillierter Umriss nicht verfügbar",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "Der Modus Raummissionen isoliert Replay-Daten. Modus verlassen, um {layer} zu aktivieren.",
|
||||
"Data attribution": "Datenquellen",
|
||||
"Data provided by:": "Daten bereitgestellt von:",
|
||||
"Light aircraft": "Leichtflugzeug",
|
||||
@@ -2083,6 +2082,7 @@
|
||||
"Exit cockpit to fly to a target": "Cockpit verlassen, um zu einem Ziel zu fliegen",
|
||||
"Exit cockpit to fly to a vessel": "Cockpit verlassen, um zu einem Schiff zu fliegen",
|
||||
"Exit cockpit to fly to a fire": "Cockpit verlassen, um zu einem Brand zu fliegen",
|
||||
"Exit cockpit to fly to an earthquake": "Cockpit verlassen, um zu einem Erdbeben zu fliegen",
|
||||
"Exit cockpit to fly to a route": "Cockpit verlassen, um zu einer Route zu fliegen",
|
||||
"Exit cockpit to fly to a file": "Cockpit verlassen, um zu einer Datei zu fliegen",
|
||||
"Exit cockpit to fly to a scene": "Cockpit verlassen, um zu einer Szene zu fliegen",
|
||||
@@ -2957,7 +2957,7 @@
|
||||
"Control cockpit": "Cockpit steuern",
|
||||
"Change visual style": "Visuellen Stil ändern",
|
||||
"Adjust HUD": "HUD anpassen",
|
||||
"Adjust cyber sonar": "Cyber-Sonar anpassen",
|
||||
"Adjust sonar": "Sonar anpassen",
|
||||
"Adjust detection overlay": "Erkennungs-Overlay anpassen",
|
||||
"Change map stack": "Kartenstapel ändern",
|
||||
"Adjust post-processing": "Nachbearbeitung anpassen",
|
||||
@@ -3047,9 +3047,8 @@
|
||||
"SEEK ▶": "SUCHEN ▶",
|
||||
"SDR VOL": "SDR-LAUTST.",
|
||||
"Local SDR volume": "Lautstärke des lokalen SDR",
|
||||
"Cyber": "Cyber",
|
||||
"Sonar": "Sonar",
|
||||
"Cyber sonar contact scanner": "Cyber-Sonar-Kontaktscanner",
|
||||
"Sonar contact scanner": "Sonar-Kontaktscanner",
|
||||
"Rings": "Ringe",
|
||||
"Sonar ring count": "Anzahl der Sonarringe",
|
||||
"Range": "Reichweite",
|
||||
@@ -3057,7 +3056,7 @@
|
||||
"Power": "Leistung",
|
||||
"Sonar intensity": "Sonarintensität",
|
||||
"Opacity": "Deckkraft",
|
||||
"Cyber contact and label opacity": "Deckkraft von Cyber-Kontakten und Beschriftungen",
|
||||
"Sonar contact and label opacity": "Deckkraft von Sonar-Kontakten und Beschriftungen",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "Minimale Deckkraft für Kartenpunkte, Symbole, Modelle, Klammern und Beschriftungen zwischen Sonardurchläufen",
|
||||
"Sector": "Sektor",
|
||||
"Sonar sector width": "Breite des Sonarsektors",
|
||||
@@ -3336,6 +3335,8 @@
|
||||
"Source: {value}": "Quelle: {value}",
|
||||
"Click the card to open EMODnet ↗": "Eintrag anklicken, um EMODnet zu öffnen ↗",
|
||||
"Click the card to open the source ↗": "Eintrag anklicken, um die Quelle zu öffnen ↗",
|
||||
"Open the source for {title}, {details}": "Quelle für {title} öffnen, {details}",
|
||||
"Focus earthquake {title}, {details}": "Erdbeben {title} fokussieren, {details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata nicht verfügbar; nur EMODnet wird angezeigt",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet nicht verfügbar; nur Wikidata wird angezeigt",
|
||||
"Shipwrecks unavailable": "Schiffswracks nicht verfügbar",
|
||||
@@ -4157,7 +4158,7 @@
|
||||
"Show settings": "Einstellungen anzeigen",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "Wähle einen Stil: Normal, CRT, NVG, FLIR, Anime oder Noir (Tasten 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "Wähle unter Kartenquelle die Grundkarte: Google 3D, Bing, Esri oder OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "Schalte hier das HUD ein oder aus. Wähle unter Layout Taktisch, Minimal oder Cyber.",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "Schalte hier das HUD ein oder aus. Wähle unter Layout Taktisch oder Minimal.",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "Der Scope rahmt die Ansicht kreisförmig ein. Weichzeichnung glättet den Rand, die Deckkraft bestimmt die Abdunklung außen.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "Reine Ansicht blendet Bedienfelder und Anzeigen aus",
|
||||
"Press search, then type part of a layer name or source": "Drücke die Suchtaste und gib einen Teil des Ebenennamens oder der Quellenbezeichnung ein",
|
||||
@@ -4242,6 +4243,7 @@
|
||||
"Turn off": "Ausschalten",
|
||||
"Command": "Befehl",
|
||||
"No layers are on": "Keine Ebenen aktiv",
|
||||
"No other layers are on": "Keine anderen Ebenen aktiv",
|
||||
"No matching layers": "Keine passenden Ebenen",
|
||||
"Show me {thing} settings": "Einstellungen für {thing} zeigen",
|
||||
"Show me how: {thing}": "Anleitung anzeigen: {thing}",
|
||||
@@ -4259,5 +4261,59 @@
|
||||
"other": "{what} in der Region {place} anzeigen ({count} Elemente)"
|
||||
},
|
||||
"Go there": "Dorthin wechseln",
|
||||
"Open draw options": "Zeichenoptionen öffnen"
|
||||
"Open draw options": "Zeichenoptionen öffnen",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} in der Region {place}: {count} Element",
|
||||
"other": "{what} in der Region {place}: {count} Elemente"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} Element im Blick",
|
||||
"other": "{count} Elemente im Blick"
|
||||
},
|
||||
"Selected · near {name}": "Auswahl · nahe {name}",
|
||||
"Near {name}": "Nahe {name}",
|
||||
"Stop drawing": "Zeichnen beenden",
|
||||
"{place} · landmarks": "{place} · Sehenswürdigkeiten",
|
||||
"In {place}": "In der Region {place}",
|
||||
"Near {place}": "Nahe {place}",
|
||||
"Unable to complete this action: {reason}": "Diese Aktion konnte nicht abgeschlossen werden: {reason}",
|
||||
"Unable to complete this action. Please try again.": "Diese Aktion konnte nicht abgeschlossen werden. Bitte versuche es erneut.",
|
||||
"{layer} M{mag}+": "{layer} ab Magnitude {mag}",
|
||||
"Search places, layers and things on the map, or ask GEV": "Suche Orte, Ebenen und Kartenelemente oder frage GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "Orte, Ebenen, Flüge suchen… oder GEV fragen · > für Befehle",
|
||||
"No matching command": "Kein passender Befehl",
|
||||
"Looks private, so nothing is searched or sent": "Sieht privat aus, daher wird nichts gesucht oder gesendet",
|
||||
"Bilawal on YouTube": "Bilawal auf YouTube",
|
||||
"BROWSE STORIES": "STORIES ANSEHEN",
|
||||
"ENTER GOD MODE": "GOTT-MODUS STARTEN",
|
||||
"Go deeper": "Mehr entdecken",
|
||||
"The studio behind GEV": "Das Studio hinter GEV",
|
||||
"Visual presets": "Visuelle Presets",
|
||||
"Open source. Self-host, fork, add a layer.": "Open Source. Selbst hosten, forken, eine Ebene hinzufügen.",
|
||||
"Choose your mode": "Modus wählen",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "Das Spionagesatelliten-Schlüsselloch: runder Bildausschnitt, taktisches HUD, filmische Kamera. Zum Erkunden.",
|
||||
"Welcome to God's Eye View": "Willkommen bei God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "Eine klarere, gut lesbare Ansicht, in der jeder Wert seine Quelle zeigt. Für Recherche und Berichte.",
|
||||
"Keyhole HUD": "Schlüsselloch-HUD",
|
||||
"Analyst": "Analyse",
|
||||
"God": "Gott",
|
||||
"COMING SOON": "DEMNÄCHST",
|
||||
"More from Halfpixel": "Mehr von Halfpixel",
|
||||
"Start with": "Starten mit",
|
||||
"FUN": "SPASS",
|
||||
"Where do you want to start?": "Wo möchtest du anfangen?",
|
||||
"Three things to know": "Drei Dinge, die du wissen solltest",
|
||||
"Pick one to begin with. You can change everything later.": "Wähle zum Einstieg eine Option. Du kannst später alles ändern.",
|
||||
"That is all you need to get going.": "Das ist alles, was du für den Einstieg brauchst.",
|
||||
"SKIP · ESC": "ÜBERSPRINGEN · ESC",
|
||||
"SKIP": "ÜBERSPRINGEN",
|
||||
"Search places": "Orte suchen",
|
||||
"Type a place into the search bar.": "Gib einen Ort in die Suchleiste ein.",
|
||||
"Turn on layers": "Ebenen einschalten",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "Schalte Ebenen ein, um Flüge, Schiffe, Kameras, Wetter und mehr zu sehen.",
|
||||
"Click anything": "Klicke auf ein Element",
|
||||
"Select a map item to see its details.": "Wähle ein Kartenelement aus, um seine Details zu sehen.",
|
||||
"Bilawal on {site}": "Bilawal auf {site}",
|
||||
"Bilawal's website": "Bilawals Website",
|
||||
"BACK": "ZURÜCK"
|
||||
}
|
||||
+75
-17
@@ -470,7 +470,6 @@
|
||||
"Space Missions": "Misiones espaciales",
|
||||
"{mode} could not start because another layer did not stop cleanly": "{mode} no pudo iniciarse porque otra capa no se detuvo correctamente",
|
||||
"Contacts could not complete the requested transition; try again": "Contactos no pudo completar la transición solicitada; inténtalo de nuevo",
|
||||
"Space Missions could not complete the requested transition; try again": "Misiones espaciales no pudo completar la transición solicitada; inténtalo de nuevo",
|
||||
"Nearby installations could not be refreshed; try again": "No se pudieron actualizar las instalaciones cercanas; inténtalo de nuevo",
|
||||
"Context could not restore every layer; try again": "Contexto no pudo restaurar todas las capas; inténtalo de nuevo",
|
||||
"Zoom in to search mapped installations": "Acércate para buscar instalaciones mapeadas",
|
||||
@@ -486,8 +485,6 @@
|
||||
"CCTV layer unavailable": "Capa de CCTV no disponible",
|
||||
"MAP": "MAPA",
|
||||
"CONTACTS — nearest planes · vessels · sites": "CONTACTOS — aeronaves · buques · sitios más cercanos",
|
||||
"SPACE MISSIONS — launches & orbital assets": "MISIONES ESPACIALES — lanzamientos y activos orbitales",
|
||||
"Space Missions cancellation could not restore the previous layer state": "La cancelación de Misiones espaciales no pudo restaurar el estado previo de las capas",
|
||||
"Collapse Cockpit display options": "Contraer las opciones de visualización de la cabina",
|
||||
"Collapse Cockpit Radio controls": "Contraer los controles de Radio de la cabina",
|
||||
"SYNC": "SINCR.",
|
||||
@@ -551,6 +548,16 @@
|
||||
"UNAVAILABLE": "NO DISPONIBLE",
|
||||
"Live Flights": "Vuelos en vivo",
|
||||
"Earthquakes (24h)": "Terremotos (24 h)",
|
||||
"earthquake|Minor": "Menor",
|
||||
"earthquake|Light": "Ligero",
|
||||
"earthquake|Moderate": "Moderado",
|
||||
"earthquake|Strong": "Fuerte",
|
||||
"earthquake|Major": "Mayor",
|
||||
"earthquake|Great": "Gran",
|
||||
"earthquake|Shallow": "Superficial",
|
||||
"earthquake|Intermediate": "Intermedio",
|
||||
"earthquake|Deep": "Profundo",
|
||||
"{km} km deep": "{km} km de profundidad",
|
||||
"No selected data layers": "No hay capas de datos seleccionadas",
|
||||
"Cleared {count} data layers": {
|
||||
"one": "Se limpió {count} capa de datos",
|
||||
@@ -929,8 +936,6 @@
|
||||
"sightings filter|CONFIRMED": "CONFIRMADOS",
|
||||
"PAD / RTLS": "PLATAFORMA / RTLS",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "CENTRO DE MANDO · PRIMER INICIO",
|
||||
"Choose your first view": "Elige tu primera vista",
|
||||
"LIVE CONTACTS": "CONTACTOS EN VIVO",
|
||||
"Don't show this again": "No volver a mostrar",
|
||||
"POWER UP": "ENCENDER",
|
||||
"GROUND STATION · PROVIDER SETTINGS": "ESTACIÓN TERRENA · AJUSTES DE PROVEEDORES",
|
||||
@@ -938,12 +943,9 @@
|
||||
"SAVE KEYS": "GUARDAR CLAVES",
|
||||
"Saving…": "Guardando…",
|
||||
"It feels like a forbidden cockpit—then you realize the sources are public and the data is real.": "Parece una cabina prohibida—hasta que descubres que las fuentes son públicas y los datos son reales.",
|
||||
"Aircraft, vessels and nearby intelligence": "Aeronaves, buques e inteligencia cercana",
|
||||
"Launches, spacecraft and orbital context": "Lanzamientos, naves y contexto orbital",
|
||||
"EXPLORE MANUALLY": "EXPLORAR MANUALMENTE",
|
||||
"Begin with a clean globe": "Empieza con un globo limpio",
|
||||
"ESC to dismiss": "ESC para cerrar",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "Consejo: el botón GEV MIC del dock te permite hablar con el mapa.",
|
||||
"Close key setup": "Cerrar la configuración de claves",
|
||||
"The globe already flies keyless. Every key below switches on another real feed — paste one and it's saved into this app's local configuration, then the server restarts itself. Server-side keys stay on this machine; Google Maps and Cesium ion run in the browser and must be provider-restricted. Keys you configured elsewhere are shown but never touched.": "El globo ya funciona sin claves. Cada clave de abajo activa otra fuente real — pega una y queda guardada en la configuración local de esta app, y luego el servidor se reinicia solo. Las claves del servidor se quedan en esta máquina; Google Maps y Cesium ion funcionan en el navegador y sus claves deben restringirse en la consola del proveedor. Las claves que configuraste en otro lugar se muestran, pero nunca se modifican.",
|
||||
"ESC to close": "ESC para cerrar",
|
||||
@@ -952,7 +954,6 @@
|
||||
"UPDATE SHOT": "ACTUALIZAR PLANO",
|
||||
"IMPORT": "IMPORTAR",
|
||||
"RUN LOG": "REGISTRO DE EJECUCIÓN",
|
||||
"Starting live contacts…": "Iniciando contactos en vivo…",
|
||||
"Opening space missions…": "Abriendo misiones espaciales…",
|
||||
"Scanning active events…": "Escaneando eventos activos…",
|
||||
"Working…": "Trabajando…",
|
||||
@@ -1022,7 +1023,6 @@
|
||||
"Running {index}/{total}: {scene} / {shot}": "Ejecutando {index}/{total}: {scene} / {shot}",
|
||||
"Scene run complete": "Ejecución de escenas completada",
|
||||
"Error: {message}": "Error: {message}",
|
||||
"Could not exit {mode} — scene layers may be refused": "No se pudo salir de {mode} — las capas de la escena pueden rechazarse",
|
||||
"REMOVE": "ELIMINAR",
|
||||
"Remove {title} from this app's saved keys": "Elimina {title} de las claves guardadas de esta app",
|
||||
"Needs {envVars} — add it in Provider Settings": "Necesita {envVars} — se añade en Ajustes de proveedores",
|
||||
@@ -1833,11 +1833,11 @@
|
||||
"POSITIONED": "POSICIONADAS",
|
||||
"SDR VOL": "VOL. SDR",
|
||||
"LOCAL RTL-SDR": "RTL-SDR LOCAL",
|
||||
"Cyber sonar contact scanner": "Escáner de contactos del sonar Ciber",
|
||||
"Sonar contact scanner": "Escáner de contactos del sonar",
|
||||
"Sonar ring count": "Número de anillos del sonar",
|
||||
"Sonar ring range": "Alcance de los anillos del sonar",
|
||||
"Sonar intensity": "Intensidad del sonar",
|
||||
"Cyber contact and label opacity": "Opacidad de contactos y etiquetas Ciber",
|
||||
"Sonar contact and label opacity": "Opacidad de contactos y etiquetas del sonar",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "Opacidad mínima de puntos, iconos, modelos, corchetes y etiquetas del mapa entre pasadas del sonar",
|
||||
"Sonar sector width": "Ancho del sector del sonar",
|
||||
"Rings": "Anillos",
|
||||
@@ -1845,7 +1845,6 @@
|
||||
"Power": "Potencia",
|
||||
"Opacity": "Opacidad",
|
||||
"Sector": "Sector",
|
||||
"Cyber": "Ciber",
|
||||
"Sonar": "Sonar",
|
||||
"Turn Street Level on or off": "Activar o desactivar A pie de calle",
|
||||
"Toggle straight-down and tilted map views": "Alternar entre la vista cenital y la vista inclinada del mapa",
|
||||
@@ -2614,7 +2613,6 @@
|
||||
"Importing project": "Importando proyecto",
|
||||
"Camera move interrupted": "Movimiento de cámara interrumpido",
|
||||
"Scene media timed out": "El contenido multimedia de la escena agotó el tiempo de espera",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "El modo Misiones espaciales aísla los datos de repetición. Sal del modo para activar {layer}.",
|
||||
"Tilted view": "Vista inclinada",
|
||||
"Straight-down view": "Vista cenital",
|
||||
"North up": "Norte arriba",
|
||||
@@ -2625,6 +2623,7 @@
|
||||
"Exit cockpit to fly to a target": "Sal de la cabina para volar a un objetivo",
|
||||
"Exit cockpit to fly to a vessel": "Sal de la cabina para volar a un buque",
|
||||
"Exit cockpit to fly to a fire": "Sal de la cabina para volar a un incendio",
|
||||
"Exit cockpit to fly to an earthquake": "Sal de la cabina para volar a un terremoto",
|
||||
"Exit cockpit to fly to a route": "Sal de la cabina para volar a una ruta",
|
||||
"Exit cockpit to fly to a file": "Sal de la cabina para volar a un archivo",
|
||||
"Exit cockpit to fly to a scene": "Sal de la cabina para volar a una escena",
|
||||
@@ -2931,7 +2930,7 @@
|
||||
"Control cockpit": "Controlar la cabina",
|
||||
"Change visual style": "Cambiar el estilo visual",
|
||||
"Adjust HUD": "Ajustar el HUD",
|
||||
"Adjust cyber sonar": "Ajustar el sonar Ciber",
|
||||
"Adjust sonar": "Ajustar el sonar",
|
||||
"Adjust detection overlay": "Ajustar la superposición de detección",
|
||||
"Change map stack": "Cambiar el conjunto de mapas",
|
||||
"Adjust post-processing": "Ajustar el posprocesado",
|
||||
@@ -3422,6 +3421,8 @@
|
||||
"Source: {value}": "Fuente: {value}",
|
||||
"Click the card to open EMODnet ↗": "Haz clic en la tarjeta para abrir EMODnet ↗",
|
||||
"Click the card to open the source ↗": "Haz clic en la tarjeta para abrir la fuente ↗",
|
||||
"Open the source for {title}, {details}": "Abrir la fuente de {title}, {details}",
|
||||
"Focus earthquake {title}, {details}": "Enfocar el terremoto {title}, {details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata no disponible; solo se muestra EMODnet",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet no disponible; solo se muestra Wikidata",
|
||||
"Shipwrecks unavailable": "Naufragios no disponibles",
|
||||
@@ -4260,7 +4261,7 @@
|
||||
"Show settings": "Mostrar ajustes",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "Elige un estilo: Normal, CRT, NVG, FLIR, Anime o Noir (teclas 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "En Fuente del mapa, elige el mapa base: Google 3D, Bing, Esri u OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "Activa o desactiva aquí el HUD. En Disposición, elige Táctica, Mínima o Ciber.",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "Activa o desactiva aquí el HUD. En Disposición, elige Táctica o Mínima.",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "Mirilla encuadra la vista en un círculo. Difuminado suaviza el borde y Opacidad regula la sombra exterior.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "Interfaz limpia oculta los paneles y los indicadores para despejar la vista",
|
||||
"Press search, then type part of a layer name or source": "Pulsa el botón de búsqueda y escribe parte del nombre o la fuente de una capa",
|
||||
@@ -4345,6 +4346,7 @@
|
||||
"Turn off": "Desactivar",
|
||||
"Command": "Comando",
|
||||
"No layers are on": "No hay capas activas",
|
||||
"No other layers are on": "No hay otras capas activas",
|
||||
"No matching layers": "No se encontraron capas",
|
||||
"Show me {thing} settings": "Muéstrame los ajustes de {thing}",
|
||||
"Show me how: {thing}": "Muéstrame cómo: {thing}",
|
||||
@@ -4363,5 +4365,61 @@
|
||||
"other": "Mostrar {what} en {place} ({count} elementos)"
|
||||
},
|
||||
"Go there": "Ir allí",
|
||||
"Open draw options": "Abrir opciones de dibujo"
|
||||
"Open draw options": "Abrir opciones de dibujo",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} en {place}: {count} elemento",
|
||||
"many": "{what} en {place}: {count} de elementos",
|
||||
"other": "{what} en {place}: {count} elementos"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} elemento a la vista",
|
||||
"many": "{count} de elementos a la vista",
|
||||
"other": "{count} elementos a la vista"
|
||||
},
|
||||
"Selected · near {name}": "Selección · cerca de {name}",
|
||||
"Near {name}": "Cerca de {name}",
|
||||
"Stop drawing": "Dejar de dibujar",
|
||||
"{place} · landmarks": "{place} · lugares de interés",
|
||||
"In {place}": "En {place}",
|
||||
"Near {place}": "Cerca de {place}",
|
||||
"Unable to complete this action: {reason}": "No se pudo completar esta acción: {reason}",
|
||||
"Unable to complete this action. Please try again.": "No se pudo completar esta acción. Inténtalo de nuevo.",
|
||||
"{layer} M{mag}+": "{layer} de M{mag} o más",
|
||||
"Search places, layers and things on the map, or ask GEV": "Busca lugares, capas y elementos del mapa, o pregunta a GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "Busca lugares, capas, vuelos… o pregunta a GEV · > para comandos",
|
||||
"No matching command": "Ningún comando coincide",
|
||||
"Looks private, so nothing is searched or sent": "Parece privado, así que no se busca ni se envía nada",
|
||||
"Bilawal on YouTube": "Bilawal en YouTube",
|
||||
"BROWSE STORIES": "VER STORIES",
|
||||
"ENTER GOD MODE": "ENTRAR EN MODO DIOS",
|
||||
"Go deeper": "Ir más allá",
|
||||
"The studio behind GEV": "El estudio detrás de GEV",
|
||||
"Visual presets": "Preajustes visuales",
|
||||
"Open source. Self-host, fork, add a layer.": "Código abierto. Alójalo tú mismo, haz un fork, añade una capa.",
|
||||
"Choose your mode": "Elige tu modo",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "La mirilla del satélite espía: visor circular, HUD táctico, cámara cinematográfica. Para explorar.",
|
||||
"Welcome to God's Eye View": "Bienvenido a God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "Una vista más limpia y legible en la que cada valor muestra su fuente. Para investigar e informar.",
|
||||
"Keyhole HUD": "HUD de mirilla",
|
||||
"Analyst": "Analista",
|
||||
"God": "Dios",
|
||||
"COMING SOON": "PRÓXIMAMENTE",
|
||||
"More from Halfpixel": "Más de Halfpixel",
|
||||
"Start with": "Empezar con",
|
||||
"FUN": "DIVERSIÓN",
|
||||
"Where do you want to start?": "¿Por dónde quieres empezar?",
|
||||
"Three things to know": "Tres cosas que debes saber",
|
||||
"Pick one to begin with. You can change everything later.": "Elige una opción para empezar. Puedes cambiarlo todo después.",
|
||||
"That is all you need to get going.": "Eso es todo lo que necesitas para empezar.",
|
||||
"SKIP · ESC": "OMITIR · ESC",
|
||||
"SKIP": "OMITIR",
|
||||
"Search places": "Buscar lugares",
|
||||
"Type a place into the search bar.": "Escribe un lugar en la barra de búsqueda.",
|
||||
"Turn on layers": "Activar capas",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "Activa capas para ver vuelos, barcos, cámaras, tiempo y más.",
|
||||
"Click anything": "Haz clic en cualquier elemento",
|
||||
"Select a map item to see its details.": "Selecciona un elemento del mapa para ver sus detalles.",
|
||||
"Bilawal on {site}": "Bilawal en {site}",
|
||||
"Bilawal's website": "Sitio web de Bilawal",
|
||||
"BACK": "ATRÁS"
|
||||
}
|
||||
+75
-17
@@ -129,7 +129,6 @@
|
||||
"Loading the keyless globe...": "Chargement du globe sans clé…",
|
||||
"Google 3D Tiles unavailable ({detail}). Loading the keyless globe...": "Google 3D Tiles indisponible ({detail}). Chargement du globe sans clé…",
|
||||
"Initializing systems...": "Initialisation des systèmes…",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "Le mode Missions spatiales isole les données de rejeu. Quittez-le pour activer {layer}.",
|
||||
"Data attribution": "Attribution des données",
|
||||
"Data provided by:": "Données fournies par :",
|
||||
"Close data attribution": "Fermer l'attribution des données",
|
||||
@@ -407,7 +406,6 @@
|
||||
"ENVIRONMENTAL": "ENVIRONNEMENT",
|
||||
"EARTH WATCH": "VEILLE TERRE",
|
||||
"ACTIVE EVENTS": "ÉVÉNEMENTS ACTIFS",
|
||||
"Starting live contacts…": "Démarrage des contacts en direct…",
|
||||
"Opening space missions…": "Ouverture des missions spatiales…",
|
||||
"Scanning active events…": "Analyse des événements actifs…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "Séismes et feux actifs en direct, via USGS et NASA",
|
||||
@@ -1500,6 +1498,7 @@
|
||||
"Exit cockpit to fly to a target": "Quittez le cockpit pour rejoindre une cible",
|
||||
"Exit cockpit to fly to a vessel": "Quittez le cockpit pour rejoindre un navire",
|
||||
"Exit cockpit to fly to a fire": "Quittez le cockpit pour rejoindre un incendie",
|
||||
"Exit cockpit to fly to an earthquake": "Quittez le cockpit pour rejoindre un séisme",
|
||||
"Exit cockpit to fly to a route": "Quittez le cockpit pour rejoindre un itinéraire",
|
||||
"Exit cockpit to fly to a file": "Quittez le cockpit pour rejoindre un fichier",
|
||||
"Exit cockpit to fly to a scene": "Quittez le cockpit pour rejoindre une scène",
|
||||
@@ -1550,7 +1549,6 @@
|
||||
"Import failed: {error}": "Échec de l'importation : {error}",
|
||||
"Import failed (could not read JSON file)": "Échec de l'importation (fichier JSON illisible)",
|
||||
"Layers refused: {layers}": "Couches refusées : {layers}",
|
||||
"Could not exit {mode} — scene layers may be refused": "Impossible de quitter {mode} — les couches de la scène peuvent être refusées",
|
||||
"Camera move interrupted": "Mouvement de caméra interrompu",
|
||||
"Scene media timed out": "Délai dépassé pour les médias de la scène",
|
||||
"Action complete": "Action terminée",
|
||||
@@ -1690,7 +1688,6 @@
|
||||
"VISUAL PRESETS": "PRÉRÉGLAGES VISUELS",
|
||||
"LOCATION": "LIEU",
|
||||
"CONTACTS — nearest planes · vessels · sites": "CONTACTS — avions, navires et sites les plus proches",
|
||||
"SPACE MISSIONS — launches & orbital assets": "MISSIONS SPATIALES — lancements et objets orbitaux",
|
||||
"LIVE SIGNALS": "SIGNAUX EN DIRECT",
|
||||
"Contacts could not complete the requested transition; try again": "Les contacts n'ont pas pu effectuer la transition demandée ; réessayez",
|
||||
"CCTV layer unavailable": "Couche CCTV indisponible",
|
||||
@@ -1917,10 +1914,8 @@
|
||||
"other": "{count} couches de données effacées"
|
||||
},
|
||||
"Selected data layers could not be cleared": "Impossible d'effacer les couches de données sélectionnées",
|
||||
"Space Missions could not complete the requested transition; try again": "Les missions spatiales n'ont pas pu effectuer la transition demandée ; réessayez",
|
||||
"Nearby installations refreshed": "Installations proches actualisées",
|
||||
"Nearby installations could not be refreshed; try again": "Impossible d'actualiser les installations proches ; réessayez",
|
||||
"Space Missions cancellation could not restore the previous layer state": "L'annulation des missions spatiales n'a pas pu restaurer l'état précédent des couches",
|
||||
"That layer is unavailable in the current Context mode": "Cette couche est indisponible dans le mode Contexte actuel",
|
||||
"{layerId} could not {action} cleanly": "{layerId} n'a pas pu {action} proprement",
|
||||
"start": "démarrer",
|
||||
@@ -1963,6 +1958,16 @@
|
||||
"Live Flights": "Vols en direct",
|
||||
"Military Flights": "Vols militaires",
|
||||
"Earthquakes (24h)": "Séismes (24 h)",
|
||||
"earthquake|Minor": "Mineur",
|
||||
"earthquake|Light": "Léger",
|
||||
"earthquake|Moderate": "Modéré",
|
||||
"earthquake|Strong": "Fort",
|
||||
"earthquake|Major": "Majeur",
|
||||
"earthquake|Great": "Exceptionnel",
|
||||
"earthquake|Shallow": "Superficiel",
|
||||
"earthquake|Intermediate": "Intermédiaire",
|
||||
"earthquake|Deep": "Profond",
|
||||
"{km} km deep": "{km} km de profondeur",
|
||||
"Satellites": "Satellites",
|
||||
"Place names": "Noms de lieux",
|
||||
"Space Missions (30d)": "Missions spatiales (30 j)",
|
||||
@@ -2802,7 +2807,7 @@
|
||||
"Control cockpit": "Piloter le cockpit",
|
||||
"Change visual style": "Changer le style visuel",
|
||||
"Adjust HUD": "Régler le HUD",
|
||||
"Adjust cyber sonar": "Régler le sonar Cyber",
|
||||
"Adjust sonar": "Régler le sonar",
|
||||
"Adjust detection overlay": "Régler la surcouche de détection",
|
||||
"Change map stack": "Changer de fond de carte",
|
||||
"Adjust post-processing": "Régler le post-traitement",
|
||||
@@ -3054,9 +3059,8 @@
|
||||
"HUD layout": "Disposition du HUD",
|
||||
"Tactical": "Tactique",
|
||||
"Minimal": "Minimal",
|
||||
"Cyber": "Cyber",
|
||||
"Sonar": "Sonar",
|
||||
"Cyber sonar contact scanner": "Scanner de contacts du sonar Cyber",
|
||||
"Sonar contact scanner": "Scanner de contacts du sonar",
|
||||
"Rings": "Anneaux",
|
||||
"Sonar ring count": "Nombre d'anneaux du sonar",
|
||||
"Range": "Portée",
|
||||
@@ -3064,7 +3068,7 @@
|
||||
"Power": "Puissance",
|
||||
"Sonar intensity": "Intensité du sonar",
|
||||
"Opacity": "Opacité",
|
||||
"Cyber contact and label opacity": "Opacité des contacts et étiquettes Cyber",
|
||||
"Sonar contact and label opacity": "Opacité des contacts et étiquettes du sonar",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "Opacité minimale des points, icônes, modèles, cadres de ciblage et étiquettes de la carte entre deux balayages du sonar",
|
||||
"Sector": "Secteur",
|
||||
"Sonar sector width": "Largeur du secteur du sonar",
|
||||
@@ -3176,15 +3180,10 @@
|
||||
"Reset map bearing to north": "Réinitialiser l'orientation de la carte vers le nord",
|
||||
"Reset camera and return to full globe view": "Réinitialiser la caméra et revenir à la vue du globe entier",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "CENTRE DE CONTRÔLE · PREMIER LANCEMENT",
|
||||
"Choose your first view": "Choisissez votre première vue",
|
||||
"LIVE CONTACTS": "CONTACTS EN DIRECT",
|
||||
"Aircraft, vessels and nearby intelligence": "Avions, navires et renseignements à proximité",
|
||||
"Launches, spacecraft and orbital context": "Lancements, vaisseaux et contexte orbital",
|
||||
"EXPLORE MANUALLY": "EXPLORER MANUELLEMENT",
|
||||
"Begin with a clean globe": "Commencer avec un globe vierge",
|
||||
"Don't show this again": "Ne plus afficher",
|
||||
"ESC to dismiss": "ESC pour fermer",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "Astuce : le bouton GEV MIC du dock permet de parler à la carte.",
|
||||
"Malformed cyclone snapshot": "Instantané cyclonique mal formé",
|
||||
"Cyclone request timed out": "Délai dépassé pour la requête cyclonique",
|
||||
"{lower} to {upper}": "De {lower} à {upper}",
|
||||
@@ -3422,6 +3421,8 @@
|
||||
"Source: {value}": "Source : {value}",
|
||||
"Click the card to open EMODnet ↗": "Cliquez sur la fiche pour ouvrir EMODnet ↗",
|
||||
"Click the card to open the source ↗": "Cliquez sur la fiche pour ouvrir la source ↗",
|
||||
"Open the source for {title}, {details}": "Ouvrir la source de {title}, {details}",
|
||||
"Focus earthquake {title}, {details}": "Centrer sur le séisme {title}, {details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata indisponible ; seul EMODnet est affiché",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet indisponible ; seul Wikidata est affiché",
|
||||
"Shipwrecks unavailable": "Épaves indisponibles",
|
||||
@@ -4260,7 +4261,7 @@
|
||||
"Show settings": "Afficher les réglages",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "Choisissez un style : Normal, CRT, NVG, FLIR, Anime ou Noir (touches 1 à 6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "Dans Source de la carte, choisissez le fond de carte : Google 3D, Bing, Esri ou OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "Activez ou désactivez ici le HUD. Dans Disposition, choisissez Tactique, Minimal ou Cyber.",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "Activez ou désactivez ici le HUD. Dans Disposition, choisissez Tactique ou Minimal.",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "La lunette cadre la vue dans un cercle. Adouci lisse le bord et Opacité règle l’assombrissement à l’extérieur.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "Vue épurée masque les panneaux et les indicateurs pour dégager la vue",
|
||||
"Press search, then type part of a layer name or source": "Appuyez sur Rechercher, puis saisissez une partie du nom ou de la source d’une couche",
|
||||
@@ -4345,6 +4346,7 @@
|
||||
"Turn off": "Désactiver",
|
||||
"Command": "Commande",
|
||||
"No layers are on": "Aucune couche active",
|
||||
"No other layers are on": "Aucune autre couche active",
|
||||
"No matching layers": "Aucune couche correspondante",
|
||||
"Show me {thing} settings": "Montrez-moi les réglages de {thing}",
|
||||
"Show me how: {thing}": "Montrez-moi comment faire : {thing}",
|
||||
@@ -4363,5 +4365,61 @@
|
||||
"other": "Afficher {what} dans la zone de {place} ({count} éléments)"
|
||||
},
|
||||
"Go there": "Y aller",
|
||||
"Open draw options": "Ouvrir les options de dessin"
|
||||
"Open draw options": "Ouvrir les options de dessin",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} dans la zone de {place} : {count} élément",
|
||||
"many": "{what} dans la zone de {place} : {count} d’éléments",
|
||||
"other": "{what} dans la zone de {place} : {count} éléments"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} élément visible",
|
||||
"many": "{count} d’éléments visibles",
|
||||
"other": "{count} éléments visibles"
|
||||
},
|
||||
"Selected · near {name}": "Sélection · près de {name}",
|
||||
"Near {name}": "Près de {name}",
|
||||
"Stop drawing": "Arrêter le dessin",
|
||||
"{place} · landmarks": "{place} · points d’intérêt",
|
||||
"In {place}": "Dans la zone de {place}",
|
||||
"Near {place}": "Près de {place}",
|
||||
"Unable to complete this action: {reason}": "Impossible de terminer cette action : {reason}",
|
||||
"Unable to complete this action. Please try again.": "Impossible de terminer cette action. Veuillez réessayer.",
|
||||
"{layer} M{mag}+": "{layer} de magnitude {mag} ou plus",
|
||||
"Search places, layers and things on the map, or ask GEV": "Recherchez des lieux, des couches et des éléments sur la carte, ou interrogez GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "Recherchez des lieux, des couches, des vols… ou interrogez GEV · > pour les commandes",
|
||||
"No matching command": "Aucune commande correspondante",
|
||||
"Looks private, so nothing is searched or sent": "Semble privé, donc rien n’est recherché ni envoyé",
|
||||
"Bilawal on YouTube": "Bilawal sur YouTube",
|
||||
"BROWSE STORIES": "PARCOURIR LES STORIES",
|
||||
"ENTER GOD MODE": "ENTRER EN MODE DIEU",
|
||||
"Go deeper": "Aller plus loin",
|
||||
"The studio behind GEV": "Le studio derrière GEV",
|
||||
"Visual presets": "Préréglages visuels",
|
||||
"Open source. Self-host, fork, add a layer.": "Open source. Hébergez-le, forkez-le, ajoutez une couche.",
|
||||
"Choose your mode": "Choisissez votre mode",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "Le viseur du satellite espion : vue circulaire, HUD tactique, caméra cinématographique. Pour explorer.",
|
||||
"Welcome to God's Eye View": "Bienvenue dans God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "Une vue plus épurée et lisible où chaque valeur indique sa source. Pour la recherche et le reportage.",
|
||||
"Keyhole HUD": "HUD viseur",
|
||||
"Analyst": "Analyste",
|
||||
"God": "Dieu",
|
||||
"COMING SOON": "BIENTÔT",
|
||||
"More from Halfpixel": "Plus de Halfpixel",
|
||||
"Start with": "Commencer par",
|
||||
"FUN": "LOISIR",
|
||||
"Where do you want to start?": "Par où voulez-vous commencer ?",
|
||||
"Three things to know": "Trois choses à savoir",
|
||||
"Pick one to begin with. You can change everything later.": "Choisissez une option pour commencer. Vous pourrez tout modifier ensuite.",
|
||||
"That is all you need to get going.": "C’est tout ce qu’il vous faut pour commencer.",
|
||||
"SKIP · ESC": "PASSER · ESC",
|
||||
"SKIP": "PASSER",
|
||||
"Search places": "Rechercher des lieux",
|
||||
"Type a place into the search bar.": "Saisissez un lieu dans la barre de recherche.",
|
||||
"Turn on layers": "Activer des couches",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "Activez des couches pour voir les vols, les navires, les caméras, la météo et plus encore.",
|
||||
"Click anything": "Cliquez sur un élément",
|
||||
"Select a map item to see its details.": "Sélectionnez un élément de la carte pour voir ses détails.",
|
||||
"Bilawal on {site}": "Bilawal sur {site}",
|
||||
"Bilawal's website": "Site web de Bilawal",
|
||||
"BACK": "RETOUR"
|
||||
}
|
||||
+75
-17
@@ -38,7 +38,6 @@
|
||||
"Loading the keyless globe...": "טוען גלובוס ללא מפתח...",
|
||||
"Google 3D Tiles unavailable ({detail}). Loading the keyless globe...": "Google 3D Tiles אינם זמינים ({detail}). טוען גלובוס ללא מפתח...",
|
||||
"Initializing systems...": "מאתחל מערכות...",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "מצב משימות החלל מבודד את נתוני ההצגה החוזרת. צא מהמצב כדי להפעיל את {layer}.",
|
||||
"Data attribution": "ייחוס נתונים",
|
||||
"Data provided by:": "הנתונים מסופקים על ידי:",
|
||||
"Close data attribution": "סגירת ייחוס הנתונים",
|
||||
@@ -300,8 +299,6 @@
|
||||
"ENVIRONMENTAL": "סביבתי",
|
||||
"EARTH WATCH": "EARTH WATCH",
|
||||
"ACTIVE EVENTS": "אירועים פעילים",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "טיפ: לחצן ה-MIC של GEV בעגינה מאפשר לדבר עם המפה.",
|
||||
"Starting live contacts…": "מתחיל מגעים חיים…",
|
||||
"Opening space missions…": "פותח משימות חלל…",
|
||||
"Scanning active events…": "סורק אירועים פעילים…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "רעידות אדמה חיות ושריפות פעילות, מ-USGS ו-NASA",
|
||||
@@ -1383,6 +1380,7 @@
|
||||
"Exit cockpit to fly to a target": "צא מתא הטייס כדי לטוס אל מטרה",
|
||||
"Exit cockpit to fly to a vessel": "צא מתא הטייס כדי לטוס אל אונייה",
|
||||
"Exit cockpit to fly to a fire": "צא מתא הטייס כדי לטוס אל שריפה",
|
||||
"Exit cockpit to fly to an earthquake": "צא מתא הטייס כדי לטוס אל רעידת אדמה",
|
||||
"Exit cockpit to fly to a sighting": "צא מתא הטייס כדי לטוס אל תצפית",
|
||||
"Exit cockpit to fly to a sighting area": "צא מתא הטייס כדי לטוס אל אזור תצפית",
|
||||
"Exit cockpit to fly to a route": "צא מתא הטייס כדי לטוס אל מסלול",
|
||||
@@ -1434,7 +1432,6 @@
|
||||
"Import failed: {error}": "הייבוא נכשל: {error}",
|
||||
"Import failed (could not read JSON file)": "הייבוא נכשל (לא ניתן לקרוא קובץ JSON)",
|
||||
"Layers refused: {layers}": "שכבות שנדחו: {layers}",
|
||||
"Could not exit {mode} — scene layers may be refused": "לא ניתן לצאת מ-{mode} — ייתכן ששכבות הסצנה יידחו",
|
||||
"Camera move interrupted": "תנועת המצלמה הופסקה",
|
||||
"Scene media timed out": "מדיית הסצנה חרגה מהזמן הקצוב",
|
||||
"Action complete": "הפעולה הושלמה",
|
||||
@@ -1756,10 +1753,8 @@
|
||||
"other": "נוקו {count} שכבות נתונים"
|
||||
},
|
||||
"Selected data layers could not be cleared": "שכבות הנתונים הנבחרות לא נוקו",
|
||||
"Space Missions could not complete the requested transition; try again": "משימות החלל לא השלימו את המעבר המבוקש; נסה שוב",
|
||||
"Nearby installations refreshed": "המתקנים הסמוכים התרעננו",
|
||||
"Nearby installations could not be refreshed; try again": "לא ניתן לרענן את המתקנים הסמוכים; נסה שוב",
|
||||
"Space Missions cancellation could not restore the previous layer state": "ביטול משימות החלל לא שיחזר את מצב השכבה הקודם",
|
||||
"That layer is unavailable in the current Context mode": "השכבה הזאת אינה זמינה במצב ההקשר הנוכחי",
|
||||
"{layerId} could not {action} cleanly": "{layerId} — הפעולה {action} לא הסתיימה כראוי",
|
||||
"start": "התחלה",
|
||||
@@ -1800,6 +1795,16 @@
|
||||
"Live Flights": "טיסות חיות",
|
||||
"Military Flights": "טיסות צבאיות",
|
||||
"Earthquakes (24h)": "רעידות אדמה (24 שע׳)",
|
||||
"earthquake|Minor": "קל מאוד",
|
||||
"earthquake|Light": "קל",
|
||||
"earthquake|Moderate": "בינוני",
|
||||
"earthquake|Strong": "חזק",
|
||||
"earthquake|Major": "חזק מאוד",
|
||||
"earthquake|Great": "עצום",
|
||||
"earthquake|Shallow": "רדוד",
|
||||
"earthquake|Intermediate": "עומק בינוני",
|
||||
"earthquake|Deep": "עמוק",
|
||||
"{km} km deep": "בעומק {km} ק״מ",
|
||||
"Satellites": "לוויינים",
|
||||
"Space Missions (30d)": "משימות חלל (30 יום)",
|
||||
"Street Traffic": "תנועה ברחובות",
|
||||
@@ -2335,7 +2340,6 @@
|
||||
"SPACE MISSIONS": "משימות חלל",
|
||||
"SELECT CONTEXT": "בחירת ההקשר",
|
||||
"CONTACTS — nearest planes · vessels · sites": "מגעים — המטוסים הקרובים · אוניות · אתרים",
|
||||
"SPACE MISSIONS — launches & orbital assets": "משימות חלל — שיגורים ונכסים במסלול",
|
||||
"Contact Context actions": "פעולות הקשר של מגעים",
|
||||
"SEARCH NEARBY SITES": "חיפוש אתרים סמוכים",
|
||||
"Reclassify tracked contact as TR-3B": "סיווג מחדש של המגע הנעקב כ-TR-3B",
|
||||
@@ -2402,14 +2406,10 @@
|
||||
"Shot name": "שם השוט",
|
||||
"DEL": "מחיקה",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "חדר בקרה · שיגור ראשון",
|
||||
"Choose your first view": "בחירת התצוגה הראשונה",
|
||||
"LIVE CONTACTS": "מגעים חיים",
|
||||
"Aircraft, vessels and nearby intelligence": "מטוסים, אוניות ומודיעין סמוך",
|
||||
"Launches, spacecraft and orbital context": "שיגורים, חלליות והקשר המסלולי",
|
||||
"EXPLORE MANUALLY": "חקירה ידנית",
|
||||
"Begin with a clean globe": "התחלה מגלובוס נקי",
|
||||
"Don't show this again": "אל תציג זאת שוב",
|
||||
"ESC to dismiss": "Esc להסתרה",
|
||||
"DISMISS": "הסתרה",
|
||||
"CONTACTS CONTEXT OFF": "הקשר המגעים כבוי",
|
||||
"SELECT CONTACTS TO LOAD OBSERVED / MAPPED PROXIMITY": "בחר מגעים לטעינת קרבה נצפית / ממופה",
|
||||
@@ -2543,9 +2543,8 @@
|
||||
"HUD layout": "פריסת ה-HUD",
|
||||
"Tactical": "טקטי",
|
||||
"Minimal": "מינימלי",
|
||||
"Cyber": "סייבר",
|
||||
"Sonar": "סונאר",
|
||||
"Cyber sonar contact scanner": "סורק הסונאר הסייברי למגעים",
|
||||
"Sonar contact scanner": "סורק המגעים של הסונאר",
|
||||
"Rings": "טבעות",
|
||||
"Sonar ring count": "מניין טבעות הסונאר",
|
||||
"Range": "טווח",
|
||||
@@ -2553,7 +2552,7 @@
|
||||
"Power": "עוצמה",
|
||||
"Sonar intensity": "עצמת הסונאר",
|
||||
"Opacity": "אטימות",
|
||||
"Cyber contact and label opacity": "אטימות המגעים והתוויות הסייבריים",
|
||||
"Sonar contact and label opacity": "אטימות המגעים והתוויות של הסונאר",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "האטימות המזערית לנקודות המפה, סמלים, דגמים, סוגריים ותוויות בין מעברי הסונאר",
|
||||
"Sector": "סקטור",
|
||||
"Sonar sector width": "רוחב סקטור הסונאר",
|
||||
@@ -3163,7 +3162,7 @@
|
||||
"Control cockpit": "שליטה בתא הטייס",
|
||||
"Change visual style": "שינוי סגנון הראייה",
|
||||
"Adjust HUD": "כוונון ה-HUD",
|
||||
"Adjust cyber sonar": "כוונון הסונאר הסייברי",
|
||||
"Adjust sonar": "כוונון הסונאר",
|
||||
"Adjust detection overlay": "כוונון שכבת הזיהוי",
|
||||
"Change map stack": "שינוי ערכת המפות",
|
||||
"Adjust post-processing": "כוונון העיבוד שלאחר הרינדור",
|
||||
@@ -3564,6 +3563,8 @@
|
||||
"Click the card to open EMODnet ↗": "לחץ על הכרטיס כדי לפתוח את EMODnet ↗",
|
||||
"Click the card to open the article ↗": "לחץ על הכרטיס כדי לפתוח את הערך ↗",
|
||||
"Click the card to open the source ↗": "לחץ על הכרטיס כדי לפתוח את המקור ↗",
|
||||
"Open the source for {title}, {details}": "פתיחת המקור של {title}, {details}",
|
||||
"Focus earthquake {title}, {details}": "התמקדות ברעידת האדמה {title}, {details}",
|
||||
"All years": "כל השנים",
|
||||
"Period": "תקופה",
|
||||
"From": "מ-",
|
||||
@@ -4260,7 +4261,7 @@
|
||||
"Show settings": "הצגת הגדרות",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "בחרו סגנון: רגיל, CRT, NVG, FLIR, אנימה או נואר (מקשים 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "במקור מפה, בחרו את מפת הבסיס: Google 3D, Bing, Esri או OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "כאן אפשר להפעיל או לכבות את התצוגה העילית. באפשרויות הפריסה בחרו טקטי, מינימלי או סייבר",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "כאן אפשר להפעיל או לכבות את התצוגה העילית. באפשרויות הפריסה בחרו טקטי או מינימלי",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "הסקופ תוחם את התצוגה בעיגול. ריכוך מרכך את השוליים, ואטימות קובעת כמה כהה האזור שמחוץ לעיגול.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "הממשק הנקי מסתיר את הלוחות והנתונים כדי לפנות את התצוגה",
|
||||
"Press search, then type part of a layer name or source": "לחצו על החיפוש והקלידו חלק משם השכבה או המקור שלה",
|
||||
@@ -4345,6 +4346,7 @@
|
||||
"Turn off": "כיבוי",
|
||||
"Command": "פקודה",
|
||||
"No layers are on": "אין שכבות פעילות",
|
||||
"No other layers are on": "אין שכבות אחרות פעילות",
|
||||
"No matching layers": "אין שכבות תואמות",
|
||||
"Show me {thing} settings": "הצגת ההגדרות של {thing}",
|
||||
"Show me how: {thing}": "איך עושים זאת: {thing}",
|
||||
@@ -4363,5 +4365,61 @@
|
||||
"other": "הצגת {what} ב{place} ({count} פריטים)"
|
||||
},
|
||||
"Go there": "מעבר למקום",
|
||||
"Open draw options": "פתיחת אפשרויות הציור"
|
||||
"Open draw options": "פתיחת אפשרויות הציור",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} ב{place}: {count} פריט",
|
||||
"two": "{what} ב{place}: {count} פריטים",
|
||||
"other": "{what} ב{place}: {count} פריטים"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} פריט בתצוגה",
|
||||
"two": "{count} פריטים בתצוגה",
|
||||
"other": "{count} פריטים בתצוגה"
|
||||
},
|
||||
"Selected · near {name}": "נבחר · ליד {name}",
|
||||
"Near {name}": "ליד {name}",
|
||||
"Stop drawing": "הפסקת הציור",
|
||||
"{place} · landmarks": "{place} · אתרים בולטים",
|
||||
"In {place}": "בתוך {place}",
|
||||
"Near {place}": "בסביבת {place}",
|
||||
"Unable to complete this action: {reason}": "לא ניתן להשלים את הפעולה: {reason}",
|
||||
"Unable to complete this action. Please try again.": "לא ניתן להשלים את הפעולה. נסו שוב.",
|
||||
"{layer} M{mag}+": "{layer} בעוצמה M{mag} ומעלה",
|
||||
"Search places, layers and things on the map, or ask GEV": "חפשו מקומות, שכבות ופריטים במפה, או שאלו את GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "חיפוש מקומות, שכבות וטיסות… או שאלה ל‑GEV · > לפקודות",
|
||||
"No matching command": "אין פקודה תואמת",
|
||||
"Looks private, so nothing is searched or sent": "נראה פרטי, ולכן שום דבר לא מחופש או נשלח",
|
||||
"Where do you want to start?": "מאיפה תרצו להתחיל?",
|
||||
"Three things to know": "שלושה דברים שכדאי לדעת",
|
||||
"Pick one to begin with. You can change everything later.": "בחרו אפשרות אחת להתחלה. אפשר לשנות הכול בהמשך.",
|
||||
"That is all you need to get going.": "זה כל מה שצריך כדי להתחיל.",
|
||||
"SKIP · ESC": "דילוג · ESC",
|
||||
"SKIP": "דילוג",
|
||||
"Search places": "חיפוש מקומות",
|
||||
"Type a place into the search bar.": "הקלידו מקום בשורת החיפוש.",
|
||||
"Turn on layers": "הפעלת שכבות",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "הפעילו שכבות כדי לראות טיסות, ספינות, מצלמות, מזג אוויר ועוד.",
|
||||
"Click anything": "לחצו על פריט כלשהו",
|
||||
"Select a map item to see its details.": "בחרו פריט במפה כדי לראות את פרטיו.",
|
||||
"Bilawal on {site}": "בילוואל ב־{site}",
|
||||
"Bilawal's website": "האתר של בילוואל",
|
||||
"BACK": "חזרה",
|
||||
"Welcome to God's Eye View": "ברוכים הבאים ל־God's Eye View",
|
||||
"Choose your mode": "בחרו מצב",
|
||||
"God": "אלוהים",
|
||||
"FUN": "בשביל הכיף",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "מבט דרך לוויין ריגול: תצוגה עגולה, תצוגה עילית טקטית ומצלמה קולנועית. לחקירה וגילוי.",
|
||||
"Keyhole HUD": "תצוגה עילית עגולה",
|
||||
"Visual presets": "הגדרות תצוגה מוכנות",
|
||||
"Analyst": "אנליסט",
|
||||
"COMING SOON": "בקרוב",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "תצוגה נקייה וקריאה יותר, שבה כל ערך מציג את מקורו. למחקר ולדיווח.",
|
||||
"Start with": "התחילו עם",
|
||||
"Go deeper": "להעמיק",
|
||||
"BROWSE STORIES": "עיון בסיפורים",
|
||||
"More from Halfpixel": "עוד מ־Halfpixel",
|
||||
"Bilawal on YouTube": "בילוואל ב־YouTube",
|
||||
"The studio behind GEV": "הסטודיו שמאחורי GEV",
|
||||
"Open source. Self-host, fork, add a layer.": "קוד פתוח. אירוח עצמאי, יצירת עותק והוספת שכבה.",
|
||||
"ENTER GOD MODE": "כניסה למצב אלוהים"
|
||||
}
|
||||
+75
-17
@@ -129,7 +129,6 @@
|
||||
"Loading the keyless globe...": "Caricamento del globo senza chiave...",
|
||||
"Google 3D Tiles unavailable ({detail}). Loading the keyless globe...": "Google 3D Tiles non disponibile ({detail}). Caricamento del globo senza chiave...",
|
||||
"Initializing systems...": "Inizializzazione dei sistemi...",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "La modalità Missioni spaziali isola i dati del replay. Esci dalla modalità per attivare {layer}.",
|
||||
"Data attribution": "Attribuzione dei dati",
|
||||
"Data provided by:": "Dati forniti da:",
|
||||
"Close data attribution": "Chiudi le attribuzioni dei dati",
|
||||
@@ -407,7 +406,6 @@
|
||||
"ENVIRONMENTAL": "AMBIENTE",
|
||||
"EARTH WATCH": "OSSERVATORIO TERRA",
|
||||
"ACTIVE EVENTS": "EVENTI ATTIVI",
|
||||
"Starting live contacts…": "Avvio dei contatti live…",
|
||||
"Opening space missions…": "Apertura delle missioni spaziali…",
|
||||
"Scanning active events…": "Scansione degli eventi attivi…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "Terremoti e incendi attivi in tempo reale, da USGS e NASA",
|
||||
@@ -1500,6 +1498,7 @@
|
||||
"Exit cockpit to fly to a target": "Esci dal cockpit per volare a un obiettivo",
|
||||
"Exit cockpit to fly to a vessel": "Esci dal cockpit per volare a una nave",
|
||||
"Exit cockpit to fly to a fire": "Esci dal cockpit per volare a un incendio",
|
||||
"Exit cockpit to fly to an earthquake": "Esci dal cockpit per volare a un terremoto",
|
||||
"Exit cockpit to fly to a route": "Esci dal cockpit per volare a un percorso",
|
||||
"Exit cockpit to fly to a file": "Esci dal cockpit per volare a un file",
|
||||
"Exit cockpit to fly to a scene": "Esci dal cockpit per volare a una scena",
|
||||
@@ -1550,7 +1549,6 @@
|
||||
"Import failed: {error}": "Importazione non riuscita: {error}",
|
||||
"Import failed (could not read JSON file)": "Importazione non riuscita (impossibile leggere il file JSON)",
|
||||
"Layers refused: {layers}": "Livelli rifiutati: {layers}",
|
||||
"Could not exit {mode} — scene layers may be refused": "Impossibile uscire da {mode}: i livelli della scena potrebbero essere rifiutati",
|
||||
"Camera move interrupted": "Movimento della camera interrotto",
|
||||
"Scene media timed out": "I contenuti della scena sono andati in timeout",
|
||||
"Action complete": "Azione completata",
|
||||
@@ -1690,7 +1688,6 @@
|
||||
"VISUAL PRESETS": "PRESET VISIVI",
|
||||
"LOCATION": "POSIZIONE",
|
||||
"CONTACTS — nearest planes · vessels · sites": "CONTATTI — aerei · navi · siti più vicini",
|
||||
"SPACE MISSIONS — launches & orbital assets": "MISSIONI SPAZIALI — lanci e asset orbitali",
|
||||
"LIVE SIGNALS": "SEGNALI LIVE",
|
||||
"Contacts could not complete the requested transition; try again": "Impossibile completare la transizione richiesta per Contatti; riprova",
|
||||
"CCTV layer unavailable": "Livello CCTV non disponibile",
|
||||
@@ -1917,10 +1914,8 @@
|
||||
"other": "Disattivati {count} livelli dati"
|
||||
},
|
||||
"Selected data layers could not be cleared": "Impossibile disattivare i livelli dati selezionati",
|
||||
"Space Missions could not complete the requested transition; try again": "Impossibile completare la transizione richiesta per Missioni spaziali; riprova",
|
||||
"Nearby installations refreshed": "Installazioni vicine aggiornate",
|
||||
"Nearby installations could not be refreshed; try again": "Impossibile aggiornare le installazioni vicine; riprova",
|
||||
"Space Missions cancellation could not restore the previous layer state": "L'annullamento di Missioni spaziali non ha potuto ripristinare lo stato precedente dei livelli",
|
||||
"That layer is unavailable in the current Context mode": "Quel livello non è disponibile nella modalità Contesto attuale",
|
||||
"{layerId} could not {action} cleanly": "{layerId} non ha potuto {action} correttamente",
|
||||
"start": "avviarsi",
|
||||
@@ -1963,6 +1958,16 @@
|
||||
"Live Flights": "Voli live",
|
||||
"Military Flights": "Voli militari",
|
||||
"Earthquakes (24h)": "Terremoti (24 h)",
|
||||
"earthquake|Minor": "Minore",
|
||||
"earthquake|Light": "Leggero",
|
||||
"earthquake|Moderate": "Moderato",
|
||||
"earthquake|Strong": "Forte",
|
||||
"earthquake|Major": "Maggiore",
|
||||
"earthquake|Great": "Grande",
|
||||
"earthquake|Shallow": "Superficiale",
|
||||
"earthquake|Intermediate": "Intermedio",
|
||||
"earthquake|Deep": "Profondo",
|
||||
"{km} km deep": "{km} km di profondità",
|
||||
"Satellites": "Satelliti",
|
||||
"Place names": "Nomi dei luoghi",
|
||||
"Space Missions (30d)": "Missioni spaziali (30 g)",
|
||||
@@ -2802,7 +2807,7 @@
|
||||
"Control cockpit": "Controlla il cockpit",
|
||||
"Change visual style": "Cambia lo stile visivo",
|
||||
"Adjust HUD": "Regola l'HUD",
|
||||
"Adjust cyber sonar": "Regola il sonar Cyber",
|
||||
"Adjust sonar": "Regola il sonar",
|
||||
"Adjust detection overlay": "Regola l'overlay di rilevamento",
|
||||
"Change map stack": "Cambia lo stack mappa",
|
||||
"Adjust post-processing": "Regola la post-elaborazione",
|
||||
@@ -3054,9 +3059,8 @@
|
||||
"HUD layout": "Layout HUD",
|
||||
"Tactical": "Tattico",
|
||||
"Minimal": "Minimale",
|
||||
"Cyber": "Cyber",
|
||||
"Sonar": "Sonar",
|
||||
"Cyber sonar contact scanner": "Scanner di contatti sonar Cyber",
|
||||
"Sonar contact scanner": "Scanner di contatti sonar",
|
||||
"Rings": "Anelli",
|
||||
"Sonar ring count": "Numero di anelli del sonar",
|
||||
"Range": "Portata",
|
||||
@@ -3064,7 +3068,7 @@
|
||||
"Power": "Potenza",
|
||||
"Sonar intensity": "Intensità del sonar",
|
||||
"Opacity": "Opacità",
|
||||
"Cyber contact and label opacity": "Opacità di contatti ed etichette Cyber",
|
||||
"Sonar contact and label opacity": "Opacità di contatti ed etichette del sonar",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "Opacità minima di punti sulla mappa, icone, modelli, riquadri ed etichette tra un passaggio del sonar e l'altro",
|
||||
"Sector": "Settore",
|
||||
"Sonar sector width": "Ampiezza del settore del sonar",
|
||||
@@ -3176,15 +3180,10 @@
|
||||
"Reset map bearing to north": "Riporta l'orientamento della mappa a nord",
|
||||
"Reset camera and return to full globe view": "Ripristina la camera e torna alla vista del globo intero",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "CONTROLLO MISSIONE · PRIMO AVVIO",
|
||||
"Choose your first view": "Scegli la tua prima vista",
|
||||
"LIVE CONTACTS": "CONTATTI LIVE",
|
||||
"Aircraft, vessels and nearby intelligence": "Aerei, navi e intelligence nelle vicinanze",
|
||||
"Launches, spacecraft and orbital context": "Lanci, veicoli spaziali e contesto orbitale",
|
||||
"EXPLORE MANUALLY": "ESPLORA MANUALMENTE",
|
||||
"Begin with a clean globe": "Inizia con un globo pulito",
|
||||
"Don't show this again": "Non mostrare più",
|
||||
"ESC to dismiss": "ESC per chiudere",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "Suggerimento: il pulsante GEV MIC nel dock ti permette di parlare con la mappa.",
|
||||
"Malformed cyclone snapshot": "Snapshot dei cicloni non valido",
|
||||
"Cyclone request timed out": "La richiesta dei cicloni è andata in timeout",
|
||||
"{lower} to {upper}": "Da {lower} a {upper}",
|
||||
@@ -3422,6 +3421,8 @@
|
||||
"Source: {value}": "Fonte: {value}",
|
||||
"Click the card to open EMODnet ↗": "Fai clic sulla scheda per aprire EMODnet ↗",
|
||||
"Click the card to open the source ↗": "Fai clic sulla scheda per aprire la fonte ↗",
|
||||
"Open the source for {title}, {details}": "Apri la fonte di {title}, {details}",
|
||||
"Focus earthquake {title}, {details}": "Inquadra il terremoto {title}, {details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata non disponibile; solo EMODnet",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet non disponibile; solo Wikidata",
|
||||
"Shipwrecks unavailable": "Relitti non disponibili",
|
||||
@@ -4260,7 +4261,7 @@
|
||||
"Show settings": "Mostra impostazioni",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "Scegli uno stile: Normale, CRT, NVG, FLIR, Anime o Noir (tasti 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "In Fonte mappa, scegli la mappa di base: Google 3D, Bing, Esri o OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "Attiva o disattiva qui l’HUD. In Layout, scegli Tattico, Minimale o Cyber.",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "Attiva o disattiva qui l’HUD. In Layout, scegli Tattico o Minimale.",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "Scope inquadra la vista in un cerchio. Sfumatura ne ammorbidisce il bordo e Opacità regola quanto scurire l’esterno.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "UI pulita nasconde i pannelli e gli indicatori per lasciare libera la vista",
|
||||
"Press search, then type part of a layer name or source": "Premi il pulsante di ricerca, poi digita parte del nome o della fonte di un livello",
|
||||
@@ -4345,6 +4346,7 @@
|
||||
"Turn off": "Disattiva",
|
||||
"Command": "Comando",
|
||||
"No layers are on": "Nessun livello attivo",
|
||||
"No other layers are on": "Nessun altro livello attivo",
|
||||
"No matching layers": "Nessun livello corrispondente",
|
||||
"Show me {thing} settings": "Mostrami le impostazioni di {thing}",
|
||||
"Show me how: {thing}": "Mostrami come: {thing}",
|
||||
@@ -4363,5 +4365,61 @@
|
||||
"other": "Mostra {what} a {place} ({count} elementi)"
|
||||
},
|
||||
"Go there": "Vai lì",
|
||||
"Open draw options": "Apri le opzioni di disegno"
|
||||
"Open draw options": "Apri le opzioni di disegno",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} a {place}: {count} elemento",
|
||||
"many": "{what} a {place}: {count} di elementi",
|
||||
"other": "{what} a {place}: {count} elementi"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} elemento in vista",
|
||||
"many": "{count} di elementi in vista",
|
||||
"other": "{count} elementi in vista"
|
||||
},
|
||||
"Selected · near {name}": "Selezione · vicino a {name}",
|
||||
"Near {name}": "Vicino a {name}",
|
||||
"Stop drawing": "Interrompi il disegno",
|
||||
"{place} · landmarks": "{place} · punti di interesse",
|
||||
"In {place}": "A {place}",
|
||||
"Near {place}": "Vicino a {place}",
|
||||
"Unable to complete this action: {reason}": "Impossibile completare questa azione: {reason}",
|
||||
"Unable to complete this action. Please try again.": "Impossibile completare questa azione. Riprova.",
|
||||
"{layer} M{mag}+": "{layer} di magnitudo {mag} o superiore",
|
||||
"Search places, layers and things on the map, or ask GEV": "Cerca luoghi, livelli ed elementi sulla mappa oppure chiedi a GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "Cerca luoghi, livelli, voli… oppure chiedi a GEV · > per i comandi",
|
||||
"No matching command": "Nessun comando corrispondente",
|
||||
"Looks private, so nothing is searched or sent": "Sembra privato, quindi non viene cercato né inviato nulla",
|
||||
"Bilawal on YouTube": "Bilawal su YouTube",
|
||||
"BROWSE STORIES": "SFOGLIA LE STORIES",
|
||||
"ENTER GOD MODE": "ENTRA IN MODALITÀ DIO",
|
||||
"Go deeper": "Approfondisci",
|
||||
"The studio behind GEV": "Lo studio dietro GEV",
|
||||
"Visual presets": "Preset visivi",
|
||||
"Open source. Self-host, fork, add a layer.": "Open source. Ospitalo tu, fai un fork, aggiungi un livello.",
|
||||
"Choose your mode": "Scegli la modalità",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "Il mirino del satellite spia: vista circolare, HUD tattico, camera cinematografica. Per esplorare.",
|
||||
"Welcome to God's Eye View": "Benvenuto in God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "Una vista più pulita e leggibile in cui ogni valore mostra la sua fonte. Per ricerca e reportage.",
|
||||
"Keyhole HUD": "HUD a mirino",
|
||||
"Analyst": "Analista",
|
||||
"God": "Dio",
|
||||
"COMING SOON": "IN ARRIVO",
|
||||
"More from Halfpixel": "Altro da Halfpixel",
|
||||
"Start with": "Inizia con",
|
||||
"FUN": "SVAGO",
|
||||
"Where do you want to start?": "Da dove vuoi iniziare?",
|
||||
"Three things to know": "Tre cose da sapere",
|
||||
"Pick one to begin with. You can change everything later.": "Scegli un’opzione per iniziare. Potrai cambiare tutto in seguito.",
|
||||
"That is all you need to get going.": "È tutto ciò che serve per iniziare.",
|
||||
"SKIP · ESC": "SALTA · ESC",
|
||||
"SKIP": "SALTA",
|
||||
"Search places": "Cerca luoghi",
|
||||
"Type a place into the search bar.": "Digita un luogo nella barra di ricerca.",
|
||||
"Turn on layers": "Attiva i livelli",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "Attiva i livelli per vedere voli, navi, telecamere, meteo e altro.",
|
||||
"Click anything": "Fai clic su un elemento",
|
||||
"Select a map item to see its details.": "Seleziona un elemento della mappa per vederne i dettagli.",
|
||||
"Bilawal on {site}": "Bilawal su {site}",
|
||||
"Bilawal's website": "Sito web di Bilawal",
|
||||
"BACK": "INDIETRO"
|
||||
}
|
||||
+71
-17
@@ -113,7 +113,6 @@
|
||||
"Loading the keyless globe...": "キー不要の地球儀を読み込み中…",
|
||||
"Google 3D Tiles unavailable ({detail}). Loading the keyless globe...": "Google 3D Tilesを利用できません({detail})。キー不要の地球儀を読み込み中…",
|
||||
"Initializing systems...": "システムを初期化中…",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "宇宙ミッションはリプレイデータを分離しています。{layer}を有効にするには、このモードを終了してください。",
|
||||
"Data attribution": "データの出典",
|
||||
"Data provided by:": "データ提供:",
|
||||
"Close data attribution": "データ出典を閉じる",
|
||||
@@ -387,7 +386,6 @@
|
||||
"ENVIRONMENTAL": "環境",
|
||||
"EARTH WATCH": "地球監視",
|
||||
"ACTIVE EVENTS": "発生中のイベント",
|
||||
"Starting live contacts…": "ライブコンタクトを開始中…",
|
||||
"Opening space missions…": "宇宙ミッションを開いています…",
|
||||
"Scanning active events…": "発生中のイベントをスキャン中…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "USGSとNASAによる地震と火災のライブ情報",
|
||||
@@ -1454,6 +1452,7 @@
|
||||
"Exit cockpit to fly to a target": "ターゲットへ移動するにはコックピットを終了してください",
|
||||
"Exit cockpit to fly to a vessel": "船舶へ移動するにはコックピットを終了してください",
|
||||
"Exit cockpit to fly to a fire": "火災へ移動するにはコックピットを終了してください",
|
||||
"Exit cockpit to fly to an earthquake": "地震へ移動するにはコックピットを終了してください",
|
||||
"Exit cockpit to fly to a route": "ルートへ移動するにはコックピットを終了してください",
|
||||
"Exit cockpit to fly to a file": "ファイルの位置へ移動するにはコックピットを終了してください",
|
||||
"Exit cockpit to fly to a scene": "シーンへ移動するにはコックピットを終了してください",
|
||||
@@ -1500,7 +1499,6 @@
|
||||
"Import failed: {error}": "インポートに失敗しました:{error}",
|
||||
"Import failed (could not read JSON file)": "インポートに失敗しました(JSONファイルを読み取れませんでした)",
|
||||
"Layers refused: {layers}": "拒否されたレイヤー:{layers}",
|
||||
"Could not exit {mode} — scene layers may be refused": "{mode}を終了できませんでした。シーンのレイヤーが拒否される可能性があります",
|
||||
"Camera move interrupted": "カメラの移動が中断されました",
|
||||
"Scene media timed out": "シーンのメディアがタイムアウトしました",
|
||||
"Action complete": "操作が完了しました",
|
||||
@@ -1634,7 +1632,6 @@
|
||||
"VISUAL PRESETS": "ビジュアルプリセット",
|
||||
"LOCATION": "位置",
|
||||
"CONTACTS — nearest planes · vessels · sites": "コンタクト:最寄りの航空機 · 船舶 · 施設",
|
||||
"SPACE MISSIONS — launches & orbital assets": "宇宙ミッション:打ち上げと軌道上の宇宙機",
|
||||
"LIVE SIGNALS": "ライブシグナル",
|
||||
"Contacts could not complete the requested transition; try again": "コンタクトが要求された切り替えを完了できませんでした。もう一度お試しください",
|
||||
"CCTV layer unavailable": "CCTVレイヤーを利用できません",
|
||||
@@ -1845,10 +1842,8 @@
|
||||
"other": "データレイヤーを{count}件解除しました"
|
||||
},
|
||||
"Selected data layers could not be cleared": "選択中のデータレイヤーを解除できませんでした",
|
||||
"Space Missions could not complete the requested transition; try again": "宇宙ミッションが要求された切り替えを完了できませんでした。もう一度お試しください",
|
||||
"Nearby installations refreshed": "周辺施設を更新しました",
|
||||
"Nearby installations could not be refreshed; try again": "周辺施設を更新できませんでした。もう一度お試しください",
|
||||
"Space Missions cancellation could not restore the previous layer state": "宇宙ミッションのキャンセル時に、以前のレイヤー状態を復元できませんでした",
|
||||
"That layer is unavailable in the current Context mode": "そのレイヤーは現在のコンテキストモードでは利用できません",
|
||||
"{layerId} could not {action} cleanly": "{layerId}を正常に{action}できませんでした",
|
||||
"start": "開始",
|
||||
@@ -1885,6 +1880,16 @@
|
||||
"Live Flights": "ライブフライト",
|
||||
"Military Flights": "軍用機",
|
||||
"Earthquakes (24h)": "地震(24時間)",
|
||||
"earthquake|Minor": "微小",
|
||||
"earthquake|Light": "軽微",
|
||||
"earthquake|Moderate": "中規模",
|
||||
"earthquake|Strong": "強い",
|
||||
"earthquake|Major": "大規模",
|
||||
"earthquake|Great": "巨大",
|
||||
"earthquake|Shallow": "浅発",
|
||||
"earthquake|Intermediate": "やや深発",
|
||||
"earthquake|Deep": "深発",
|
||||
"{km} km deep": "深さ {km} km",
|
||||
"Satellites": "衛星",
|
||||
"Place names": "地名",
|
||||
"Space Missions (30d)": "宇宙ミッション(30日)",
|
||||
@@ -2642,7 +2647,7 @@
|
||||
"Control cockpit": "コックピットを操作",
|
||||
"Change visual style": "ビジュアルスタイルを変更",
|
||||
"Adjust HUD": "HUDを調整",
|
||||
"Adjust cyber sonar": "サイバーソナーを調整",
|
||||
"Adjust sonar": "ソナーを調整",
|
||||
"Adjust detection overlay": "検出オーバーレイを調整",
|
||||
"Change map stack": "マップスタックを変更",
|
||||
"Adjust post-processing": "ポストプロセスを調整",
|
||||
@@ -2890,9 +2895,8 @@
|
||||
"HUD layout": "HUDレイアウト",
|
||||
"Tactical": "タクティカル",
|
||||
"Minimal": "ミニマル",
|
||||
"Cyber": "サイバー",
|
||||
"Sonar": "ソナー",
|
||||
"Cyber sonar contact scanner": "サイバーソナーのコンタクトスキャナー",
|
||||
"Sonar contact scanner": "ソナーのコンタクトスキャナー",
|
||||
"Rings": "リング数",
|
||||
"Sonar ring count": "ソナーのリング数",
|
||||
"Range": "範囲",
|
||||
@@ -2900,7 +2904,7 @@
|
||||
"Power": "強度",
|
||||
"Sonar intensity": "ソナーの強度",
|
||||
"Opacity": "不透明度",
|
||||
"Cyber contact and label opacity": "サイバーのコンタクトとラベルの不透明度",
|
||||
"Sonar contact and label opacity": "ソナーのコンタクトとラベルの不透明度",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "ソナーの走査の合間における地図上の点、アイコン、モデル、ブラケット、ラベルの最小不透明度",
|
||||
"Sector": "扇形",
|
||||
"Sonar sector width": "ソナーの扇形の幅",
|
||||
@@ -3012,15 +3016,10 @@
|
||||
"Reset map bearing to north": "地図の方位を北にリセット",
|
||||
"Reset camera and return to full globe view": "カメラをリセットして地球全体ビューに戻す",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "ミッションコントロール · 初回起動",
|
||||
"Choose your first view": "最初のビューを選択",
|
||||
"LIVE CONTACTS": "ライブコンタクト",
|
||||
"Aircraft, vessels and nearby intelligence": "航空機、船舶、周辺のインテリジェンス",
|
||||
"Launches, spacecraft and orbital context": "打ち上げ、宇宙機、軌道の状況",
|
||||
"EXPLORE MANUALLY": "手動で探索",
|
||||
"Begin with a clean globe": "まっさらな地球儀から始める",
|
||||
"Don't show this again": "今後表示しない",
|
||||
"ESC to dismiss": "Escで閉じる",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "ヒント:ドックの[マイク]ボタンで地図に話しかけられます。",
|
||||
"routing busy — too many routes at once": "ルート検索サービスが混雑しています。同時に要求されたルートが多すぎます",
|
||||
"route proxy error": "ルート検索プロキシでエラーが発生しました",
|
||||
"Malformed cyclone snapshot": "サイクロンのスナップショットの形式が不正です",
|
||||
@@ -3250,6 +3249,8 @@
|
||||
"Source: {value}": "出典:{value}",
|
||||
"Click the card to open EMODnet ↗": "カードをクリックしてEMODnetを開く ↗",
|
||||
"Click the card to open the source ↗": "カードをクリックして出典を開く ↗",
|
||||
"Open the source for {title}, {details}": "{title}のソースを開く({details})",
|
||||
"Focus earthquake {title}, {details}": "地震{title}にフォーカス({details})",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidataを利用できません。EMODnetのみ表示しています",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnetを利用できません。Wikidataのみ表示しています",
|
||||
"Shipwrecks unavailable": "難破船データを利用できません",
|
||||
@@ -4054,7 +4055,7 @@
|
||||
"Show settings": "設定を表示",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "標準、CRT、NVG、FLIR、アニメ、ノワールからスタイルを選びます(キー1~6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "マップソースで背景地図を選びます:Google 3D、Bing、Esri、OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "ここでHUDをオン・オフできます。レイアウトでタクティカル、ミニマル、サイバーを選びます",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "ここでHUDをオン・オフできます。レイアウトでタクティカルかミニマルを選びます",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "スコープは表示範囲を円形に切り取ります。ぼかしで円の縁をなじませ、不透明度で円の外側の暗さを調整します。",
|
||||
"Clean UI hides the panels and readouts for a clear view": "クリーンUIはパネルや表示情報を隠し、マップを見やすくします",
|
||||
"Press search, then type part of a layer name or source": "検索ボタンを押し、レイヤー名やソース名の一部を入力します",
|
||||
@@ -4139,6 +4140,7 @@
|
||||
"Turn off": "オフにする",
|
||||
"Command": "コマンド",
|
||||
"No layers are on": "オンになっているレイヤーはありません",
|
||||
"No other layers are on": "他にオンになっているレイヤーはありません",
|
||||
"No matching layers": "該当するレイヤーはありません",
|
||||
"Show me {thing} settings": "{thing}の設定を表示",
|
||||
"Show me how: {thing}": "使い方を見る:{thing}",
|
||||
@@ -4155,5 +4157,57 @@
|
||||
"other": "{place}の{what}を表示({count}件)"
|
||||
},
|
||||
"Go there": "その場所に移動",
|
||||
"Open draw options": "描画オプションを開く"
|
||||
"Open draw options": "描画オプションを開く",
|
||||
"{what} in {place}: {count} items": {
|
||||
"other": "{place}の{what}:{count}件"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"other": "{count}件表示中"
|
||||
},
|
||||
"Selected · near {name}": "選択中 · {name}の周辺",
|
||||
"Near {name}": "{name}の周辺",
|
||||
"Stop drawing": "描画を終了",
|
||||
"{place} · landmarks": "{place} · 名所",
|
||||
"In {place}": "{place}の範囲内",
|
||||
"Near {place}": "{place}の周辺",
|
||||
"Unable to complete this action: {reason}": "この操作を完了できませんでした:{reason}",
|
||||
"Unable to complete this action. Please try again.": "この操作を完了できませんでした。もう一度お試しください。",
|
||||
"{layer} M{mag}+": "{layer}(M{mag}以上)",
|
||||
"Search places, layers and things on the map, or ask GEV": "場所、レイヤー、マップ上の対象を検索するか、GEVに質問",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "場所、レイヤー、航空便を検索… またはGEVに質問 · > でコマンド",
|
||||
"No matching command": "一致するコマンドがありません",
|
||||
"Looks private, so nothing is searched or sent": "個人情報の可能性があるため、検索も送信もしません",
|
||||
"Bilawal on YouTube": "YouTube の Bilawal",
|
||||
"BROWSE STORIES": "STORIES を見る",
|
||||
"ENTER GOD MODE": "ゴッドモードで開始",
|
||||
"Go deeper": "さらに詳しく",
|
||||
"The studio behind GEV": "GEV を手がけるスタジオ",
|
||||
"Visual presets": "ビジュアルプリセット",
|
||||
"Open source. Self-host, fork, add a layer.": "オープンソース。セルフホスト、フォーク、レイヤーの追加が可能。",
|
||||
"Choose your mode": "モードを選択",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "偵察衛星の鍵穴ビュー:円形の視野、タクティカル HUD、映画のようなカメラ。探索向け。",
|
||||
"Welcome to God's Eye View": "God's Eye View へようこそ",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "すべての値に出典が表示される、すっきり読みやすいビュー。調査やレポート向け。",
|
||||
"Keyhole HUD": "鍵穴 HUD",
|
||||
"Analyst": "アナリスト",
|
||||
"God": "ゴッド",
|
||||
"COMING SOON": "近日公開",
|
||||
"More from Halfpixel": "Halfpixel のその他のコンテンツ",
|
||||
"Start with": "ここから始める",
|
||||
"FUN": "エンタメ",
|
||||
"Where do you want to start?": "どこから始めますか?",
|
||||
"Three things to know": "知っておきたい3つのこと",
|
||||
"Pick one to begin with. You can change everything later.": "まずは1つ選んでください。後からすべて変更できます。",
|
||||
"That is all you need to get going.": "これで始める準備は完了です。",
|
||||
"SKIP · ESC": "スキップ · ESC",
|
||||
"SKIP": "スキップ",
|
||||
"Search places": "場所を検索",
|
||||
"Type a place into the search bar.": "検索バーに場所を入力して探せます。",
|
||||
"Turn on layers": "レイヤーを有効にする",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "レイヤーを有効にすると、航空機、船舶、カメラ、天気などを表示できます。",
|
||||
"Click anything": "項目をクリック",
|
||||
"Select a map item to see its details.": "地図上の項目を選択すると詳細が表示されます。",
|
||||
"Bilawal on {site}": "{site}のBilawal",
|
||||
"Bilawal's website": "Bilawalのウェブサイト",
|
||||
"BACK": "戻る"
|
||||
}
|
||||
+75
-17
@@ -129,7 +129,6 @@
|
||||
"Loading the keyless globe...": "Carregando o globo sem chave...",
|
||||
"Google 3D Tiles unavailable ({detail}). Loading the keyless globe...": "Google 3D Tiles indisponível ({detail}). Carregando o globo sem chave...",
|
||||
"Initializing systems...": "Inicializando sistemas...",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "O modo Missões espaciais isola os dados da reprise. Saia do modo para ativar {layer}.",
|
||||
"Data attribution": "Atribuição de dados",
|
||||
"Data provided by:": "Dados fornecidos por:",
|
||||
"Close data attribution": "Fechar atribuição de dados",
|
||||
@@ -407,7 +406,6 @@
|
||||
"ENVIRONMENTAL": "AMBIENTAL",
|
||||
"EARTH WATCH": "VIGILÂNCIA DA TERRA",
|
||||
"ACTIVE EVENTS": "EVENTOS ATIVOS",
|
||||
"Starting live contacts…": "Iniciando contatos ao vivo…",
|
||||
"Opening space missions…": "Abrindo missões espaciais…",
|
||||
"Scanning active events…": "Varrendo eventos ativos…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "Terremotos e incêndios ativos ao vivo, do USGS e da NASA",
|
||||
@@ -1500,6 +1498,7 @@
|
||||
"Exit cockpit to fly to a target": "Saia da cabine para voar até um alvo",
|
||||
"Exit cockpit to fly to a vessel": "Saia da cabine para voar até uma embarcação",
|
||||
"Exit cockpit to fly to a fire": "Saia da cabine para voar até um incêndio",
|
||||
"Exit cockpit to fly to an earthquake": "Saia da cabine para voar até um terremoto",
|
||||
"Exit cockpit to fly to a route": "Saia da cabine para voar até uma rota",
|
||||
"Exit cockpit to fly to a file": "Saia da cabine para voar até um arquivo",
|
||||
"Exit cockpit to fly to a scene": "Saia da cabine para voar até uma cena",
|
||||
@@ -1550,7 +1549,6 @@
|
||||
"Import failed: {error}": "Falha na importação: {error}",
|
||||
"Import failed (could not read JSON file)": "Falha na importação (não foi possível ler o arquivo JSON)",
|
||||
"Layers refused: {layers}": "Camadas recusadas: {layers}",
|
||||
"Could not exit {mode} — scene layers may be refused": "Não foi possível sair de {mode} — as camadas da cena podem ser recusadas",
|
||||
"Camera move interrupted": "Movimento de câmera interrompido",
|
||||
"Scene media timed out": "A mídia da cena excedeu o tempo limite",
|
||||
"Action complete": "Ação concluída",
|
||||
@@ -1690,7 +1688,6 @@
|
||||
"VISUAL PRESETS": "PREDEF. VISUAIS",
|
||||
"LOCATION": "LOCAL",
|
||||
"CONTACTS — nearest planes · vessels · sites": "CONTATOS — aviões · embarcações · locais mais próximos",
|
||||
"SPACE MISSIONS — launches & orbital assets": "MISSÕES ESPACIAIS — lançamentos e ativos orbitais",
|
||||
"LIVE SIGNALS": "SINAIS AO VIVO",
|
||||
"Contacts could not complete the requested transition; try again": "Contatos: não foi possível concluir a transição solicitada; tente novamente",
|
||||
"CCTV layer unavailable": "Camada de CCTV indisponível",
|
||||
@@ -1917,10 +1914,8 @@
|
||||
"other": "{count} camadas de dados limpas"
|
||||
},
|
||||
"Selected data layers could not be cleared": "Não foi possível limpar as camadas de dados selecionadas",
|
||||
"Space Missions could not complete the requested transition; try again": "Missões espaciais: não foi possível concluir a transição solicitada; tente novamente",
|
||||
"Nearby installations refreshed": "Instalações próximas atualizadas",
|
||||
"Nearby installations could not be refreshed; try again": "Não foi possível atualizar as instalações próximas; tente novamente",
|
||||
"Space Missions cancellation could not restore the previous layer state": "O cancelamento de Missões espaciais não conseguiu restaurar o estado anterior das camadas",
|
||||
"That layer is unavailable in the current Context mode": "Essa camada não está disponível no modo de contexto atual",
|
||||
"{layerId} could not {action} cleanly": "Não foi possível {action} {layerId} corretamente",
|
||||
"start": "iniciar",
|
||||
@@ -1963,6 +1958,16 @@
|
||||
"Live Flights": "Voos ao vivo",
|
||||
"Military Flights": "Voos militares",
|
||||
"Earthquakes (24h)": "Terremotos (24 h)",
|
||||
"earthquake|Minor": "Menor",
|
||||
"earthquake|Light": "Leve",
|
||||
"earthquake|Moderate": "Moderado",
|
||||
"earthquake|Strong": "Forte",
|
||||
"earthquake|Major": "Maior",
|
||||
"earthquake|Great": "Grande",
|
||||
"earthquake|Shallow": "Raso",
|
||||
"earthquake|Intermediate": "Intermediário",
|
||||
"earthquake|Deep": "Profundo",
|
||||
"{km} km deep": "{km} km de profundidade",
|
||||
"Satellites": "Satélites",
|
||||
"Place names": "Nomes de lugares",
|
||||
"Space Missions (30d)": "Missões espaciais (30 d)",
|
||||
@@ -2804,7 +2809,7 @@
|
||||
"Control cockpit": "Controlar a cabine",
|
||||
"Change visual style": "Mudar o estilo visual",
|
||||
"Adjust HUD": "Ajustar o HUD",
|
||||
"Adjust cyber sonar": "Ajustar o sonar Ciber",
|
||||
"Adjust sonar": "Ajustar o sonar",
|
||||
"Adjust detection overlay": "Ajustar a sobreposição de detecção",
|
||||
"Change map stack": "Mudar a pilha de mapas",
|
||||
"Adjust post-processing": "Ajustar o pós-processamento",
|
||||
@@ -3056,9 +3061,8 @@
|
||||
"HUD layout": "Layout do HUD",
|
||||
"Tactical": "Tático",
|
||||
"Minimal": "Mínimo",
|
||||
"Cyber": "Ciber",
|
||||
"Sonar": "Sonar",
|
||||
"Cyber sonar contact scanner": "Scanner de contatos do sonar Ciber",
|
||||
"Sonar contact scanner": "Scanner de contatos do sonar",
|
||||
"Rings": "Anéis",
|
||||
"Sonar ring count": "Número de anéis do sonar",
|
||||
"Range": "Alcance",
|
||||
@@ -3066,7 +3070,7 @@
|
||||
"Power": "Potência",
|
||||
"Sonar intensity": "Intensidade do sonar",
|
||||
"Opacity": "Opacidade",
|
||||
"Cyber contact and label opacity": "Opacidade de contatos e rótulos Ciber",
|
||||
"Sonar contact and label opacity": "Opacidade de contatos e rótulos do sonar",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "Opacidade mínima de pontos, ícones, modelos, marcadores de alvo e rótulos do mapa entre as passagens do sonar",
|
||||
"Sector": "Setor",
|
||||
"Sonar sector width": "Largura do setor do sonar",
|
||||
@@ -3178,15 +3182,10 @@
|
||||
"Reset map bearing to north": "Redefinir a orientação do mapa para o norte",
|
||||
"Reset camera and return to full globe view": "Redefinir a câmera e voltar à vista do globo completo",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "CENTRO DE CONTROLE · PRIMEIRO ACESSO",
|
||||
"Choose your first view": "Escolha sua primeira vista",
|
||||
"LIVE CONTACTS": "CONTATOS AO VIVO",
|
||||
"Aircraft, vessels and nearby intelligence": "Aeronaves, embarcações e informações da região",
|
||||
"Launches, spacecraft and orbital context": "Lançamentos, espaçonaves e contexto orbital",
|
||||
"EXPLORE MANUALLY": "EXPLORAR MANUALMENTE",
|
||||
"Begin with a clean globe": "Comece com um globo limpo",
|
||||
"Don't show this again": "Não mostrar novamente",
|
||||
"ESC to dismiss": "ESC para fechar",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "Dica: o botão GEV MIC no dock permite falar com o mapa.",
|
||||
"{lower} to {upper}": "{lower} a {upper}",
|
||||
"Up to {upper}": "Até {upper}",
|
||||
"From {lower}": "A partir de {lower}",
|
||||
@@ -3422,6 +3421,8 @@
|
||||
"Source: {value}": "Fonte: {value}",
|
||||
"Click the card to open EMODnet ↗": "Clique no cartão para abrir o EMODnet ↗",
|
||||
"Click the card to open the source ↗": "Clique no cartão para abrir a fonte ↗",
|
||||
"Open the source for {title}, {details}": "Abrir a fonte de {title}, {details}",
|
||||
"Focus earthquake {title}, {details}": "Focar terremoto {title}, {details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata indisponível; mostrando só o EMODnet",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet indisponível; mostrando só o Wikidata",
|
||||
"Shipwrecks unavailable": "Naufrágios indisponíveis",
|
||||
@@ -4260,7 +4261,7 @@
|
||||
"Show settings": "Mostrar configurações",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "Escolha um estilo: Normal, CRT, NVG, FLIR, Anime ou Noir (teclas 1 a 6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "Em Fonte do mapa, escolha o mapa de base: Google 3D, Bing, Esri ou OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "Ative ou desative o HUD aqui. Em Layout, escolha Tático, Mínimo ou Ciber.",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "Ative ou desative o HUD aqui. Em Layout, escolha Tático ou Mínimo.",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "A mira enquadra a vista em um círculo. A suavização deixa a borda menos marcada e Opacidade controla o escurecimento da área externa.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "Interface limpa oculta os painéis e os indicadores para liberar a vista",
|
||||
"Press search, then type part of a layer name or source": "Use o botão de pesquisa e digite parte do nome ou da fonte de uma camada",
|
||||
@@ -4345,6 +4346,7 @@
|
||||
"Turn off": "Desativar",
|
||||
"Command": "Comando",
|
||||
"No layers are on": "Nenhuma camada ativa",
|
||||
"No other layers are on": "Não há outras camadas ativas",
|
||||
"No matching layers": "Nenhuma camada encontrada",
|
||||
"Show me {thing} settings": "Mostre as configurações de {thing}",
|
||||
"Show me how: {thing}": "Mostre como fazer: {thing}",
|
||||
@@ -4363,5 +4365,61 @@
|
||||
"other": "Mostrar {what} em {place} ({count} itens)"
|
||||
},
|
||||
"Go there": "Ir até lá",
|
||||
"Open draw options": "Abrir opções de desenho"
|
||||
"Open draw options": "Abrir opções de desenho",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} em {place}: {count} item",
|
||||
"many": "{what} em {place}: {count} de itens",
|
||||
"other": "{what} em {place}: {count} itens"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} item à vista",
|
||||
"many": "{count} de itens à vista",
|
||||
"other": "{count} itens à vista"
|
||||
},
|
||||
"Selected · near {name}": "Seleção · perto de {name}",
|
||||
"Near {name}": "Perto de {name}",
|
||||
"Stop drawing": "Parar de desenhar",
|
||||
"{place} · landmarks": "{place} · pontos de interesse",
|
||||
"In {place}": "Em {place}",
|
||||
"Near {place}": "Perto de {place}",
|
||||
"Unable to complete this action: {reason}": "Não foi possível concluir esta ação: {reason}",
|
||||
"Unable to complete this action. Please try again.": "Não foi possível concluir esta ação. Tente novamente.",
|
||||
"{layer} M{mag}+": "{layer} de magnitude {mag} ou mais",
|
||||
"Search places, layers and things on the map, or ask GEV": "Busque lugares, camadas e elementos no mapa ou pergunte ao GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "Busque lugares, camadas, voos… ou pergunte ao GEV · > para comandos",
|
||||
"No matching command": "Nenhum comando correspondente",
|
||||
"Looks private, so nothing is searched or sent": "Parece privado, por isso nada é pesquisado nem enviado",
|
||||
"Bilawal on YouTube": "Bilawal no YouTube",
|
||||
"BROWSE STORIES": "VER STORIES",
|
||||
"ENTER GOD MODE": "ENTRAR NO MODO DEUS",
|
||||
"Go deeper": "Ir além",
|
||||
"The studio behind GEV": "O estúdio por trás do GEV",
|
||||
"Visual presets": "Predefinições visuais",
|
||||
"Open source. Self-host, fork, add a layer.": "Código aberto. Hospede você mesmo, faça um fork, adicione uma camada.",
|
||||
"Choose your mode": "Escolha seu modo",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "A mira do satélite espião: visão circular, HUD tático, câmera cinematográfica. Para explorar.",
|
||||
"Welcome to God's Eye View": "Bem-vindo ao God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "Uma visão mais limpa e legível em que cada valor mostra sua fonte. Para pesquisa e reportagem.",
|
||||
"Keyhole HUD": "HUD de mira",
|
||||
"Analyst": "Analista",
|
||||
"God": "Deus",
|
||||
"COMING SOON": "EM BREVE",
|
||||
"More from Halfpixel": "Mais da Halfpixel",
|
||||
"Start with": "Começar com",
|
||||
"FUN": "DIVERSÃO",
|
||||
"Where do you want to start?": "Por onde você quer começar?",
|
||||
"Three things to know": "Três coisas a saber",
|
||||
"Pick one to begin with. You can change everything later.": "Escolha uma opção para começar. Você pode mudar tudo depois.",
|
||||
"That is all you need to get going.": "Isso é tudo que você precisa para começar.",
|
||||
"SKIP · ESC": "PULAR · ESC",
|
||||
"SKIP": "PULAR",
|
||||
"Search places": "Pesquisar lugares",
|
||||
"Type a place into the search bar.": "Digite um lugar na barra de busca.",
|
||||
"Turn on layers": "Ativar camadas",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "Ative camadas para ver voos, navios, câmeras, clima e muito mais.",
|
||||
"Click anything": "Clique em qualquer elemento",
|
||||
"Select a map item to see its details.": "Selecione um item do mapa para ver seus detalhes.",
|
||||
"Bilawal on {site}": "Bilawal no {site}",
|
||||
"Bilawal's website": "Site de Bilawal",
|
||||
"BACK": "VOLTAR"
|
||||
}
|
||||
+77
-17
@@ -152,7 +152,6 @@
|
||||
"CARGO": "ГРУЗОВОЕ",
|
||||
"TANKER": "ТАНКЕР",
|
||||
"OTHER": "ДРУГОЕ",
|
||||
"Starting live contacts…": "Запуск контактов в реальном времени…",
|
||||
"Opening space missions…": "Открытие космических миссий…",
|
||||
"Scanning active events…": "Сканирование активных событий…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "Землетрясения и активные пожары в реальном времени от USGS и NASA",
|
||||
@@ -431,7 +430,6 @@
|
||||
"Error: {message}": "Ошибка: {message}",
|
||||
"Project exported": "Проект экспортирован",
|
||||
"Ready": "Готово",
|
||||
"Could not exit {mode} — scene layers may be refused": "Не удалось выйти из режима {mode} — слои сцены могут быть отклонены",
|
||||
"Loaded: {scene} / {shot}": "Загружено: {scene} / {shot}",
|
||||
"Global Flights Radar": "Глобальный радар рейсов",
|
||||
"Orbital Watch": "Орбитальный дозор",
|
||||
@@ -455,7 +453,6 @@
|
||||
"DISPLAY": "ЭКРАН",
|
||||
"CONTACT": "КОНТАКТ",
|
||||
"CONTACTS — nearest planes · vessels · sites": "КОНТАКТЫ — ближайшие самолёты · суда · объекты",
|
||||
"SPACE MISSIONS — launches & orbital assets": "КОСМИЧЕСКИЕ МИССИИ — пуски и орбитальные аппараты",
|
||||
"LIVE SIGNALS": "СИГНАЛЫ ОНЛАЙН",
|
||||
"MAP SOURCE": "ИСТОЧНИК КАРТЫ",
|
||||
"Map source": "Источник карты",
|
||||
@@ -643,11 +640,9 @@
|
||||
"Nearby installations refreshed": "Ближайшие объекты обновлены",
|
||||
"Nearby installations could not be refreshed; try again": "Не удалось обновить ближайшие объекты; попробуйте снова",
|
||||
"Contacts could not complete the requested transition; try again": "Не удалось переключить режим «Контакты»; попробуйте снова",
|
||||
"Space Missions could not complete the requested transition; try again": "Не удалось переключить режим «Космические миссии»; попробуйте снова",
|
||||
"{layerId} could not {action} cleanly": "Не удалось корректно {action} слой {layerId}",
|
||||
"start": "запустить",
|
||||
"stop": "остановить",
|
||||
"Space Missions cancellation could not restore the previous layer state": "Не удалось восстановить прежнее состояние слоёв после отмены космических миссий",
|
||||
"That layer is unavailable in the current Context mode": "Этот слой недоступен в текущем режиме контекста",
|
||||
"{mode} could not start because another layer did not stop cleanly": "Не удалось запустить режим «{mode}»: другой слой не остановился корректно",
|
||||
"Space Missions": "Космические миссии",
|
||||
@@ -659,6 +654,16 @@
|
||||
"Live Flights": "Рейсы онлайн",
|
||||
"Military Flights": "Военные рейсы",
|
||||
"Earthquakes (24h)": "Землетрясения (24 ч)",
|
||||
"earthquake|Minor": "Слабое",
|
||||
"earthquake|Light": "Лёгкое",
|
||||
"earthquake|Moderate": "Умеренное",
|
||||
"earthquake|Strong": "Сильное",
|
||||
"earthquake|Major": "Мощное",
|
||||
"earthquake|Great": "Катастрофическое",
|
||||
"earthquake|Shallow": "Мелкофокусное",
|
||||
"earthquake|Intermediate": "Среднефокусное",
|
||||
"earthquake|Deep": "Глубокофокусное",
|
||||
"{km} km deep": "глубина {km} км",
|
||||
"Satellites": "Спутники",
|
||||
"Place names": "Названия мест",
|
||||
"Space Missions (30d)": "Космические миссии (30 дн.)",
|
||||
@@ -1025,15 +1030,10 @@
|
||||
"Globe actions": "Действия с глобусом",
|
||||
"NO PLACE LEFT BEHIND": "НИ ОДНА ТОЧКА НЕ ОСТАНЕТСЯ ПОЗАДИ",
|
||||
"ACTIVE STYLE": "АКТИВНЫЙ СТИЛЬ",
|
||||
"Choose your first view": "Выберите первый вид",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "Совет: кнопка «МИК» в доке позволяет говорить с картой.",
|
||||
"Aircraft, vessels and nearby intelligence": "Самолёты, суда и разведданные поблизости",
|
||||
"Launches, spacecraft and orbital context": "Пуски, космические аппараты и орбитальный контекст",
|
||||
"Begin with a clean globe": "Начните с чистого глобуса",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "ЦЕНТР УПРАВЛЕНИЯ · ПЕРВЫЙ ЗАПУСК",
|
||||
"Don't show this again": "Больше не показывать",
|
||||
"ESC to dismiss": "ESC — скрыть",
|
||||
"LIVE CONTACTS": "КОНТАКТЫ ОНЛАЙН",
|
||||
"EXPLORE MANUALLY": "ИЗУЧИТЬ ВРУЧНУЮ",
|
||||
"Celestial ring — reveal the full globe": "Небесное кольцо — показать весь глобус",
|
||||
"Celestial ring — available in Normal style": "Небесное кольцо — доступно в стиле «Обычный»",
|
||||
@@ -1870,11 +1870,11 @@
|
||||
"POSITIONED": "С КООРД.",
|
||||
"SDR VOL": "ГРОМК. SDR",
|
||||
"LOCAL RTL-SDR": "ЛОКАЛЬНЫЙ RTL-SDR",
|
||||
"Cyber sonar contact scanner": "Кибер-сонар: сканер контактов",
|
||||
"Sonar contact scanner": "Сонар: сканер контактов",
|
||||
"Sonar ring count": "Число колец сонара",
|
||||
"Sonar ring range": "Дальность колец сонара",
|
||||
"Sonar intensity": "Интенсивность сонара",
|
||||
"Cyber contact and label opacity": "Непрозрачность контактов и подписей в режиме «Кибер»",
|
||||
"Sonar contact and label opacity": "Непрозрачность контактов и подписей сонара",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "Минимальная непрозрачность точек, значков, моделей, рамок и подписей на карте между проходами сонара",
|
||||
"Sonar sector width": "Ширина сектора сонара",
|
||||
"Rings": "Кольца",
|
||||
@@ -1882,7 +1882,6 @@
|
||||
"Power": "Мощность",
|
||||
"Opacity": "Непрозрачность",
|
||||
"Sector": "Сектор",
|
||||
"Cyber": "Кибер",
|
||||
"Sonar": "Сонар",
|
||||
"Turn Street Level on or off": "Включить или выключить «Уличные снимки»",
|
||||
"Toggle straight-down and tilted map views": "Переключить вид карты: сверху или с наклоном",
|
||||
@@ -2666,7 +2665,6 @@
|
||||
"Importing project": "Импорт проекта",
|
||||
"Camera move interrupted": "Перелёт камеры прерван",
|
||||
"Scene media timed out": "Истекло время ожидания медиа сцены",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "Режим «Космические миссии» изолирует данные воспроизведения. Выйдите из режима, чтобы включить слой «{layer}».",
|
||||
"Tilted view": "Вид с наклоном",
|
||||
"Straight-down view": "Вид сверху",
|
||||
"North up": "Север вверху",
|
||||
@@ -2677,6 +2675,7 @@
|
||||
"Exit cockpit to fly to a target": "Выйдите из кабины, чтобы перелететь к цели",
|
||||
"Exit cockpit to fly to a vessel": "Выйдите из кабины, чтобы перелететь к судну",
|
||||
"Exit cockpit to fly to a fire": "Выйдите из кабины, чтобы перелететь к пожару",
|
||||
"Exit cockpit to fly to an earthquake": "Выйдите из кабины, чтобы перелететь к землетрясению",
|
||||
"Exit cockpit to fly to a route": "Выйдите из кабины, чтобы перелететь к маршруту",
|
||||
"Exit cockpit to fly to a file": "Выйдите из кабины, чтобы перелететь к файлу",
|
||||
"Exit cockpit to fly to a scene": "Выйдите из кабины, чтобы перелететь к сцене",
|
||||
@@ -2999,7 +2998,7 @@
|
||||
"Control cockpit": "Управлять кабиной",
|
||||
"Change visual style": "Сменить визуальный стиль",
|
||||
"Adjust HUD": "Настроить HUD",
|
||||
"Adjust cyber sonar": "Настроить кибер-сонар",
|
||||
"Adjust sonar": "Настроить сонар",
|
||||
"Adjust detection overlay": "Настроить слой детекции",
|
||||
"Change map stack": "Сменить набор карт",
|
||||
"Adjust post-processing": "Настроить постобработку",
|
||||
@@ -3508,6 +3507,8 @@
|
||||
"Source: {value}": "Источник: {value}",
|
||||
"Click the card to open EMODnet ↗": "Нажмите на карточку, чтобы открыть EMODnet ↗",
|
||||
"Click the card to open the source ↗": "Нажмите на карточку, чтобы открыть источник ↗",
|
||||
"Open the source for {title}, {details}": "Открыть источник: {title}, {details}",
|
||||
"Focus earthquake {title}, {details}": "Фокус на землетрясении {title}, {details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata недоступна; показан только EMODnet",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet недоступен; показана только Wikidata",
|
||||
"Shipwrecks unavailable": "Данные о кораблекрушениях недоступны",
|
||||
@@ -4363,7 +4364,7 @@
|
||||
"Show settings": "Показать настройки",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "Выберите стиль: Обычный, CRT, NVG, FLIR, Аниме или Нуар (клавиши 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "В разделе «Источник карты» выберите базовую карту: Google 3D, Bing, Esri или OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "Здесь можно включить или выключить HUD. В разделе «Макет» выберите «Тактический», «Минимальный» или «Кибер».",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "Здесь можно включить или выключить HUD. В разделе «Макет» выберите «Тактический» или «Минимальный».",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "«Прицел» обрамляет вид кругом. «Растушёвка» смягчает край, а «Непрозрачность» задаёт затемнение снаружи.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "«Чистый интерфейс» скрывает панели и индикаторы, освобождая обзор",
|
||||
"Press search, then type part of a layer name or source": "Нажмите кнопку поиска и введите часть названия слоя или источника",
|
||||
@@ -4448,6 +4449,7 @@
|
||||
"Turn off": "Выключить",
|
||||
"Command": "Команда",
|
||||
"No layers are on": "Нет включённых слоёв",
|
||||
"No other layers are on": "Других включённых слоёв нет",
|
||||
"No matching layers": "Подходящие слои не найдены",
|
||||
"Show me {thing} settings": "Показать настройки для {thing}",
|
||||
"Show me how: {thing}": "Показать как: {thing}",
|
||||
@@ -4467,5 +4469,63 @@
|
||||
"other": "Показать {what} · {place} ({count} объекта)"
|
||||
},
|
||||
"Go there": "Перейти туда",
|
||||
"Open draw options": "Открыть параметры рисования"
|
||||
"Open draw options": "Открыть параметры рисования",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} · {place}: {count} объект",
|
||||
"few": "{what} · {place}: {count} объекта",
|
||||
"many": "{what} · {place}: {count} объектов",
|
||||
"other": "{what} · {place}: {count} объекта"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} объект в поле зрения",
|
||||
"few": "{count} объекта в поле зрения",
|
||||
"many": "{count} объектов в поле зрения",
|
||||
"other": "{count} объекта в поле зрения"
|
||||
},
|
||||
"Selected · near {name}": "Выбрано · рядом с {name}",
|
||||
"Near {name}": "Рядом с {name}",
|
||||
"Stop drawing": "Завершить рисование",
|
||||
"{place} · landmarks": "{place} · достопримечательности",
|
||||
"In {place}": "Места в {place}",
|
||||
"Near {place}": "Рядом с {place}",
|
||||
"Unable to complete this action: {reason}": "Не удалось выполнить действие: {reason}",
|
||||
"Unable to complete this action. Please try again.": "Не удалось выполнить действие. Попробуйте ещё раз.",
|
||||
"{layer} M{mag}+": "{layer} с магнитудой от {mag}",
|
||||
"Search places, layers and things on the map, or ask GEV": "Ищите места, слои и объекты на карте или спросите GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "Ищите места, слои, рейсы… или спросите GEV · > для команд",
|
||||
"No matching command": "Подходящая команда не найдена",
|
||||
"Looks private, so nothing is searched or sent": "Похоже на личные данные, поэтому ничего не ищется и не отправляется",
|
||||
"Bilawal on YouTube": "Билавал на YouTube",
|
||||
"BROWSE STORIES": "СМОТРЕТЬ STORIES",
|
||||
"ENTER GOD MODE": "ВОЙТИ В РЕЖИМ БОГА",
|
||||
"Go deeper": "Глубже",
|
||||
"The studio behind GEV": "Студия, создавшая GEV",
|
||||
"Visual presets": "Визуальные пресеты",
|
||||
"Open source. Self-host, fork, add a layer.": "Открытый код. Разверните у себя, сделайте форк, добавьте слой.",
|
||||
"Choose your mode": "Выберите режим",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "Замочная скважина спутника-шпиона: круглый обзор, тактический HUD, кинематографичная камера. Для исследования.",
|
||||
"Welcome to God's Eye View": "Добро пожаловать в God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "Более чистый и читаемый вид, где у каждого значения указан источник. Для исследований и отчётов.",
|
||||
"Keyhole HUD": "HUD-скважина",
|
||||
"Analyst": "Аналитик",
|
||||
"God": "Бог",
|
||||
"COMING SOON": "СКОРО",
|
||||
"More from Halfpixel": "Ещё от Halfpixel",
|
||||
"Start with": "Начать с",
|
||||
"FUN": "ИГРА",
|
||||
"Where do you want to start?": "С чего хотите начать?",
|
||||
"Three things to know": "Три вещи, которые стоит знать",
|
||||
"Pick one to begin with. You can change everything later.": "Выберите один вариант для начала. Позже всё можно изменить.",
|
||||
"That is all you need to get going.": "Это всё, что нужно для начала.",
|
||||
"SKIP · ESC": "ПРОПУСТИТЬ · ESC",
|
||||
"SKIP": "ПРОПУСТИТЬ",
|
||||
"Search places": "Поиск мест",
|
||||
"Type a place into the search bar.": "Введите место в строке поиска.",
|
||||
"Turn on layers": "Включайте слои",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "Включайте слои, чтобы видеть самолёты, суда, камеры, погоду и многое другое.",
|
||||
"Click anything": "Нажмите на объект",
|
||||
"Select a map item to see its details.": "Выберите объект на карте, чтобы увидеть подробности.",
|
||||
"Bilawal on {site}": "Билал на {site}",
|
||||
"Bilawal's website": "Сайт Билала",
|
||||
"BACK": "НАЗАД"
|
||||
}
|
||||
+73
-17
@@ -155,7 +155,6 @@
|
||||
"ENVIRONMENTAL": "MILJÖ",
|
||||
"EARTH WATCH": "JORDBEVAKNING",
|
||||
"ACTIVE EVENTS": "AKTIVA HÄNDELSER",
|
||||
"Starting live contacts…": "Startar livekontakter …",
|
||||
"Opening space missions…": "Öppnar rymduppdrag …",
|
||||
"Scanning active events…": "Söker efter aktiva händelser …",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "Jordbävningar och aktiva bränder i realtid, från USGS och NASA",
|
||||
@@ -418,7 +417,6 @@
|
||||
"Camera unavailable — exit cockpit first": "Kameran är otillgänglig – lämna cockpit först",
|
||||
"No shots to run": "Inga tagningar att köra",
|
||||
"Project exported": "Projektet har exporterats",
|
||||
"Could not exit {mode} — scene layers may be refused": "Kunde inte lämna {mode} – scenens lager kan nekas",
|
||||
"Running {index}/{total}: {scene} / {shot}": "Kör {index}/{total}: {scene} / {shot}",
|
||||
"Scene run complete": "Scenkörningen är klar",
|
||||
"Global Flights Radar": "Global flygradar",
|
||||
@@ -432,7 +430,6 @@
|
||||
"VISUAL PRESETS": "VISUELLA FÖRVAL",
|
||||
"LOCATION": "PLATS",
|
||||
"CONTACTS — nearest planes · vessels · sites": "KONTAKTER – närmaste flygplan · fartyg · platser",
|
||||
"SPACE MISSIONS — launches & orbital assets": "RYMDUPPDRAG – uppskjutningar och objekt i omloppsbana",
|
||||
"LIVE SIGNALS": "LIVESIGNALER",
|
||||
"Contacts could not complete the requested transition; try again": "Läget ”Kontakter” kunde inte slutföra övergången – försök igen",
|
||||
"CCTV layer unavailable": "CCTV-lagret är otillgängligt",
|
||||
@@ -591,10 +588,8 @@
|
||||
"other": "Stängde av {count} datalager"
|
||||
},
|
||||
"Selected data layers could not be cleared": "De valda datalagren kunde inte stängas av",
|
||||
"Space Missions could not complete the requested transition; try again": "Läget ”Rymduppdrag” kunde inte slutföra övergången – försök igen",
|
||||
"Nearby installations refreshed": "Anläggningar i närheten har uppdaterats",
|
||||
"Nearby installations could not be refreshed; try again": "Det gick inte att uppdatera anläggningar i närheten – försök igen",
|
||||
"Space Missions cancellation could not restore the previous layer state": "Lagrens tidigare läge kunde inte återställas när ”Rymduppdrag” avbröts",
|
||||
"That layer is unavailable in the current Context mode": "Lagret är otillgängligt i det aktuella läget ”Kontext”",
|
||||
"{layerId} could not {action} cleanly": "{layerId} kunde inte {action} korrekt",
|
||||
"start": "startas",
|
||||
@@ -605,6 +600,16 @@
|
||||
"Live Flights": "Liveflyg",
|
||||
"Military Flights": "Militärflyg",
|
||||
"Earthquakes (24h)": "Jordbävningar (24 h)",
|
||||
"earthquake|Minor": "Mindre",
|
||||
"earthquake|Light": "Lätt",
|
||||
"earthquake|Moderate": "Måttlig",
|
||||
"earthquake|Strong": "Kraftig",
|
||||
"earthquake|Major": "Stor",
|
||||
"earthquake|Great": "Mycket stor",
|
||||
"earthquake|Shallow": "Grund",
|
||||
"earthquake|Intermediate": "Medeldjup",
|
||||
"earthquake|Deep": "Djup",
|
||||
"{km} km deep": "{km} km djup",
|
||||
"Satellites": "Satelliter",
|
||||
"Space Missions (30d)": "Rymduppdrag (30 d)",
|
||||
"Street Traffic": "Gatutrafik",
|
||||
@@ -957,15 +962,10 @@
|
||||
"Copy share link": "Kopiera delningslänk",
|
||||
"Reset camera and return to full globe view": "Återställ kameran och återgå till vy över hela globen",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "UPPDRAGSLEDNING · FÖRSTA START",
|
||||
"Choose your first view": "Välj första vy",
|
||||
"LIVE CONTACTS": "LIVEKONTAKTER",
|
||||
"Aircraft, vessels and nearby intelligence": "Flygplan, fartyg och lägesbild i närheten",
|
||||
"Launches, spacecraft and orbital context": "Uppskjutningar, rymdfarkoster och omloppsbanor",
|
||||
"EXPLORE MANUALLY": "UTFORSKA MANUELLT",
|
||||
"Begin with a clean globe": "Börja med en tom glob",
|
||||
"Don't show this again": "Visa inte igen",
|
||||
"ESC to dismiss": "ESC för att stänga",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "Tips: med knappen MIK i dockan går det att prata med kartan.",
|
||||
"Pick a shape, then click the map.": "Välj en form och klicka sedan på kartan.",
|
||||
"Enter to place the pin, Esc to cancel.": "Enter placerar nålen, Esc avbryter.",
|
||||
"Click where the pin goes.": "Klicka där nålen ska sitta.",
|
||||
@@ -983,7 +983,6 @@
|
||||
"Could not place the shape: {error}": "Kunde inte placera formen: {error}",
|
||||
"Board cleared.": "Ritytan rensad.",
|
||||
"{label} · Detailed outline unavailable": "{label} · Detaljerad kontur otillgänglig",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "Läget ”Rymduppdrag” isolerar uppspelningsdata. Lämna läget för att aktivera {layer}.",
|
||||
"Data attribution": "Datakällor",
|
||||
"Data provided by:": "Data från:",
|
||||
"Light aircraft": "Lätt flygplan",
|
||||
@@ -1999,6 +1998,7 @@
|
||||
"Exit cockpit to fly to a target": "Lämna cockpiten för att flyga till ett mål",
|
||||
"Exit cockpit to fly to a vessel": "Lämna cockpiten för att flyga till ett fartyg",
|
||||
"Exit cockpit to fly to a fire": "Lämna cockpiten för att flyga till en brand",
|
||||
"Exit cockpit to fly to an earthquake": "Lämna cockpiten för att flyga till en jordbävning",
|
||||
"Exit cockpit to fly to a route": "Lämna cockpiten för att flyga till en rutt",
|
||||
"Exit cockpit to fly to a file": "Lämna cockpiten för att flyga till en fil",
|
||||
"Exit cockpit to fly to a scene": "Lämna cockpiten för att flyga till en scen",
|
||||
@@ -2873,7 +2873,7 @@
|
||||
"Control cockpit": "Styr cockpit",
|
||||
"Change visual style": "Byt visuell stil",
|
||||
"Adjust HUD": "Justera HUD",
|
||||
"Adjust cyber sonar": "Justera cybersonar",
|
||||
"Adjust sonar": "Justera sonaren",
|
||||
"Adjust detection overlay": "Justera detekteringsöverlägg",
|
||||
"Change map stack": "Byt kartuppsättning",
|
||||
"Adjust post-processing": "Justera efterbehandling",
|
||||
@@ -2958,9 +2958,8 @@
|
||||
"SEEK ▶": "SÖK ▶",
|
||||
"SDR VOL": "SDR-VOL.",
|
||||
"Local SDR volume": "Volym för lokal SDR",
|
||||
"Cyber": "Cyber",
|
||||
"Sonar": "Sonar",
|
||||
"Cyber sonar contact scanner": "Kontaktskanner med cybersonar",
|
||||
"Sonar contact scanner": "Kontaktskanner med sonar",
|
||||
"Rings": "Ringar",
|
||||
"Sonar ring count": "Antal sonarringar",
|
||||
"Range": "Räckvidd",
|
||||
@@ -2968,7 +2967,7 @@
|
||||
"Power": "Styrka",
|
||||
"Sonar intensity": "Sonarintensitet",
|
||||
"Opacity": "Opacitet",
|
||||
"Cyber contact and label opacity": "Opacitet för cyberkontakter och etiketter",
|
||||
"Sonar contact and label opacity": "Opacitet för sonarkontakter och etiketter",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "Lägsta opacitet för kartpunkter, ikoner, modeller, ramar och etiketter mellan sonarsvepen",
|
||||
"Sector": "Sektor",
|
||||
"Sonar sector width": "Sonarsektorns bredd",
|
||||
@@ -3249,6 +3248,8 @@
|
||||
"Click the card to open EMODnet ↗": "Klicka på kortet för att öppna EMODnet ↗",
|
||||
"Click the card to open the article ↗": "Klicka på kortet för att öppna artikeln ↗",
|
||||
"Click the card to open the source ↗": "Klicka på kortet för att öppna källan ↗",
|
||||
"Open the source for {title}, {details}": "Öppna källan för {title}, {details}",
|
||||
"Focus earthquake {title}, {details}": "Fokusera på jordbävningen {title}, {details}",
|
||||
"All years": "Alla år",
|
||||
"Period": "Period",
|
||||
"From": "Från",
|
||||
@@ -4157,7 +4158,7 @@
|
||||
"Show settings": "Visa inställningar",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "Välj en stil: Normal, CRT, NVG, FLIR, Anime eller Noir (tangenterna 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "Välj baskarta under Kartkälla: Google 3D, Bing, Esri eller OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "Slå på eller av HUD här. Välj Taktisk, Minimal eller Cyber under Layout.",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "Slå på eller av HUD här. Välj Taktisk eller Minimal under Layout.",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "Scope ramar in vyn med en cirkel. Mjuk kant tonar ut kanten och Opacitet styr hur mörkt det är utanför.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "Rent gränssnitt döljer paneler och indikatorer för att ge fri sikt",
|
||||
"Press search, then type part of a layer name or source": "Tryck på sökknappen och skriv en del av lagrets namn eller källa",
|
||||
@@ -4242,6 +4243,7 @@
|
||||
"Turn off": "Slå av",
|
||||
"Command": "Kommando",
|
||||
"No layers are on": "Inga lager är på",
|
||||
"No other layers are on": "Inga andra lager är på",
|
||||
"No matching layers": "Inga matchande lager",
|
||||
"Show me {thing} settings": "Visa inställningarna för {thing}",
|
||||
"Show me how: {thing}": "Visa hur: {thing}",
|
||||
@@ -4259,5 +4261,59 @@
|
||||
"other": "Visa {what} i {place} ({count} objekt)"
|
||||
},
|
||||
"Go there": "Gå dit",
|
||||
"Open draw options": "Öppna ritalternativ"
|
||||
"Open draw options": "Öppna ritalternativ",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} i {place}: {count} objekt",
|
||||
"other": "{what} i {place}: {count} objekt"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} objekt i vyn",
|
||||
"other": "{count} objekt i vyn"
|
||||
},
|
||||
"Selected · near {name}": "Valt objekt · nära {name}",
|
||||
"Near {name}": "Nära {name}",
|
||||
"Stop drawing": "Sluta rita",
|
||||
"{place} · landmarks": "{place} · sevärdheter",
|
||||
"In {place}": "I {place}",
|
||||
"Near {place}": "Nära {place}",
|
||||
"Unable to complete this action: {reason}": "Det gick inte att slutföra åtgärden: {reason}",
|
||||
"Unable to complete this action. Please try again.": "Det gick inte att slutföra åtgärden. Försök igen.",
|
||||
"{layer} M{mag}+": "{layer} med magnitud {mag} eller högre",
|
||||
"Search places, layers and things on the map, or ask GEV": "Sök efter platser, lager och objekt på kartan eller fråga GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "Sök efter platser, lager, flyg… eller fråga GEV · > för kommandon",
|
||||
"No matching command": "Inget matchande kommando",
|
||||
"Looks private, so nothing is searched or sent": "Ser privat ut, så inget söks eller skickas",
|
||||
"Where do you want to start?": "Var vill du börja?",
|
||||
"Three things to know": "Tre saker att känna till",
|
||||
"Pick one to begin with. You can change everything later.": "Välj ett alternativ att börja med. Du kan ändra allt senare.",
|
||||
"That is all you need to get going.": "Det är allt du behöver för att komma igång.",
|
||||
"SKIP · ESC": "HOPPA ÖVER · ESC",
|
||||
"SKIP": "HOPPA ÖVER",
|
||||
"Search places": "Sök platser",
|
||||
"Type a place into the search bar.": "Skriv en plats i sökfältet.",
|
||||
"Turn on layers": "Aktivera lager",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "Aktivera lager för att se flyg, fartyg, kameror, väder och mer.",
|
||||
"Click anything": "Klicka på ett objekt",
|
||||
"Select a map item to see its details.": "Välj ett kartobjekt för att se detaljerna.",
|
||||
"Bilawal on {site}": "Bilawal på {site}",
|
||||
"Bilawal's website": "Bilawals webbplats",
|
||||
"BACK": "TILLBAKA",
|
||||
"Welcome to God's Eye View": "Välkommen till God's Eye View",
|
||||
"Choose your mode": "Välj läge",
|
||||
"God": "Gud",
|
||||
"FUN": "NÖJE",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "Spionsatellitens nyckelhål: rund vy, taktisk HUD och filmisk kamera. För utforskning.",
|
||||
"Keyhole HUD": "Nyckelhåls-HUD",
|
||||
"Visual presets": "Visuella förval",
|
||||
"Analyst": "Analytiker",
|
||||
"COMING SOON": "KOMMER SNART",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "En renare, lättläst vy där varje värde visar sin källa. För research och rapportering.",
|
||||
"Start with": "Börja med",
|
||||
"Go deeper": "Gå djupare",
|
||||
"BROWSE STORIES": "BLÄDDRA BLAND BERÄTTELSER",
|
||||
"More from Halfpixel": "Mer från Halfpixel",
|
||||
"Bilawal on YouTube": "Bilawal på YouTube",
|
||||
"The studio behind GEV": "Studion bakom GEV",
|
||||
"Open source. Self-host, fork, add a layer.": "Öppen källkod. Kör själv, skapa en egen variant, lägg till ett lager.",
|
||||
"ENTER GOD MODE": "STARTA GUDLÄGE"
|
||||
}
|
||||
+77
-17
@@ -137,7 +137,6 @@
|
||||
"Loading the keyless globe...": "Завантаження глобуса без ключа...",
|
||||
"Google 3D Tiles unavailable ({detail}). Loading the keyless globe...": "Google 3D Tiles недоступні ({detail}). Завантаження глобуса без ключа...",
|
||||
"Initializing systems...": "Ініціалізація систем...",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "Режим «Космічні місії» ізолює дані відтворення. Вийдіть із режиму, щоб увімкнути шар «{layer}».",
|
||||
"Data attribution": "Джерела даних",
|
||||
"Data provided by:": "Дані надали:",
|
||||
"Close data attribution": "Закрити відомості про джерела даних",
|
||||
@@ -417,7 +416,6 @@
|
||||
"ENVIRONMENTAL": "ДОВКІЛЛЯ",
|
||||
"EARTH WATCH": "СПОСТЕРЕЖЕННЯ ЗА ЗЕМЛЕЮ",
|
||||
"ACTIVE EVENTS": "АКТИВНІ ПОДІЇ",
|
||||
"Starting live contacts…": "Запуск контактів у реальному часі…",
|
||||
"Opening space missions…": "Відкриття космічних місій…",
|
||||
"Scanning active events…": "Сканування активних подій…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "Землетруси в реальному часі й активні пожежі від USGS та NASA",
|
||||
@@ -1522,6 +1520,7 @@
|
||||
"Exit cockpit to fly to a target": "Вийдіть із кабіни, щоб перелетіти до цілі",
|
||||
"Exit cockpit to fly to a vessel": "Вийдіть із кабіни, щоб перелетіти до судна",
|
||||
"Exit cockpit to fly to a fire": "Вийдіть із кабіни, щоб перелетіти до пожежі",
|
||||
"Exit cockpit to fly to an earthquake": "Вийдіть із кабіни, щоб перелетіти до землетрусу",
|
||||
"Exit cockpit to fly to a route": "Вийдіть із кабіни, щоб перелетіти до маршруту",
|
||||
"Exit cockpit to fly to a file": "Вийдіть із кабіни, щоб перелетіти до файлу",
|
||||
"Exit cockpit to fly to a scene": "Вийдіть із кабіни, щоб перелетіти до сцени",
|
||||
@@ -1574,7 +1573,6 @@
|
||||
"Import failed: {error}": "Помилка імпорту: {error}",
|
||||
"Import failed (could not read JSON file)": "Помилка імпорту (не вдалося прочитати файл JSON)",
|
||||
"Layers refused: {layers}": "Шари відхилено: {layers}",
|
||||
"Could not exit {mode} — scene layers may be refused": "Не вдалося вийти з {mode} — шари сцени може бути відхилено",
|
||||
"Camera move interrupted": "Переліт камери перервано",
|
||||
"Scene media timed out": "Минув час очікування медіа сцени",
|
||||
"Action complete": "Дію виконано",
|
||||
@@ -1717,7 +1715,6 @@
|
||||
"VISUAL PRESETS": "ВІЗУАЛЬНІ ПРЕСЕТИ",
|
||||
"LOCATION": "РОЗТАШУВАННЯ",
|
||||
"CONTACTS — nearest planes · vessels · sites": "КОНТАКТИ — найближчі літаки · судна · обʼєкти",
|
||||
"SPACE MISSIONS — launches & orbital assets": "КОСМІЧНІ МІСІЇ — запуски та орбітальні апарати",
|
||||
"LIVE SIGNALS": "СИГНАЛИ ОНЛАЙН",
|
||||
"Contacts could not complete the requested transition; try again": "Режим «Контакти» не зміг завершити запитаний перехід; спробуйте ще раз",
|
||||
"CCTV layer unavailable": "Шар CCTV недоступний",
|
||||
@@ -1952,10 +1949,8 @@
|
||||
"other": "Очищено {count} шару даних"
|
||||
},
|
||||
"Selected data layers could not be cleared": "Не вдалося очистити вибрані шари даних",
|
||||
"Space Missions could not complete the requested transition; try again": "Режим «Космічні місії» не зміг завершити запитаний перехід; спробуйте ще раз",
|
||||
"Nearby installations refreshed": "Найближчі обʼєкти оновлено",
|
||||
"Nearby installations could not be refreshed; try again": "Не вдалося оновити найближчі обʼєкти; спробуйте ще раз",
|
||||
"Space Missions cancellation could not restore the previous layer state": "Скасування режиму «Космічні місії» не відновило попередній стан шарів",
|
||||
"That layer is unavailable in the current Context mode": "Цей шар недоступний у поточному режимі контексту",
|
||||
"{layerId} could not {action} cleanly": "{layerId}: не вдалося коректно {action}",
|
||||
"start": "запустити",
|
||||
@@ -2001,6 +1996,16 @@
|
||||
"Live Flights": "Рейси онлайн",
|
||||
"Military Flights": "Військові рейси",
|
||||
"Earthquakes (24h)": "Землетруси (24 год)",
|
||||
"earthquake|Minor": "Слабкий",
|
||||
"earthquake|Light": "Легкий",
|
||||
"earthquake|Moderate": "Помірний",
|
||||
"earthquake|Strong": "Сильний",
|
||||
"earthquake|Major": "Потужний",
|
||||
"earthquake|Great": "Катастрофічний",
|
||||
"earthquake|Shallow": "Мілкофокусний",
|
||||
"earthquake|Intermediate": "Середньофокусний",
|
||||
"earthquake|Deep": "Глибокофокусний",
|
||||
"{km} km deep": "глибина {km} км",
|
||||
"Satellites": "Супутники",
|
||||
"Place names": "Назви місць",
|
||||
"Space Missions (30d)": "Космічні місії (30 дн)",
|
||||
@@ -2881,7 +2886,7 @@
|
||||
"Control cockpit": "Керувати кабіною",
|
||||
"Change visual style": "Змінити візуальний стиль",
|
||||
"Adjust HUD": "Налаштувати HUD",
|
||||
"Adjust cyber sonar": "Налаштувати кібер-сонар",
|
||||
"Adjust sonar": "Налаштувати сонар",
|
||||
"Adjust detection overlay": "Налаштувати накладку виявлення",
|
||||
"Change map stack": "Змінити набір карт",
|
||||
"Adjust post-processing": "Налаштувати постобробку",
|
||||
@@ -3135,9 +3140,8 @@
|
||||
"HUD layout": "Компонування HUD",
|
||||
"Tactical": "Тактичне",
|
||||
"Minimal": "Мінімальне",
|
||||
"Cyber": "Кібер",
|
||||
"Sonar": "Сонар",
|
||||
"Cyber sonar contact scanner": "Кібер-сонар: сканер контактів",
|
||||
"Sonar contact scanner": "Сонар: сканер контактів",
|
||||
"Rings": "Кільця",
|
||||
"Sonar ring count": "Кількість кілець сонара",
|
||||
"Range": "Дальність",
|
||||
@@ -3145,7 +3149,7 @@
|
||||
"Power": "Потужність",
|
||||
"Sonar intensity": "Інтенсивність сонара",
|
||||
"Opacity": "Непрозорість",
|
||||
"Cyber contact and label opacity": "Непрозорість контактів і підписів у режимі «Кібер»",
|
||||
"Sonar contact and label opacity": "Непрозорість контактів і підписів сонара",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "Мінімальна непрозорість точок, значків, моделей, рамок і підписів на карті між проходами сонара",
|
||||
"Sector": "Сектор",
|
||||
"Sonar sector width": "Ширина сектора сонара",
|
||||
@@ -3257,15 +3261,10 @@
|
||||
"Reset map bearing to north": "Скинути азимут карти на північ",
|
||||
"Reset camera and return to full globe view": "Скинути камеру та повернутися до вигляду всього глобуса",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "ЦЕНТР КЕРУВАННЯ · ПЕРШИЙ ЗАПУСК",
|
||||
"Choose your first view": "Виберіть, із чого почати",
|
||||
"LIVE CONTACTS": "КОНТАКТИ ОНЛАЙН",
|
||||
"Aircraft, vessels and nearby intelligence": "Літаки, судна й розвіддані поблизу",
|
||||
"Launches, spacecraft and orbital context": "Запуски, космічні апарати та орбітальний контекст",
|
||||
"EXPLORE MANUALLY": "ДОСЛІДИТИ ВРУЧНУ",
|
||||
"Begin with a clean globe": "Почніть із чистого глобуса",
|
||||
"Don't show this again": "Більше не показувати",
|
||||
"ESC to dismiss": "ESC — приховати",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "Порада: кнопка МІК у доку дає змогу говорити з картою.",
|
||||
"fire confidence filter|All": "Усі",
|
||||
"fire confidence filter|Nominal+": "Середня+",
|
||||
"fire confidence filter|High": "Висока",
|
||||
@@ -3508,6 +3507,8 @@
|
||||
"Source: {value}": "Джерело: {value}",
|
||||
"Click the card to open EMODnet ↗": "Клацніть картку, щоб відкрити EMODnet ↗",
|
||||
"Click the card to open the source ↗": "Клацніть картку, щоб відкрити джерело ↗",
|
||||
"Open the source for {title}, {details}": "Відкрити джерело: {title}, {details}",
|
||||
"Focus earthquake {title}, {details}": "Фокус на землетрусі {title}, {details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata недоступна; показано лише EMODnet",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet недоступний; показано лише Wikidata",
|
||||
"Shipwrecks unavailable": "Дані про затонулі судна недоступні",
|
||||
@@ -4363,7 +4364,7 @@
|
||||
"Show settings": "Показати налаштування",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "Виберіть стиль: Звичайний, CRT, NVG, FLIR, Аніме або Нуар (клавіші 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "У розділі «Джерело карти» виберіть базову карту: Google 3D, Bing, Esri або OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "Увімкніть або вимкніть HUD тут. У розділі «Компонування» виберіть «Тактичне», «Мінімальне» або «Кібер».",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "Увімкніть або вимкніть HUD тут. У розділі «Компонування» виберіть «Тактичне» або «Мінімальне».",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "«Приціл» обрамляє огляд колом. «Розмиття» пом’якшує край, а «Непрозорість» визначає затемнення зовні.",
|
||||
"Clean UI hides the panels and readouts for a clear view": "«Чистий інтерфейс» приховує панелі та індикатори, щоб ніщо не заважало огляду",
|
||||
"Press search, then type part of a layer name or source": "Натисніть кнопку пошуку й введіть частину назви шару або джерела",
|
||||
@@ -4448,6 +4449,7 @@
|
||||
"Turn off": "Вимкнути",
|
||||
"Command": "Команда",
|
||||
"No layers are on": "Немає увімкнених шарів",
|
||||
"No other layers are on": "Інших увімкнених шарів немає",
|
||||
"No matching layers": "Відповідних шарів не знайдено",
|
||||
"Show me {thing} settings": "Показати налаштування для {thing}",
|
||||
"Show me how: {thing}": "Показати як: {thing}",
|
||||
@@ -4467,5 +4469,63 @@
|
||||
"other": "Показати {what} · {place} ({count} об’єкта)"
|
||||
},
|
||||
"Go there": "Перейти туди",
|
||||
"Open draw options": "Відкрити параметри малювання"
|
||||
"Open draw options": "Відкрити параметри малювання",
|
||||
"{what} in {place}: {count} items": {
|
||||
"one": "{what} · {place}: {count} об’єкт",
|
||||
"few": "{what} · {place}: {count} об’єкти",
|
||||
"many": "{what} · {place}: {count} об’єктів",
|
||||
"other": "{what} · {place}: {count} об’єкта"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"one": "{count} об’єкт у полі зору",
|
||||
"few": "{count} об’єкти у полі зору",
|
||||
"many": "{count} об’єктів у полі зору",
|
||||
"other": "{count} об’єкта у полі зору"
|
||||
},
|
||||
"Selected · near {name}": "Вибране · поблизу {name}",
|
||||
"Near {name}": "Поблизу {name}",
|
||||
"Stop drawing": "Припинити малювання",
|
||||
"{place} · landmarks": "{place} · визначні місця",
|
||||
"In {place}": "Місця в {place}",
|
||||
"Near {place}": "Поблизу {place}",
|
||||
"Unable to complete this action: {reason}": "Не вдалося виконати цю дію: {reason}",
|
||||
"Unable to complete this action. Please try again.": "Не вдалося виконати цю дію. Спробуйте ще раз.",
|
||||
"{layer} M{mag}+": "{layer} з магнітудою від {mag}",
|
||||
"Search places, layers and things on the map, or ask GEV": "Шукайте місця, шари й об’єкти на карті або запитайте GEV",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "Шукайте місця, шари, рейси… або запитайте GEV · > для команд",
|
||||
"No matching command": "Відповідної команди не знайдено",
|
||||
"Looks private, so nothing is searched or sent": "Схоже на особисті дані, тому нічого не шукається й не надсилається",
|
||||
"Bilawal on YouTube": "Білавал на YouTube",
|
||||
"BROWSE STORIES": "ПЕРЕГЛЯНУТИ STORIES",
|
||||
"ENTER GOD MODE": "УВІЙТИ В РЕЖИМ БОГА",
|
||||
"Go deeper": "Глибше",
|
||||
"The studio behind GEV": "Студія, що створила GEV",
|
||||
"Visual presets": "Візуальні пресети",
|
||||
"Open source. Self-host, fork, add a layer.": "Відкритий код. Розгорніть у себе, зробіть форк, додайте шар.",
|
||||
"Choose your mode": "Оберіть режим",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "Замкова шпарина супутника-шпигуна: круглий огляд, тактичний HUD, кінематографічна камера. Для дослідження.",
|
||||
"Welcome to God's Eye View": "Ласкаво просимо до God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "Чистіший і зручний для читання вигляд, де кожне значення показує своє джерело. Для досліджень і звітів.",
|
||||
"Keyhole HUD": "HUD-шпарина",
|
||||
"Analyst": "Аналітик",
|
||||
"God": "Бог",
|
||||
"COMING SOON": "НЕЗАБАРОМ",
|
||||
"More from Halfpixel": "Більше від Halfpixel",
|
||||
"Start with": "Почати з",
|
||||
"FUN": "ГРА",
|
||||
"Where do you want to start?": "З чого хочете почати?",
|
||||
"Three things to know": "Три речі, які варто знати",
|
||||
"Pick one to begin with. You can change everything later.": "Виберіть один варіант для початку. Згодом усе можна змінити.",
|
||||
"That is all you need to get going.": "Це все, що потрібно для початку.",
|
||||
"SKIP · ESC": "ПРОПУСТИТИ · ESC",
|
||||
"SKIP": "ПРОПУСТИТИ",
|
||||
"Search places": "Пошук місць",
|
||||
"Type a place into the search bar.": "Введіть місце в рядку пошуку.",
|
||||
"Turn on layers": "Увімкніть шари",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "Увімкніть шари, щоб бачити літаки, судна, камери, погоду та інше.",
|
||||
"Click anything": "Натисніть на об’єкт",
|
||||
"Select a map item to see its details.": "Виберіть об’єкт на карті, щоб побачити подробиці.",
|
||||
"Bilawal on {site}": "Білал на {site}",
|
||||
"Bilawal's website": "Сайт Білала",
|
||||
"BACK": "НАЗАД"
|
||||
}
|
||||
+71
-17
@@ -113,7 +113,6 @@
|
||||
"Loading the keyless globe...": "正在加载免密钥地球…",
|
||||
"Google 3D Tiles unavailable ({detail}). Loading the keyless globe...": "Google 3D Tiles 不可用({detail})。正在加载免密钥地球…",
|
||||
"Initializing systems...": "正在初始化系统…",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "太空任务模式会隔离回放数据。退出该模式后才能启用“{layer}”。",
|
||||
"Data attribution": "数据来源说明",
|
||||
"Data provided by:": "数据提供方:",
|
||||
"Close data attribution": "关闭数据来源说明",
|
||||
@@ -387,7 +386,6 @@
|
||||
"ENVIRONMENTAL": "环境",
|
||||
"EARTH WATCH": "地球监测",
|
||||
"ACTIVE EVENTS": "活跃事件",
|
||||
"Starting live contacts…": "正在接入实时目标…",
|
||||
"Opening space missions…": "正在打开太空任务…",
|
||||
"Scanning active events…": "正在扫描活跃事件…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "来自 USGS 和 NASA 的实时地震与活跃火点",
|
||||
@@ -1429,6 +1427,7 @@
|
||||
"Exit cockpit to fly to a target": "请先退出座舱,再飞往目标",
|
||||
"Exit cockpit to fly to a vessel": "请先退出座舱,再飞往船舶",
|
||||
"Exit cockpit to fly to a fire": "请先退出座舱,再飞往火点",
|
||||
"Exit cockpit to fly to an earthquake": "请先退出座舱,再飞往地震",
|
||||
"Exit cockpit to fly to a route": "请先退出座舱,再飞往路线",
|
||||
"Exit cockpit to fly to a file": "请先退出座舱,再飞往文件位置",
|
||||
"Exit cockpit to fly to a scene": "请先退出座舱,再飞往场景",
|
||||
@@ -1475,7 +1474,6 @@
|
||||
"Import failed: {error}": "导入失败:{error}",
|
||||
"Import failed (could not read JSON file)": "导入失败(无法读取 JSON 文件)",
|
||||
"Layers refused: {layers}": "被拒绝的图层:{layers}",
|
||||
"Could not exit {mode} — scene layers may be refused": "无法退出 {mode}——场景图层可能被拒绝",
|
||||
"Camera move interrupted": "相机移动被中断",
|
||||
"Scene media timed out": "场景媒体播放超时",
|
||||
"Action complete": "动作已完成",
|
||||
@@ -1609,7 +1607,6 @@
|
||||
"VISUAL PRESETS": "视觉预设",
|
||||
"LOCATION": "位置",
|
||||
"CONTACTS — nearest planes · vessels · sites": "目标:最近的飞机 · 船舶 · 设施",
|
||||
"SPACE MISSIONS — launches & orbital assets": "太空任务:发射与在轨资产",
|
||||
"LIVE SIGNALS": "实时信号",
|
||||
"CCTV layer unavailable": "CCTV 图层不可用",
|
||||
"Link copied!": "链接已复制!",
|
||||
@@ -1821,10 +1818,8 @@
|
||||
},
|
||||
"Selected data layers could not be cleared": "无法清除已选数据图层",
|
||||
"Contacts could not complete the requested transition; try again": "目标未能完成所请求的切换,请重试",
|
||||
"Space Missions could not complete the requested transition; try again": "太空任务未能完成所请求的切换,请重试",
|
||||
"Nearby installations refreshed": "附近设施已刷新",
|
||||
"Nearby installations could not be refreshed; try again": "无法刷新附近设施,请重试",
|
||||
"Space Missions cancellation could not restore the previous layer state": "取消太空任务后无法恢复先前的图层状态",
|
||||
"That layer is unavailable in the current Context mode": "该图层在当前态势模式下不可用",
|
||||
"{layerId} could not {action} cleanly": "{layerId} 未能正常{action}",
|
||||
"start": "启动",
|
||||
@@ -1861,6 +1856,16 @@
|
||||
"Live Flights": "实时航班",
|
||||
"Military Flights": "军用航班",
|
||||
"Earthquakes (24h)": "地震(24 小时)",
|
||||
"earthquake|Minor": "微弱",
|
||||
"earthquake|Light": "轻微",
|
||||
"earthquake|Moderate": "中等",
|
||||
"earthquake|Strong": "强烈",
|
||||
"earthquake|Major": "重大",
|
||||
"earthquake|Great": "巨大",
|
||||
"earthquake|Shallow": "浅源",
|
||||
"earthquake|Intermediate": "中源",
|
||||
"earthquake|Deep": "深源",
|
||||
"{km} km deep": "震源深度 {km} km",
|
||||
"Satellites": "卫星",
|
||||
"Place names": "地名",
|
||||
"Space Missions (30d)": "太空任务(30 天)",
|
||||
@@ -2543,7 +2548,7 @@
|
||||
"Control cockpit": "控制座舱",
|
||||
"Change visual style": "切换视觉样式",
|
||||
"Adjust HUD": "调整 HUD",
|
||||
"Adjust cyber sonar": "调整赛博声呐",
|
||||
"Adjust sonar": "调整声呐",
|
||||
"Adjust detection overlay": "调整探测叠加层",
|
||||
"Change map stack": "切换地图组合",
|
||||
"Adjust post-processing": "调整后期处理",
|
||||
@@ -2790,9 +2795,8 @@
|
||||
"HUD layout": "HUD 布局",
|
||||
"Tactical": "战术",
|
||||
"Minimal": "精简",
|
||||
"Cyber": "赛博",
|
||||
"Sonar": "声呐",
|
||||
"Cyber sonar contact scanner": "赛博声呐目标扫描器",
|
||||
"Sonar contact scanner": "声呐目标扫描器",
|
||||
"Rings": "圈数",
|
||||
"Sonar ring count": "声呐圈数",
|
||||
"Range": "范围",
|
||||
@@ -2800,7 +2804,7 @@
|
||||
"Power": "强度",
|
||||
"Sonar intensity": "声呐强度",
|
||||
"Opacity": "不透明度",
|
||||
"Cyber contact and label opacity": "赛博目标与标签不透明度",
|
||||
"Sonar contact and label opacity": "声呐目标与标签不透明度",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "两次声呐扫描之间地图点、图标、模型、括号标记与标签的最低不透明度",
|
||||
"Sector": "扇区",
|
||||
"Sonar sector width": "声呐扇区宽度",
|
||||
@@ -2916,15 +2920,10 @@
|
||||
"Reset map bearing to north": "重置地图方位为正北",
|
||||
"Reset camera and return to full globe view": "重置相机并返回完整地球视图",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "任务控制 · 首次启动",
|
||||
"Choose your first view": "选择初始视图",
|
||||
"LIVE CONTACTS": "实时目标",
|
||||
"Aircraft, vessels and nearby intelligence": "飞机、船舶及周边情报",
|
||||
"Launches, spacecraft and orbital context": "发射、航天器与轨道态势",
|
||||
"EXPLORE MANUALLY": "手动探索",
|
||||
"Begin with a clean globe": "从空白地球开始",
|
||||
"Don't show this again": "不再显示",
|
||||
"ESC to dismiss": "按 ESC 关闭",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "提示:可通过停靠栏中的 GEV 麦克风按钮用语音操控地图。",
|
||||
"hemisphere|N": "N",
|
||||
"hemisphere|S": "S",
|
||||
"hemisphere|E": "E",
|
||||
@@ -3250,6 +3249,8 @@
|
||||
"Source: {value}": "来源:{value}",
|
||||
"Click the card to open EMODnet ↗": "点击卡片打开 EMODnet ↗",
|
||||
"Click the card to open the source ↗": "点击卡片打开来源 ↗",
|
||||
"Open the source for {title}, {details}": "打开 {title} 的来源,{details}",
|
||||
"Focus earthquake {title}, {details}": "聚焦地震 {title},{details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata 不可用;仅显示 EMODnet",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet 不可用;仅显示 Wikidata",
|
||||
"Shipwrecks unavailable": "沉船数据不可用",
|
||||
@@ -4054,7 +4055,7 @@
|
||||
"Show settings": "显示设置",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "选择一种样式:常规、CRT、NVG、FLIR、动漫或黑色电影(按键 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "在地图源中选择底图:Google 3D、Bing、Esri 或 OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "在此开启或关闭 HUD。在布局中选择战术、精简或赛博",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "在此开启或关闭 HUD。在布局中选择战术或精简",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "视域用圆形框出视野。羽化柔化边缘,不透明度决定圆外的明暗。",
|
||||
"Clean UI hides the panels and readouts for a clear view": "简洁界面会隐藏面板和读数,让视图更清晰",
|
||||
"Press search, then type part of a layer name or source": "点击搜索,然后输入部分图层名称或来源",
|
||||
@@ -4139,6 +4140,7 @@
|
||||
"Turn off": "关闭",
|
||||
"Command": "命令",
|
||||
"No layers are on": "没有已启用的图层",
|
||||
"No other layers are on": "没有其他已启用的图层",
|
||||
"No matching layers": "没有匹配的图层",
|
||||
"Show me {thing} settings": "显示{thing}的设置",
|
||||
"Show me how: {thing}": "查看操作方法:{thing}",
|
||||
@@ -4155,5 +4157,57 @@
|
||||
"other": "显示{place}的{what}({count} 个)"
|
||||
},
|
||||
"Go there": "前往该地点",
|
||||
"Open draw options": "打开绘制选项"
|
||||
"Open draw options": "打开绘制选项",
|
||||
"{what} in {place}: {count} items": {
|
||||
"other": "{place}的{what}:{count} 个"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"other": "视野内 {count} 个"
|
||||
},
|
||||
"Selected · near {name}": "已选中 · {name}附近",
|
||||
"Near {name}": "{name}附近",
|
||||
"Stop drawing": "停止绘制",
|
||||
"{place} · landmarks": "{place} · 地标",
|
||||
"In {place}": "{place}境内",
|
||||
"Near {place}": "{place}附近",
|
||||
"Unable to complete this action: {reason}": "无法完成此操作:{reason}",
|
||||
"Unable to complete this action. Please try again.": "无法完成此操作。请重试。",
|
||||
"{layer} M{mag}+": "{layer}(震级 M{mag} 及以上)",
|
||||
"Search places, layers and things on the map, or ask GEV": "搜索地点、图层和地图上的对象,或向 GEV 提问",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "搜索地点、图层、航班… 或问 GEV · > 输入命令",
|
||||
"No matching command": "没有匹配的命令",
|
||||
"Looks private, so nothing is searched or sent": "疑似隐私信息,因此不会搜索或发送",
|
||||
"Bilawal on YouTube": "Bilawal 的 YouTube",
|
||||
"BROWSE STORIES": "浏览 STORIES",
|
||||
"ENTER GOD MODE": "进入上帝模式",
|
||||
"Go deeper": "深入了解",
|
||||
"The studio behind GEV": "GEV 背后的工作室",
|
||||
"Visual presets": "视觉预设",
|
||||
"Open source. Self-host, fork, add a layer.": "开源。可自行托管、派生、添加图层。",
|
||||
"Choose your mode": "选择模式",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "间谍卫星锁孔视图:圆形视野、战术 HUD、电影级镜头。适合探索。",
|
||||
"Welcome to God's Eye View": "欢迎使用 God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "更简洁易读的视图,每个数值都标明来源。适合研究和报道。",
|
||||
"Keyhole HUD": "锁孔 HUD",
|
||||
"Analyst": "分析师",
|
||||
"God": "上帝",
|
||||
"COMING SOON": "即将推出",
|
||||
"More from Halfpixel": "更多来自 Halfpixel",
|
||||
"Start with": "从这里开始",
|
||||
"FUN": "娱乐",
|
||||
"Where do you want to start?": "您想从哪里开始?",
|
||||
"Three things to know": "需要了解的三件事",
|
||||
"Pick one to begin with. You can change everything later.": "先选择一项,之后可以随时更改。",
|
||||
"That is all you need to get going.": "了解这些就可以开始了。",
|
||||
"SKIP · ESC": "跳过 · ESC",
|
||||
"SKIP": "跳过",
|
||||
"Search places": "搜索地点",
|
||||
"Type a place into the search bar.": "在搜索栏中输入地点。",
|
||||
"Turn on layers": "开启图层",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "开启图层以查看航班、船舶、摄像头、天气等。",
|
||||
"Click anything": "点击任意项目",
|
||||
"Select a map item to see its details.": "选择地图上的项目以查看详情。",
|
||||
"Bilawal on {site}": "Bilawal 的 {site} 主页",
|
||||
"Bilawal's website": "Bilawal 的网站",
|
||||
"BACK": "返回"
|
||||
}
|
||||
@@ -113,7 +113,6 @@
|
||||
"Loading the keyless globe...": "正在加載免密鑰地球…",
|
||||
"Google 3D Tiles unavailable ({detail}). Loading the keyless globe...": "Google 3D Tiles 不可用({detail})。正在加載免密鑰地球…",
|
||||
"Initializing systems...": "正在初始化系統…",
|
||||
"Space Missions isolates replay data. Exit the mode to enable {layer}.": "太空任務模式會隔離回放數據。退出該模式後才能啟用“{layer}”。",
|
||||
"Data attribution": "數據來源說明",
|
||||
"Data provided by:": "數據提供方:",
|
||||
"Close data attribution": "關閉數據來源說明",
|
||||
@@ -387,7 +386,6 @@
|
||||
"ENVIRONMENTAL": "環境",
|
||||
"EARTH WATCH": "地球監測",
|
||||
"ACTIVE EVENTS": "活躍事件",
|
||||
"Starting live contacts…": "正在接入實時目標…",
|
||||
"Opening space missions…": "正在打開太空任務…",
|
||||
"Scanning active events…": "正在掃描活躍事件…",
|
||||
"Live earthquakes and active fires, from USGS and NASA": "來自 USGS 和 NASA 的實時地震與活躍火點",
|
||||
@@ -1429,6 +1427,7 @@
|
||||
"Exit cockpit to fly to a target": "請先退出座艙,再飛往目標",
|
||||
"Exit cockpit to fly to a vessel": "請先退出座艙,再飛往船舶",
|
||||
"Exit cockpit to fly to a fire": "請先退出座艙,再飛往火點",
|
||||
"Exit cockpit to fly to an earthquake": "請先退出座艙,再飛往地震",
|
||||
"Exit cockpit to fly to a route": "請先退出座艙,再飛往路線",
|
||||
"Exit cockpit to fly to a file": "請先退出座艙,再飛往文件位置",
|
||||
"Exit cockpit to fly to a scene": "請先退出座艙,再飛往場景",
|
||||
@@ -1475,7 +1474,6 @@
|
||||
"Import failed: {error}": "導入失敗:{error}",
|
||||
"Import failed (could not read JSON file)": "導入失敗(無法讀取 JSON 文件)",
|
||||
"Layers refused: {layers}": "被拒絕的圖層:{layers}",
|
||||
"Could not exit {mode} — scene layers may be refused": "無法退出 {mode}——場景圖層可能被拒絕",
|
||||
"Camera move interrupted": "相機移動被中斷",
|
||||
"Scene media timed out": "場景媒體播放超時",
|
||||
"Action complete": "動作已完成",
|
||||
@@ -1609,7 +1607,6 @@
|
||||
"VISUAL PRESETS": "視覺預設",
|
||||
"LOCATION": "位置",
|
||||
"CONTACTS — nearest planes · vessels · sites": "目標:最近的飛機 · 船舶 · 設施",
|
||||
"SPACE MISSIONS — launches & orbital assets": "太空任務:發射與在軌資產",
|
||||
"LIVE SIGNALS": "實時信號",
|
||||
"CCTV layer unavailable": "CCTV 圖層不可用",
|
||||
"Link copied!": "鏈接已複製!",
|
||||
@@ -1821,10 +1818,8 @@
|
||||
},
|
||||
"Selected data layers could not be cleared": "無法清除已選數據圖層",
|
||||
"Contacts could not complete the requested transition; try again": "目標未能完成所請求的切換,請重試",
|
||||
"Space Missions could not complete the requested transition; try again": "太空任務未能完成所請求的切換,請重試",
|
||||
"Nearby installations refreshed": "附近設施已刷新",
|
||||
"Nearby installations could not be refreshed; try again": "無法刷新附近設施,請重試",
|
||||
"Space Missions cancellation could not restore the previous layer state": "取消太空任務後無法恢復先前的圖層狀態",
|
||||
"That layer is unavailable in the current Context mode": "該圖層在當前態勢模式下不可用",
|
||||
"{layerId} could not {action} cleanly": "{layerId} 未能正常{action}",
|
||||
"start": "啟動",
|
||||
@@ -1861,6 +1856,16 @@
|
||||
"Live Flights": "實時航班",
|
||||
"Military Flights": "軍用航班",
|
||||
"Earthquakes (24h)": "地震(24 小時)",
|
||||
"earthquake|Minor": "微弱",
|
||||
"earthquake|Light": "輕微",
|
||||
"earthquake|Moderate": "中等",
|
||||
"earthquake|Strong": "強烈",
|
||||
"earthquake|Major": "重大",
|
||||
"earthquake|Great": "巨大",
|
||||
"earthquake|Shallow": "淺源",
|
||||
"earthquake|Intermediate": "中源",
|
||||
"earthquake|Deep": "深源",
|
||||
"{km} km deep": "震源深度 {km} km",
|
||||
"Satellites": "衛星",
|
||||
"Place names": "地名",
|
||||
"Space Missions (30d)": "太空任務(30 天)",
|
||||
@@ -2543,7 +2548,7 @@
|
||||
"Control cockpit": "控制座艙",
|
||||
"Change visual style": "切換視覺樣式",
|
||||
"Adjust HUD": "調整 HUD",
|
||||
"Adjust cyber sonar": "調整賽博聲吶",
|
||||
"Adjust sonar": "調整聲吶",
|
||||
"Adjust detection overlay": "調整探測疊加層",
|
||||
"Change map stack": "切換地圖組合",
|
||||
"Adjust post-processing": "調整後期處理",
|
||||
@@ -2790,9 +2795,8 @@
|
||||
"HUD layout": "HUD 佈局",
|
||||
"Tactical": "戰術",
|
||||
"Minimal": "精簡",
|
||||
"Cyber": "賽博",
|
||||
"Sonar": "聲吶",
|
||||
"Cyber sonar contact scanner": "賽博聲吶目標掃描器",
|
||||
"Sonar contact scanner": "聲吶目標掃描器",
|
||||
"Rings": "圈數",
|
||||
"Sonar ring count": "聲吶圈數",
|
||||
"Range": "範圍",
|
||||
@@ -2800,7 +2804,7 @@
|
||||
"Power": "強度",
|
||||
"Sonar intensity": "聲吶強度",
|
||||
"Opacity": "不透明度",
|
||||
"Cyber contact and label opacity": "賽博目標與標籤不透明度",
|
||||
"Sonar contact and label opacity": "聲吶目標與標籤不透明度",
|
||||
"Minimum opacity for map dots, icons, models, brackets, and labels between sonar passes": "兩次聲吶掃描之間地圖點、圖標、模型、括號標記與標籤的最低不透明度",
|
||||
"Sector": "扇區",
|
||||
"Sonar sector width": "聲吶扇區寬度",
|
||||
@@ -2916,15 +2920,10 @@
|
||||
"Reset map bearing to north": "重置地圖方位為正北",
|
||||
"Reset camera and return to full globe view": "重置相機並返回完整地球視圖",
|
||||
"MISSION CONTROL · FIRST LAUNCH": "任務控制 · 首次啟動",
|
||||
"Choose your first view": "選擇初始視圖",
|
||||
"LIVE CONTACTS": "實時目標",
|
||||
"Aircraft, vessels and nearby intelligence": "飛機、船舶及周邊情報",
|
||||
"Launches, spacecraft and orbital context": "發射、航天器與軌道態勢",
|
||||
"EXPLORE MANUALLY": "手動探索",
|
||||
"Begin with a clean globe": "從空白地球開始",
|
||||
"Don't show this again": "不再顯示",
|
||||
"ESC to dismiss": "按 ESC 關閉",
|
||||
"Tip: the GEV MIC button in the dock lets you talk to the map.": "提示:可通過停靠欄中的 GEV 麥克風按鈕用語音操控地圖。",
|
||||
"hemisphere|N": "N",
|
||||
"hemisphere|S": "S",
|
||||
"hemisphere|E": "E",
|
||||
@@ -3250,6 +3249,8 @@
|
||||
"Source: {value}": "來源:{value}",
|
||||
"Click the card to open EMODnet ↗": "點擊卡片打開 EMODnet ↗",
|
||||
"Click the card to open the source ↗": "點擊卡片打開來源 ↗",
|
||||
"Open the source for {title}, {details}": "打開 {title} 的來源,{details}",
|
||||
"Focus earthquake {title}, {details}": "聚焦地震 {title},{details}",
|
||||
"Wikidata unavailable; showing EMODnet only": "Wikidata 不可用;僅顯示 EMODnet",
|
||||
"EMODnet unavailable; showing Wikidata only": "EMODnet 不可用;僅顯示 Wikidata",
|
||||
"Shipwrecks unavailable": "沉船數據不可用",
|
||||
@@ -4054,7 +4055,7 @@
|
||||
"Show settings": "顯示設置",
|
||||
"Pick a look: Normal, CRT, NVG, FLIR, Anime or Noir (keys 1–6)": "選擇一種樣式:常規、CRT、NVG、FLIR、動漫或黑色電影(按鍵 1–6)",
|
||||
"Under Map source, pick the map underneath: Google 3D, Bing, Esri or OpenStreetMap": "在地圖源中選擇底圖:Google 3D、Bing、Esri 或 OpenStreetMap",
|
||||
"Switch the HUD on or off here; Layout picks Tactical, Minimal or Cyber": "在此開啟或關閉 HUD。在佈局中選擇戰術、精簡或賽博",
|
||||
"Switch the HUD on or off here; Layout picks Tactical or Minimal": "在此開啟或關閉 HUD。在佈局中選擇戰術或精簡",
|
||||
"Scope frames the view in a circle. Feather softens its edge, Opacity sets how dark it shades outside.": "視域用圓形框出視野。羽化柔化邊緣,不透明度決定圓外的明暗。",
|
||||
"Clean UI hides the panels and readouts for a clear view": "簡潔界面會隱藏面板和讀數,讓視圖更清晰",
|
||||
"Press search, then type part of a layer name or source": "點擊搜索,然後輸入部分圖層名稱或來源",
|
||||
@@ -4139,6 +4140,7 @@
|
||||
"Turn off": "關閉",
|
||||
"Command": "命令",
|
||||
"No layers are on": "沒有已啟用的圖層",
|
||||
"No other layers are on": "沒有其他已啟用的圖層",
|
||||
"No matching layers": "沒有匹配的圖層",
|
||||
"Show me {thing} settings": "顯示{thing}的設置",
|
||||
"Show me how: {thing}": "查看操作方法:{thing}",
|
||||
@@ -4155,5 +4157,57 @@
|
||||
"other": "顯示{place}的{what}({count} 個)"
|
||||
},
|
||||
"Go there": "前往該地點",
|
||||
"Open draw options": "打開繪製選項"
|
||||
"Open draw options": "打開繪製選項",
|
||||
"{what} in {place}: {count} items": {
|
||||
"other": "{place}的{what}:{count} 個"
|
||||
},
|
||||
"{count} items in view": {
|
||||
"other": "視野內 {count} 個"
|
||||
},
|
||||
"Selected · near {name}": "已選中 · {name}附近",
|
||||
"Near {name}": "{name}附近",
|
||||
"Stop drawing": "停止繪製",
|
||||
"{place} · landmarks": "{place} · 地標",
|
||||
"In {place}": "{place}境內",
|
||||
"Near {place}": "{place}附近",
|
||||
"Unable to complete this action: {reason}": "無法完成此操作:{reason}",
|
||||
"Unable to complete this action. Please try again.": "無法完成此操作。請重試。",
|
||||
"{layer} M{mag}+": "{layer}(震級 M{mag} 及以上)",
|
||||
"Search places, layers and things on the map, or ask GEV": "搜索地點、圖層和地圖上的對象,或向 GEV 提問",
|
||||
"Search places, layers, flights… or ask GEV · > for commands": "搜索地點、圖層、航班… 或問 GEV · > 輸入命令",
|
||||
"No matching command": "沒有匹配的命令",
|
||||
"Looks private, so nothing is searched or sent": "疑似隱私信息,因此不會搜索或發送",
|
||||
"Bilawal on YouTube": "Bilawal 的 YouTube",
|
||||
"BROWSE STORIES": "瀏覽 STORIES",
|
||||
"ENTER GOD MODE": "進入上帝模式",
|
||||
"Go deeper": "深入瞭解",
|
||||
"The studio behind GEV": "GEV 背後的工作室",
|
||||
"Visual presets": "視覺預設",
|
||||
"Open source. Self-host, fork, add a layer.": "開源。可自行託管、派生、添加圖層。",
|
||||
"Choose your mode": "選擇模式",
|
||||
"The spy-satellite keyhole: circular viewport, tactical HUD, cinematic camera. For exploring.": "間諜衛星鎖孔視圖:圓形視野、戰術 HUD、電影級鏡頭。適合探索。",
|
||||
"Welcome to God's Eye View": "歡迎使用 God's Eye View",
|
||||
"A cleaner, readable view where every value shows its source. For research and reporting.": "更簡潔易讀的視圖,每個數值都標明來源。適合研究和報道。",
|
||||
"Keyhole HUD": "鎖孔 HUD",
|
||||
"Analyst": "分析師",
|
||||
"God": "上帝",
|
||||
"COMING SOON": "即將推出",
|
||||
"More from Halfpixel": "更多來自 Halfpixel",
|
||||
"Start with": "從這裡開始",
|
||||
"FUN": "娛樂",
|
||||
"Where do you want to start?": "您想從哪裡開始?",
|
||||
"Three things to know": "需要了解的三件事",
|
||||
"Pick one to begin with. You can change everything later.": "先選擇一項,之後可以隨時更改。",
|
||||
"That is all you need to get going.": "瞭解這些就可以開始了。",
|
||||
"SKIP · ESC": "跳過 · ESC",
|
||||
"SKIP": "跳過",
|
||||
"Search places": "搜索地點",
|
||||
"Type a place into the search bar.": "在搜索欄中輸入地點。",
|
||||
"Turn on layers": "開啟圖層",
|
||||
"Turn layers on to see flights, ships, cameras, weather and more.": "開啟圖層以查看航班、船舶、攝像頭、天氣等。",
|
||||
"Click anything": "點擊任意項目",
|
||||
"Select a map item to see its details.": "選擇地圖上的項目以查看詳情。",
|
||||
"Bilawal on {site}": "Bilawal 的 {site} 主頁",
|
||||
"Bilawal's website": "Bilawal 的網站",
|
||||
"BACK": "返回"
|
||||
}
|
||||
@@ -86,7 +86,6 @@
|
||||
"Chat",
|
||||
"Country",
|
||||
"Cyan",
|
||||
"Cyber",
|
||||
"DEST ---°",
|
||||
"DEST {bearing}",
|
||||
"Dance",
|
||||
@@ -536,7 +535,6 @@
|
||||
"Conversation",
|
||||
"Country",
|
||||
"Cyan",
|
||||
"Cyber",
|
||||
"Cyclones · NHC / CPHC",
|
||||
"DENSE",
|
||||
"DEST ---°",
|
||||
@@ -788,7 +786,6 @@
|
||||
"CRT",
|
||||
"Chat",
|
||||
"Country",
|
||||
"Cyber",
|
||||
"DEST ---°",
|
||||
"DEST {bearing}",
|
||||
"DISPLAY",
|
||||
@@ -1431,7 +1428,6 @@
|
||||
"SIG",
|
||||
"AUTO",
|
||||
"FM MHZ",
|
||||
"Cyber",
|
||||
"Sonar",
|
||||
"Cyan",
|
||||
"≥ {value} MW",
|
||||
|
||||
+59
-5
@@ -182,6 +182,12 @@ function topHitOf(hit, foreign) {
|
||||
* when the adapter has none.
|
||||
* @property {unknown} pick `native.pick`, for code still bound to the
|
||||
* engine's pick objects that reads it here.
|
||||
* @property {boolean} overlay Whether a painted overlay target took the
|
||||
* click ({@link InputDispatcher.onOverlayClick}). Its hits then name only
|
||||
* that target: something drawn outside the draw port, with no id. A
|
||||
* target the world overlay paints (a Space Missions label) is also the
|
||||
* card on top for every handler (`clickCard` in src/data/pickRegistry.js),
|
||||
* so nothing under it acts.
|
||||
* @property {(width: number, height: number) => unknown} pickWindow
|
||||
* `native.pickWindow`, the same.
|
||||
*/
|
||||
@@ -190,6 +196,11 @@ function topHitOf(hit, foreign) {
|
||||
* @typedef {object} InputDispatcher
|
||||
* @property {(fn: (event: ClickEvent) => void) => () => void} onClick
|
||||
* Ambient click subscription. Returns its unsubscribe.
|
||||
* @property {(fn: (event: ClickEvent) => boolean) => () => void} onOverlayClick
|
||||
* Hit-test a painted overlay before ambient clicks. Return true after
|
||||
* handling its topmost target: the geometry beneath it is not picked, and
|
||||
* the click subscribers hear the click as one on that target (`overlay`
|
||||
* true, `topHit` a hit with no set and no id, nothing drilled).
|
||||
* @property {(type: 'down'|'move'|'up'|'click'|'dblclick', fn: Function, options?: {lease?: object|(() => object|null)}) => () => void} onPointer
|
||||
* Raw pointer subscription: `click` gets the {@link ClickEvent}, the others
|
||||
* `{position}` (`move`: `{startPosition, endPosition, pickPosition}`, its
|
||||
@@ -267,6 +278,7 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
|
||||
const queryOf = () => givenQuery ?? findQuery(viewer);
|
||||
/** @type {Array<{fn: Function}>} */
|
||||
const clickSubscribers = [];
|
||||
const overlayClicks = new Set();
|
||||
/** @type {Record<string, Array<{fn: Function, lease: object|null}>>} */
|
||||
const pointerSubscribers = Object.fromEntries(
|
||||
POINTER_TYPES.map((type) => [type, []]),
|
||||
@@ -327,12 +339,26 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
|
||||
click: (ev) => {
|
||||
if (!unmodifiedLeft(ev)) return;
|
||||
const ambient = free();
|
||||
const event = createClickEvent(
|
||||
const { event, cover } = createClickEvent(
|
||||
viewer,
|
||||
queryOf,
|
||||
xy(ev.position),
|
||||
ev.gesture ?? { travelPx: 0, durationMs: 0 },
|
||||
);
|
||||
if (ambient) {
|
||||
for (const handle of [...overlayClicks]) {
|
||||
try {
|
||||
// A handled overlay target hides the geometry beneath it; every
|
||||
// subscriber still hears the click, as a click on that target.
|
||||
if (handle(event) === true) {
|
||||
cover();
|
||||
break;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Pointer input handler failed', error);
|
||||
}
|
||||
}
|
||||
}
|
||||
run(pointerSubscribers.click, ambient, event);
|
||||
if (ambient) run(clickSubscribers, true, event);
|
||||
},
|
||||
@@ -357,6 +383,12 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
|
||||
return subscribe(clickSubscribers, { fn, lease: null });
|
||||
},
|
||||
|
||||
onOverlayClick(fn) {
|
||||
if (destroyed) return () => {};
|
||||
overlayClicks.add(fn);
|
||||
return () => overlayClicks.delete(fn);
|
||||
},
|
||||
|
||||
onPointer(type, fn, { lease = null } = {}) {
|
||||
const list = pointerSubscribers[type];
|
||||
if (!list) throw new TypeError(`Unknown pointer event: ${type}`);
|
||||
@@ -395,7 +427,7 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
|
||||
subscriberCount() {
|
||||
return POINTER_TYPES.reduce(
|
||||
(sum, type) => sum + pointerSubscribers[type].length,
|
||||
clickSubscribers.length,
|
||||
clickSubscribers.length + overlayClicks.size,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -404,6 +436,7 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
|
||||
destroyed = true;
|
||||
if (dispatchers.get(viewer) === self) dispatchers.delete(viewer);
|
||||
clickSubscribers.length = 0;
|
||||
overlayClicks.clear();
|
||||
for (const type of POINTER_TYPES) pointerSubscribers[type].length = 0;
|
||||
for (const off of offPort) off();
|
||||
bridge.off();
|
||||
@@ -417,6 +450,10 @@ function createDispatcher(viewer, { query: givenQuery, ...portOptions } = {}) {
|
||||
return self;
|
||||
}
|
||||
|
||||
/** What a click handled by a painted overlay target hits: that target,
|
||||
* drawn outside the draw port and named by no pick id. */
|
||||
const OVERLAY_HIT = Object.freeze({ set: '', id: null, surface: false });
|
||||
|
||||
/** A drill is run at least this deep and sliced, so callers asking for
|
||||
* different depths on one click share one pass. */
|
||||
const DRILL_DEPTH = 16;
|
||||
@@ -426,7 +463,8 @@ const DRILL_DEPTH = 16;
|
||||
* @param {() => import('../render/contract/query').QueryPort|null} queryOf
|
||||
* @param {{x: number, y: number}} at Where the click is, CSS pixels.
|
||||
* @param {ClickGesture} gesture
|
||||
* @returns {ClickEvent}
|
||||
* @returns {{event: ClickEvent, cover: () => void}} The click, and how a
|
||||
* handled overlay target hides the geometry beneath it from the click.
|
||||
*/
|
||||
function createClickEvent(viewer, queryOf, at, gesture) {
|
||||
const position = sensorPickPosition(viewer, at, canvasOf(viewer));
|
||||
@@ -445,11 +483,25 @@ function createClickEvent(viewer, queryOf, at, gesture) {
|
||||
};
|
||||
/** @type {Map<string, {limit: number, hits: Hit[]}>} */
|
||||
const drills = new Map();
|
||||
let covered = false;
|
||||
const cover = () => {
|
||||
covered = true;
|
||||
memo.clear();
|
||||
drills.clear();
|
||||
memo.set('top', OVERLAY_HIT);
|
||||
memo.set('hit', OVERLAY_HIT);
|
||||
memo.set('id', null);
|
||||
memo.set('ownerId', null);
|
||||
memo.set('native', null);
|
||||
};
|
||||
|
||||
return {
|
||||
const event = {
|
||||
screenPosition: at,
|
||||
position,
|
||||
gesture,
|
||||
get overlay() {
|
||||
return covered;
|
||||
},
|
||||
get topHit() {
|
||||
return once('top', () => {
|
||||
const hit = pick();
|
||||
@@ -495,6 +547,7 @@ function createClickEvent(viewer, queryOf, at, gesture) {
|
||||
return !this.hit;
|
||||
},
|
||||
windowHit(width, height) {
|
||||
if (covered) return { id: null, drawHit: null, surface: false };
|
||||
return once(`windowHit:${width}x${height}`, () => {
|
||||
const picked = pick({ width, height });
|
||||
void native()?.native.pickWindow(width, height);
|
||||
@@ -515,7 +568,7 @@ function createClickEvent(viewer, queryOf, at, gesture) {
|
||||
// A deeper pass already made holds these. (One that came back short
|
||||
// may not hold every hit: it drops what is not a draw-set item.)
|
||||
if (done && limit <= done.limit) return done.hits.slice(0, limit);
|
||||
const q = query();
|
||||
const q = covered ? null : query();
|
||||
if (!q) return [];
|
||||
// Only the default window is shared between layers; round that one up.
|
||||
const depth =
|
||||
@@ -548,4 +601,5 @@ function createClickEvent(viewer, queryOf, at, gesture) {
|
||||
return native()?.native.pickWindow(width, height);
|
||||
},
|
||||
};
|
||||
return { event, cover };
|
||||
}
|
||||
@@ -129,6 +129,97 @@ test('a click nobody reads is never picked', (t) => {
|
||||
assert.equal(h.calls.pick, 0);
|
||||
});
|
||||
|
||||
test('a painted overlay can claim a click before its underlying owner', (t) => {
|
||||
registerPickOwner('satellites', (id) => id === '25544');
|
||||
t.after(() => unregisterPickOwner('satellites'));
|
||||
const h = harness({ pick: () => ({ id: '25544' }) });
|
||||
t.after(() => h.input.destroy());
|
||||
const clicks = [];
|
||||
|
||||
h.input.onClick((event) => clicks.push(event.ownerId));
|
||||
const offOverlay = h.input.onOverlayClick(({ screenPosition }) => {
|
||||
if (screenPosition.x !== 10) return false;
|
||||
clicks.push('mission label');
|
||||
return true;
|
||||
});
|
||||
h.input.onPointer('click', () => clicks.push('ambient pointer'));
|
||||
|
||||
h.click();
|
||||
// The click still reaches every subscriber, as one on the label.
|
||||
assert.deepEqual(clicks, ['mission label', 'ambient pointer', null]);
|
||||
assert.equal(h.calls.pick, 0);
|
||||
|
||||
h.click(11, 10);
|
||||
offOverlay();
|
||||
h.click();
|
||||
assert.deepEqual(clicks, [
|
||||
'mission label',
|
||||
'ambient pointer',
|
||||
null,
|
||||
'ambient pointer',
|
||||
'satellites',
|
||||
'ambient pointer',
|
||||
'satellites',
|
||||
]);
|
||||
});
|
||||
|
||||
test('a click a painted overlay handles still reaches subscribers that clear selection', (t) => {
|
||||
const h = harness({
|
||||
pick: () => ({ set: 'flights', id: 'abc123' }),
|
||||
drillPick: () => [{ set: 'flights', id: 'abc123' }],
|
||||
});
|
||||
t.after(() => h.input.destroy());
|
||||
let seenByOverlay = null;
|
||||
h.input.onOverlayClick((event) => {
|
||||
seenByOverlay = event;
|
||||
return true;
|
||||
});
|
||||
const seen = [];
|
||||
h.input.onClick((event) => {
|
||||
seen.push({
|
||||
same: event === seenByOverlay,
|
||||
overlay: event.overlay,
|
||||
topHit: event.topHit,
|
||||
drawHit: event.drawHit,
|
||||
hit: event.hit,
|
||||
id: event.id,
|
||||
ownerId: event.ownerId,
|
||||
surface: event.surface,
|
||||
drill: event.drill(4),
|
||||
windowHit: event.windowHit(8, 8),
|
||||
pick: event.pick,
|
||||
});
|
||||
});
|
||||
h.click();
|
||||
assert.deepEqual(seen, [
|
||||
{
|
||||
same: true,
|
||||
overlay: true,
|
||||
topHit: { set: '', id: null, surface: false },
|
||||
drawHit: null,
|
||||
hit: { set: '', id: null, surface: false },
|
||||
id: null,
|
||||
ownerId: null,
|
||||
surface: false,
|
||||
drill: [],
|
||||
windowHit: { id: null, drawHit: null, surface: false },
|
||||
pick: undefined,
|
||||
},
|
||||
]);
|
||||
assert.equal(h.calls.pick, 0, 'the geometry beneath is not picked');
|
||||
assert.equal(h.calls.drillPick, 0);
|
||||
|
||||
// Without an overlay target the same click picks the geometry.
|
||||
seen.length = 0;
|
||||
h.input.destroy();
|
||||
const g = harness({ pick: () => ({ set: 'flights', id: 'abc123' }) });
|
||||
t.after(() => g.input.destroy());
|
||||
g.input.onClick((event) => seen.push([event.overlay, event.topHit]));
|
||||
g.click();
|
||||
assert.equal(seen[0][0], false);
|
||||
assert.equal(g.calls.pick, 1);
|
||||
});
|
||||
|
||||
test('the gesture carries summed travel and press time', (t) => {
|
||||
const h = harness();
|
||||
t.after(() => h.input.destroy());
|
||||
|
||||
@@ -18,6 +18,8 @@ import { rendererOf } from '../render/rendererOf.js';
|
||||
import { fakeScenePicks } from '../testSupport/fakeCesiumScene.mjs';
|
||||
import { provideStyleStageAlias } from '../styles/styleStages.js';
|
||||
import { inputFor } from './dispatcher.js';
|
||||
import { setClickCardHitTest } from '../data/pickRegistry.js';
|
||||
import { ROCKET_MISSION_AMBIENT_OVERLAY_SOURCE_ID } from '../layers/launches/policy.js';
|
||||
|
||||
/** Cesium's own event types, the ones the input port binds. */
|
||||
export const FAKE_EVENT_TYPES = Cesium.ScreenSpaceEventType;
|
||||
@@ -140,3 +142,40 @@ export function fakeInput(viewer, { now } = {}) {
|
||||
destroy: () => input.destroy(),
|
||||
};
|
||||
}
|
||||
|
||||
/** The Space Missions label {@link fakeInputUnderLabel} paints: an
|
||||
* interactive entry of the missions' world-overlay source. */
|
||||
export const MISSION_LABEL = Object.freeze({
|
||||
sourceId: ROCKET_MISSION_AMBIENT_OVERLAY_SOURCE_ID,
|
||||
entryId: 'launch:L1',
|
||||
});
|
||||
|
||||
/**
|
||||
* `fakeInput` with a Space Missions label painted over the map: while
|
||||
* `label.over` is true the label takes each click, so every click subscriber
|
||||
* hears it as an overlay click (`event.overlay`) and the geometry beneath it
|
||||
* is not picked, and the pick registry names it as the card on top
|
||||
* (`clickCard`), as the world-overlay host's hit test names an interactive
|
||||
* mission label. `destroy` also clears that hit test.
|
||||
* @param {object} viewer
|
||||
* @param {{now?: () => number, beneath?: () => ({sourceId: string, entryId: string}|null)}} [options]
|
||||
* `beneath`: the card painted under the label, on top when the label is
|
||||
* not over the click.
|
||||
*/
|
||||
export function fakeInputUnderLabel(
|
||||
viewer,
|
||||
{ beneath = () => null, ...options } = {},
|
||||
) {
|
||||
const fake = fakeInput(viewer, options);
|
||||
const label = { over: false };
|
||||
fake.input.onOverlayClick(() => label.over);
|
||||
setClickCardHitTest(() => (label.over ? MISSION_LABEL : beneath()));
|
||||
return {
|
||||
...fake,
|
||||
label,
|
||||
destroy() {
|
||||
setClickCardHitTest(null);
|
||||
fake.destroy();
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { isFollowing } from '../../data/followed.js';
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import { isUnderOtherCard } from '../../data/pickRegistry.js';
|
||||
import { distance, fromDegrees, toLonLatH } from '../../geo/index.js';
|
||||
import {
|
||||
LAYER_ID,
|
||||
@@ -581,6 +582,9 @@ export function createAlprPresentation({ state, services, source }) {
|
||||
if (state.clickSubscription) return;
|
||||
state.clickSubscription = inputFor(viewer).onClick((event) => {
|
||||
if (!state.enabled) return;
|
||||
// Another layer's card or label painted on top takes the click: the item
|
||||
// under it does not act, and the click is not empty space either.
|
||||
if (isUnderOtherCard(event)) return;
|
||||
// The painted overlay answers first; the scene is picked only if not.
|
||||
const hit = event.drawHit;
|
||||
const id =
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import * as Cesium from 'cesium';
|
||||
import { fakeInput, fakeInputUnderLabel } from '../../input/testDoubles.mjs';
|
||||
import { setClickCardHitTest } from '../../data/pickRegistry.js';
|
||||
import { fakeDrawPort } from '../../testSupport/fakeDrawPort.mjs';
|
||||
import { bindFakeCesiumScene } from '../../testSupport/fakeCesiumScene.mjs';
|
||||
import { createAlprMarkerSet } from './markerState.js';
|
||||
import { createAlprPresentation } from './presentation.js';
|
||||
|
||||
/** One camera drawn and painted at (100, 100), over a viewer whose clicks a
|
||||
* label may take. */
|
||||
function harness(t) {
|
||||
const previousImage = globalThis.Image;
|
||||
const project = Cesium.SceneTransforms.worldToWindowCoordinates;
|
||||
globalThis.Image = class {
|
||||
complete = true;
|
||||
naturalWidth = 128;
|
||||
};
|
||||
Cesium.SceneTransforms.worldToWindowCoordinates = () => ({ x: 100, y: 100 });
|
||||
const record = {
|
||||
id: 'camera:0',
|
||||
latitude: 30,
|
||||
longitude: -97,
|
||||
directionDeg: 90,
|
||||
};
|
||||
const drawPort = fakeDrawPort();
|
||||
const markers = createAlprMarkerSet();
|
||||
markers.attach(drawPort.icons({ id: 'alpr-cameras:test:markers' }));
|
||||
const viewer = {
|
||||
camera: {
|
||||
positionWC: Cesium.Cartesian3.fromDegrees(-97, 30, 500),
|
||||
pickEllipsoid: () => Cesium.Cartesian3.fromDegrees(-97, 30),
|
||||
},
|
||||
scene: {
|
||||
canvas: { clientWidth: 800, clientHeight: 600 },
|
||||
globe: { show: true, getHeight: () => 150 },
|
||||
pick: () => null,
|
||||
},
|
||||
};
|
||||
const { unbind } = bindFakeCesiumScene(viewer, { draw: drawPort });
|
||||
const fake = fakeInputUnderLabel(viewer);
|
||||
const state = {
|
||||
viewer,
|
||||
enabled: true,
|
||||
selectedId: null,
|
||||
markers,
|
||||
records: [record],
|
||||
recordById: new Map([[record.id, record]]),
|
||||
renderRevision: 0,
|
||||
lastAnchorSampleAt: 0,
|
||||
};
|
||||
let selected = null;
|
||||
let paint;
|
||||
const presentation = createAlprPresentation({
|
||||
state,
|
||||
source: { label: 'Test cameras' },
|
||||
services: {
|
||||
render: { governorRequestRender() {} },
|
||||
context: {
|
||||
clearSelectedEntityContextForLayer() {
|
||||
selected = null;
|
||||
},
|
||||
getSelectedEntityContext: () => selected,
|
||||
registerEntityContext() {},
|
||||
removeEntityContextsForLayer() {},
|
||||
selectEntityContext(carrier) {
|
||||
selected = { id: carrier.id, layerId: 'alpr-cameras' };
|
||||
},
|
||||
},
|
||||
groundFloor: { cachedGroundFloor: () => 150 },
|
||||
overlays: {
|
||||
registerPaintLane(_lane, painter) {
|
||||
paint = painter;
|
||||
return { setActive() {}, requestPaint() {}, unregister() {} };
|
||||
},
|
||||
keyholeAlpha: () => 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
presentation.initOverlay();
|
||||
presentation.installInteraction(viewer);
|
||||
t.after(() => {
|
||||
presentation.destroyOverlay();
|
||||
fake.destroy();
|
||||
unbind();
|
||||
if (previousImage === undefined) delete globalThis.Image;
|
||||
else globalThis.Image = previousImage;
|
||||
Cesium.SceneTransforms.worldToWindowCoordinates = project;
|
||||
});
|
||||
presentation.renderRecords();
|
||||
const ctx = {
|
||||
globalAlpha: 1,
|
||||
save() {},
|
||||
restore() {},
|
||||
beginPath() {},
|
||||
moveTo() {},
|
||||
lineTo() {},
|
||||
closePath() {},
|
||||
stroke() {},
|
||||
fill() {},
|
||||
createLinearGradient: () => ({ addColorStop() {} }),
|
||||
drawImage() {},
|
||||
};
|
||||
paint({ ctx, width: 800, height: 600 });
|
||||
return { state, fake, at: { x: 100, y: 100 } };
|
||||
}
|
||||
|
||||
test('a click on a mission label over a camera never selects it, and keeps the selected camera', (t) => {
|
||||
const h = harness(t);
|
||||
h.fake.label.over = true;
|
||||
h.fake.click(h.at);
|
||||
assert.equal(h.state.selectedId, null, 'the camera under the label');
|
||||
|
||||
// Off the label, the same click selects the camera.
|
||||
h.fake.label.over = false;
|
||||
h.fake.click(h.at);
|
||||
assert.equal(h.state.selectedId, 'camera:0');
|
||||
|
||||
// The label on top is its own click: the selection stays.
|
||||
h.fake.label.over = true;
|
||||
h.fake.click(h.at);
|
||||
assert.equal(h.state.selectedId, 'camera:0', 'the selection stays');
|
||||
});
|
||||
|
||||
// The card or label painted on top takes the click: ALPR does not even pick
|
||||
// under another layer's card, so no camera is selected or released there.
|
||||
test("another layer's card over an ALPR camera keeps the click", (t) => {
|
||||
let picks = 0;
|
||||
const viewer = {
|
||||
scene: {
|
||||
canvas: new EventTarget(),
|
||||
pick: () => {
|
||||
picks++;
|
||||
return null;
|
||||
},
|
||||
},
|
||||
};
|
||||
const input = fakeInput(viewer);
|
||||
const noop = () => {};
|
||||
const state = {
|
||||
enabled: true,
|
||||
viewer,
|
||||
clickSubscription: null,
|
||||
markers: { icons: null },
|
||||
recordById: new Map(),
|
||||
selectedId: null,
|
||||
};
|
||||
const presentation = createAlprPresentation({
|
||||
state,
|
||||
services: {
|
||||
render: { governorRequestRender: noop },
|
||||
context: {
|
||||
clearSelectedEntityContextForLayer: noop,
|
||||
getSelectedEntityContext: () => null,
|
||||
registerEntityContext: noop,
|
||||
removeEntityContextsForLayer: noop,
|
||||
selectEntityContext: noop,
|
||||
},
|
||||
groundFloor: { cachedGroundFloor: () => null },
|
||||
},
|
||||
});
|
||||
presentation.installInteraction(viewer);
|
||||
let top = { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' };
|
||||
setClickCardHitTest(() => top);
|
||||
t.after(() => {
|
||||
setClickCardHitTest(null);
|
||||
state.clickSubscription?.();
|
||||
input.destroy();
|
||||
});
|
||||
input.tap({ x: 10, y: 10 });
|
||||
assert.equal(picks, 0, 'covered: the scene under the card is not picked');
|
||||
top = null;
|
||||
input.tap({ x: 10, y: 10 });
|
||||
assert.ok(picks > 0, 'open map: the click reaches the scene');
|
||||
});
|
||||
@@ -96,7 +96,7 @@ export const AWARENESS_RANGE_RING_STYLE = Object.freeze({
|
||||
* (tracking, cockpit, orbit, a fly-to) do not. Below the band's height they
|
||||
* rest too. While they run they never hold
|
||||
* continuous rendering; each drawn frame arms one more step after the
|
||||
* Cyber sonar's 80 ms cadence, so the two never beat. Fronts and band,
|
||||
* sonar's 80 ms cadence, so the two never beat. Fronts and band,
|
||||
* fixed in the world, step at that cadence however many frames are
|
||||
* drawn, so they look the same whether the camera moves or not; crossing
|
||||
* the rim height shows or hides them at once.
|
||||
|
||||
@@ -430,7 +430,7 @@ export function createRangeRing({
|
||||
* Run the range pulses again for `activeMs`, after a camera move. Call it
|
||||
* during a frame (lifecycle's preRender): that frame's postRender arms the
|
||||
* next request, so waking asks for no extra frame of its own. Pulses at
|
||||
* rest start in this frame; running ones keep their Cyber sonar interval,
|
||||
* rest start in this frame; running ones keep their sonar interval,
|
||||
* however many frames a drag draws.
|
||||
*/
|
||||
function wakePulses() {
|
||||
@@ -506,7 +506,7 @@ export function createRangeRing({
|
||||
const { lines, band } = setsOn(viewer);
|
||||
const frame = findFrame(viewer);
|
||||
// A renderer without frame hooks gets the static ring only, as the
|
||||
// Cyber sonar scene does. So does a viewer who prefers reduced motion.
|
||||
// sonar scene does. So does a viewer who prefers reduced motion.
|
||||
const animate = Boolean(!reducedMotion && frame?.on);
|
||||
// Pulses run from now until `wake.untilMs`, then rest.
|
||||
const wake = animate
|
||||
@@ -681,7 +681,7 @@ export function createRangeRing({
|
||||
bandShown = false;
|
||||
return;
|
||||
}
|
||||
// The soft band is painted at most once a Cyber sonar interval;
|
||||
// The soft band is painted at most once a sonar interval;
|
||||
// the fronts, crisp lines, move on every step.
|
||||
if (
|
||||
bandShown &&
|
||||
@@ -726,7 +726,7 @@ export function createRangeRing({
|
||||
// Whether the camera was below the rim at the last step.
|
||||
let wasBelow = belowRim();
|
||||
// The fronts and band are fixed in the world: a camera move needs
|
||||
// nothing of them, so they step a Cyber sonar interval apart however
|
||||
// nothing of them, so they step a sonar interval apart however
|
||||
// many frames are drawn, and look the same parked or moving. Each
|
||||
// frame checks only whether the camera crossed the rim height, which
|
||||
// shows or hides them at once. A step asks for the frame that draws
|
||||
@@ -746,8 +746,8 @@ export function createRangeRing({
|
||||
stepRunning(nowMs);
|
||||
}
|
||||
});
|
||||
// Each drawn frame, whoever asked for it, arms one step a Cyber
|
||||
// sonar interval later, as the Cyber sonar scene does, whose changes
|
||||
// Each drawn frame, whoever asked for it, arms one step a
|
||||
// sonar interval later, as the sonar scene does, whose changes
|
||||
// ask for the frame that draws them. Requests never land within
|
||||
// 80 ms of a frame, so they cannot beat the detection lane's 80 ms
|
||||
// gate, and they stop once the pulses rest.
|
||||
|
||||
@@ -488,7 +488,7 @@ test('pulses ask for a frame 80 ms after each drawn frame instead of holding con
|
||||
const { rendering, pulseFrames } = ring;
|
||||
const loop = frameLoop(t, ring);
|
||||
rendering.renderVisual(flight(3));
|
||||
// A Contacts view repaints at the Cyber sonar cadence, ~12.5 fps, while
|
||||
// A Contacts view repaints at the sonar cadence, ~12.5 fps, while
|
||||
// the pulses run, never every display frame.
|
||||
assert.equal(pulseFrames(), 0);
|
||||
loop.advance(1); // the frame the new ring asked for arms the first request
|
||||
@@ -972,14 +972,14 @@ test('disabling the layer tears the pulses down completely', (t) => {
|
||||
);
|
||||
});
|
||||
|
||||
test('pulse requests wait 80 ms after any frame, so they cannot beat the Cyber sonar', (t) => {
|
||||
test('pulse requests wait 80 ms after any frame, so they cannot beat the sonar', (t) => {
|
||||
const ring = ringRendering(t);
|
||||
const { rendering, pulseFrames } = ring;
|
||||
const loop = frameLoop(t, ring);
|
||||
rendering.renderVisual(flight(3));
|
||||
loop.advance(1);
|
||||
const frames = pulseFrames();
|
||||
// Another owner (the Cyber sonar, a data update) draws 67 ms after ours.
|
||||
// Another owner (the sonar, a data update) draws 67 ms after ours.
|
||||
loop.advance(67);
|
||||
loop.draw();
|
||||
loop.advance(CYBER_SONAR_RENDER_INTERVAL_MS - 1);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { t } from '../../i18n/index.js';
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import { isUnderOtherCard } from '../../data/pickRegistry.js';
|
||||
import {
|
||||
BIKESHARE_SELECTED_OVERLAY_SOURCE_ID,
|
||||
BIKESHARE_SELECTED_OVERLAY_SOURCE_OPTIONS,
|
||||
@@ -179,6 +180,9 @@ export function createSelection({
|
||||
if (layerState._clickSubscription) return;
|
||||
|
||||
layerState._clickSubscription = inputFor(viewer).onClick((event) => {
|
||||
// Another layer's card or label painted on top takes the click: the item
|
||||
// under it does not act, and the click is not empty space either.
|
||||
if (isUnderOtherCard(event)) return;
|
||||
const hit = event.drawHit;
|
||||
|
||||
if (hit) {
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createSelection } from './selection.js';
|
||||
import { fakeInput } from '../../input/testDoubles.mjs';
|
||||
import { setClickCardHitTest } from '../../data/pickRegistry.js';
|
||||
|
||||
/** A station layer's selection on a viewer whose pick is scripted. */
|
||||
function harness(t) {
|
||||
const previousDocument = globalThis.document;
|
||||
globalThis.document = new EventTarget();
|
||||
let picked = null;
|
||||
const viewer = { scene: { canvas: new EventTarget(), pick: () => picked } };
|
||||
const input = fakeInput(viewer);
|
||||
const noop = () => {};
|
||||
const state = {
|
||||
_selectedKey: null,
|
||||
_clickSubscription: null,
|
||||
_stationRenderMap: new Map([['nyc:1', { position: { x: 1, y: 0, z: 0 } }]]),
|
||||
_stationSet: { id: 'bikeshare:stations', upsert: noop },
|
||||
_selectedSet: {
|
||||
id: 'bikeshare:selected',
|
||||
set: noop,
|
||||
size: () => 0,
|
||||
clear: noop,
|
||||
},
|
||||
_overlayHost: { setEntries: noop, clearSource: noop },
|
||||
};
|
||||
const selection = createSelection({
|
||||
state,
|
||||
services: {},
|
||||
parts: { rendering: { stationItem: () => ({}) } },
|
||||
});
|
||||
selection._installClickHandler(viewer);
|
||||
t.after(() => {
|
||||
state._clickSubscription?.();
|
||||
input.destroy();
|
||||
if (previousDocument === undefined) delete globalThis.document;
|
||||
else globalThis.document = previousDocument;
|
||||
});
|
||||
return {
|
||||
state,
|
||||
click(hit) {
|
||||
picked = hit ? { id: hit } : null;
|
||||
input.tap({ x: 10, y: 10 });
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// The card or label painted on top takes the click: a station under another
|
||||
// layer's card is neither selected nor let go.
|
||||
test("another layer's card over a station keeps the click", (t) => {
|
||||
const h = harness(t);
|
||||
let top = { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' };
|
||||
setClickCardHitTest(() => top);
|
||||
t.after(() => setClickCardHitTest(null));
|
||||
const station = { set: 'bikeshare:stations', id: 'nyc:1' };
|
||||
h.click(station);
|
||||
assert.equal(h.state._selectedKey, null, 'covered: not selected');
|
||||
top = null;
|
||||
h.click(station);
|
||||
assert.equal(h.state._selectedKey, 'nyc:1');
|
||||
top = { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' };
|
||||
h.click(null);
|
||||
assert.equal(h.state._selectedKey, 'nyc:1', 'covered: kept');
|
||||
top = null;
|
||||
h.click(null);
|
||||
assert.equal(h.state._selectedKey, null, 'open map lets it go');
|
||||
});
|
||||
@@ -23,7 +23,7 @@ export function createLifecycle({
|
||||
source,
|
||||
}) {
|
||||
const { activateCctvCameraFromWorldClick } = services.activation;
|
||||
const { resolvePickId, registerPickOwner, unregisterPickOwner } =
|
||||
const { resolvePickId, registerPickOwner, unregisterPickOwner, clickCard } =
|
||||
services.picking;
|
||||
const { onFocusTargetAppear } = services.focus;
|
||||
const { releaseContinuousRender } = services.render;
|
||||
@@ -391,6 +391,20 @@ export function createLifecycle({
|
||||
(event) => {
|
||||
if (!layerState._enabled) return;
|
||||
const picked = event.topHit;
|
||||
// The card or label painted on top takes the click, read once per
|
||||
// click so every layer agrees: a live card of ours acts whatever
|
||||
// is drawn under it; another layer's is that layer's click.
|
||||
const top = clickCard?.(event) ?? null;
|
||||
if (top && top.sourceId !== CCTV_OVERLAY_SOURCE_ID) return;
|
||||
if (top) {
|
||||
// A card of ours that is going away is still not the scene.
|
||||
if (layerState._recordById.has(top.entryId))
|
||||
activateCctvCameraFromWorldClick(
|
||||
top.entryId,
|
||||
parts.selection.setActiveCamera,
|
||||
);
|
||||
return;
|
||||
}
|
||||
const cameraId = parts.selection.extractPickedCameraId(
|
||||
event.drawHit ?? null,
|
||||
);
|
||||
@@ -401,29 +415,11 @@ export function createLifecycle({
|
||||
);
|
||||
return;
|
||||
}
|
||||
// Any identified scene object owns this click even if its layer does not
|
||||
// register a shared pick predicate. This keeps selectable siblings ahead
|
||||
// of an overlapping CCTV card while ID-less globe/terrain/tile surfaces
|
||||
// remain eligible for true empty-space deselection.
|
||||
const pickedId = resolvePickId(picked);
|
||||
if (pickedId !== null) return;
|
||||
// Item A (owner round 2): the scene pick found no camera — try the
|
||||
// painted ambient cards. The cards canvas is pointer-events:none (this
|
||||
// handler owns the events), so a click landing on a card's rect selects
|
||||
// its camera exactly like a click on the icon. Click positions
|
||||
// and the recorded rects are both CSS px — direct comparison.
|
||||
const cardId = layerState._cctvOverlayHost.hitTest(
|
||||
event.screenPosition.x,
|
||||
event.screenPosition.y,
|
||||
{ sourceId: CCTV_OVERLAY_SOURCE_ID },
|
||||
)?.entryId;
|
||||
if (cardId && layerState._recordById.has(cardId)) {
|
||||
activateCctvCameraFromWorldClick(
|
||||
cardId,
|
||||
parts.selection.setActiveCamera,
|
||||
);
|
||||
return;
|
||||
}
|
||||
// Any identified scene object owns this click even if its layer
|
||||
// does not register a shared pick predicate. This keeps selectable
|
||||
// siblings ahead of the CCTV selection while ID-less globe, terrain
|
||||
// and tile surfaces remain eligible for empty-space deselection.
|
||||
if (resolvePickId(picked) !== null) return;
|
||||
if (
|
||||
parts.selection.cctvEmptyClickDeselects(picked, {
|
||||
activeCameraId: layerState._activeCameraId,
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createLifecycle } from './lifecycle.js';
|
||||
import { createSelection } from './selection.js';
|
||||
import { CCTV_OVERLAY_SOURCE_ID } from '../../data/cctvCards.js';
|
||||
import { fakeInput, fakeInputUnderLabel } from '../../input/testDoubles.mjs';
|
||||
import * as picking from '../../data/pickRegistry.js';
|
||||
import { bindRenderer } from '../../render/rendererOf.js';
|
||||
import { fakeCameraPort } from '../../testSupport/fakeCameraPort.mjs';
|
||||
|
||||
@@ -72,3 +76,265 @@ test('the view listeners follow the camera port and let go on teardown', () => {
|
||||
assert.deepEqual(counts(second.camera), [0, 0]);
|
||||
assert.equal(state._viewListenerCamera, null);
|
||||
});
|
||||
|
||||
/** A part whose members are `own`'s, and any other a function that does
|
||||
* nothing. */
|
||||
const inert = (own = {}) =>
|
||||
new Proxy(own, {
|
||||
get: (target, name) => (name in target ? target[name] : () => {}),
|
||||
});
|
||||
|
||||
test("a click on a mission label over a camera's card never turns that camera on, and keeps the active one", async (t) => {
|
||||
const { viewer } = viewerWithCamera();
|
||||
viewer.scene = { canvas: {}, pick: () => null };
|
||||
// The card of camera `cam-1` lies under every click, under the label.
|
||||
const fake = fakeInputUnderLabel(viewer, {
|
||||
beneath: () => ({ sourceId: CCTV_OVERLAY_SOURCE_ID, entryId: 'cam-1' }),
|
||||
});
|
||||
t.after(() => fake.destroy());
|
||||
const activated = [];
|
||||
const deactivated = [];
|
||||
const state = {};
|
||||
const lifecycle = createLifecycle({
|
||||
state,
|
||||
services: {
|
||||
activation: {
|
||||
activateCctvCameraFromWorldClick: (id) => activated.push(id),
|
||||
},
|
||||
picking,
|
||||
focus: {},
|
||||
render: {},
|
||||
},
|
||||
parts: {
|
||||
calibration: { loadCalibrationStore: () => new Map() },
|
||||
catalog: {
|
||||
loadCameraSources: async () => [],
|
||||
buildCatalogFromSources: () => [],
|
||||
seedCatalog: () => [],
|
||||
},
|
||||
ground: {
|
||||
resolveGroundPriors: async () => [],
|
||||
currentSurfaceRegime: () => null,
|
||||
},
|
||||
rendering: inert({ refreshHorizonCulling: () => false }),
|
||||
health: { syncHealthState: async () => {} },
|
||||
geometryQueue: inert(),
|
||||
cards: inert(),
|
||||
projection: inert(),
|
||||
presentation: inert(),
|
||||
navigation: inert(),
|
||||
hover: inert(),
|
||||
selection: {
|
||||
// The camera's own gate takes only clean clicks; these are.
|
||||
bindCctvWorldClickGesture: (input, onClick) => input.onClick(onClick),
|
||||
extractPickedCameraId: () => null,
|
||||
cctvEmptyClickDeselects: (picked, { activeCameraId }) =>
|
||||
Boolean(activeCameraId) && picking.resolvePickId(picked) === null,
|
||||
deactivateActiveCamera: () => deactivated.push(state._activeCameraId),
|
||||
},
|
||||
},
|
||||
});
|
||||
// Init's bounded wait for ground heights never runs out here: they are in.
|
||||
t.mock.timers.enable({ apis: ['setTimeout'] });
|
||||
await lifecycle.methods.init(viewer);
|
||||
t.after(() => state._clickSubscription?.());
|
||||
state._enabled = true;
|
||||
state._activeCameraId = 'cam-0';
|
||||
state._recordById.set('cam-1', {});
|
||||
|
||||
fake.label.over = true;
|
||||
fake.click();
|
||||
assert.deepEqual(activated, [], 'the camera under the label stays off');
|
||||
assert.deepEqual(deactivated, [], 'the active camera stays on');
|
||||
|
||||
// Off the label, a click on the card turns its camera on.
|
||||
fake.label.over = false;
|
||||
fake.click();
|
||||
assert.deepEqual(activated, ['cam-1']);
|
||||
});
|
||||
|
||||
test('the card painted on top takes world clicks, whatever is drawn under it', async (t) => {
|
||||
const noop = () => {};
|
||||
const { viewer } = viewerWithCamera();
|
||||
let picked = null;
|
||||
viewer.scene = {
|
||||
canvas: {},
|
||||
pick: () => (picked ? { id: picked } : undefined),
|
||||
drillPick: () => drilled.map((id) => ({ id })),
|
||||
};
|
||||
let drilled = [];
|
||||
const input = fakeInput(viewer);
|
||||
// An aircraft layer that runs before ours and tracks the plane it was
|
||||
// clicked on, standing aside under another layer's card.
|
||||
let tracked = null;
|
||||
input.input.onClick((event) => {
|
||||
if (picking.isUnderOtherCard(event)) return;
|
||||
if (event.hit?.id === 'plane:9') tracked = 'plane:9';
|
||||
});
|
||||
const ownCard = { sourceId: CCTV_OVERLAY_SOURCE_ID, entryId: 'cam-1' };
|
||||
const foreignCard = {
|
||||
sourceId: 'earthquake-card',
|
||||
entryId: 'earthquake-card:qa',
|
||||
};
|
||||
let painted = [];
|
||||
const actions = [];
|
||||
// The card on top at a click, as the host answers the pick registry.
|
||||
picking.setClickCardHitTest(() => painted[0] ?? null);
|
||||
const state = {
|
||||
_cctvOverlayHost: {
|
||||
hitTest: (_x, _y, options = {}) =>
|
||||
painted.find(
|
||||
(hit) => !options.sourceId || hit.sourceId === options.sourceId,
|
||||
) ?? null,
|
||||
},
|
||||
};
|
||||
const parts = {
|
||||
calibration: { loadCalibrationStore: () => new Map() },
|
||||
catalog: {
|
||||
loadCameraSources: async () => [],
|
||||
buildCatalogFromSources: () => [],
|
||||
seedCatalog: () => [],
|
||||
},
|
||||
ground: {
|
||||
resolveGroundPriors: async () => [],
|
||||
currentSurfaceRegime: () => 'terrain-globe',
|
||||
},
|
||||
cards: { teardownAmbientCards: noop },
|
||||
projection: { clearProjectionOverlay: noop },
|
||||
geometryQueue: { stopGeometryLoadQueue: noop },
|
||||
rendering: {
|
||||
createCameraIcons: noop,
|
||||
refreshHorizonCulling: () => false,
|
||||
refreshCoverageStyles: noop,
|
||||
extractPickedCameraId: (hit) =>
|
||||
hit?.set === 'cctv:fixture' ? hit.id : null,
|
||||
},
|
||||
hover: { handleHoverMove: noop },
|
||||
health: { syncHealthState: async () => {} },
|
||||
presentation: { notifyListeners: noop },
|
||||
};
|
||||
const services = {
|
||||
sprites: {},
|
||||
focus: { onFocusTargetAppear: () => noop },
|
||||
render: { releaseContinuousRender: noop },
|
||||
picking,
|
||||
activation: { activateCctvCameraFromWorldClick: (id) => actions.push(id) },
|
||||
};
|
||||
parts.selection = createSelection({ state, services, parts });
|
||||
parts.selection.deactivateActiveCamera = () => actions.push('clear');
|
||||
const lifecycle = createLifecycle({ state, services, parts });
|
||||
t.after(() => {
|
||||
state._clickSubscription?.();
|
||||
lifecycle.detachViewListeners();
|
||||
input.destroy();
|
||||
picking.setClickCardHitTest(null);
|
||||
picking.unregisterPickOwner('area-control');
|
||||
picking.unregisterPickOwner('test-trails');
|
||||
picking.unregisterPickOwner('test-planes');
|
||||
picking.unregisterPickOwner('test-tracking');
|
||||
picking.unregisterPickOwner('test-exact');
|
||||
});
|
||||
await lifecycle.methods.init(viewer);
|
||||
state._enabled = true;
|
||||
state._activeCameraId = 'cam-1';
|
||||
state._recordById.set('cam-1', { camera: { id: 'cam-1' } });
|
||||
const click = (hit, cards, expected) => {
|
||||
picked = hit;
|
||||
painted = cards;
|
||||
actions.length = 0;
|
||||
input.tap();
|
||||
assert.deepEqual(actions, expected, JSON.stringify({ hit, cards }));
|
||||
};
|
||||
const drone = {
|
||||
set: 'drone-airspace:1:fills',
|
||||
id: 'drone-airspace:zone:0',
|
||||
surface: false,
|
||||
};
|
||||
const perimeter = {
|
||||
set: 'fire-perimeters:1:lines',
|
||||
id: 'fire-perimeter:incident:0',
|
||||
surface: false,
|
||||
};
|
||||
const quake = { set: 'earthquakes:1', id: 'earthquake:q1', surface: false };
|
||||
const cable = { set: 'submarine-cables:1:lines', id: 'c:0', surface: false };
|
||||
const launch = {
|
||||
set: 'launches:1:markers',
|
||||
id: 'rocket-x:1',
|
||||
surface: false,
|
||||
};
|
||||
const backgrounds = [drone, perimeter, quake, cable, launch];
|
||||
for (const area of backgrounds) {
|
||||
click(area, [ownCard], ['cam-1']);
|
||||
click(area, [], []);
|
||||
click(area, [foreignCard, ownCard], []);
|
||||
}
|
||||
// The live top card acts over anything drawn under it; with no card an
|
||||
// identified object is not empty map.
|
||||
for (const hit of [
|
||||
{ set: 'flights:1', id: 'aircraft', surface: false },
|
||||
{ set: '', id: 'unregistered-local-entity', surface: false },
|
||||
{ ...drone, set: 'unrelated:1:fills' },
|
||||
{ ...drone, id: 'unregistered-local-entity' },
|
||||
]) {
|
||||
click(hit, [ownCard], ['cam-1']);
|
||||
click(hit, [], []);
|
||||
}
|
||||
// A trail under the live top card: the card keeps the click, and with no
|
||||
// card the owned pick is not empty map.
|
||||
const trail = { set: 'trails:1', id: 'gev-trail:fl-1:head', surface: false };
|
||||
picking.registerPickOwner('test-trails', (id) => id === trail.id);
|
||||
click(trail, [ownCard], ['cam-1']);
|
||||
click(trail, [], []);
|
||||
click(trail, [foreignCard, ownCard], []);
|
||||
picking.unregisterPickOwner('test-trails');
|
||||
// A coarse tap whose touch contact is an aircraft (a layer that acts on
|
||||
// nearby contacts) under a live CCTV card is the card's.
|
||||
const previousMatch = globalThis.matchMedia;
|
||||
const restoreMatch = () => {
|
||||
if (previousMatch) globalThis.matchMedia = previousMatch;
|
||||
else delete globalThis.matchMedia;
|
||||
};
|
||||
// Restored below for the fine-pointer clicks that follow; here too, so a
|
||||
// failing assertion cannot leave the coarse pointer for later tests.
|
||||
t.after(restoreMatch);
|
||||
globalThis.matchMedia = () => ({ matches: true });
|
||||
picking.registerPickOwner('test-planes', (id) => id === 'plane:1');
|
||||
drilled = ['plane:1'];
|
||||
click(null, [ownCard], ['cam-1']);
|
||||
// With no card, the bare tap near the aircraft still deselects.
|
||||
click(null, [], ['clear']);
|
||||
// A contact whose layer acts only on exact hits leaves the card its tap.
|
||||
picking.registerPickOwner('test-exact', (id) => id === 'exact:1');
|
||||
drilled = ['exact:1'];
|
||||
click(null, [ownCard], ['cam-1']);
|
||||
picking.unregisterPickOwner('test-exact');
|
||||
drilled = [];
|
||||
click(null, [ownCard], ['cam-1']);
|
||||
picking.unregisterPickOwner('test-planes');
|
||||
restoreMatch();
|
||||
// The live card over an aircraft takes the click; the aircraft layer,
|
||||
// run first, stands aside and does not track.
|
||||
picking.registerPickOwner('test-tracking', (id) => id === 'plane:9');
|
||||
click(
|
||||
{ set: 'flights:1', id: 'plane:9', surface: false },
|
||||
[ownCard],
|
||||
['cam-1'],
|
||||
);
|
||||
assert.equal(tracked, null, 'the aircraft did not track');
|
||||
picking.unregisterPickOwner('test-tracking');
|
||||
picking.registerPickOwner('area-control', (id) => id === drone.id);
|
||||
click(drone, [ownCard], ['cam-1']);
|
||||
picking.unregisterPickOwner('area-control');
|
||||
click(null, [foreignCard, ownCard], []);
|
||||
click(null, [ownCard], ['cam-1']);
|
||||
click(null, [], ['clear']);
|
||||
click(drone, [{ ...ownCard, entryId: 'stale-camera' }], []);
|
||||
// A card of ours that is going away is still not the scene under it: no
|
||||
// camera beneath it activates, and nothing clears.
|
||||
const staleCard = { ...ownCard, entryId: 'stale-camera' };
|
||||
click({ set: 'cctv:fixture', id: 'cam-1' }, [staleCard], []);
|
||||
click(null, [staleCard], []);
|
||||
// A camera icon under another layer's card is that card's click.
|
||||
click({ set: 'cctv:fixture', id: 'cam-1' }, [foreignCard, ownCard], []);
|
||||
click({ set: 'cctv:fixture', id: 'cam-1' }, [], ['cam-1']);
|
||||
});
|
||||
@@ -1,7 +1,6 @@
|
||||
import { hitTestWorldOverlay } from '../../overlays/worldOverlay.js';
|
||||
import { VESSEL_OVERLAY_SOURCE_ID } from '../../data/vesselLabels.js';
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import {
|
||||
clickCard,
|
||||
registerPickOwner,
|
||||
unregisterPickOwner,
|
||||
} from '../../data/pickRegistry.js';
|
||||
@@ -79,7 +78,6 @@ const intensityText = (storm) => {
|
||||
/** Advisory status and coherent forecast geometry; selected through the shared row list. */
|
||||
export function createCyclonesLayer({
|
||||
feed,
|
||||
hitTestOverlay = hitTestWorldOverlay,
|
||||
overlayHost,
|
||||
context = null,
|
||||
createRendering = createCycloneRendering,
|
||||
@@ -97,8 +95,7 @@ export function createCyclonesLayer({
|
||||
selectionIntent = 'auto',
|
||||
navigationGeneration = 0,
|
||||
selectionOwner = null,
|
||||
selectedContextStormId = null,
|
||||
removeClickCapture = null;
|
||||
selectedContextStormId = null;
|
||||
let enabled = false,
|
||||
loading = false,
|
||||
error = null,
|
||||
@@ -169,75 +166,28 @@ export function createCyclonesLayer({
|
||||
rendering?.setSelection(id);
|
||||
}
|
||||
function installSelection() {
|
||||
const canvas = canvasOf(viewer);
|
||||
if (selectionOwner || !canvas) return;
|
||||
if (selectionOwner || !canvasOf(viewer)) return;
|
||||
const owner = {};
|
||||
selectionOwner = owner;
|
||||
// Snapshot before sibling bubble listeners can rebuild the overlay hit
|
||||
// rectangles. A vessel selection does that synchronously in the same click.
|
||||
let capturedHit = null;
|
||||
const overlayHit = (x, y) => {
|
||||
const hit = hitTestOverlay(x, y);
|
||||
return { sourceId: hit?.sourceId, entryId: hit?.entryId };
|
||||
};
|
||||
const capture = (event) => {
|
||||
capturedHit = null;
|
||||
const point = event.changedTouches?.[0] || event;
|
||||
if (!Number.isFinite(point.clientX) || !Number.isFinite(point.clientY))
|
||||
return;
|
||||
const rect = canvas.getBoundingClientRect();
|
||||
const x = point.clientX - rect.left,
|
||||
y = point.clientY - rect.top;
|
||||
capturedHit = { x, y, ...overlayHit(x, y) };
|
||||
};
|
||||
const resetCapture = () => {
|
||||
capturedHit = null;
|
||||
};
|
||||
const resetEvents = [
|
||||
'pointerdown',
|
||||
'mousedown',
|
||||
'touchstart',
|
||||
'pointercancel',
|
||||
'touchcancel',
|
||||
];
|
||||
for (const type of resetEvents)
|
||||
canvas.addEventListener?.(type, resetCapture, { capture: true });
|
||||
const events = ['pointerup', 'mouseup', 'touchend'];
|
||||
for (const type of events)
|
||||
canvas.addEventListener?.(type, capture, { capture: true });
|
||||
removeClickCapture = () => {
|
||||
for (const type of events)
|
||||
canvas.removeEventListener?.(type, capture, { capture: true });
|
||||
for (const type of resetEvents)
|
||||
canvas.removeEventListener?.(type, resetCapture, { capture: true });
|
||||
capturedHit = null;
|
||||
};
|
||||
const unsubscribe = inputFor(viewer).onClick((event) => {
|
||||
const nativeHit = capturedHit;
|
||||
capturedHit = null;
|
||||
// Ambient selection yields to draw tools and Director (the dispatcher
|
||||
// skips a held pointer); it never claims the pointer, camera, or
|
||||
// tracking state.
|
||||
const position = event.screenPosition;
|
||||
if (!enabled || destroyed || selectionOwner !== owner || !position)
|
||||
return;
|
||||
// AIS cards paint above the globe on a pointer-events:none canvas. The
|
||||
// vessel handler resolves this same topmost hit before cyclone geometry.
|
||||
const captureMatches =
|
||||
nativeHit &&
|
||||
Math.abs(nativeHit.x - position.x) < 1 &&
|
||||
Math.abs(nativeHit.y - position.y) < 1;
|
||||
const hit = captureMatches
|
||||
? nativeHit
|
||||
: overlayHit(position.x, position.y);
|
||||
if (hit.sourceId === VESSEL_OVERLAY_SOURCE_ID) return;
|
||||
// The card or label painted on top, as it was when the click landed.
|
||||
const card = clickCard(event);
|
||||
// Storm cards and lead-hour labels paint on the same canvas; a click on
|
||||
// one selects its storm. An id from a superseded advisory changes nothing.
|
||||
if (hit.sourceId === CYCLONE_OVERLAY_SOURCE_ID) {
|
||||
const id = cycloneStormIdFromEntryId(hit.entryId);
|
||||
if (card?.sourceId === CYCLONE_OVERLAY_SOURCE_ID) {
|
||||
const id = cycloneStormIdFromEntryId(card.entryId);
|
||||
if (id) layer.setParams({ stormId: id });
|
||||
return;
|
||||
}
|
||||
// Another layer's card on top takes the click: the storm under it does
|
||||
// not act, and the click is not empty map either.
|
||||
if (card) return;
|
||||
// A storm's own drawing names it; empty map (the globe, or 3D tiles)
|
||||
// clears the selection.
|
||||
const id = rendering?.pickStorm(event.drawHit);
|
||||
@@ -249,8 +199,6 @@ export function createCyclonesLayer({
|
||||
function removeSelection() {
|
||||
const owner = selectionOwner;
|
||||
selectionOwner = null;
|
||||
removeClickCapture?.();
|
||||
removeClickCapture = null;
|
||||
owner?.unsubscribe?.();
|
||||
}
|
||||
const layer = {
|
||||
|
||||
@@ -6,7 +6,10 @@ import {
|
||||
releasePointer,
|
||||
isPointerFree,
|
||||
} from '../../data/inputOwnership.js';
|
||||
import { isOwnedByOtherLayer } from '../../data/pickRegistry.js';
|
||||
import {
|
||||
isOwnedByOtherLayer,
|
||||
setClickCardHitTest,
|
||||
} from '../../data/pickRegistry.js';
|
||||
import { fakeInput } from '../../input/testDoubles.mjs';
|
||||
import { bindFakeCesiumCamera } from '../../testSupport/fakeCameraPort.mjs';
|
||||
|
||||
@@ -77,7 +80,7 @@ const deferred = () => {
|
||||
return { promise, resolve };
|
||||
};
|
||||
|
||||
test('map selection yields to pointer owners and owns only its enabled handler', async () => {
|
||||
test('map selection yields to pointer owners and owns only its enabled handler', async (t) => {
|
||||
const handlers = [],
|
||||
// A pick of an item in one of the layer's draw sets, and one of another
|
||||
// layer's set: the dispatcher hands each to pickStorm as a draw hit.
|
||||
@@ -109,11 +112,12 @@ test('map selection yields to pointer owners and owns only its enabled handler',
|
||||
const layer = createCyclonesLayer({
|
||||
feed: { getSnapshot: async () => snapshot([storm(), storm('ep162026')]) },
|
||||
createRendering: () => rendering,
|
||||
hitTestOverlay: () => {
|
||||
overlayTests++;
|
||||
return overlayHit;
|
||||
},
|
||||
});
|
||||
setClickCardHitTest(() => {
|
||||
overlayTests++;
|
||||
return overlayHit;
|
||||
});
|
||||
t.after(() => setClickCardHitTest(null));
|
||||
const canvas = new EventTarget();
|
||||
canvas.getBoundingClientRect = () => ({ left: 100, top: 200 });
|
||||
const viewer = {
|
||||
@@ -180,41 +184,15 @@ test('map selection yields to pointer owners and owns only its enabled handler',
|
||||
'foreground AIS card wins before scene picking',
|
||||
);
|
||||
assert.equal(layer.getDiagnostics().selectedId, 'ep152026');
|
||||
// A native capture runs before an earlier sibling handler clears hit rects.
|
||||
const up = new Event('pointerup');
|
||||
Object.assign(up, { clientX: 110, clientY: 220 });
|
||||
canvas.dispatchEvent(up);
|
||||
overlayHit = null;
|
||||
// Any other layer's card on top takes the click, not only a vessel's.
|
||||
overlayHit = { sourceId: 'cctv', entryId: 'camera:1' };
|
||||
handlers[0].click(click);
|
||||
assert.equal(
|
||||
layer.getDiagnostics().selectedId,
|
||||
'ep152026',
|
||||
'captured AIS hit survives synchronous sibling overlay rebuild',
|
||||
'a camera card over the storm keeps the click',
|
||||
);
|
||||
// A captured background hit remains background even if a sibling adds a card.
|
||||
canvas.dispatchEvent(up);
|
||||
overlayHit = { sourceId: 'ais-live-vessels', entryId: 'vessel:123' };
|
||||
handlers[0].click(click);
|
||||
assert.equal(layer.getDiagnostics().selectedId, 'ep162026');
|
||||
layer.setParams({ stormId: 'ep152026' });
|
||||
// A new gesture clears an unconsumed release snapshot.
|
||||
canvas.dispatchEvent(up);
|
||||
canvas.dispatchEvent(new Event('pointerdown'));
|
||||
overlayHit = null;
|
||||
handlers[0].click(click);
|
||||
assert.equal(layer.getDiagnostics().selectedId, 'ep162026');
|
||||
layer.setParams({ stormId: 'ep152026' });
|
||||
overlayHit = { sourceId: 'ais-live-vessels', entryId: 'vessel:123' };
|
||||
canvas.dispatchEvent(up);
|
||||
overlayHit = null;
|
||||
handlers[0].click({ position: { x: 15, y: 25 } });
|
||||
assert.equal(
|
||||
layer.getDiagnostics().selectedId,
|
||||
'ep162026',
|
||||
'a different click cannot reuse the captured card',
|
||||
);
|
||||
layer.setParams({ stormId: 'ep152026' });
|
||||
overlayHit = { sourceId: 'cctv', entryId: 'camera:1' };
|
||||
const before = notices;
|
||||
handlers[0].click(click);
|
||||
assert.equal(layer.getDiagnostics().selectedId, 'ep162026');
|
||||
@@ -264,13 +242,12 @@ test('map selection yields to pointer owners and owns only its enabled handler',
|
||||
assert.equal(layer.getDiagnostics().selectionActive, false);
|
||||
const afterDisable = picks;
|
||||
const afterDisableOverlay = overlayTests;
|
||||
canvas.dispatchEvent(up);
|
||||
handlers[0].click(click);
|
||||
assert.equal(
|
||||
overlayTests,
|
||||
afterDisableOverlay,
|
||||
'disable removes native capture listeners',
|
||||
'a disabled layer reads no card',
|
||||
);
|
||||
handlers[0].click(click);
|
||||
assert.equal(picks, afterDisable, 'queued disabled callback is inert');
|
||||
layer.enable();
|
||||
await layer.update();
|
||||
@@ -289,7 +266,7 @@ test('map selection yields to pointer owners and owns only its enabled handler',
|
||||
);
|
||||
assert.equal(handlers[1].destroyed, true);
|
||||
});
|
||||
test('a click on a storm card or lead-hour label selects that storm without picking', async () => {
|
||||
test('a click on a storm card or lead-hour label selects that storm without picking', async (t) => {
|
||||
const handlers = [];
|
||||
let picks = 0,
|
||||
overlayHit = null,
|
||||
@@ -309,8 +286,9 @@ test('a click on a storm card or lead-hour label selects that storm without pick
|
||||
getDiagnostics: () => ({}),
|
||||
};
|
||||
},
|
||||
hitTestOverlay: () => overlayHit,
|
||||
});
|
||||
setClickCardHitTest(() => overlayHit);
|
||||
t.after(() => setClickCardHitTest(null));
|
||||
const canvas = new EventTarget();
|
||||
canvas.getBoundingClientRect = () => ({ left: 0, top: 0 });
|
||||
const viewer = {
|
||||
@@ -343,15 +321,11 @@ test('a click on a storm card or lead-hour label selects that storm without pick
|
||||
overlayHit = { sourceId: 'weather-cyclones', entryId: 'storm:al019999' };
|
||||
handlers[0].click(click);
|
||||
assert.equal(layer.getDiagnostics().selectedId, 'ep152026');
|
||||
// The native release snapshot carries the card identity too.
|
||||
const up = new Event('pointerup');
|
||||
Object.assign(up, { clientX: 10, clientY: 20 });
|
||||
overlayHit = { sourceId: 'weather-cyclones', entryId: 'storm:ep162026' };
|
||||
canvas.dispatchEvent(up);
|
||||
overlayHit = null;
|
||||
handlers[0].click(click);
|
||||
assert.equal(layer.getDiagnostics().selectedId, 'ep162026');
|
||||
assert.equal(picks, 0, 'card clicks never fall through to the scene');
|
||||
overlayHit = null;
|
||||
handlers[0].click(click);
|
||||
assert.equal(picks, 1);
|
||||
assert.equal(layer.getDiagnostics().selectedId, null, 'empty map clears');
|
||||
|
||||
@@ -1584,6 +1584,9 @@ export function createDirectionsLayer({ services, source }) {
|
||||
// yields the moment a tool (this one included) owns the click.
|
||||
const offSelect = input.onClick((event) => {
|
||||
if (!_enabled) return;
|
||||
// Another layer's card or label painted on top takes the click: the item
|
||||
// under it does not act, and the click is not empty space either.
|
||||
if (services.picking?.isUnderOtherCard?.(event)) return;
|
||||
let hit = null;
|
||||
try {
|
||||
hit = event.drawHit;
|
||||
|
||||
@@ -130,12 +130,11 @@ export function createDroneAirspaceLayer({
|
||||
// cards inert anywhere over a zone. Unowned, our picks read as
|
||||
// "empty space" to siblings — the same contract as fire perimeters.
|
||||
_clickSubscription = inputFor(_viewer).onClick((event) => {
|
||||
const cardHit = overlayHost.hitTest?.(
|
||||
event.screenPosition?.x,
|
||||
event.screenPosition?.y,
|
||||
{ sourceId: DRONE_AIRSPACE_OVERLAY_SOURCE_ID },
|
||||
);
|
||||
if (cardHit && cardHit.entryId === _selectedCardId) return;
|
||||
// The card or label painted on top takes the click, read once per
|
||||
// click so every layer agrees: this area's shapes are background to
|
||||
// another layer's card or label painted over them, and a click on our
|
||||
// own card leaves the selection as it is.
|
||||
if (picking.clickCard?.(event)) return;
|
||||
const picked = event.topHit;
|
||||
const zoneId = picked ? pickedZoneId(event.drawHit) : null;
|
||||
if (zoneId) {
|
||||
|
||||
@@ -2,7 +2,8 @@ import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { createDroneAirspaceLayer } from './index.js';
|
||||
import { layerFeedState } from '../../data/feedState.js';
|
||||
import { fakeInput } from '../../input/testDoubles.mjs';
|
||||
import { clickCard } from '../../data/pickRegistry.js';
|
||||
import { fakeInputUnderLabel } from '../../input/testDoubles.mjs';
|
||||
import { bindFakeDraw } from '../../testSupport/fakeDrawPort.mjs';
|
||||
|
||||
// The fills set of the layer the last harness made: zone picks name it.
|
||||
@@ -19,11 +20,12 @@ function harness(source, { pick = () => null, cardHit = () => null } = {}) {
|
||||
const owners = new Map();
|
||||
const viewer = { scene: { pick } };
|
||||
const { draw } = bindFakeDraw(viewer);
|
||||
const input = fakeInput(viewer);
|
||||
const input = fakeInputUnderLabel(viewer);
|
||||
const clicks = {
|
||||
handler: (click) => input.click(click.position),
|
||||
// Only the label's own overlay handler is left.
|
||||
get destroyed() {
|
||||
return input.input.subscriberCount() === 0 ? 1 : 0;
|
||||
return input.input.subscriberCount() === 1 ? 1 : 0;
|
||||
},
|
||||
};
|
||||
const layer = createDroneAirspaceLayer({
|
||||
@@ -47,6 +49,11 @@ function harness(source, { pick = () => null, cardHit = () => null } = {}) {
|
||||
String(pickedId).startsWith('other-layer:'),
|
||||
registerPickOwner: (layerId, predicate) => owners.set(layerId, predicate),
|
||||
unregisterPickOwner: (layerId) => owners.delete(layerId),
|
||||
// The card on top at a click, as the registry answers from the host.
|
||||
// A mission label painted over everything comes first.
|
||||
clickCard: (click) =>
|
||||
clickCard(click) ??
|
||||
cardHit(click.screenPosition?.x, click.screenPosition?.y, {}),
|
||||
},
|
||||
});
|
||||
layer.init(viewer);
|
||||
@@ -61,6 +68,8 @@ function harness(source, { pick = () => null, cardHit = () => null } = {}) {
|
||||
overlay,
|
||||
clicks,
|
||||
owners,
|
||||
/** A label painted over the map: while `over`, it takes each click. */
|
||||
label: input.label,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -143,6 +152,86 @@ test('clicking a zone publishes its card; empty space clears it', async () => {
|
||||
assert.equal(h.overlay.entries.get('drone-airspace')?.length ?? 0, 0);
|
||||
});
|
||||
|
||||
test('a click on a mission label over the open zone card keeps it open and takes no zone beneath', async () => {
|
||||
let pickResult = null;
|
||||
let cardHitResult = null;
|
||||
const h = harness(
|
||||
{ getSnapshot: async () => [row] },
|
||||
{ pick: () => pickResult, cardHit: () => cardHitResult },
|
||||
);
|
||||
await h.layer.update(h.viewer);
|
||||
pickResult = zonePick('drone-airspace:310:0');
|
||||
h.clicks.handler({ position: { x: 10, y: 10 } });
|
||||
const [card] = h.overlay.entries.get('drone-airspace');
|
||||
|
||||
// The open card and its zone lie under the label: the label on top is
|
||||
// its own click, so the card stays open.
|
||||
cardHitResult = { sourceId: 'drone-airspace', entryId: card.id };
|
||||
h.label.over = true;
|
||||
h.clicks.handler({ position: { x: 12, y: 12 } });
|
||||
assert.equal(h.overlay.entries.get('drone-airspace')?.[0]?.id, card.id);
|
||||
pickResult = null;
|
||||
cardHitResult = null;
|
||||
h.clicks.handler({ position: { x: 12, y: 12 } });
|
||||
assert.equal(
|
||||
h.overlay.entries.get('drone-airspace')?.[0]?.id,
|
||||
card.id,
|
||||
'a label over bare map is not empty space either',
|
||||
);
|
||||
|
||||
// Off the label, the same click on bare map closes the card.
|
||||
h.label.over = false;
|
||||
h.clicks.handler({ position: { x: 12, y: 12 } });
|
||||
assert.equal(h.overlay.entries.get('drone-airspace')?.length ?? 0, 0);
|
||||
h.layer.destroy();
|
||||
});
|
||||
|
||||
// Another layer's card or label painted over the area (a quake's card or
|
||||
// magnitude label) is that layer's click: the area under it stands aside.
|
||||
test("another layer's overlay on top keeps a click off the area", async () => {
|
||||
let pickResult = null;
|
||||
let foreignOnTop = false;
|
||||
const h = harness(
|
||||
{ getSnapshot: async () => [row] },
|
||||
{
|
||||
pick: () => pickResult,
|
||||
// Unfiltered: the topmost entry of any source.
|
||||
// As the host does: drone-airspace cards are not interactive, so only
|
||||
// another layer's card painted on top is ever hit.
|
||||
cardHit: (_x, _y, options) =>
|
||||
foreignOnTop && !options?.sourceId
|
||||
? { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' }
|
||||
: null,
|
||||
},
|
||||
);
|
||||
await h.layer.update(h.viewer);
|
||||
pickResult = zonePick('drone-airspace:310:0');
|
||||
foreignOnTop = true;
|
||||
h.clicks.handler({ position: { x: 10, y: 10 } });
|
||||
assert.equal(h.overlay.entries.get('drone-airspace')?.length ?? 0, 0);
|
||||
// With nothing painted over it, the same click selects the area.
|
||||
foreignOnTop = false;
|
||||
h.clicks.handler({ position: { x: 10, y: 10 } });
|
||||
assert.equal(
|
||||
h.overlay.entries.get('drone-airspace')[0].id,
|
||||
'drone-airspace-card:310',
|
||||
);
|
||||
// An overlay on top covers the selected area's card.
|
||||
foreignOnTop = true;
|
||||
h.clicks.handler({ position: { x: 10, y: 10 } });
|
||||
assert.equal(
|
||||
h.overlay.entries.get('drone-airspace')[0].id,
|
||||
'drone-airspace-card:310',
|
||||
);
|
||||
pickResult = null;
|
||||
h.clicks.handler({ position: { x: 10, y: 10 } });
|
||||
assert.equal(
|
||||
h.overlay.entries.get('drone-airspace')[0].id,
|
||||
'drone-airspace-card:310',
|
||||
'the foreground overlay preserves selection over bare map too',
|
||||
);
|
||||
});
|
||||
|
||||
test('late refresh cannot publish after disable or destroy', async () => {
|
||||
for (const action of ['disable', 'destroy']) {
|
||||
let resolve, signal;
|
||||
|
||||
+416
-30
@@ -1,6 +1,10 @@
|
||||
import { fromDegrees } from '../../geo/ellipsoid.js';
|
||||
import { drawOf } from '../../render/rendererOf.js';
|
||||
import { worldClock } from '../../time/worldClock.js';
|
||||
import {
|
||||
isTrackingClickGesture,
|
||||
isTrackingSelectionGesture,
|
||||
} from '../../data/trackingClickGesture.js';
|
||||
import {
|
||||
EARTHQUAKE_OVERLAY_SOURCE_ID,
|
||||
EARTHQUAKE_OVERLAY_COHORT_LIMIT,
|
||||
@@ -11,6 +15,11 @@ import {
|
||||
selectEarthquakeOverlayCohort,
|
||||
mapAnalystRecord,
|
||||
earthquakeCoverage,
|
||||
earthquakeMarkLabel,
|
||||
earthquakeMagnitudeTitle,
|
||||
earthquakeZoomLabel,
|
||||
earthquakeDiscRadiusM,
|
||||
describeEarthquake,
|
||||
} from './model.js';
|
||||
export * from './model.js';
|
||||
export { createUsgsEarthquakeSource } from './source.js';
|
||||
@@ -25,6 +34,20 @@ const msg = (text) => text;
|
||||
* as `Hit.set`.
|
||||
*/
|
||||
export const EARTHQUAKE_DISC_SET_ID = 'earthquakes';
|
||||
export const EARTHQUAKES_LAYER_ID = 'earthquakes';
|
||||
/** The overlay source the clicked quake's detail card is shown in. */
|
||||
export const EARTHQUAKE_CARD_SOURCE_ID = 'earthquake-card';
|
||||
/** A disc's item id is this prefix and the event's stable id. */
|
||||
const PICK_PREFIX = 'earthquake:';
|
||||
/** Fly-to range per metre of disc radius: 220 km frames an M6 (64 km). */
|
||||
const EARTHQUAKE_FOCUS_RANGE_PER_RADIUS = 3.5;
|
||||
/** The selected quake's flat fill, faint under the painted gradient. */
|
||||
const SELECTED_DISC_ALPHA = 0.04;
|
||||
const CARD_HOST_OPTIONS = Object.freeze({
|
||||
cohortLimit: 1,
|
||||
collisionCapacity: 1,
|
||||
moving: false,
|
||||
});
|
||||
let instances = 0;
|
||||
|
||||
/**
|
||||
@@ -33,8 +56,48 @@ let instances = 0;
|
||||
* The discs are one renderer draw set (`drawOf(viewer)`), made at `init`.
|
||||
* Given a Cesium viewer with no renderer bound, the
|
||||
* caller loads the package's `./render/cesium/unbound` export first.
|
||||
*
|
||||
* Clicking a disc shows that quake's detail card and selects it in the
|
||||
* shared context. The application gives the click and selection services;
|
||||
* without `input` and `picking` the discs are drawn but take no clicks.
|
||||
* @param {object} options
|
||||
* @param {object} options.source Snapshot source.
|
||||
* @param {object} options.overlayHost World-overlay host.
|
||||
* @param {(viewer: object) => {onClick: Function}} [options.input] The
|
||||
* viewer's click dispatcher.
|
||||
* @param {{resolvePickId: Function, isOwnedByOtherLayer: Function,
|
||||
* clickCard?: Function}} [options.picking] The pick
|
||||
* registry; `clickCard` names the card or label painted on top of a
|
||||
* click, which takes it (the quake card and labels need it to act).
|
||||
* @param {{registerEntityContext: Function, selectEntityContext: Function,
|
||||
* clearSelectedEntityContextForLayer: Function,
|
||||
* getContextStore: Function}} [options.context] Shared selection store.
|
||||
* @param {{isPointerFree: () => boolean}} [options.pointer]
|
||||
* @param {(url: string) => void} [options.openExternal]
|
||||
* @param {{requestWorldFocus: (detail: object) => boolean}} [options.focus]
|
||||
* The camera transfer a clicked magnitude label asks for.
|
||||
* @param {{show: (target: {id: string, lon: number, lat: number,
|
||||
* heightM?: number, heightAt?: () => number|null, radiusM: number,
|
||||
* color: string}) => void, hide: () => void}} [options.ripples]
|
||||
* The selected quake's animated contour rings.
|
||||
* @param {(viewer: object, lon: number, lat: number) => number|null} [options.groundHeight]
|
||||
* The loaded ground height under a point, so the rings sit on the disc
|
||||
* that is draped there; null (or no service) draws them at sea level.
|
||||
* @param {object} [options.text] Card formatters (see describeEarthquake).
|
||||
*/
|
||||
export function createEarthquakesLayer({ source, overlayHost } = {}) {
|
||||
export function createEarthquakesLayer({
|
||||
source,
|
||||
overlayHost,
|
||||
input = null,
|
||||
picking = null,
|
||||
context = null,
|
||||
pointer = null,
|
||||
openExternal = null,
|
||||
focus = null,
|
||||
ripples = null,
|
||||
groundHeight = null,
|
||||
text = undefined,
|
||||
} = {}) {
|
||||
if (typeof source?.getSnapshot !== 'function')
|
||||
throw new TypeError('Earthquakes require a snapshot source');
|
||||
if (!overlayHost) throw new TypeError('Earthquakes require an overlay host');
|
||||
@@ -60,6 +123,307 @@ export function createEarthquakesLayer({ source, overlayHost } = {}) {
|
||||
_marksKey = key;
|
||||
worldClock.coverageChanged();
|
||||
};
|
||||
// The drawn events by stable id, for clicks; the selected one's id, card
|
||||
// and the context record it was published as.
|
||||
let _eventById = new Map();
|
||||
let _selectedId = null;
|
||||
let _selectedCardId = null;
|
||||
let _selectedLink = null;
|
||||
let _contextId = null;
|
||||
let _clickHandler = null;
|
||||
const canSelect = () => Boolean(input && picking);
|
||||
// The disc whose flat fill is faded while the painter draws its gradient.
|
||||
let _fadedDiscId = null;
|
||||
|
||||
/**
|
||||
* A quake's disc: filled on the ground, with static axes (re-tessellating
|
||||
* clamped ground geometry every frame is what once cost 30 fps). No
|
||||
* outline: clamped to the ground, Cesium never drew one. A selected
|
||||
* quake's disc is all but clear: the ripples painter fills it with a
|
||||
* gradient instead, and the faint fill keeps it pickable.
|
||||
*/
|
||||
function discItem(event, faded = false) {
|
||||
const radius = earthquakeDiscRadiusM(event.mag);
|
||||
const [r, g, b] = depthColor(event.depthKm || 0);
|
||||
const fillAlpha = faded
|
||||
? SELECTED_DISC_ALPHA
|
||||
: event.mag >= 5.0
|
||||
? 0.4
|
||||
: 0.3;
|
||||
return {
|
||||
id: `${PICK_PREFIX}${event.stableId}`,
|
||||
geometry: {
|
||||
kind: 'ellipse',
|
||||
center: { lon: event.lon, lat: event.lat },
|
||||
semiMajor: radius,
|
||||
semiMinor: radius,
|
||||
},
|
||||
fill: [r, g, b, fillAlpha],
|
||||
height: 'clampGround',
|
||||
clampTo: 'both',
|
||||
};
|
||||
}
|
||||
|
||||
/** Fade one disc's flat fill (and restore the one faded before). */
|
||||
function fadeDisc(stableId) {
|
||||
if (!ripples || !_discs || _fadedDiscId === stableId) return;
|
||||
const changed = [];
|
||||
const before = _eventById.get(_fadedDiscId);
|
||||
if (before) changed.push(discItem(before, false));
|
||||
const next = _eventById.get(stableId);
|
||||
if (next) changed.push(discItem(next, true));
|
||||
_fadedDiscId = next ? stableId : null;
|
||||
if (changed.length) _discs.upsert(changed);
|
||||
}
|
||||
|
||||
/** The drawn event a pick id names, or null. */
|
||||
function eventOfPickId(pickId) {
|
||||
if (typeof pickId !== 'string' || !pickId.startsWith(PICK_PREFIX))
|
||||
return null;
|
||||
return _eventById.get(pickId.slice(PICK_PREFIX.length)) ?? null;
|
||||
}
|
||||
|
||||
/** The drawn event a click's draw hit is on: an item of this layer's set. */
|
||||
function pickedEvent(hit) {
|
||||
if (!hit || hit.surface || !_discs || hit.set !== _discs.id) return null;
|
||||
return eventOfPickId(hit.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the selected quake's card, context and contours. `user`: a click or
|
||||
* a label's activation, which claims the shared selection and runs the
|
||||
* contours again; a feed refresh only brings them up to date, so it never
|
||||
* takes back a selection made since, nor restarts the animation.
|
||||
*/
|
||||
function publishCard({ user = false } = {}) {
|
||||
const event = _selectedId ? _eventById.get(_selectedId) : null;
|
||||
if (!_enabled || !event) {
|
||||
// A refresh that no longer carries the selected quake evicts it, as
|
||||
// other feeds report; anything else is a deliberate clear.
|
||||
clearSelection({ evicted: _enabled && Boolean(_selectedId) && !user });
|
||||
return;
|
||||
}
|
||||
const { title, details, link, accessibilityLabel } = describeEarthquake(
|
||||
event,
|
||||
{ ...text, canOpen: Boolean(openExternal) },
|
||||
);
|
||||
_selectedLink = link && openExternal ? link : null;
|
||||
const card = {
|
||||
id: `earthquake-card:${event.stableId}`,
|
||||
selected: true,
|
||||
// Always hit-testable (the host only hit-tests interactive entries),
|
||||
// so a click on a card with no link keeps it rather than falling
|
||||
// through to the ground under it and clearing the selection.
|
||||
interactive: true,
|
||||
title,
|
||||
details,
|
||||
accent: depthAccent(event.depthKm || 0),
|
||||
priority: Number.MAX_SAFE_INTEGER,
|
||||
gapPx: 15,
|
||||
verticalOnly: true,
|
||||
placement: 'above',
|
||||
stateless: true,
|
||||
horizonCull: true,
|
||||
position: fromDegrees(event.lon, event.lat),
|
||||
};
|
||||
if (_selectedLink) {
|
||||
const target = _selectedLink;
|
||||
card.accessibilityLabel = accessibilityLabel;
|
||||
card.activate = () => {
|
||||
openExternal(target);
|
||||
return true;
|
||||
};
|
||||
} else if (focus?.requestWorldFocus) {
|
||||
// No source to open: the card's keyboard action flies to its quake,
|
||||
// as a fire card's focuses its fire, so it stays in the action list.
|
||||
const stableId = event.stableId;
|
||||
card.accessibilityLabel = accessibilityLabel;
|
||||
card.activate = () => selectAndFocus(stableId);
|
||||
}
|
||||
_selectedCardId = card.id;
|
||||
overlayHost.setEntries(
|
||||
EARTHQUAKE_CARD_SOURCE_ID,
|
||||
[card],
|
||||
CARD_HOST_OPTIONS,
|
||||
);
|
||||
overlayHost.setVisible(EARTHQUAKE_CARD_SOURCE_ID, true);
|
||||
publishContext(event, user);
|
||||
fadeDisc(event.stableId);
|
||||
let heightM = null;
|
||||
try {
|
||||
heightM = groundHeight?.(_viewer, event.lon, event.lat) ?? null;
|
||||
} catch {
|
||||
heightM = null;
|
||||
}
|
||||
ripples?.show?.(
|
||||
{
|
||||
id: event.stableId,
|
||||
lon: event.lon,
|
||||
lat: event.lat,
|
||||
heightM: Number.isFinite(heightM) ? heightM : 0,
|
||||
// Read again as the ground loads: a label's fly-to starts far away.
|
||||
heightAt: groundHeight
|
||||
? () => groundHeight(_viewer, event.lon, event.lat)
|
||||
: null,
|
||||
radiusM: earthquakeDiscRadiusM(event.mag),
|
||||
color: depthAccent(event.depthKm || 0),
|
||||
},
|
||||
{ restart: user },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the event in the shared context store, so "what's selected"
|
||||
* (voice, the Cockpit) answers with it, as a clicked fire does.
|
||||
*/
|
||||
function publishContext(event, select) {
|
||||
if (!context) return;
|
||||
const id = `${PICK_PREFIX}${event.stableId}`;
|
||||
try {
|
||||
if (_contextId && _contextId !== id)
|
||||
context.getContextStore().entities.delete(_contextId);
|
||||
const carrier = { show: true };
|
||||
context.registerEntityContext(carrier, {
|
||||
id,
|
||||
layerId: EARTHQUAKES_LAYER_ID,
|
||||
layerName: layer.name,
|
||||
source: 'USGS',
|
||||
// Hidden with the layer: the context store reads its `show`.
|
||||
dataSource: _discs,
|
||||
targetPosition: fromDegrees(event.lon, event.lat),
|
||||
// i18n-ignore: English entity label, as the analyst records are
|
||||
label: `Earthquake · ${earthquakeMarkLabel(event)}`,
|
||||
latitude: event.lat,
|
||||
longitude: event.lon,
|
||||
properties: {
|
||||
magnitude: event.mag,
|
||||
depthKm: event.depthKm ?? null,
|
||||
place: event.place ?? null,
|
||||
time: Number.isFinite(event.time)
|
||||
? new Date(event.time).toISOString()
|
||||
: null,
|
||||
usgsId: event.usgsId ?? null,
|
||||
},
|
||||
});
|
||||
_contextId = id;
|
||||
if (select) context.selectEntityContext(carrier);
|
||||
} catch {
|
||||
// No context store (no window): the card still shows.
|
||||
}
|
||||
}
|
||||
|
||||
function clearContext({ evicted = false } = {}) {
|
||||
if (!context || !_contextId) return;
|
||||
try {
|
||||
context.clearSelectedEntityContextForLayer(EARTHQUAKES_LAYER_ID, {
|
||||
evicted,
|
||||
});
|
||||
context.getContextStore().entities.delete(_contextId);
|
||||
} catch {
|
||||
// store unavailable: nothing to clean
|
||||
}
|
||||
_contextId = null;
|
||||
}
|
||||
|
||||
function clearSelection({ evicted = false } = {}) {
|
||||
const had = _selectedId || _selectedCardId;
|
||||
_selectedId = null;
|
||||
_selectedCardId = null;
|
||||
_selectedLink = null;
|
||||
clearContext({ evicted });
|
||||
ripples?.hide?.();
|
||||
fadeDisc(null);
|
||||
if (had)
|
||||
overlayHost.setEntries(EARTHQUAKE_CARD_SOURCE_ID, [], CARD_HOST_OPTIONS);
|
||||
}
|
||||
|
||||
function installClickHandler() {
|
||||
if (!canSelect() || _clickHandler || !_viewer) return;
|
||||
// Deliberately NOT registered in the pick-ownership registry, like drone
|
||||
// airspace and fire perimeters: siblings yield to owned picks before
|
||||
// their own card hit-tests and treat an owned pick as not empty space,
|
||||
// so claiming these large discs would make their cards inert and their
|
||||
// selections stick anywhere over a quake. Unowned, a disc reads as
|
||||
// empty space to them; this handler finds its own discs by draw set.
|
||||
// A viewer with no renderer input bound takes no clicks.
|
||||
let clicks = null;
|
||||
try {
|
||||
clicks = input(_viewer) ?? null;
|
||||
} catch {
|
||||
clicks = null;
|
||||
}
|
||||
if (!clicks) return;
|
||||
_clickHandler = clicks.onClick((click) => {
|
||||
if (!_enabled || (pointer && !pointer.isPointerFree())) return;
|
||||
// A pan that ends near where it began still raises a click. As for the
|
||||
// tracking layers and Context, a press that travelled is a drag, not a
|
||||
// pick; opening the source and clearing also need a short press.
|
||||
if (!isTrackingSelectionGesture(click.gesture)) return;
|
||||
const clean = isTrackingClickGesture(click.gesture);
|
||||
// The card or label painted on top takes the click, read once per
|
||||
// click so every layer agrees: another layer's is that layer's click
|
||||
// (the disc under it is background), and ours acts whatever is drawn
|
||||
// under it.
|
||||
const top = picking.clickCard?.(click) ?? null;
|
||||
if (top?.sourceId === EARTHQUAKE_CARD_SOURCE_ID) {
|
||||
// The card's action, as its keyboard action: open the source, or
|
||||
// with none, fly to the quake.
|
||||
if (top.entryId !== _selectedCardId) return;
|
||||
if (_selectedLink) {
|
||||
if (clean) openExternal(_selectedLink);
|
||||
} else if (focus?.requestWorldFocus && _selectedId)
|
||||
selectAndFocus(_selectedId);
|
||||
return;
|
||||
}
|
||||
// A magnitude label is what a far view (the whole globe) can click:
|
||||
// it selects the quake and flies to it.
|
||||
if (top?.sourceId === EARTHQUAKE_OVERLAY_SOURCE_ID) {
|
||||
if (_eventById.has(top.entryId)) selectAndFocus(top.entryId);
|
||||
return;
|
||||
}
|
||||
if (top) return;
|
||||
// Another layer's pick (an aircraft, a camera, a flight trail) is not
|
||||
// empty space and not this layer's: leave the selection alone.
|
||||
const hit = click.hit;
|
||||
const pickId = picking.resolvePickId(hit);
|
||||
if (pickId && picking.isOwnedByOtherLayer(EARTHQUAKES_LAYER_ID, pickId))
|
||||
return;
|
||||
const event = pickedEvent(hit);
|
||||
if (event) {
|
||||
_selectedId = event.stableId;
|
||||
publishCard({ user: true });
|
||||
return;
|
||||
}
|
||||
if (clean) clearSelection();
|
||||
});
|
||||
}
|
||||
|
||||
/** Select a drawn quake, show its card, and ask the camera to go there. */
|
||||
function selectAndFocus(stableId) {
|
||||
const event = _eventById.get(stableId);
|
||||
if (!_enabled || !event) return false;
|
||||
_selectedId = stableId;
|
||||
publishCard({ user: true });
|
||||
focus?.requestWorldFocus?.({
|
||||
kind: 'earthquake',
|
||||
id: `${PICK_PREFIX}${stableId}`,
|
||||
label: earthquakeMagnitudeTitle(event.mag),
|
||||
position: fromDegrees(event.lon, event.lat),
|
||||
// The whole disc in view: the framing's range fits an M6 disc, so only
|
||||
// a larger one asks for its own range (the framing stays the floor).
|
||||
radiusM: earthquakeDiscRadiusM(event.mag),
|
||||
rangeM:
|
||||
event.mag > 6
|
||||
? earthquakeDiscRadiusM(event.mag) * EARTHQUAKE_FOCUS_RANGE_PER_RADIUS
|
||||
: undefined,
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
function removeClickHandler() {
|
||||
_clickHandler?.();
|
||||
_clickHandler = null;
|
||||
}
|
||||
|
||||
const layer = {
|
||||
id: 'earthquakes',
|
||||
@@ -93,6 +457,7 @@ export function createEarthquakesLayer({ source, overlayHost } = {}) {
|
||||
// layer has no per-frame animator to keep the render loop alive for.
|
||||
if (_discs) _discs.show = true;
|
||||
overlayHost.setVisible(EARTHQUAKE_OVERLAY_SOURCE_ID, true);
|
||||
installClickHandler();
|
||||
coverageChanged();
|
||||
},
|
||||
|
||||
@@ -101,6 +466,10 @@ export function createEarthquakesLayer({ source, overlayHost } = {}) {
|
||||
_request = null;
|
||||
_enabled = false;
|
||||
if (_discs) _discs.show = false;
|
||||
removeClickHandler();
|
||||
clearSelection();
|
||||
overlayHost.clearSource(EARTHQUAKE_CARD_SOURCE_ID);
|
||||
overlayHost.setVisible(EARTHQUAKE_CARD_SOURCE_ID, false);
|
||||
overlayHost.clearSource(EARTHQUAKE_OVERLAY_SOURCE_ID);
|
||||
overlayHost.setVisible(EARTHQUAKE_OVERLAY_SOURCE_ID, false);
|
||||
coverageChanged();
|
||||
@@ -132,41 +501,52 @@ export function createEarthquakesLayer({ source, overlayHost } = {}) {
|
||||
time,
|
||||
} of rows) {
|
||||
count++;
|
||||
const baseRadius = Math.pow(2, mag) * 1000;
|
||||
const color = depthColor(depthKm || 0);
|
||||
const [r, g, b] = color;
|
||||
const isSignificant = mag >= 5.0;
|
||||
const fillAlpha = isSignificant ? 0.4 : 0.3;
|
||||
|
||||
const position = fromDegrees(lon, lat);
|
||||
nextEvents.push({ usgsId, mag, place, time, depthKm, lon, lat });
|
||||
// A filled disc on the ground, with static axes: re-tessellating
|
||||
// clamped ground geometry every frame is what once cost 30 fps.
|
||||
// No outline: clamped to the ground, Cesium never drew one.
|
||||
nextDiscs.push({
|
||||
id: `earthquake:${stableId}`,
|
||||
geometry: {
|
||||
kind: 'ellipse',
|
||||
center: { lon, lat },
|
||||
semiMajor: baseRadius,
|
||||
semiMinor: baseRadius,
|
||||
},
|
||||
fill: [r, g, b, fillAlpha],
|
||||
height: 'clampGround',
|
||||
clampTo: 'both',
|
||||
});
|
||||
overlayEntries.push(
|
||||
createEarthquakeOverlayEntry({
|
||||
id: String(stableId),
|
||||
position,
|
||||
magnitude: mag,
|
||||
accent: depthAccent(depthKm || 0),
|
||||
}),
|
||||
const event = {
|
||||
stableId: String(stableId),
|
||||
usgsId,
|
||||
mag,
|
||||
place,
|
||||
time,
|
||||
depthKm,
|
||||
lon,
|
||||
lat,
|
||||
};
|
||||
nextEvents.push(event);
|
||||
nextDiscs.push(
|
||||
discItem(event, Boolean(ripples) && event.stableId === _selectedId),
|
||||
);
|
||||
const label = createEarthquakeOverlayEntry({
|
||||
id: String(stableId),
|
||||
position,
|
||||
magnitude: mag,
|
||||
accent: depthAccent(depthKm || 0),
|
||||
});
|
||||
if (canSelect()) {
|
||||
const id = String(stableId);
|
||||
label.interactive = true;
|
||||
label.accessibilityLabel = earthquakeZoomLabel(
|
||||
{ mag, place },
|
||||
text,
|
||||
);
|
||||
label.activate = () => selectAndFocus(id);
|
||||
}
|
||||
overlayEntries.push(label);
|
||||
}
|
||||
|
||||
// Bigger quakes first, so a small quake inside a big one's disc is
|
||||
// drawn, and picked, on top of it.
|
||||
nextDiscs.sort((a, b) => b.geometry.semiMajor - a.geometry.semiMajor);
|
||||
_discs.set(nextDiscs);
|
||||
_events = nextEvents;
|
||||
_eventById = new Map(
|
||||
nextEvents.map((event) => [event.stableId, event]),
|
||||
);
|
||||
_fadedDiscId =
|
||||
ripples && _eventById.has(_selectedId) ? _selectedId : null;
|
||||
// A selected quake still in the feed keeps its card, refreshed; one
|
||||
// that left the 24 h window loses it.
|
||||
if (_selectedId) publishCard();
|
||||
coverageChanged();
|
||||
if (_enabled) {
|
||||
overlayHost.setEntries(
|
||||
@@ -199,13 +579,19 @@ export function createEarthquakesLayer({ source, overlayHost } = {}) {
|
||||
destroy(viewer = _viewer) {
|
||||
_request?.abort();
|
||||
_request = null;
|
||||
removeClickHandler();
|
||||
clearSelection();
|
||||
ripples?.dispose?.();
|
||||
_viewer = null;
|
||||
_enabled = false;
|
||||
overlayHost.clearSource(EARTHQUAKE_CARD_SOURCE_ID);
|
||||
overlayHost.setVisible(EARTHQUAKE_CARD_SOURCE_ID, false);
|
||||
overlayHost.clearSource(EARTHQUAKE_OVERLAY_SOURCE_ID);
|
||||
overlayHost.setVisible(EARTHQUAKE_OVERLAY_SOURCE_ID, false);
|
||||
_discs?.dispose();
|
||||
_discs = null;
|
||||
_events = [];
|
||||
_eventById = new Map();
|
||||
_uncover?.();
|
||||
_uncover = null;
|
||||
_marksKey = null;
|
||||
|
||||
@@ -23,6 +23,12 @@ export const EARTHQUAKE_MARK_MAGNITUDE = 6;
|
||||
|
||||
/** The longest place a timeline mark's label carries, ellipsis and all. */
|
||||
const MARK_PLACE_LENGTH = 40;
|
||||
/**
|
||||
* The longest place line the detail card shows, ellipsis and all, so a long
|
||||
* place or translation keeps the card inside a phone's width. The card's
|
||||
* accessible name carries the whole place.
|
||||
*/
|
||||
const CARD_PLACE_LENGTH = 48;
|
||||
|
||||
/** A magnitude as the map's labels show it: `M6.4`. */
|
||||
export const earthquakeMagnitudeTitle = (magnitude) =>
|
||||
@@ -123,6 +129,332 @@ export function createEarthquakeOverlayEntry({
|
||||
};
|
||||
}
|
||||
|
||||
/** Where USGS publishes one event's page, its event id appended. */
|
||||
export const USGS_EVENT_PAGE_URL =
|
||||
'https://earthquake.usgs.gov/earthquakes/eventpage/';
|
||||
|
||||
/**
|
||||
* The USGS page for an event id, or null when there is no usable id (a
|
||||
* fallback `event-N` id never names a USGS page, and is never sent).
|
||||
* @param {unknown} usgsId
|
||||
* @returns {string|null}
|
||||
*/
|
||||
export function earthquakeEventLink(usgsId) {
|
||||
const id =
|
||||
typeof usgsId === 'string' || typeof usgsId === 'number'
|
||||
? String(usgsId).trim()
|
||||
: '';
|
||||
return /^[A-Za-z0-9_-]{1,64}$/.test(id)
|
||||
? `${USGS_EVENT_PAGE_URL}${id}`
|
||||
: null;
|
||||
}
|
||||
|
||||
// The package carries no i18n: with no translator given, the card stays
|
||||
// English, its `{name}` slots filled in.
|
||||
const english = (text, values) =>
|
||||
String(text).replace(/\{(\w+)\}/g, (all, key) =>
|
||||
values && Object.hasOwn(values, key) ? String(values[key]) : all,
|
||||
);
|
||||
const utcMinute = (time) =>
|
||||
`${new Date(time).toISOString().slice(0, 16).replace('T', ' ')} UTC`;
|
||||
const oneDecimal = (value) => String(Math.round(value * 10) / 10);
|
||||
|
||||
/**
|
||||
* The detail card one clicked earthquake shows: its magnitude as the title,
|
||||
* then where, when and how deep, and the source. With a USGS event id the
|
||||
* card opens that event's page.
|
||||
* @param {{mag: number, place?: string|null, time?: number|null,
|
||||
* depthKm?: number|null, usgsId?: string|null}} event
|
||||
* @param {object} [text] The application's formatters.
|
||||
* @param {(text: string, values?: object) => string} [text.t] Translator.
|
||||
* @param {(time: number) => string} [text.formatTime] An event time.
|
||||
* @param {(value: number) => string} [text.formatDepth] A depth in km.
|
||||
* @param {boolean} [text.canOpen] Whether a link can be opened here (an
|
||||
* opener is injected); without one the card offers no link to click.
|
||||
* @returns {{title: string, details: string[], link: string|null,
|
||||
* accessibilityLabel: string}} `accessibilityLabel` names the card's
|
||||
* action, with its details: opening the source, or focusing the quake.
|
||||
*/
|
||||
export function describeEarthquake(
|
||||
event,
|
||||
{
|
||||
t = english,
|
||||
formatTime = utcMinute,
|
||||
formatDepth = oneDecimal,
|
||||
canOpen = true,
|
||||
} = {},
|
||||
) {
|
||||
const details = [];
|
||||
// What the card says, spoken: depth, the whole place, and the time.
|
||||
const spoken = [];
|
||||
// Severity at a glance, right under the title: the class meter, then
|
||||
// where in the crust it broke.
|
||||
const glance = [earthquakeSeverityMeter(event?.mag)];
|
||||
if (Number.isFinite(event?.depthKm)) {
|
||||
const depth = `${earthquakeDepthBandName(event.depthKm, t)} · ${t(
|
||||
'{km} km deep',
|
||||
{ km: formatDepth(event.depthKm) },
|
||||
)}`;
|
||||
glance.push(depth);
|
||||
spoken.push(depth);
|
||||
}
|
||||
details.push(glance.join(' '));
|
||||
const place =
|
||||
typeof event?.place === 'string'
|
||||
? event.place.replace(/\s+/g, ' ').trim()
|
||||
: '';
|
||||
if (place) {
|
||||
// Cut by characters, not UTF-16 units, so a pair is never split.
|
||||
const chars = Array.from(place);
|
||||
details.push(
|
||||
chars.length > CARD_PLACE_LENGTH
|
||||
? `${chars
|
||||
.slice(0, CARD_PLACE_LENGTH - 1)
|
||||
.join('')
|
||||
.trimEnd()}…`
|
||||
: place,
|
||||
);
|
||||
spoken.push(place);
|
||||
}
|
||||
if (Number.isFinite(event?.time)) {
|
||||
const time = formatTime(event.time);
|
||||
details.push(time);
|
||||
spoken.push(time);
|
||||
}
|
||||
const source = t('Source: {value}', { value: 'USGS' });
|
||||
details.push(source);
|
||||
// The source closes the spoken details, so they are never empty.
|
||||
spoken.push(source);
|
||||
const link = earthquakeEventLink(event?.usgsId);
|
||||
const opens = Boolean(link) && canOpen;
|
||||
if (opens) details.push(t('Click the card to open the source ↗'));
|
||||
const title = `${earthquakeMagnitudeTitle(event?.mag)} · ${earthquakeSeverityName(
|
||||
event?.mag,
|
||||
t,
|
||||
)}`;
|
||||
const summary = { title, details: spoken.join(', ') };
|
||||
return {
|
||||
title,
|
||||
details,
|
||||
link,
|
||||
accessibilityLabel: opens
|
||||
? t('Open the source for {title}, {details}', summary)
|
||||
: t('Focus earthquake {title}, {details}', summary),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* USGS's magnitude classes, weakest first: minor (under 4; the feed starts
|
||||
* at M2.5), light, moderate, strong, major, great (8 and up).
|
||||
*/
|
||||
export const EARTHQUAKE_SEVERITY_LEVELS = 6;
|
||||
|
||||
/**
|
||||
* A magnitude's USGS class, 0 (minor) to 5 (great).
|
||||
* @param {number} magnitude
|
||||
* @returns {number}
|
||||
*/
|
||||
export function earthquakeSeverityLevel(magnitude) {
|
||||
const mag = Number(magnitude);
|
||||
if (!Number.isFinite(mag) || mag < 4) return 0;
|
||||
return Math.min(EARTHQUAKE_SEVERITY_LEVELS - 1, Math.floor(mag) - 3);
|
||||
}
|
||||
|
||||
/** A magnitude's class, as a word in the page's language. */
|
||||
export function earthquakeSeverityName(magnitude, t = english) {
|
||||
switch (earthquakeSeverityLevel(magnitude)) {
|
||||
case 5:
|
||||
return t('Great', { context: 'earthquake' });
|
||||
case 4:
|
||||
return t('Major', { context: 'earthquake' });
|
||||
case 3:
|
||||
return t('Strong', { context: 'earthquake' });
|
||||
case 2:
|
||||
return t('Moderate', { context: 'earthquake' });
|
||||
case 1:
|
||||
return t('Light', { context: 'earthquake' });
|
||||
default:
|
||||
return t('Minor', { context: 'earthquake' });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The class as a six-step meter, one filled block per class up to this one:
|
||||
* `■■□□□□` for a light quake. Plain text, so the card shows it as it is.
|
||||
* @param {number} magnitude
|
||||
* @returns {string}
|
||||
*/
|
||||
export function earthquakeSeverityMeter(magnitude) {
|
||||
const filled = earthquakeSeverityLevel(magnitude) + 1;
|
||||
return '■'.repeat(filled) + '□'.repeat(EARTHQUAKE_SEVERITY_LEVELS - filled);
|
||||
}
|
||||
|
||||
/**
|
||||
* The depth band the disc's colour shows, as a word: shallow (under 70 km,
|
||||
* red), intermediate (to 300 km, orange), deep (yellow).
|
||||
*/
|
||||
export function earthquakeDepthBandName(depthKm, t = english) {
|
||||
const band = depthBand(depthKm);
|
||||
if (band === SHALLOW) return t('Shallow', { context: 'earthquake' });
|
||||
if (band === INTERMEDIATE)
|
||||
return t('Intermediate', { context: 'earthquake' });
|
||||
return t('Deep', { context: 'earthquake' });
|
||||
}
|
||||
|
||||
/**
|
||||
* A quake's disc radius on the ground, in metres: it doubles with each
|
||||
* magnitude step (about 5.7 km at M2.5, 32 km at M5, 64 km at M6).
|
||||
* @param {number} magnitude
|
||||
* @returns {number}
|
||||
*/
|
||||
export const earthquakeDiscRadiusM = (magnitude) =>
|
||||
Math.pow(2, magnitude) * 1000;
|
||||
|
||||
/** How many contour lines run out from a selected quake at once. */
|
||||
export const EARTHQUAKE_RIPPLE_RINGS = 6;
|
||||
/** How long one contour line takes from the marker to the disc's edge. */
|
||||
export const EARTHQUAKE_RIPPLE_PERIOD_MS = 4800;
|
||||
/** Every this many lines one is an index contour, drawn heavier. */
|
||||
export const EARTHQUAKE_INDEX_CONTOUR_EVERY = 3;
|
||||
|
||||
/**
|
||||
* How far a contour line dents in from the circle, as a share of its
|
||||
* radius. Kept with the drift below so nested lines never cross: a line's
|
||||
* radius grows with `fraction` faster than its dents move (see
|
||||
* earthquakeContourScale).
|
||||
*/
|
||||
export const EARTHQUAKE_CONTOUR_WOBBLE = 0.24;
|
||||
const CONTOUR_HARMONICS = Object.freeze([2, 3, 5]);
|
||||
const CONTOUR_WEIGHTS = Object.freeze([1, 0.6, 0.3]);
|
||||
const CONTOUR_MAX_DRIFT = 1.5;
|
||||
|
||||
/** A stable 32-bit hash of a string (FNV-1a). */
|
||||
function hashString(text) {
|
||||
let h = 0x811c9dc5;
|
||||
for (const ch of String(text ?? '')) {
|
||||
h ^= ch.codePointAt(0);
|
||||
h = Math.imul(h, 0x01000193);
|
||||
}
|
||||
return h >>> 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* One quake's contour shape: a few harmonics around the circle, each with
|
||||
* its own phase and a drift that turns it as a line runs outward, seeded by
|
||||
* the quake's id so the same quake always draws the same contours.
|
||||
* @param {string} seed The quake's stable id.
|
||||
* @returns {ReadonlyArray<{harmonic: number, weight: number, phase: number, drift: number}>}
|
||||
*/
|
||||
export function earthquakeContourShape(seed) {
|
||||
let state = hashString(seed) || 1;
|
||||
// xorshift32: a small, stable stream from the seed.
|
||||
const next = () => {
|
||||
state ^= state << 13;
|
||||
state ^= state >>> 17;
|
||||
state ^= state << 5;
|
||||
return (state >>> 0) / 0x100000000;
|
||||
};
|
||||
return Object.freeze(
|
||||
CONTOUR_HARMONICS.map((harmonic, i) =>
|
||||
Object.freeze({
|
||||
harmonic,
|
||||
weight: CONTOUR_WEIGHTS[i],
|
||||
phase: next() * 2 * Math.PI,
|
||||
drift: (next() * 2 - 1) * CONTOUR_MAX_DRIFT,
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Where a contour line runs at `angle` (radians), as a share of a circle of
|
||||
* the same `fraction`: between 1 - EARTHQUAKE_CONTOUR_WOBBLE and 1, so the
|
||||
* outermost line never leaves the disc. The dents turn as `fraction` grows,
|
||||
* and no faster than the line grows, so lines never cross: with wobble A
|
||||
* and drift D, d(fraction · scale)/d(fraction) ≥ 1 - A - A·D/2 > 0.
|
||||
* @param {ReturnType<typeof earthquakeContourShape>} shape
|
||||
* @param {number} angle
|
||||
* @param {number} fraction 0 at the marker, 1 at the disc's edge.
|
||||
* @returns {number}
|
||||
*/
|
||||
export function earthquakeContourScale(shape, angle, fraction) {
|
||||
let sum = 0;
|
||||
let total = 0;
|
||||
for (const { harmonic, weight, phase, drift } of shape) {
|
||||
sum += weight * Math.sin(harmonic * angle + phase + drift * fraction);
|
||||
total += weight;
|
||||
}
|
||||
const n = total > 0 ? sum / total : 0;
|
||||
return 1 - (EARTHQUAKE_CONTOUR_WOBBLE * (1 - n)) / 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* The selected quake's contour lines at a time: each runs from the marker
|
||||
* (`fraction` 0) out to the disc's edge (1), evenly staggered, fading in
|
||||
* just after it starts and out as it reaches the edge; every
|
||||
* EARTHQUAKE_INDEX_CONTOUR_EVERY-th is an index contour. Pure: the painter
|
||||
* gives the clock.
|
||||
* @param {number} timeMs Any steady clock, in milliseconds.
|
||||
* @param {{count?: number, periodMs?: number}} [options]
|
||||
* @returns {Array<{fraction: number, alpha: number, index: boolean}>}
|
||||
*/
|
||||
export function earthquakeRippleRings(
|
||||
timeMs,
|
||||
{
|
||||
count = EARTHQUAKE_RIPPLE_RINGS,
|
||||
periodMs = EARTHQUAKE_RIPPLE_PERIOD_MS,
|
||||
} = {},
|
||||
) {
|
||||
const phase = Number.isFinite(timeMs) && periodMs > 0 ? timeMs / periodMs : 0;
|
||||
const rings = [];
|
||||
for (let k = 0; k < count; k++) {
|
||||
const fraction = (((phase + k / count) % 1) + 1) % 1;
|
||||
rings.push({
|
||||
fraction,
|
||||
alpha: earthquakeRippleAlpha(fraction),
|
||||
index: k % EARTHQUAKE_INDEX_CONTOUR_EVERY === 0,
|
||||
});
|
||||
}
|
||||
return rings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Still contour lines, for viewers who ask for reduced motion: the same
|
||||
* lines as the animation, held evenly spaced out to the edge.
|
||||
* @param {number} [count]
|
||||
* @returns {Array<{fraction: number, alpha: number, index: boolean}>}
|
||||
*/
|
||||
export function earthquakeContourRings(count = EARTHQUAKE_RIPPLE_RINGS) {
|
||||
const rings = [];
|
||||
for (let k = 1; k <= count; k++)
|
||||
rings.push({
|
||||
fraction: k / count,
|
||||
alpha: 0.7,
|
||||
index: k % EARTHQUAKE_INDEX_CONTOUR_EVERY === 0,
|
||||
});
|
||||
return rings;
|
||||
}
|
||||
|
||||
const RIPPLE_FADE_IN = 0.12;
|
||||
/** A ring's opacity where it is: in from 0 near the marker, out to 0 at the edge. */
|
||||
function earthquakeRippleAlpha(fraction) {
|
||||
if (fraction <= 0 || fraction >= 1) return 0;
|
||||
return fraction < RIPPLE_FADE_IN
|
||||
? fraction / RIPPLE_FADE_IN
|
||||
: (1 - fraction) / (1 - RIPPLE_FADE_IN);
|
||||
}
|
||||
|
||||
/**
|
||||
* What a magnitude label says to assistive technology: activating it zooms
|
||||
* to the quake (`Zoom to M5.0 · 42 km SW of Anchorage, Alaska`).
|
||||
* @param {{mag: number, place?: string|null}} event
|
||||
* @param {{t?: (text: string, values?: object) => string}} [text]
|
||||
* @returns {string}
|
||||
*/
|
||||
export function earthquakeZoomLabel(event, { t = english } = {}) {
|
||||
return t('Zoom to {name}', { name: earthquakeMarkLabel(event) });
|
||||
}
|
||||
|
||||
/** Keep the largest events, with stable identity as the tie-break. */
|
||||
export function selectEarthquakeOverlayCohort(
|
||||
entries,
|
||||
|
||||
@@ -28,10 +28,15 @@ export function normalizeEarthquakeSnapshot(geojson) {
|
||||
return null;
|
||||
// A missing magnitude cannot establish that this event meets M2.5+.
|
||||
if (mag == null || mag < 2.5) continue;
|
||||
const stableId =
|
||||
feature.id == null || feature.id === ''
|
||||
? `event-${index + 1}`
|
||||
: String(feature.id);
|
||||
// An id-less event is named by what it is (time, position, depth and
|
||||
// magnitude), not by its row, so a refresh that inserts a row keeps the
|
||||
// selection on the same quake; a revision to any of those names a new
|
||||
// one. Two id-less events that match exactly fall back to the row.
|
||||
const idless = feature.id == null || feature.id === '';
|
||||
let stableId = idless
|
||||
? `event-${[properties.time ?? 'na', lon, lat, depthKm ?? 'na', mag].join(':')}`
|
||||
: String(feature.id);
|
||||
if (idless && ids.has(stableId)) stableId = `${stableId}:${index + 1}`;
|
||||
if (ids.has(stableId)) return null;
|
||||
ids.add(stableId);
|
||||
rows.push({
|
||||
|
||||
@@ -37,7 +37,7 @@ test('normalizeEarthquakeSnapshot parses valid GeoJSON earthquake features', ()
|
||||
});
|
||||
});
|
||||
|
||||
test('normalizeEarthquakeSnapshot generates index-based stable IDs when id is missing or blank', () => {
|
||||
test('normalizeEarthquakeSnapshot names id-less events by their content, not their row', () => {
|
||||
const geojson = {
|
||||
features: [
|
||||
{
|
||||
@@ -55,10 +55,35 @@ test('normalizeEarthquakeSnapshot generates index-based stable IDs when id is mi
|
||||
|
||||
const rows = normalizeEarthquakeSnapshot(geojson);
|
||||
assert.equal(rows.length, 2);
|
||||
assert.equal(rows[0].stableId, 'event-1');
|
||||
assert.equal(rows[0].stableId, 'event-1711930000000:139.6917:35.6895:25:3.5');
|
||||
assert.equal(rows[0].usgsId, null);
|
||||
assert.equal(rows[1].stableId, 'event-2');
|
||||
assert.equal(
|
||||
rows[1].stableId,
|
||||
'event-1711931000000:-70.6693:-33.4489:45.2:5.1',
|
||||
);
|
||||
assert.equal(rows[1].usgsId, '');
|
||||
// A row inserted ahead of them keeps each id-less quake's id, so a selected
|
||||
// one stays selected across the refresh.
|
||||
const inserted = normalizeEarthquakeSnapshot({
|
||||
features: [
|
||||
{
|
||||
id: 'us7000new',
|
||||
geometry: { type: 'Point', coordinates: [10, 20, 5] },
|
||||
properties: { mag: 4, place: 'New', time: 1711932000000 },
|
||||
},
|
||||
...geojson.features,
|
||||
],
|
||||
});
|
||||
assert.deepEqual(
|
||||
inserted.map((row) => row.stableId).slice(1),
|
||||
rows.map((row) => row.stableId),
|
||||
);
|
||||
// Two id-less events that match exactly stay apart.
|
||||
const twins = normalizeEarthquakeSnapshot({
|
||||
features: [geojson.features[0], geojson.features[0]],
|
||||
});
|
||||
assert.equal(twins.length, 2);
|
||||
assert.notEqual(twins[0].stableId, twins[1].stableId);
|
||||
});
|
||||
|
||||
test('normalizeEarthquakeSnapshot filters events below M2.5 without dropping the feed', () => {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -76,7 +76,10 @@ export function createCards({
|
||||
const height = canvas.clientHeight;
|
||||
let ambientCount = 0;
|
||||
|
||||
for (const candidate of layerState._labelCandidates) {
|
||||
// An application drawing the detections in place of the markers draws
|
||||
// them unlabelled: only the selected fire's card shows then.
|
||||
const candidates = layerState._standIn ? [] : layerState._labelCandidates;
|
||||
for (const candidate of candidates) {
|
||||
if (ambientCount >= MAX_AMBIENT_LABELS) break;
|
||||
if (candidate.fire && candidate.fire === layerState._selectedFire)
|
||||
continue;
|
||||
|
||||
@@ -52,10 +52,12 @@ export function createLifecycle({
|
||||
if (layerState._cells) layerState._cells.show = true;
|
||||
// The GPU culls the far side each frame, so retained rows are right
|
||||
// for wherever the camera went while the layer was off.
|
||||
if (layerState._icons) layerState._icons.show = true;
|
||||
if (layerState._icons) layerState._icons.show = !layerState._standIn;
|
||||
overlayHost.setVisible(FIRMS_OVERLAY_SOURCE_ID, true);
|
||||
// A filter can leave an old raster cached while the current set is empty.
|
||||
layerState._heatImagery?.setShow(layerState._fires.length > 0);
|
||||
layerState._heatImagery?.setShow(
|
||||
layerState._fires.length > 0 && !layerState._standIn,
|
||||
);
|
||||
// The camera can have crossed the hand-off while the layer was off.
|
||||
components.rendering.applyHandoffFade(true);
|
||||
components.viewport.installLodWatcher();
|
||||
@@ -68,6 +70,32 @@ export function createLifecycle({
|
||||
await components.ingestion.loadHeatmap();
|
||||
},
|
||||
|
||||
/**
|
||||
* Let an application draw the detections in place of the layer's
|
||||
* markers. While a stand-in is set, the glows, the heatmap and the
|
||||
* ambient cards are hidden and everything else works as before: a click
|
||||
* on a fire the stand-in draws (`standIn.hitTest(screenPosition)`, which
|
||||
* answers a detection record from the same source, or null) selects it
|
||||
* and moves the camera to it as a click on its marker does, the selected
|
||||
* fire's card shows, and a click on empty space clears the selection.
|
||||
* Its optional `focusRangeM(record)` gives how far, in metres, the camera
|
||||
* stands from a fire it draws when moving to it, for fires drawn larger
|
||||
* than a marker; without one, or for null, the usual fire framing holds.
|
||||
* `null` brings the markers back. The selection is kept either way.
|
||||
* @param {?{hitTest: (screenPosition: {x: number, y: number}) => ?Object, focusRangeM?: (record: Object) => ?number}} standIn
|
||||
*/
|
||||
setMarkerStandIn(standIn) {
|
||||
layerState._standIn =
|
||||
typeof standIn?.hitTest === 'function' ? standIn : null;
|
||||
layerState._heatImagery?.setShow(
|
||||
layerState._enabled &&
|
||||
layerState._fires.length > 0 &&
|
||||
!layerState._standIn,
|
||||
);
|
||||
components.rendering.applyHandoffFade(true);
|
||||
components.cards.rebuildAmbientLabels();
|
||||
},
|
||||
|
||||
disable() {
|
||||
layerState.request?.abort();
|
||||
layerState.request = null;
|
||||
@@ -129,6 +157,7 @@ export function createLifecycle({
|
||||
layerState._currentLodIndex = -1;
|
||||
layerState._lastViewRect = null;
|
||||
layerState._selectedFire = null;
|
||||
layerState._standIn = null;
|
||||
layerState._labelCandidates = [];
|
||||
layerState._labelLodDistance = 0;
|
||||
layerState._pickIndexById.clear();
|
||||
|
||||
@@ -122,7 +122,7 @@ export function createRendering({
|
||||
glowAlpha = alpha;
|
||||
const set = layerState._icons;
|
||||
if (!set) return;
|
||||
set.show = layerState._enabled && heat < 1;
|
||||
set.show = layerState._enabled && !layerState._standIn && heat < 1;
|
||||
if (!changed || !drawnGlows.size) return;
|
||||
const faded = [];
|
||||
for (const drawn of drawnGlows.values()) {
|
||||
@@ -273,7 +273,7 @@ export function createRendering({
|
||||
// The map stack may have changed since the last render.
|
||||
imagery.rehome();
|
||||
ensureHeatRaster(now);
|
||||
imagery.setShow(layerState._enabled);
|
||||
imagery.setShow(layerState._enabled && !layerState._standIn);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -469,7 +469,10 @@ export function createRendering({
|
||||
// Blended as one translucent pass, as its billboards were.
|
||||
blend: 'translucent',
|
||||
horizonCull: true,
|
||||
show: layerState._enabled && !(layerState._handoffHeat >= 1),
|
||||
show:
|
||||
layerState._enabled &&
|
||||
!layerState._standIn &&
|
||||
!(layerState._handoffHeat >= 1),
|
||||
drawOrder: spriteDrawOrder?.('firms') ?? 0,
|
||||
});
|
||||
// Columns of no rows put the set's host in the scene now, rather than
|
||||
|
||||
@@ -13,7 +13,7 @@ export function createSelection({
|
||||
config,
|
||||
feed,
|
||||
}) {
|
||||
const { resolvePickId, isOwnedByOtherLayer } = services.picking;
|
||||
const { resolvePickId, isOwnedByOtherLayer, clickCard } = services.picking;
|
||||
const { requestWorldFocus } = services.focus;
|
||||
const {
|
||||
selectEntityContext,
|
||||
@@ -21,7 +21,7 @@ export function createSelection({
|
||||
getContextStore,
|
||||
registerEntityContext,
|
||||
} = services.context;
|
||||
const { id, name, overlayHost } = config;
|
||||
const { id, name } = config;
|
||||
|
||||
/**
|
||||
* Install the LEFT_CLICK handler for fire selection (enable-time only,
|
||||
@@ -34,30 +34,33 @@ export function createSelection({
|
||||
if (layerState._clickSubscription || !layerState._viewer) return;
|
||||
const input = inputFor(layerState._viewer);
|
||||
layerState._clickSubscription = input.onClick((event) => {
|
||||
const picked = event.topHit;
|
||||
const fire = pickedFire(event.drawHit);
|
||||
// The card or label painted on top takes the click, read once per
|
||||
// click so every layer agrees: ours acts whatever is drawn under it;
|
||||
// another layer's is that layer's click.
|
||||
const top = clickCard?.(event) ?? null;
|
||||
if (top) {
|
||||
if (top.sourceId !== FIRMS_OVERLAY_SOURCE_ID) return;
|
||||
const carded = layerState._fireByCardId.get(top.entryId);
|
||||
if (carded) selectAndFocusFire(carded);
|
||||
return;
|
||||
}
|
||||
const pickedId = resolvePickId(event.topHit ?? null);
|
||||
// A pick that belongs to a sibling layer (an aircraft, a flight trail)
|
||||
// is not "empty space": leave the selection alone.
|
||||
const otherLayer = Boolean(pickedId && isOwnedByOtherLayer(id, pickedId));
|
||||
// The stand-in is asked where markers are picked: the click corrected
|
||||
// for the sensor style (`event.position`), and only when no sibling
|
||||
// layer's item is on top, as a marker under that item would not be hit.
|
||||
const fire = layerState._standIn
|
||||
? otherLayer
|
||||
? null
|
||||
: standInFire(event.position ?? event.screenPosition)
|
||||
: pickedFire(event.drawHit);
|
||||
if (fire) {
|
||||
selectAndFocusFire(fire);
|
||||
return;
|
||||
}
|
||||
// A pick that belongs to a sibling layer (e.g. an aircraft) is not
|
||||
// "empty space" — leave the selection alone and let that layer handle it.
|
||||
if (picked) {
|
||||
const pickedId = resolvePickId(picked);
|
||||
if (pickedId && isOwnedByOtherLayer(id, pickedId)) return;
|
||||
}
|
||||
const cardHit = overlayHost.hitTest?.(
|
||||
event.screenPosition?.x,
|
||||
event.screenPosition?.y,
|
||||
{
|
||||
sourceId: FIRMS_OVERLAY_SOURCE_ID,
|
||||
},
|
||||
);
|
||||
if (cardHit) {
|
||||
const carded = layerState._fireByCardId.get(cardHit.entryId);
|
||||
if (carded) selectAndFocusFire(carded);
|
||||
return;
|
||||
}
|
||||
if (otherLayer) return;
|
||||
clearFireSelection();
|
||||
});
|
||||
}
|
||||
@@ -71,11 +74,15 @@ export function createSelection({
|
||||
|
||||
function selectAndFocusFire(fire) {
|
||||
selectFire(fire);
|
||||
// A stand-in that draws the fire larger than a marker says how far the
|
||||
// camera stands from it (`setMarkerStandIn`).
|
||||
const rangeM = layerState._standIn?.focusRangeM?.(fire);
|
||||
requestWorldFocus({
|
||||
kind: 'fire',
|
||||
id: fireDetectionKey(fire),
|
||||
label: t('FIRE'),
|
||||
position: components.model.firePosition(fire),
|
||||
...(Number.isFinite(rangeM) && rangeM > 0 ? { rangeM } : {}),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -93,6 +100,32 @@ export function createSelection({
|
||||
return layerState._pickIndexById.get(hit.id) ?? null;
|
||||
}
|
||||
|
||||
/** The shown detections by their key, for the shown set they were made from. */
|
||||
let keyed = { fires: null, byKey: null };
|
||||
|
||||
/**
|
||||
* Resolve a click to one of this layer's fire records through the
|
||||
* application's stand-in for its markers (`setMarkerStandIn`), or null:
|
||||
* the record its hit test answers, matched by its detection key to a fire
|
||||
* the layer shows now (so one the filter hides is not selected).
|
||||
* @param {?{x: number, y: number}} screenPosition - Where the user clicked.
|
||||
* @returns {?Object} Fire record.
|
||||
*/
|
||||
|
||||
function standInFire(screenPosition) {
|
||||
if (!screenPosition) return null;
|
||||
const record = layerState._standIn?.hitTest(screenPosition);
|
||||
if (!record) return null;
|
||||
if (keyed.fires !== layerState._fires)
|
||||
keyed = {
|
||||
fires: layerState._fires,
|
||||
byKey: new Map(
|
||||
layerState._fires.map((fire) => [fireDetectionKey(fire), fire]),
|
||||
),
|
||||
};
|
||||
return keyed.byKey.get(fireDetectionKey(record)) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a fire: show its detail label and mark it selected in the shared
|
||||
* context store so voice "what's selected" resolves to it.
|
||||
@@ -229,6 +262,7 @@ export function createSelection({
|
||||
removeClickHandler,
|
||||
selectAndFocusFire,
|
||||
pickedFire,
|
||||
standInFire,
|
||||
selectFire,
|
||||
clearFireSelection,
|
||||
refreshContextRegistrations,
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { FIRMS_OVERLAY_SOURCE_ID } from '../../data/firmsLabels.js';
|
||||
import { clickCard, resolvePickId } from '../../data/pickRegistry.js';
|
||||
import { fakeInputUnderLabel } from '../../input/testDoubles.mjs';
|
||||
import { createSelection } from './selection.js';
|
||||
|
||||
/** The fire selection over a viewer whose clicks a Space Missions label may
|
||||
* take, with a fire's card under every click. */
|
||||
function selectionHarness(t) {
|
||||
const viewer = { scene: { canvas: {}, pick: () => null } };
|
||||
const fake = fakeInputUnderLabel(viewer, {
|
||||
beneath: () => ({
|
||||
sourceId: FIRMS_OVERLAY_SOURCE_ID,
|
||||
entryId: 'firms-card:1',
|
||||
}),
|
||||
});
|
||||
t.after(() => fake.destroy());
|
||||
const fire = { lat: 1, lon: 2, acqMs: 3, frp: 40, satellite: 'N' };
|
||||
const focused = [];
|
||||
const cleared = [];
|
||||
const layerState = {
|
||||
_viewer: viewer,
|
||||
_icons: { id: 'firms:icons' },
|
||||
_pickIndexById: new Map(),
|
||||
_fireByCardId: new Map([['firms-card:1', fire]]),
|
||||
_selectedFire: null,
|
||||
_contextIds: new Set(),
|
||||
};
|
||||
const selection = createSelection({
|
||||
layerState,
|
||||
services: {
|
||||
picking: { resolvePickId, isOwnedByOtherLayer: () => false, clickCard },
|
||||
focus: { requestWorldFocus: (request) => focused.push(request.kind) },
|
||||
context: {
|
||||
selectEntityContext() {},
|
||||
clearSelectedEntityContextForLayer: (id) => cleared.push(id),
|
||||
getContextStore() {},
|
||||
registerEntityContext() {},
|
||||
},
|
||||
},
|
||||
components: {
|
||||
model: {
|
||||
firePosition: () => ({ x: 0, y: 0, z: 0 }),
|
||||
formatFrp: String,
|
||||
confidenceBucket: String,
|
||||
},
|
||||
cards: { rebuildAmbientLabels() {} },
|
||||
},
|
||||
config: {
|
||||
id: 'firms',
|
||||
name: 'Fires',
|
||||
},
|
||||
});
|
||||
selection.installClickHandler();
|
||||
t.after(() => selection.removeClickHandler());
|
||||
return { fake, layerState, fire, focused, cleared };
|
||||
}
|
||||
|
||||
test("a click on a mission label over a fire's card never selects or focuses the fire", (t) => {
|
||||
const h = selectionHarness(t);
|
||||
h.fake.label.over = true;
|
||||
h.fake.click();
|
||||
assert.equal(h.layerState._selectedFire, null);
|
||||
assert.deepEqual(h.focused, [], 'the camera is not sent to the fire');
|
||||
});
|
||||
|
||||
test('a click on a mission label keeps the selected fire', (t) => {
|
||||
const h = selectionHarness(t);
|
||||
// Off the label, a click on the card selects and focuses its fire.
|
||||
h.fake.click();
|
||||
assert.equal(h.layerState._selectedFire, h.fire);
|
||||
assert.deepEqual(h.focused, ['fire']);
|
||||
// The label on top is its own click: the fire stays selected.
|
||||
h.fake.label.over = true;
|
||||
h.fake.click();
|
||||
assert.equal(h.layerState._selectedFire, h.fire);
|
||||
assert.deepEqual(h.cleared, []);
|
||||
assert.deepEqual(h.focused, ['fire']);
|
||||
});
|
||||
@@ -98,6 +98,14 @@ export function createFirmsState({ services, config }) {
|
||||
|
||||
layerState._selectedFire = null;
|
||||
|
||||
/**
|
||||
* What an application draws in place of the markers (`setMarkerStandIn`):
|
||||
* while set, the glows, heatmap and ambient cards are hidden and clicks
|
||||
* resolve through its `hitTest`.
|
||||
*/
|
||||
|
||||
layerState._standIn = null;
|
||||
|
||||
/** Priority-ordered label candidates from the last rebuild (detections or cells). */
|
||||
|
||||
layerState._labelCandidates = [];
|
||||
|
||||
@@ -4,6 +4,8 @@ import { createCivilFlightLayer } from './index.js';
|
||||
import { createFlightState } from './state.js';
|
||||
import { createEnrichment } from './enrichment.js';
|
||||
import { createTracking } from './tracking.js';
|
||||
import { fakeInput } from '../../input/testDoubles.mjs';
|
||||
import * as picking from '../../data/pickRegistry.js';
|
||||
import { LiveSourceError } from '../../sources/live/contract.js';
|
||||
|
||||
function services() {
|
||||
@@ -609,6 +611,50 @@ test('a route answer for a callsign the plane no longer flies is dropped', async
|
||||
flightState.lifetime.abort();
|
||||
});
|
||||
|
||||
// The card or label painted on top takes the click: an aircraft under another
|
||||
// layer's card is not even picked, so it is neither tracked nor released.
|
||||
test("another layer's card over an aircraft keeps the click", (t) => {
|
||||
const previousDocument = globalThis.document;
|
||||
globalThis.document = Object.assign(new EventTarget(), {
|
||||
body: { classList: { contains: () => false } },
|
||||
});
|
||||
let picks = 0;
|
||||
const viewer = {
|
||||
scene: {
|
||||
canvas: new EventTarget(),
|
||||
pick: () => {
|
||||
picks++;
|
||||
return null;
|
||||
},
|
||||
},
|
||||
};
|
||||
const input = fakeInput(viewer);
|
||||
const flightState = createFlightState({ services: services() });
|
||||
flightState._trackedEntityChangedRemove = () => {};
|
||||
const tracking = createTracking({
|
||||
flightState,
|
||||
services: { ...services(), picking },
|
||||
parts: {},
|
||||
layer: {},
|
||||
});
|
||||
tracking._installClickHandler(viewer);
|
||||
let top = { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' };
|
||||
picking.setClickCardHitTest(() => top);
|
||||
t.after(() => {
|
||||
picking.setClickCardHitTest(null);
|
||||
flightState._clickSubscription?.();
|
||||
input.destroy();
|
||||
flightState.lifetime.abort();
|
||||
if (previousDocument === undefined) delete globalThis.document;
|
||||
else globalThis.document = previousDocument;
|
||||
});
|
||||
input.tap({ x: 10, y: 10 });
|
||||
assert.equal(picks, 0, 'covered: the scene under the card is not picked');
|
||||
top = null;
|
||||
input.tap({ x: 10, y: 10 });
|
||||
assert.ok(picks > 0, 'open map: the click reaches the scene');
|
||||
});
|
||||
|
||||
test("a type lookup overrides the feed's type and fills the type name", async () => {
|
||||
const queries = [];
|
||||
const source = {
|
||||
|
||||
@@ -88,7 +88,8 @@ export function createTracking({
|
||||
const { trackedLabelModelFromText, refreshTrackedReadout } = services.readout;
|
||||
const { FOLLOW_MIN_RANGE_M, SELECTION_FOLLOW_TRANSITION_S, followViewFrom } =
|
||||
services.camera;
|
||||
const { resolvePickId, isOwnedByOtherLayer } = services.picking;
|
||||
const { resolvePickId, isOwnedByOtherLayer, isUnderOtherCard } =
|
||||
services.picking;
|
||||
const flightsLayer = layer;
|
||||
/** The tracked contact's billboard (an icon set on the draw port). */
|
||||
const trackedIcon = createTrackedAircraftIcon({
|
||||
@@ -1316,6 +1317,9 @@ export function createTracking({
|
||||
// first-person reference. A globe click must not fall through to the
|
||||
// normal empty-space deselection path; cockpit has explicit exit controls.
|
||||
if (document.body.classList.contains('cockpit-mode')) return;
|
||||
// Another layer's card or label painted on top takes the click: the item
|
||||
// under it does not act, and the click is not empty space either.
|
||||
if (isUnderOtherCard?.(event)) return;
|
||||
const picked = event.hit;
|
||||
|
||||
if (picked) {
|
||||
|
||||
@@ -707,13 +707,19 @@ export function createGhostMapsLayer({
|
||||
typeof pickedId === 'string' && pickedId.startsWith(PICK_PREFIX),
|
||||
);
|
||||
_clickSubscription = inputFor(_viewer).onClick((event) => {
|
||||
const cardHit = overlayHost.hitTest?.(
|
||||
event.screenPosition?.x,
|
||||
event.screenPosition?.y,
|
||||
{ sourceId: GHOSTMAPS_OVERLAY_SOURCE_ID },
|
||||
);
|
||||
if (cardHit && cardHit.entryId === _selectedCardId) {
|
||||
if (_selectedLink && openExternal) openExternal(_selectedLink);
|
||||
// The card or label painted on top takes the click, read once per
|
||||
// click so every layer agrees: ours opens its source whatever is drawn
|
||||
// under it; another layer's is that layer's click, so the maps under
|
||||
// it do not act and the selection stays.
|
||||
const cardHit = picking.clickCard?.(event) ?? null;
|
||||
if (cardHit) {
|
||||
if (
|
||||
cardHit.sourceId === GHOSTMAPS_OVERLAY_SOURCE_ID &&
|
||||
cardHit.entryId === _selectedCardId &&
|
||||
_selectedLink &&
|
||||
openExternal
|
||||
)
|
||||
openExternal(_selectedLink);
|
||||
return;
|
||||
}
|
||||
const picked = event.topHit;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { setLocale } from '../../i18n/index.js';
|
||||
import { createGhostMapsLayer } from './index.js';
|
||||
import { createGhostMapsLayer, GHOSTMAPS_OVERLAY_SOURCE_ID } from './index.js';
|
||||
import { bindFakeDraw } from '../../testSupport/fakeDrawPort.mjs';
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import { MISSION_LABEL } from '../../input/testDoubles.mjs';
|
||||
import { clickCard, setClickCardHitTest } from '../../data/pickRegistry.js';
|
||||
import { GHOSTMAPS_PRODUCTS, GHOSTMAPS_LATEST_DROP } from './catalog.js';
|
||||
|
||||
function element(localName, children = [], value = '', attributes = {}) {
|
||||
@@ -672,3 +675,109 @@ test('narrowing to a window the loaded data covers clears a failed wider reload'
|
||||
assert.equal(layer.getStats().error, null);
|
||||
assert.equal(layer.getStats().count, 1);
|
||||
});
|
||||
|
||||
test("a click on a mission label over the open card never opens the card's link, and keeps the card open", async (t) => {
|
||||
const cards = [];
|
||||
const opened = [];
|
||||
let cardUnder = null;
|
||||
// A Space Missions label painted over the map: while it is over, it takes
|
||||
// each click and is the card on top; under it may lie our open card.
|
||||
let labelOver = false;
|
||||
setClickCardHitTest(() =>
|
||||
labelOver
|
||||
? MISSION_LABEL
|
||||
: cardUnder
|
||||
? { sourceId: GHOSTMAPS_OVERLAY_SOURCE_ID, entryId: cardUnder }
|
||||
: null,
|
||||
);
|
||||
t.after(() => setClickCardHitTest(null));
|
||||
const { layer, viewer, click } = fixture(t, {
|
||||
now: () => Date.UTC(2026, 10, 3, 12),
|
||||
reports: [
|
||||
{
|
||||
name: 'Linked',
|
||||
description:
|
||||
'<table><tr><td>Date</td><td>11/2/2026</td></tr>' +
|
||||
'<tr><td>Source</td><td><a href="https://example.com/report">report</a></td></tr></table>',
|
||||
},
|
||||
],
|
||||
controls: {
|
||||
overlayHost: { setEntries: (_id, entries) => cards.push(entries) },
|
||||
picking: { resolvePickId: (picked) => picked?.id ?? null, clickCard },
|
||||
openExternal: (url) => opened.push(url),
|
||||
},
|
||||
});
|
||||
inputFor(viewer).onOverlayClick(() => labelOver);
|
||||
await layer.update(viewer);
|
||||
click('ghostmaps:cip:0:0');
|
||||
const [card] = cards.at(-1);
|
||||
assert.equal(card.interactive, true);
|
||||
|
||||
// The open card lies under the label: the click opens nothing, and the
|
||||
// label on top is its own click, so the card stays open.
|
||||
cardUnder = card.id;
|
||||
labelOver = true;
|
||||
click(null);
|
||||
assert.deepEqual(opened, [], 'the link beneath the label is not opened');
|
||||
assert.equal(cards.at(-1)[0]?.id, card.id, 'the card stays open');
|
||||
|
||||
// Off the label, a click on the open card opens its link.
|
||||
labelOver = false;
|
||||
click(null);
|
||||
assert.deepEqual(opened, ['https://example.com/report']);
|
||||
});
|
||||
|
||||
test('a covered selected card yields while genuine GhostMaps markers still select', async (t) => {
|
||||
const cards = [];
|
||||
const opened = [];
|
||||
let painted = [];
|
||||
const { layer, viewer, click } = fixture(t, {
|
||||
reports: [
|
||||
{
|
||||
name: 'First',
|
||||
description: '<a href="https://example.com/first">Source</a>',
|
||||
},
|
||||
{
|
||||
name: 'Second',
|
||||
description: '<a href="https://example.com/second">Source</a>',
|
||||
},
|
||||
],
|
||||
controls: {
|
||||
overlayHost: {
|
||||
setEntries: (_id, entries) => cards.push(entries),
|
||||
hitTest: (_x, _y, { sourceId } = {}) =>
|
||||
painted.find((hit) => !sourceId || hit.sourceId === sourceId) ?? null,
|
||||
},
|
||||
picking: {
|
||||
resolvePickId: (picked) => picked,
|
||||
// The card on top at a click, as the registry answers from the host.
|
||||
clickCard: () => painted[0] ?? null,
|
||||
},
|
||||
openExternal: (url) => opened.push(url),
|
||||
},
|
||||
});
|
||||
await layer.update(viewer);
|
||||
click('ghostmaps:cip:0:0');
|
||||
const first = cards.at(-1)[0];
|
||||
const foreign = {
|
||||
sourceId: 'earthquake-card',
|
||||
entryId: 'earthquake-card:ak1',
|
||||
};
|
||||
painted = [foreign, { sourceId: 's2-ghostmaps', entryId: first.id }];
|
||||
click(null);
|
||||
assert.deepEqual(opened, []);
|
||||
assert.equal(cards.at(-1)[0].id, first.id);
|
||||
// A marker under another layer's card is that card's click too.
|
||||
click('ghostmaps:cip:1:0');
|
||||
assert.equal(cards.at(-1)[0].id, first.id, 'a covered marker yields');
|
||||
painted = [];
|
||||
click('ghostmaps:cip:1:0');
|
||||
const second = cards.at(-1)[0];
|
||||
assert.notEqual(second.id, first.id, 'a bare marker selects');
|
||||
painted = [{ sourceId: 's2-ghostmaps', entryId: second.id }];
|
||||
click(null);
|
||||
assert.deepEqual(opened, ['https://example.com/second']);
|
||||
painted = [];
|
||||
click(null);
|
||||
assert.deepEqual(cards.at(-1), [], 'bare map still clears the selection');
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
import { inputFor } from '../../input/dispatcher.js';
|
||||
import { isUnderOtherCard } from '../../data/pickRegistry.js';
|
||||
import { LAYER_ID } from './policy.js';
|
||||
|
||||
export function createSelection({
|
||||
@@ -52,6 +53,9 @@ export function createSelection({
|
||||
const input = inputFor(viewer);
|
||||
layerState.clickSubscription = input.onClick((event) => {
|
||||
if (!layerState.enabled) return;
|
||||
// Another layer's card or label painted on top takes the click: the item
|
||||
// under it does not act, and the click is not empty space either.
|
||||
if (isUnderOtherCard(event)) return;
|
||||
// A site's dot, outline or fill, or a named marker: each draw item
|
||||
// names its installation in its `meta`.
|
||||
const hit = event.drawHit;
|
||||
|
||||
@@ -7,6 +7,7 @@ import { createRendering } from './rendering.js';
|
||||
import { createNamedMarkers, namedPointId } from './namedMarkers.js';
|
||||
import { bindFakeCesiumScene } from '../../testSupport/fakeCesiumScene.mjs';
|
||||
import { fakeInput } from '../../input/testDoubles.mjs';
|
||||
import { setClickCardHitTest } from '../../data/pickRegistry.js';
|
||||
|
||||
function harness(t) {
|
||||
const previousWindow = globalThis.window;
|
||||
@@ -186,6 +187,30 @@ test('a click on a named marker point selects its site; again releases it', (t)
|
||||
h.assertSelected(false);
|
||||
});
|
||||
|
||||
// The card or label painted on top takes the click: a site under another
|
||||
// layer's card neither selects nor releases.
|
||||
test("another layer's card over a site keeps the click", (t) => {
|
||||
const h = harness(t);
|
||||
let top = { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' };
|
||||
setClickCardHitTest(() => top);
|
||||
t.after(() => setClickCardHitTest(null));
|
||||
const setId = h.parts.namedMarkers.setId;
|
||||
const item = h.draw.set(setId).items.get(namedPointId('base'));
|
||||
const pointPick = { id: { set: setId, id: item.id, meta: item.meta } };
|
||||
h.click(pointPick);
|
||||
h.assertSelected(true);
|
||||
h.click(undefined);
|
||||
h.assertSelected(true);
|
||||
h.state.selectedId = null;
|
||||
context.clearSelectedEntityContextForLayer('military-installations');
|
||||
h.parts.rendering.renderRecords();
|
||||
h.click(pointPick);
|
||||
h.assertSelected(false);
|
||||
top = null;
|
||||
h.click(pointPick);
|
||||
h.assertSelected(true);
|
||||
});
|
||||
|
||||
test('a click on a site dot or its outline selects the site; another set does not', (t) => {
|
||||
const h = harness(t);
|
||||
h.state.selectedId = null;
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { createLifecycle } from './lifecycle.js';
|
||||
import { createOverlays } from './overlays.js';
|
||||
import {
|
||||
ROCKET_MISSION_AMBIENT_OVERLAY_SOURCE_ID,
|
||||
ROCKET_MISSION_SELECTED_OVERLAY_SOURCE_ID,
|
||||
} from './policy.js';
|
||||
import { fakeInput } from '../../input/testDoubles.mjs';
|
||||
import * as picking from '../../data/pickRegistry.js';
|
||||
|
||||
/** Any part method is a no-op unless the test supplies it. */
|
||||
const stubs = (given = {}) =>
|
||||
new Proxy(given, {
|
||||
get: (target, key) => (key in target ? target[key] : () => undefined),
|
||||
});
|
||||
|
||||
// A mission label on top takes its click through the overlay handler first;
|
||||
// here an overlay entry under the pointer is another layer's card or label
|
||||
// painted over the mission (a quake label), and that layer takes the click,
|
||||
// so the mission is not also selected.
|
||||
test('a card painted over a launch marker keeps its click; with none the mission selects', () => {
|
||||
const viewer = {
|
||||
scene: {
|
||||
pick: () => null,
|
||||
canvas: { clientWidth: 100, clientHeight: 100 },
|
||||
},
|
||||
};
|
||||
const input = fakeInput(viewer);
|
||||
let top = { sourceId: 'earthquake-card', entryId: 'earthquake-card:ak1' };
|
||||
const selected = [];
|
||||
const state = { _launches: [{ id: 'L1' }], _enabled: false };
|
||||
const { methods: lifecycle } = createLifecycle({
|
||||
state,
|
||||
services: {
|
||||
render: { holdContinuousRender() {}, releaseContinuousRender() {} },
|
||||
// The card on top at a click, as the registry answers from the host.
|
||||
picking: { ...picking, clickCard: () => top },
|
||||
},
|
||||
parts: {
|
||||
panel: stubs(),
|
||||
overlays: stubs(),
|
||||
launchPad: stubs(),
|
||||
orbitRendering: stubs(),
|
||||
replay: stubs(),
|
||||
ingestion: stubs(),
|
||||
rendering: stubs({
|
||||
missionsShown: () => true,
|
||||
missionHitsAt: () => [{ id: 'mission:L1' }],
|
||||
launchIdFromPicks: (hits) =>
|
||||
hits.some((hit) => hit?.id === 'mission:L1') ? 'L1' : null,
|
||||
}),
|
||||
selection: stubs({ setSelectedMission: (id) => selected.push(id) }),
|
||||
},
|
||||
source: {},
|
||||
});
|
||||
try {
|
||||
// init installs the click handler; enable would start a feed load.
|
||||
lifecycle.init(viewer);
|
||||
state._enabled = true;
|
||||
input.click();
|
||||
assert.deepEqual(selected, [], 'the mission stands aside');
|
||||
top = null;
|
||||
input.click();
|
||||
assert.deepEqual(
|
||||
selected,
|
||||
['L1'],
|
||||
'with no card on top, the mission selects',
|
||||
);
|
||||
} finally {
|
||||
state._inputSubscription?.();
|
||||
input.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
// A mission label is an interactive world-overlay entry, so the host's hit
|
||||
// test names it and every other layer reads it as the card on top: a click
|
||||
// on it never acts on what lies under it.
|
||||
test('a mission label is the card on top for every other layer', (t) => {
|
||||
const overlays = createOverlays({
|
||||
state: {},
|
||||
services: {},
|
||||
parts: {},
|
||||
source: {},
|
||||
});
|
||||
const launch = {
|
||||
id: 'L1',
|
||||
name: 'Starlink Group 1',
|
||||
launchTime: '2026-11-01T00:00:00Z',
|
||||
};
|
||||
for (const selected of [false, true]) {
|
||||
const entry = overlays.createRocketMissionMarkerOverlayEntry(
|
||||
launch,
|
||||
{ x: 1, y: 2, z: 3 },
|
||||
selected,
|
||||
);
|
||||
assert.equal(entry.interactive, true, `selected: ${selected}`);
|
||||
}
|
||||
for (const sourceId of [
|
||||
ROCKET_MISSION_AMBIENT_OVERLAY_SOURCE_ID,
|
||||
ROCKET_MISSION_SELECTED_OVERLAY_SOURCE_ID,
|
||||
]) {
|
||||
picking.setClickCardHitTest(() => ({ sourceId, entryId: 'launch:L1' }));
|
||||
t.after(() => picking.setClickCardHitTest(null));
|
||||
const click = { screenPosition: { x: 10, y: 10 } };
|
||||
assert.equal(picking.isUnderOtherCard(click, ['vessels']), true);
|
||||
assert.equal(picking.isUnderOtherCard(click, [sourceId]), false);
|
||||
}
|
||||
});
|
||||
Vendored
+106
-1
@@ -1,4 +1,35 @@
|
||||
import { formatNumber, t } from '../../i18n/index.js';
|
||||
|
||||
export function createControls({ state: layerState, services, parts, source }) {
|
||||
let unsubscribeRowControls = null;
|
||||
|
||||
function cycleMission(step) {
|
||||
const entries = layerState._missionRosterView?.entries;
|
||||
if (!layerState._enabled || !entries?.length) return;
|
||||
const index = entries.findIndex(
|
||||
({ id }) => id === layerState._selectedLaunchId,
|
||||
);
|
||||
const next =
|
||||
index < 0
|
||||
? step > 0
|
||||
? 0
|
||||
: entries.length - 1
|
||||
: (index + step + entries.length) % entries.length;
|
||||
parts.panel.selectMissionAt(entries[next].index);
|
||||
// Stepped from the Data Layers row: the panel opens, as for a globe pick.
|
||||
const id = layerState._selectedLaunchId;
|
||||
for (const listener of [...(layerState._globePickListeners || [])]) {
|
||||
try {
|
||||
listener(id);
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
'[Data:RocketLaunches] mission step listener failed',
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const methods = {
|
||||
id: 'rocket-launches',
|
||||
|
||||
@@ -10,6 +41,67 @@ export function createControls({ state: layerState, services, parts, source }) {
|
||||
|
||||
updateInterval: 300000,
|
||||
|
||||
getRowControls() {
|
||||
const entries = layerState._missionRosterView?.entries;
|
||||
if (!layerState._enabled || !entries?.length) return null;
|
||||
const index = entries.findIndex(
|
||||
({ id }) => id === layerState._selectedLaunchId,
|
||||
);
|
||||
const disabled = entries.length === 1 && index >= 0;
|
||||
return {
|
||||
info:
|
||||
index < 0
|
||||
? t('SELECT A MISSION TO INSPECT')
|
||||
: `${formatNumber(index + 1)} / ${formatNumber(entries.length)} · ${entries[index].label}`,
|
||||
chips: [
|
||||
{
|
||||
id: 'previous-mission',
|
||||
label: t('Previous mission'),
|
||||
icon: 'chevron_left',
|
||||
action: true,
|
||||
disabled,
|
||||
onClick: () => cycleMission(-1),
|
||||
},
|
||||
{
|
||||
id: 'next-mission',
|
||||
label: t('Next mission'),
|
||||
icon: 'chevron_right',
|
||||
action: true,
|
||||
disabled,
|
||||
onClick: () => cycleMission(1),
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
|
||||
setRowControlsListener(listener) {
|
||||
unsubscribeRowControls?.();
|
||||
unsubscribeRowControls = null;
|
||||
if (!listener) return;
|
||||
let previousRoster;
|
||||
let previousSelection;
|
||||
unsubscribeRowControls = parts.panel.subscribePanel(({ roster }) => {
|
||||
// Replay and telemetry can update without changing the roster or pick.
|
||||
const selection = layerState._selectedLaunchId;
|
||||
if (roster === previousRoster && selection === previousSelection)
|
||||
return;
|
||||
previousRoster = roster;
|
||||
previousSelection = selection;
|
||||
listener();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Hear each mission picked on the globe (a marker or its label), after
|
||||
* it is selected. The app reveals the Space Missions panel for it.
|
||||
* @param {(launchId: string) => void} listener
|
||||
* @returns {() => void} Unsubscribe.
|
||||
*/
|
||||
subscribeGlobePick(listener) {
|
||||
layerState._globePickListeners.add(listener);
|
||||
return () => layerState._globePickListeners.delete(listener);
|
||||
},
|
||||
|
||||
/** Release only Space Mission camera ownership, preserving layer and selection state. */
|
||||
releaseCameraOwnership() {
|
||||
// Navigation takes the camera; a failed entry must not restore the old view.
|
||||
@@ -54,19 +146,32 @@ export function createControls({ state: layerState, services, parts, source }) {
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Why a start failed, for the person: the mission index never loaded.
|
||||
* Null when the failure is not the index's (the app then names it).
|
||||
* @returns {?string}
|
||||
*/
|
||||
enableFailureMessage() {
|
||||
return layerState._lastError && layerState._lastUpdate == null
|
||||
? t(
|
||||
'Space Missions unavailable: the mission index could not load. Try again later.',
|
||||
)
|
||||
: null;
|
||||
},
|
||||
|
||||
getStats() {
|
||||
return {
|
||||
count: layerState._count,
|
||||
orbitMatches: layerState._orbitMatches,
|
||||
lastUpdate: layerState._lastUpdate,
|
||||
error: layerState._lastError,
|
||||
errorAt: layerState._lastErrorAt,
|
||||
stale: layerState._stale,
|
||||
};
|
||||
},
|
||||
|
||||
attachDataManager(dataManager) {
|
||||
layerState._dataManager = dataManager;
|
||||
parts.satelliteIntents.connect(dataManager);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { DataLayerManager } from '../../data/manager.js';
|
||||
import { ContextControls } from '../../ui/contextControls.js';
|
||||
import { spaceMissionsIndexFailure } from '../../ui/contextActions.js';
|
||||
import { createLaunchSource } from './source.js';
|
||||
import { createState } from './state.js';
|
||||
import { createModel } from './model.js';
|
||||
import { createPolicyHelpers } from './policyHelpers.js';
|
||||
import { createIngestion } from './ingestion.js';
|
||||
import { createSatelliteIntents } from './satelliteIntents.js';
|
||||
import { createPanel } from './panel.js';
|
||||
import { createControls } from './controls.js';
|
||||
import { createLifecycle } from './lifecycle.js';
|
||||
@@ -98,7 +98,7 @@ function fakeCamera() {
|
||||
return camera;
|
||||
}
|
||||
|
||||
async function fixture(t) {
|
||||
async function fixture(t, { beforeConnect } = {}) {
|
||||
const upstream = { status: 429, results: [launchRecord] };
|
||||
const source = createLaunchSource({
|
||||
async fetchImpl(url) {
|
||||
@@ -191,6 +191,7 @@ async function fixture(t) {
|
||||
parts.panel = createPanel(context);
|
||||
parts.replay = createReplay(context);
|
||||
parts.ingestion = createIngestion(context);
|
||||
parts.satelliteIntents = createSatelliteIntents(context);
|
||||
parts.controls = createControls(context);
|
||||
parts.lifecycle = createLifecycle(context);
|
||||
const missions = Object.assign(
|
||||
@@ -206,6 +207,7 @@ async function fixture(t) {
|
||||
manager.register(plainLayer('earthquakes', 'Earthquakes (24h)'));
|
||||
manager.register(plainLayer('satellites', 'Satellites'));
|
||||
manager.register(plainLayer('wind', 'Wind'));
|
||||
manager.register(plainLayer('military-awareness', 'Global Context'));
|
||||
manager.register(missions);
|
||||
missions.attachDataManager(manager);
|
||||
|
||||
@@ -224,12 +226,19 @@ async function fixture(t) {
|
||||
setPanelCollapsed: noop,
|
||||
},
|
||||
});
|
||||
beforeConnect?.(manager);
|
||||
controls.connect(manager);
|
||||
|
||||
t.after(async () => {
|
||||
controls.stop();
|
||||
controls.disconnect();
|
||||
for (const id of ['rocket-launches', 'satellites', 'earthquakes', 'wind'])
|
||||
for (const id of [
|
||||
'rocket-launches',
|
||||
'satellites',
|
||||
'earthquakes',
|
||||
'wind',
|
||||
'military-awareness',
|
||||
])
|
||||
await manager.setEnabled(id, false);
|
||||
await missions.destroy(viewer);
|
||||
});
|
||||
@@ -257,46 +266,37 @@ async function fixture(t) {
|
||||
state,
|
||||
camera,
|
||||
rosters,
|
||||
panel: parts.panel,
|
||||
enabledIds,
|
||||
view,
|
||||
settle,
|
||||
};
|
||||
}
|
||||
|
||||
const entries = {
|
||||
direct: (f) =>
|
||||
f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
'Context-panel': async (f) =>
|
||||
(
|
||||
await f.controls.setContextMode('space-missions', {
|
||||
claimVisualAuthority: false,
|
||||
})
|
||||
).ok,
|
||||
};
|
||||
test('a Space Missions start that gets HTTP 429 rolls back and leaves other layers alone', async (t) => {
|
||||
const f = await fixture(t);
|
||||
await f.manager.setEnabled('earthquakes', true, { origin: 'user' });
|
||||
const before = f.view();
|
||||
|
||||
for (const [path, enter] of Object.entries(entries))
|
||||
test(`a ${path} Space Missions entry that gets HTTP 429 rolls back instead of isolating`, async (t) => {
|
||||
const f = await fixture(t);
|
||||
await f.manager.setEnabled('earthquakes', true, { origin: 'user' });
|
||||
const before = f.view();
|
||||
|
||||
const entered = await enter(f);
|
||||
await f.settle();
|
||||
|
||||
assert.equal(entered, false, 'a failed mission index fails the enable');
|
||||
assert.deepEqual(f.enabledIds(), ['earthquakes']);
|
||||
assert.equal(f.controls.getContextModeState().mode, null);
|
||||
assert.equal(f.controls.getContextModeState().active, false);
|
||||
assert.equal(f.missions.getStats().error, 'HTTP 429');
|
||||
assert.deepEqual(f.view(), before, 'the pre-entry view comes back');
|
||||
assert.ok(f.camera.cancelled > 0, 'the full-globe flight is cancelled');
|
||||
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('wind', true, { origin: 'user' }),
|
||||
true,
|
||||
'an unrelated layer is not blocked after the failed entry',
|
||||
);
|
||||
const entered = await f.manager.setEnabled('rocket-launches', true, {
|
||||
origin: 'user',
|
||||
});
|
||||
await f.settle();
|
||||
|
||||
assert.equal(entered, false, 'a failed mission index fails the enable');
|
||||
assert.deepEqual(f.enabledIds(), ['earthquakes']);
|
||||
assert.equal(f.controls.getContextModeState().mode, null);
|
||||
assert.equal(f.controls.getContextModeState().active, false);
|
||||
assert.equal(f.missions.getStats().error, 'HTTP 429');
|
||||
assert.deepEqual(f.view(), before, 'the pre-entry view comes back');
|
||||
assert.ok(f.camera.cancelled > 0, 'the full-globe flight is cancelled');
|
||||
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('wind', true, { origin: 'user' }),
|
||||
true,
|
||||
'an unrelated layer is not blocked after the failed entry',
|
||||
);
|
||||
});
|
||||
|
||||
// Holds the /api/launches reply until the returned release is called.
|
||||
function holdReply(f) {
|
||||
@@ -410,7 +410,12 @@ test('the roster reports a failed mission index instead of loading forever', asy
|
||||
await f.settle();
|
||||
assert.equal(f.rosters.slice(loadingFrom).includes(null), true);
|
||||
assert.equal(f.rosters.at(-1).entries.length, 1);
|
||||
assert.equal(f.controls.getContextModeState().mode, 'space-missions');
|
||||
assert.equal(f.manager.isEnabled('rocket-launches'), true);
|
||||
assert.equal(
|
||||
f.controls.getContextModeState().mode,
|
||||
null,
|
||||
'not a Context mode',
|
||||
);
|
||||
});
|
||||
|
||||
test('a valid empty mission index is a successful entry', async (t) => {
|
||||
@@ -422,7 +427,7 @@ test('a valid empty mission index is a successful entry', async (t) => {
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
assert.equal(f.controls.getContextModeState().mode, 'space-missions');
|
||||
assert.equal(f.manager.isEnabled('rocket-launches'), true);
|
||||
assert.equal(
|
||||
f.rosters.at(-1).empty,
|
||||
'NO MISSIONS AVAILABLE IN THE CURRENT 30-DAY WINDOW',
|
||||
@@ -430,7 +435,383 @@ test('a valid empty mission index is a successful entry', async (t) => {
|
||||
assert.ok(f.camera.flights > 0, 'a successful entry frames the globe');
|
||||
});
|
||||
|
||||
test('a refresh failure after a loaded index keeps the mode and its records', async (t) => {
|
||||
for (const phase of ['while starting', 'after start']) {
|
||||
test(`Space Missions runs beside Contacts and a later Satellites OFF ends it (${phase})`, async (t) => {
|
||||
const gate = Promise.withResolvers();
|
||||
const guardReached = Promise.withResolvers();
|
||||
const f = await fixture(t, {
|
||||
beforeConnect(manager) {
|
||||
if (phase !== 'while starting') return;
|
||||
manager.addVisibilityGuard(async ({ layerId, enabled }) => {
|
||||
if (layerId !== 'rocket-launches' || !enabled) return;
|
||||
guardReached.resolve();
|
||||
await gate.promise;
|
||||
});
|
||||
},
|
||||
});
|
||||
f.upstream.status = 200;
|
||||
await f.manager.setEnabled('satellites', true, { origin: 'user' });
|
||||
assert.equal(await f.controls._selectContextMode('flights'), true);
|
||||
await f.settle();
|
||||
assert.deepEqual(
|
||||
f.enabledIds(),
|
||||
['military-awareness', 'satellites'],
|
||||
'Contacts leaves Satellites alone',
|
||||
);
|
||||
|
||||
const launch = f.manager.setEnabled('rocket-launches', true, {
|
||||
origin: 'user',
|
||||
});
|
||||
try {
|
||||
if (phase === 'while starting') {
|
||||
await guardReached.promise;
|
||||
} else {
|
||||
assert.equal(await launch, true);
|
||||
assert.deepEqual(f.enabledIds(), [
|
||||
'military-awareness',
|
||||
'rocket-launches',
|
||||
'satellites',
|
||||
]);
|
||||
}
|
||||
assert.equal(
|
||||
f.controls.getContextModeState().mode,
|
||||
'flights',
|
||||
'starting Space Missions leaves Contacts on',
|
||||
);
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('satellites', false, { origin: 'voice' }),
|
||||
true,
|
||||
);
|
||||
} finally {
|
||||
gate.resolve();
|
||||
}
|
||||
assert.equal(await launch, phase === 'after start');
|
||||
await f.missions.waitForSatelliteIntents?.();
|
||||
await f.settle();
|
||||
assert.deepEqual(f.enabledIds(), ['military-awareness']);
|
||||
assert.equal(f.controls.getContextModeState().mode, 'flights');
|
||||
});
|
||||
}
|
||||
|
||||
test('Contacts started and ended while Space Missions runs leaves it and Satellites alone', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
const missionParams = f.manager.getLayerParams('satellites');
|
||||
assert.equal(missionParams.showPoints, false, 'the mission display applied');
|
||||
|
||||
assert.equal(await f.controls._selectContextMode('flights'), true);
|
||||
await f.settle();
|
||||
assert.deepEqual(f.enabledIds(), [
|
||||
'military-awareness',
|
||||
'rocket-launches',
|
||||
'satellites',
|
||||
]);
|
||||
assert.equal(await f.controls._selectContextMode(null), true);
|
||||
await f.settle();
|
||||
assert.deepEqual(f.enabledIds(), ['rocket-launches', 'satellites']);
|
||||
assert.deepEqual(f.manager.getLayerParams('satellites'), missionParams);
|
||||
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.deepEqual(f.enabledIds(), []);
|
||||
const after = f.manager.getLayerParams('satellites');
|
||||
assert.notEqual(after.showPoints, false, 'Satellites shows its points again');
|
||||
assert.notEqual(after.showOrbits, false, 'and its orbits');
|
||||
});
|
||||
|
||||
test('a Satellites OFF requested before Space Missions entry does not cancel it', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
await f.manager.setEnabled('satellites', true, { origin: 'user' });
|
||||
const satellites = f.manager.layers.get('satellites').module;
|
||||
const disable = satellites.disable;
|
||||
const gate = Promise.withResolvers();
|
||||
const disabling = Promise.withResolvers();
|
||||
satellites.disable = async () => {
|
||||
disabling.resolve();
|
||||
await gate.promise;
|
||||
};
|
||||
let entry;
|
||||
try {
|
||||
const off = f.manager.setEnabled('satellites', false, { origin: 'user' });
|
||||
await disabling.promise;
|
||||
// The entry is requested while the earlier OFF is still settling.
|
||||
entry = f.manager.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
gate.resolve();
|
||||
assert.equal(await off, true);
|
||||
} finally {
|
||||
gate.resolve();
|
||||
satellites.disable = disable;
|
||||
}
|
||||
assert.equal(await entry, true, 'the later entry is not cancelled');
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('rocket-launches'), true);
|
||||
|
||||
// Leaving keeps the earlier Satellites OFF.
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('satellites'), false);
|
||||
assert.equal(f.manager.isEnabled('rocket-launches'), false);
|
||||
});
|
||||
|
||||
test('Space Missions is an ordinary layer: it neither isolates nor opens a Context session', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
await f.manager.setEnabled('earthquakes', true, { origin: 'user' });
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
assert.deepEqual(f.enabledIds(), [
|
||||
'earthquakes',
|
||||
'rocket-launches',
|
||||
'satellites',
|
||||
]);
|
||||
assert.equal(f.controls._contextSessionSnapshot, null);
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('wind', true, { origin: 'user' }),
|
||||
true,
|
||||
'other layers are not refused while Space Missions is on',
|
||||
);
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.deepEqual(
|
||||
f.enabledIds(),
|
||||
['earthquakes', 'wind'],
|
||||
'Space Missions gives back only the Satellites it turned on',
|
||||
);
|
||||
});
|
||||
|
||||
test('a Satellites enable that never settles still lets mission disable complete', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
f.state.satelliteSettleTimeoutMs = 50;
|
||||
const satellites = f.manager.layers.get('satellites').module;
|
||||
const enable = satellites.enable;
|
||||
const stuck = Promise.withResolvers();
|
||||
satellites.enable = () => stuck.promise;
|
||||
try {
|
||||
// A programmatic Satellites restart whose enable hangs.
|
||||
await f.manager.setEnabled('satellites', false);
|
||||
void f.manager.setEnabled('satellites', true);
|
||||
const exit = f.manager.setEnabled('rocket-launches', false, {
|
||||
origin: 'user',
|
||||
});
|
||||
const outcome = await Promise.race([
|
||||
exit.then(() => 'settled'),
|
||||
new Promise((resolve) => setTimeout(() => resolve('hung'), 2000)),
|
||||
]);
|
||||
assert.equal(
|
||||
outcome,
|
||||
'settled',
|
||||
'the mission disable does not wait forever',
|
||||
);
|
||||
assert.equal(f.missions.getAnalystRecords().length, 0);
|
||||
} finally {
|
||||
satellites.enable = enable;
|
||||
stuck.resolve();
|
||||
}
|
||||
await f.settle();
|
||||
// The saved Satellites state was kept: turning Space Missions off again
|
||||
// once Satellites settles gives back the Satellites it turned on.
|
||||
assert.equal(f.manager.isEnabled('satellites'), true);
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('rocket-launches'), false);
|
||||
assert.equal(f.manager.isEnabled('satellites'), false);
|
||||
});
|
||||
|
||||
test('Space Missions turned on again after a busy restore switches Satellites on', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
f.state.satelliteSettleTimeoutMs = 50;
|
||||
const satellites = f.manager.layers.get('satellites').module;
|
||||
const enable = satellites.enable;
|
||||
const stuck = Promise.withResolvers();
|
||||
satellites.enable = () => stuck.promise;
|
||||
try {
|
||||
await f.manager.setEnabled('satellites', false);
|
||||
void f.manager.setEnabled('satellites', true);
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
} finally {
|
||||
satellites.enable = enable;
|
||||
stuck.resolve();
|
||||
}
|
||||
await f.settle();
|
||||
// Something else switches Satellites off, then Space Missions comes back.
|
||||
await f.manager.setEnabled('satellites', false);
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('satellites'), false);
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('satellites'), true);
|
||||
// Its own off still gives back the Satellites from before the first start.
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('satellites'), false);
|
||||
});
|
||||
|
||||
test('a Satellites switch made between missions is what the next mission gives back', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
f.state.satelliteSettleTimeoutMs = 50;
|
||||
const satellites = f.manager.layers.get('satellites').module;
|
||||
const enable = satellites.enable;
|
||||
const stuck = Promise.withResolvers();
|
||||
satellites.enable = () => stuck.promise;
|
||||
try {
|
||||
await f.manager.setEnabled('satellites', false);
|
||||
void f.manager.setEnabled('satellites', true);
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
} finally {
|
||||
satellites.enable = enable;
|
||||
stuck.resolve();
|
||||
}
|
||||
await f.settle();
|
||||
// The person switches Satellites on, then something else switches it off.
|
||||
await f.manager.setEnabled('satellites', true, { origin: 'user' });
|
||||
await f.settle();
|
||||
await f.manager.setEnabled('satellites', false);
|
||||
await f.settle();
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('satellites'), true);
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('satellites'), false);
|
||||
});
|
||||
|
||||
test('a Satellites setting changed between missions survives the next one', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
f.state.satelliteSettleTimeoutMs = 50;
|
||||
const satellites = f.manager.layers.get('satellites').module;
|
||||
const enable = satellites.enable;
|
||||
const stuck = Promise.withResolvers();
|
||||
satellites.enable = () => stuck.promise;
|
||||
try {
|
||||
await f.manager.setEnabled('satellites', false);
|
||||
void f.manager.setEnabled('satellites', true);
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
} finally {
|
||||
satellites.enable = enable;
|
||||
stuck.resolve();
|
||||
}
|
||||
await f.settle();
|
||||
f.manager.setLayerParams(
|
||||
'satellites',
|
||||
{ showOrbits: false },
|
||||
{ origin: 'user' },
|
||||
);
|
||||
await f.settle();
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
await f.settle();
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.equal(f.manager.getLayerParams('satellites').showOrbits, false);
|
||||
});
|
||||
|
||||
test('tracking stopped by a place search during a mission stays stopped after it', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
f.manager.setLayerParams(
|
||||
'satellites',
|
||||
{ selectedSatTrackingId: 25544 },
|
||||
{ origin: 'voice' },
|
||||
);
|
||||
await f.settle();
|
||||
// A place search stops tracking with the tool origin.
|
||||
f.manager.setLayerParams(
|
||||
'satellites',
|
||||
{ selectedSatTrackingId: null },
|
||||
{ origin: 'tool' },
|
||||
);
|
||||
await f.settle();
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.equal(
|
||||
f.manager.getLayerParams('satellites').selectedSatTrackingId ?? null,
|
||||
null,
|
||||
);
|
||||
});
|
||||
|
||||
test('a failed Satellites restore still clears the selected mission panel', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' }),
|
||||
true,
|
||||
);
|
||||
await f.settle();
|
||||
assert.equal(f.manager.isEnabled('satellites'), true);
|
||||
|
||||
let panelView;
|
||||
const unsubscribe = f.panel.subscribePanel((view) => {
|
||||
panelView = view;
|
||||
});
|
||||
const satellites = f.manager.layers.get('satellites').module;
|
||||
const disable = satellites.disable;
|
||||
try {
|
||||
f.state._selectedLaunchId = f.state._launches[0].id;
|
||||
f.panel.renderMissionPanel();
|
||||
assert.ok(panelView.mission);
|
||||
|
||||
satellites.disable = () => {
|
||||
throw new Error('injected Satellites restore failure');
|
||||
};
|
||||
assert.equal(
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' }),
|
||||
false,
|
||||
);
|
||||
const { enabled, uncertain } =
|
||||
f.manager.getLayerLifecycleState('rocket-launches');
|
||||
assert.equal(enabled, true);
|
||||
assert.equal(uncertain, true);
|
||||
assert.equal(panelView.mission, null);
|
||||
} finally {
|
||||
satellites.disable = disable;
|
||||
unsubscribe();
|
||||
}
|
||||
});
|
||||
|
||||
test('a refresh failure after a loaded index keeps the layer and its records', async (t) => {
|
||||
const f = await fixture(t);
|
||||
f.upstream.status = 200;
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
@@ -442,12 +823,11 @@ test('a refresh failure after a loaded index keeps the mode and its records', as
|
||||
await f.settle();
|
||||
|
||||
assert.equal(f.manager.isEnabled('rocket-launches'), true);
|
||||
assert.equal(f.controls.getContextModeState().mode, 'space-missions');
|
||||
assert.equal(f.missions.getStats().count, 1);
|
||||
assert.equal(f.missions.getStats().error, 'HTTP 429');
|
||||
assert.equal(f.rosters.at(-1).entries.length, 1);
|
||||
|
||||
// Leaving a loaded mode does not restore the pre-entry view.
|
||||
// Leaving after a loaded index does not restore the pre-entry view.
|
||||
await f.manager.setEnabled('rocket-launches', false, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.deepEqual(f.view(), framed);
|
||||
@@ -475,11 +855,9 @@ test('a failed first load tells the user the mission index is unavailable', asyn
|
||||
const f = await fixture(t);
|
||||
await f.manager.setEnabled('earthquakes', true, { origin: 'user' });
|
||||
|
||||
await f.controls.setContextMode('space-missions', {
|
||||
claimVisualAuthority: false,
|
||||
});
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.equal(f.controls.getContextModeState().mode, null, 'rolled back');
|
||||
assert.equal(f.manager.isEnabled('rocket-launches'), false, 'rolled back');
|
||||
assert.ok(
|
||||
f.toasts.some((message) => /mission index/i.test(message)),
|
||||
`visible feedback names the failure, got ${JSON.stringify(f.toasts)}`,
|
||||
@@ -504,10 +882,17 @@ test('navigation taking the camera keeps a mission flight it asked to preserve',
|
||||
assert.equal(f.camera.flight, other);
|
||||
});
|
||||
|
||||
test("an earlier attempt's index error is not blamed for a later failure", async (t) => {
|
||||
test('a refresh error after a loaded index is not blamed on the index', async (t) => {
|
||||
const f = await fixture(t);
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
await f.settle();
|
||||
assert.match(spaceMissionsIndexFailure(f.manager), /mission index/);
|
||||
assert.equal(spaceMissionsIndexFailure(f.manager, Date.now() + 1), null);
|
||||
assert.match(f.missions.enableFailureMessage(), /mission index/);
|
||||
|
||||
f.upstream.status = 200;
|
||||
await f.manager.setEnabled('rocket-launches', true, { origin: 'user' });
|
||||
await f.settle();
|
||||
f.upstream.status = 429;
|
||||
await f.missions.update();
|
||||
assert.equal(f.missions.getStats().error, 'HTTP 429');
|
||||
assert.equal(f.missions.enableFailureMessage(), null);
|
||||
});
|
||||
Loaded 100 of 445 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user