Remove always-true layer availability and leftover viewer paths

Every layer draws on both engines, so the per-engine availability
machinery always answered yes. The renderer manifest is now the id to
display map plus the wind flow backend; the catalog filter, the voice and
QA-probe refusals and the engine-kind checks go with it. The Navara
notice lists the same layers in the same words.

Paths that read the Cesium viewer behind an engine that is always there
are gone: the Recent Imagery viewer fallbacks, the shell's imagery-host
service (one shared host module remains), the engineless map controller,
viewer gates in voice actions, world packets and camera verbs, the
orientation controls' tracked-entity fallback, and the Bhote Koshi and
FIRMS Cesium-shaped paths. setCameraInputs, which nothing called, leaves
the contract; suspensions remain.

Smaller duplicates go too: one tracker-release helper for navigation and
location, the no-op frame latch, missing-engine guards, one name for the
injected display, flat bikeshare and installations displays, one overlay
host and binder, one name per world-overlay method, and stub-viewer
guards in the Cesium engine. Layers that still read the viewer keep the
shared init(viewer, context) entry.

Behaviour is unchanged on both engines. Viewer lines fall from 849 to
750 and engine-name literals from 32 to 27.
This commit is contained in:
German Khokhlov committed 2026-11-08 17:06:01 +04:00
1 parent 371d848eec
commit 7f478e3815
279 files changed
+1570 -3104

No files matched your search

+5 -49
View File
@@ -407,12 +407,12 @@ export function createGevActionRunner({
typeof annotations?.[method] === 'function';
const renderSupported = (capability, method) =>
typeof styleManager?.[method] === 'function' &&
Boolean(viewer || engineCapabilities(engine)[capability]);
engineCapabilities(engine)[capability];
const postEffectSupported = (effect) =>
effect === 'bloom'
? renderSupported('bloom', 'setBloom')
: typeof styleManager?.setSharpen === 'function' &&
Boolean(viewer || typeof engine?.render?.setSharpen === 'function');
typeof engine?.render?.setSharpen === 'function';
function actionSupported(name) {
switch (name) {
case 'annotate_map':
@@ -582,17 +582,6 @@ export function createGevActionRunner({
throw new Error(`Unknown data layer: ${args.layerId || 'missing'}`);
}
if (!dataManager.layers.has(layerId)) {
// A layer this engine cannot show (the catalog left it out): a
// refusal that names it, not an unknown-layer error.
if (!viewer && voiceLayer(layerId))
return {
...unavailableOnEngine(
'set_layer_visibility',
engine,
`The ${layerId} layer`,
),
layerId,
};
if (layerId === 'radio') {
return {
ok: false,
@@ -906,11 +895,7 @@ export function createGevActionRunner({
const style = normalizeStyle(args.style);
if (!style)
throw new Error(`Unknown visual style: ${args.style || 'missing'}`);
if (
!viewer &&
style !== 'normal' &&
!engine.render.visualStyles.includes(style)
)
if (style !== 'normal' && !engine.render.visualStyles.includes(style))
return unavailableOnEngine(name, engine, `The ${style} visual style`);
styleManager.setStyle(style, { userInitiated: true });
return { ok: true, action: 'set_visual_style', style };
@@ -1472,29 +1457,6 @@ export function createGevActionRunner({
}
if (name === 'analyst_query') {
// Layers this engine's catalog left out cannot be asked: say so rather
// than answer zero.
const missing = !viewer
? (Array.isArray(args.layers) ? args.layers : [])
.map(normalizeLayerId)
.filter(
(layerId) =>
layerId &&
voiceLayer(layerId) &&
!dataManager.layers.has(layerId),
)
: [];
if (missing.length)
return {
...unavailableOnEngine(
'analyst_query',
engine,
missing.length === 1
? `The ${missing[0]} layer`
: `The ${missing.join(', ')} layers`,
),
layerIds: missing,
};
return runAnalystQuery(
ensureAnalystEngine(),
dataManager,
@@ -1624,7 +1586,6 @@ export function createGevActionRunner({
if (name === 'get_current_view_state') {
return getWorldPacket({
viewer,
engine,
styleManager,
dataManager,
@@ -1732,7 +1693,7 @@ export function createGevActionRunner({
}
if (name === 'control_radio') {
return controlRadio(viewer, dataManager, args, {
return controlRadio(dataManager, args, {
...runOptions,
placeSearch,
});
@@ -2412,12 +2373,7 @@ async function resolveRadioLocation(
}
/** Voice Radio controls over the Radio layer's public player surface. */
export async function controlRadio(
viewer,
dataManager,
args = {},
options = {},
) {
export async function controlRadio(dataManager, args = {}, options = {}) {
const requestedAction = String(args.action || '')
.trim()
.toLowerCase();