mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Merge main into fix/earthquake-click-details
Resolves conflicts with main: a world focus target's own range past its framed radius replaces the kind's range (#1832), so a quake asks for its own range only past M6 and the earthquake framing stays its floor; FIRMS keeps main's marker stand-in under the card-on-top rule; launches keep main's label click and also read the card on top through the pick registry.
This commit is contained in:
commit
e87aa5190d
1337 files changed
+38638
-9950
No files matched your search
@@ -211,6 +211,7 @@ const schemas = [
|
||||
'utilities-panel',
|
||||
'pp-toggles',
|
||||
'global-context-panel',
|
||||
'space-missions-panel',
|
||||
'weather-panel',
|
||||
'recent-imagery-panel',
|
||||
'voice-settings',
|
||||
|
||||
@@ -60,7 +60,10 @@ test('the complete Realtime tool payload pins the manifest-generated layer relea
|
||||
// absolute with its -45 default, with steps sent as a direction.
|
||||
// show_street_level (map, source, photo) adds one tool.
|
||||
// open_stories adds the Stories Explore entry action.
|
||||
'5a2deb65bef5db8fa49ee55dd66efb884e7c3ba97dbdcaad3fada087170d2225',
|
||||
// The Cyber HUD layout leaves set_hud's layout enum (its sonar is a
|
||||
// visual style; set_cyber_sonar is excluded above).
|
||||
// The Space Missions panel adds one panel target.
|
||||
'09abe70ef3a1fc4320e25cff997dd3b04db7e78ff31b8530e17bbbbb8156b4c6',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -193,6 +196,7 @@ test('all legacy action arguments are byte-identical after removing the delibera
|
||||
'voice-preview',
|
||||
'provider-settings',
|
||||
'utilities-panel',
|
||||
'space-missions-panel',
|
||||
].includes(id),
|
||||
);
|
||||
for (const tool of legacy) {
|
||||
@@ -227,9 +231,9 @@ test('all legacy action arguments are byte-identical after removing the delibera
|
||||
delete center.properties[axis].minimum;
|
||||
delete center.properties[axis].maximum;
|
||||
}
|
||||
// Cyber adds one HUD layout and Operator was retired.
|
||||
// Operator and then Cyber were retired.
|
||||
const hud = property('set_hud').layout;
|
||||
assert.deepEqual(hud.enum, ['tactical', 'minimal', 'cyber']);
|
||||
assert.deepEqual(hud.enum, ['tactical', 'minimal']);
|
||||
hud.enum = ['tactical', 'operator', 'minimal'];
|
||||
// Snow is retired from set_visual_style; restore it to keep the legacy pin.
|
||||
const visualStyle = legacy.find((tool) => tool.name === 'set_visual_style')
|
||||
@@ -340,3 +344,17 @@ test('tilt accepts an angle with no direction', () => {
|
||||
validateArgs(schema, { motion: 'tilt', pitchDeg: 'steep' }).length > 0,
|
||||
);
|
||||
});
|
||||
|
||||
test('set_panel_open accepts the Space Missions panel', () => {
|
||||
const schema = GEV_ACTION_SCHEMAS.find(
|
||||
(tool) => tool.name === 'set_panel_open',
|
||||
).parameters;
|
||||
assert.deepEqual(
|
||||
validateArgs(schema, { panelId: 'space-missions-panel', open: true }),
|
||||
[],
|
||||
);
|
||||
assert.ok(
|
||||
validateArgs(schema, { panelId: 'space-missions', open: true }).length > 0,
|
||||
'the Context mode name is not a panel id',
|
||||
);
|
||||
});
|
||||
@@ -74,6 +74,14 @@ const transitCoverage = [
|
||||
'transit: No feed here yet · 12 regions available',
|
||||
];
|
||||
|
||||
// Mapped Installations' statusMessage (data/installationFeedback.js).
|
||||
const installationNotes = [
|
||||
'military-installations: No mapped sites in view',
|
||||
'military-installations: No mapped sites within 25 km of the contact',
|
||||
'military-installations: Overpass timed out — retrying in 30s',
|
||||
'military-installations: Zoom in to search mapped installations',
|
||||
];
|
||||
|
||||
for (const locale of ['es', 'ru']) {
|
||||
for (const [layerKey, caveat] of cases) {
|
||||
test(`${locale}: analyst note "${caveat}" is translated`, () => {
|
||||
@@ -85,6 +93,19 @@ for (const locale of ['es', 'ru']) {
|
||||
});
|
||||
}
|
||||
|
||||
test(`${locale}: Mapped Installations' empty note is translated on the analyst card`, () => {
|
||||
inLocale(locale, () => {
|
||||
for (const caveat of installationNotes) {
|
||||
const notes = notesFor('military-installations', caveat);
|
||||
assert.ok(notes.length > 0, 'the note is shown');
|
||||
assert.doesNotMatch(
|
||||
notes.join(' | '),
|
||||
/mapped sites|retrying|Overpass timed out|Zoom in/,
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test(`${locale}: Transit's empty note is translated on the analyst card`, () => {
|
||||
inLocale(locale, () => {
|
||||
for (const caveat of transitCoverage) {
|
||||
|
||||
+109
-3
@@ -6,7 +6,11 @@ import {
|
||||
feedProvenanceEnvelope,
|
||||
} from '../data/layerSnapshot.js';
|
||||
import { readLayerLifecycleSummary } from './layerSummary.js';
|
||||
import { SPEECH_BUILDERS, attachVoiceResult } from './speech.js';
|
||||
import {
|
||||
SPEECH_BUILDERS,
|
||||
VIEW_CENTRE_LABEL,
|
||||
attachVoiceResult,
|
||||
} from './speech.js';
|
||||
import { resolveDeicticArgs } from './deixis.js';
|
||||
import { isStoriesOpen } from './realtimeInputPolicy.js';
|
||||
export { readLayerLifecycleSummary } from './layerSummary.js';
|
||||
@@ -134,6 +138,9 @@ const PANEL_ALIASES = new Map([
|
||||
['global context', 'global-context-panel'],
|
||||
['right context', 'global-context-panel'],
|
||||
['context right panel', 'global-context-panel'],
|
||||
['space missions panel', 'space-missions-panel'],
|
||||
['missions panel', 'space-missions-panel'],
|
||||
['mission panel', 'space-missions-panel'],
|
||||
['utilities', 'utilities-panel'],
|
||||
['utilities panel', 'utilities-panel'],
|
||||
['draw', 'utilities-panel'],
|
||||
@@ -163,6 +170,7 @@ const PANEL_IDS = new Set([
|
||||
'cctv-panel',
|
||||
'radio-panel',
|
||||
'global-context-panel',
|
||||
'space-missions-panel',
|
||||
'utilities-panel',
|
||||
'scene-panel',
|
||||
'pp-toggles',
|
||||
@@ -603,6 +611,12 @@ export function createGevActionRunner({
|
||||
changeOptions,
|
||||
);
|
||||
}
|
||||
if (layerId === 'satellites') {
|
||||
// A Satellites OFF can end Space Missions, which needs it.
|
||||
await dataManager.layers
|
||||
.get('rocket-launches')
|
||||
?.module?.waitForSatelliteIntents?.();
|
||||
}
|
||||
if (layerId === 'rocket-launches' || layerId === 'satellites') {
|
||||
await styleManager?._waitForContextLayerSettlement?.();
|
||||
}
|
||||
@@ -977,6 +991,47 @@ export function createGevActionRunner({
|
||||
...(!applied ? { error: say } : {}),
|
||||
};
|
||||
}
|
||||
// The Space Missions panel exists only while its layer is on; opening it
|
||||
// otherwise would fold the other right-rail panels for nothing.
|
||||
if (
|
||||
open &&
|
||||
panelId === 'space-missions-panel' &&
|
||||
!dataManager?.isEnabled?.('rocket-launches')
|
||||
) {
|
||||
const say = dataManager?.isEffectivelyEnabled?.('rocket-launches')
|
||||
? 'Space Missions is still starting; its panel opens when it is on.'
|
||||
: 'The Space Missions panel shows while Space Missions is on. Turn on Space Missions first.';
|
||||
return {
|
||||
ok: false,
|
||||
action: 'set_panel_open',
|
||||
panelId,
|
||||
open,
|
||||
applied: false,
|
||||
unavailable: true,
|
||||
say,
|
||||
error: say,
|
||||
};
|
||||
}
|
||||
// The Cockpit owns the screen and hides the right rail: the panel is
|
||||
// not opened (or its preference written) under it.
|
||||
if (
|
||||
open &&
|
||||
panelId === 'space-missions-panel' &&
|
||||
styleManager?.getCockpitState?.()?.active
|
||||
) {
|
||||
const say =
|
||||
'The Space Missions panel opens once you leave the cockpit.';
|
||||
return {
|
||||
ok: false,
|
||||
action: 'set_panel_open',
|
||||
panelId,
|
||||
open,
|
||||
applied: false,
|
||||
unavailable: true,
|
||||
say,
|
||||
error: say,
|
||||
};
|
||||
}
|
||||
if (!setPanelOpen(styleManager, panelId, open)) {
|
||||
const say = 'There is no panel to open here.';
|
||||
return {
|
||||
@@ -988,6 +1043,9 @@ export function createGevActionRunner({
|
||||
error: say,
|
||||
};
|
||||
}
|
||||
// A phone shows the right rail only as tab sheets: show this one's.
|
||||
if (open && panelId === 'space-missions-panel')
|
||||
styleManager?.revealPanel?.(panelId);
|
||||
return { ok: true, action: 'set_panel_open', panelId, open };
|
||||
}
|
||||
|
||||
@@ -1026,6 +1084,54 @@ export function createGevActionRunner({
|
||||
...cancellationState(),
|
||||
};
|
||||
}
|
||||
if (mode === 'space-missions') {
|
||||
// Space Missions is an ordinary layer with its own panel, not a
|
||||
// Context mode; older phrasings still reach it through this alias.
|
||||
const result = await runGevAction(
|
||||
'set_layer_visibility',
|
||||
{ layerId: 'rocket-launches', enabled: true },
|
||||
runOptions,
|
||||
);
|
||||
// Open the panel even when the layer was already on, but never under
|
||||
// the Cockpit, which owns the screen (as the layer's own reveal).
|
||||
if (
|
||||
result?.ok === true &&
|
||||
current() &&
|
||||
!styleManager?.getCockpitState?.()?.active
|
||||
) {
|
||||
setPanelOpen(styleManager, 'space-missions-panel', true);
|
||||
styleManager?.revealPanel?.('space-missions-panel');
|
||||
}
|
||||
return {
|
||||
...result,
|
||||
action: 'set_context_mode',
|
||||
mode: 'space-missions',
|
||||
};
|
||||
}
|
||||
const contextState = styleManager.getContextModeState?.() || {};
|
||||
if (
|
||||
mode === 'off' &&
|
||||
!contextState.mode &&
|
||||
!contextState.changing &&
|
||||
!contextState.entering &&
|
||||
!dataManager.isEffectivelyEnabled?.('military-awareness') &&
|
||||
(dataManager.isEffectivelyEnabled?.('rocket-launches') ??
|
||||
dataManager.isEnabled?.('rocket-launches'))
|
||||
) {
|
||||
// "Exit Space Missions" still arrives as context off. With no Context
|
||||
// mode on, entering or starting (Contacts), Space Missions, on or
|
||||
// still starting, is what is being left: switch its layer off.
|
||||
const result = await runGevAction(
|
||||
'set_layer_visibility',
|
||||
{ layerId: 'rocket-launches', enabled: false },
|
||||
runOptions,
|
||||
);
|
||||
return {
|
||||
...result,
|
||||
action: 'set_context_mode',
|
||||
mode: 'off',
|
||||
};
|
||||
}
|
||||
if (mode && mode !== 'off') {
|
||||
setPanelOpen(styleManager, 'global-context-panel', true);
|
||||
}
|
||||
@@ -1600,7 +1706,7 @@ export function createGevActionRunner({
|
||||
return {
|
||||
ok: false,
|
||||
action: 'set_cyber_sonar',
|
||||
error: 'Cyber sonar controls are unavailable.',
|
||||
error: 'Sonar controls are unavailable.',
|
||||
};
|
||||
}
|
||||
return { action: 'set_cyber_sonar', ...styleManager.setCyberSonar(args) };
|
||||
@@ -4015,7 +4121,7 @@ async function requestStreetLevel(
|
||||
query ||
|
||||
(entity ? String(entity.label || entity.id) : '') ||
|
||||
(hasCoordinates ? `${latitude.toFixed(4)}, ${longitude.toFixed(4)}` : '') ||
|
||||
'the view centre';
|
||||
VIEW_CENTRE_LABEL;
|
||||
atViewCentre = !query && !hasCoordinates && !entity;
|
||||
let point = null;
|
||||
let location = null;
|
||||
|
||||
+1438
-307
File diff suppressed because it is too large.
Load diff
+28
-12
@@ -1066,7 +1066,7 @@ const STEP_TITLES = Object.freeze({
|
||||
control_cockpit: msg('Control cockpit'),
|
||||
set_visual_style: msg('Change visual style'),
|
||||
set_hud: msg('Adjust HUD'),
|
||||
set_cyber_sonar: msg('Adjust cyber sonar'),
|
||||
set_cyber_sonar: msg('Adjust sonar'),
|
||||
set_detection: msg('Adjust detection overlay'),
|
||||
set_map_stack: msg('Change map stack'),
|
||||
set_post_processing: msg('Adjust post-processing'),
|
||||
@@ -1113,14 +1113,26 @@ export function planStepLabel(name, args = {}) {
|
||||
}
|
||||
case 'show_street_level': {
|
||||
const source = STREET_LEVEL_SOURCE_NAMES[args.provider];
|
||||
const place = args.query
|
||||
? shownPlace(args.query, 32)
|
||||
: args.latitude != null
|
||||
? t('this spot')
|
||||
: t('the view centre');
|
||||
const query = String(args.query || '').trim();
|
||||
// A pointed or numbered thing is found later (deixis): no place yet.
|
||||
if (query.toLowerCase() === 'pointer' || args.referent != null)
|
||||
return source || t('Street Level');
|
||||
// "This spot" and "the view centre" are phrases, not place names:
|
||||
// each is a message of its own, worded in the grammar of the language.
|
||||
if (query) {
|
||||
const place = shownPlace(query, 32);
|
||||
return source
|
||||
? t('{source} at {place}', { source, place })
|
||||
: t('Street level at {place}', { place });
|
||||
}
|
||||
// Coordinates count only as a pair, as show_street_level reads them.
|
||||
if (args.latitude != null && args.longitude != null)
|
||||
return source
|
||||
? t('{source} at this spot', { source })
|
||||
: t('Street level at this spot');
|
||||
return source
|
||||
? t('{source} at {place}', { source, place })
|
||||
: t('Street level at {place}', { place });
|
||||
? t('{source} at the view centre', { source })
|
||||
: t('Street level at the view centre');
|
||||
}
|
||||
case 'set_layer_visibility': {
|
||||
const on = args.enabled !== false;
|
||||
@@ -1196,6 +1208,9 @@ export function narrationLabel(name, args = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
/** The place show_street_level reports when it names none. */
|
||||
export const VIEW_CENTRE_LABEL = 'the view centre';
|
||||
|
||||
/** On-screen labels for progress steps. */
|
||||
const STEP_LABELS = Object.freeze({
|
||||
resolve: msg('Finding places'),
|
||||
@@ -1220,10 +1235,11 @@ export function progressStepLabel(step, label) {
|
||||
: step
|
||||
? spokenLabel(step, 24)
|
||||
: t('Working');
|
||||
// The join is a catalog string so each language spaces its colon.
|
||||
return label
|
||||
? t('{name}: {state}', { name: base, state: spokenLabel(label, 32) })
|
||||
: base;
|
||||
// The join is a catalog string so each language spaces its colon. The
|
||||
// view centre is a phrase show_street_level reports in English, not a name.
|
||||
const state =
|
||||
label === VIEW_CENTRE_LABEL ? t('the view centre') : spokenLabel(label, 32);
|
||||
return label ? t('{name}: {state}', { name: base, state }) : base;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,10 +7,11 @@ import {
|
||||
progressLine,
|
||||
progressStepLabel,
|
||||
spokenLabel,
|
||||
VIEW_CENTRE_LABEL,
|
||||
} from './speech.js';
|
||||
import { presentResult } from './resultDisplay.js';
|
||||
import { countWords, findHedges } from './speechLint.js';
|
||||
import { setLocale } from '../i18n/index.js';
|
||||
import { setLocale, t } from '../i18n/index.js';
|
||||
|
||||
function envelope(name, result, args) {
|
||||
return attachVoiceResult(name, result, args);
|
||||
@@ -779,3 +780,51 @@ test('progress step labels join through the catalog colon', () => {
|
||||
setLocale('en');
|
||||
}
|
||||
});
|
||||
|
||||
test('the street-level card words "the view centre" and "this spot" as phrases, not names', () => {
|
||||
setLocale('de');
|
||||
try {
|
||||
assert.equal(
|
||||
planStepLabel('show_street_level', { provider: 'mapillary' }),
|
||||
'Mapillary in der Bildmitte',
|
||||
);
|
||||
assert.equal(
|
||||
planStepLabel('show_street_level', { latitude: 1, longitude: 2 }),
|
||||
'Straßenebene an dieser Stelle',
|
||||
);
|
||||
assert.equal(
|
||||
planStepLabel('show_street_level', { query: 'Alexanderplatz', provider: 'kartaview' }),
|
||||
'KartaView: Alexanderplatz',
|
||||
);
|
||||
assert.equal(
|
||||
progressStepLabel('imagery', VIEW_CENTRE_LABEL),
|
||||
`${t('Opening imagery')}: die Bildmitte`,
|
||||
);
|
||||
} finally {
|
||||
setLocale('en');
|
||||
}
|
||||
});
|
||||
|
||||
test('the street-level plan step names the place as show_street_level finds it', () => {
|
||||
// A pointed or numbered thing is located later, by deixis.
|
||||
assert.equal(planStepLabel('show_street_level', { referent: 2 }), 'Street Level');
|
||||
assert.equal(
|
||||
planStepLabel('show_street_level', { referent: 2, provider: 'mapillary' }),
|
||||
'Mapillary',
|
||||
);
|
||||
assert.equal(planStepLabel('show_street_level', { query: ' Pointer ' }), 'Street Level');
|
||||
// One coordinate alone is no spot: the action looks at the view centre.
|
||||
assert.equal(
|
||||
planStepLabel('show_street_level', { latitude: 10 }),
|
||||
'Street level at the view centre',
|
||||
);
|
||||
setLocale('de');
|
||||
try {
|
||||
assert.equal(
|
||||
planStepLabel('show_street_level', { referent: 1 }),
|
||||
'Straßenebene',
|
||||
);
|
||||
} finally {
|
||||
setLocale('en');
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user