fix(voice): the in-view scan sees News reports and Wildlife Sightings again

Voice's in-view scan projects each context record's targetPosition. News
and Wildlife Sightings still set only the entity's base position, so both
dropped out of "what am I looking at". They now pass it as targetPosition,
as GeoJSON and FIRMS do.
This commit is contained in:
Sameh Khamis committed 2026-11-14 00:23:36 -08:00
1 parent ea3b87805a
commit 14e406002c
4 files changed
+32 -1

No files matched your search

+2
View File
@@ -909,6 +909,8 @@ export function createNewsLayer({
);
entity.__localBaseCartesian = fromDegrees(lon, lat);
registerEntityContext(entity, {
// Where voice's in-view scan projects it.
targetPosition: entity.__localBaseCartesian,
id: `news-report:${report.id}`,
layerId: NEWS_LAYER_ID,
layerName: 'News',
+12
View File
@@ -5,6 +5,7 @@ import { fromDegrees } from '../../geo/ellipsoid.js';
import { bindFakeDraw } from '../../testSupport/fakeDrawPort.mjs';
import { fakeCameraPort } from '../../testSupport/fakeCameraPort.mjs';
import { NEWS_KEY_PROVIDERS, createNewsLayer } from './index.js';
import { getSelectedEntityContext } from '../../data/contextStore.js';
const NOW = Date.parse('2026-10-28T10:00:00Z');
const hotspotsPayload = {
@@ -251,6 +252,17 @@ test('choosing a card selects it and flies straight down from 150 km; reduced mo
assert.equal(layer.getRowControls().feed.selected, null);
});
test('a selected report carries the point voice projects to find what is in view', async (t) => {
const { layer } = fixture(t);
layer.enable();
await layer.update();
layer.setParams({ reportId: 'major' });
const record = getSelectedEntityContext();
assert.equal(record?.id, 'news-report:major');
assert.ok(record.targetPosition, 'a position voice can project');
assert.equal(record.targetPosition, record.entity.__localBaseCartesian);
});
test('the severity floor changes what is shown, not what is read', async (t) => {
const { layer, entries, calls } = fixture(t, { height: 500_000 });
layer.enable();