fix(voice): point-and-ask over an ALPR camera or a local ADS-B aircraft names it again

A pick resolves to its context record through the drawn item's meta. The
ALPR and local ADS-B icons carried none, so point-and-ask got the layer
name and no position instead of the camera or aircraft and where it is.
Each icon now carries its context carrier, as before the draw port, when
the pick was the registered entity itself.
This commit is contained in:
Sameh Khamis committed 2026-11-14 00:42:34 -08:00
1 parent ca7a736456
commit 4c7deb11dc
4 files changed
+10

No files matched your search

+2
View File
@@ -67,6 +67,8 @@ export function alprIconItem(carrier) {
size: [size, size], size: [size, size],
disableDepthTest: Number.POSITIVE_INFINITY, disableDepthTest: Number.POSITIVE_INFINITY,
show: marker.shown !== false, show: marker.shown !== false,
// The context carrier: what a pick hands to point-and-ask.
meta: carrier,
...(canvas ...(canvas
? { color: PICK_TARGET_COLOR } ? { color: PICK_TARGET_COLOR }
: { scaleByDistance: SCALE_BY_DISTANCE }), : { scaleByDistance: SCALE_BY_DISTANCE }),
+5
View File
@@ -148,6 +148,11 @@ test('a selected camera without a bearing gets its badge and brackets, never a f
assert.equal(h.overlay.pick({ x: 100, y: 100 }), 'camera:0'); assert.equal(h.overlay.pick({ x: 100, y: 100 }), 'camera:0');
assert.equal(h.icon('camera:0').show, true); assert.equal(h.icon('camera:0').show, true);
assert.equal(h.icon('camera:0').color[3], 0.01, 'a faint pick target'); assert.equal(h.icon('camera:0').color[3], 0.01, 'a faint pick target');
assert.equal(
h.icon('camera:0').meta,
h.carrier('camera:0'),
'a pick hands point-and-ask the context carrier',
);
assert.equal(directionWedgePositions(h.records[0]), null); assert.equal(directionWedgePositions(h.records[0]), null);
}); });
+2
View File
@@ -368,6 +368,8 @@ export function createLocalAdsbLayer({
show: !marker.modelOwnsVisual, show: !marker.modelOwnsVisual,
disableDepthTest: Number.POSITIVE_INFINITY, disableDepthTest: Number.POSITIVE_INFINITY,
displayRange: MARKER_RANGE, displayRange: MARKER_RANGE,
// The context carrier: what a pick hands to point-and-ask.
meta: marker.carrier,
}; };
} }
+1
View File
@@ -260,6 +260,7 @@ test('local aircraft use their class silhouette and scale in magenta', async (t)
assert.equal(icon.disableDepthTest, Number.POSITIVE_INFINITY); assert.equal(icon.disableDepthTest, Number.POSITIVE_INFINITY);
assert.equal(layerSet(draw, ':markers').spec.horizonCull, true); assert.equal(layerSet(draw, ':markers').spec.horizonCull, true);
const carrier = calls.carriers.get('local-adsb:abc123'); const carrier = calls.carriers.get('local-adsb:abc123');
assert.equal(icon.meta, carrier, 'a pick hands point-and-ask the carrier');
assert.equal(readEntityRecord(carrier)?.labelModel.title, 'LOCAL1'); assert.equal(readEntityRecord(carrier)?.labelModel.title, 'LOCAL1');
assert.equal(typeof readEntityRecord(carrier)?.displayPosition, 'function'); assert.equal(typeof readEntityRecord(carrier)?.displayPosition, 'function');