From b7431d782372d26aa2a79d0437100bc390e8d224 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Tue, 3 Nov 2026 02:39:27 +0400 Subject: [PATCH] Use cockpit readiness for voice entry on either globe --- src/voice/gevActions.js | 4 +++- src/voice/gevActionsEngine.test.mjs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/voice/gevActions.js b/src/voice/gevActions.js index 9517d5327..a58c5c213 100644 --- a/src/voice/gevActions.js +++ b/src/voice/gevActions.js @@ -1076,7 +1076,9 @@ export function createGevActionRunner({ contextState?.mode === 'flights' && contextState?.active !== false && contextState?.changing !== true; - if (!contactsReady && engine?.kind !== 'navara') { + const directEntry = !targetLayer && !aircraftClass && + styleManager.getCockpitState?.()?.entryAllowed === true; + if (!contactsReady && !directEntry) { const contextResult = await styleManager.setContextMode('flights', { signal: runOptions.signal, isCurrent: runOptions.isCurrent, diff --git a/src/voice/gevActionsEngine.test.mjs b/src/voice/gevActionsEngine.test.mjs index f640cc9a8..929c3d1e8 100644 --- a/src/voice/gevActionsEngine.test.mjs +++ b/src/voice/gevActionsEngine.test.mjs @@ -104,10 +104,11 @@ test('the viewer-only actions are one exported list of real tools', () => { assert.ok(tools.has(name), `${name} is a voice tool`); }); -test('Navara enters cockpit on the tracked aircraft without starting Contacts', async () => { - const engine = engineOverAustin({ kind: 'navara' }); +for (const kind of ['cesium', 'navara']) test(`${kind} enters cockpit on a ready tracked aircraft without starting Contacts`, async () => { + const engine = engineOverAustin({kind}); const runner = runnerOn(engine, { styleManager: { + getCockpitState: () => ({ entryAllowed: true }), getAircraftTrackingTarget: () => ({ layerId: 'flights', id: '507c84' }), setContextMode: () => assert.fail('the selected flight already owns the camera'), controlCockpit: (action, { rollbackTarget }) => {