From 4c7deb11dc064f5070da8ea8f6e9b3aa8233b248 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 14 Nov 2026 00:42:34 -0800 Subject: [PATCH] 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. --- src/layers/alpr/markerState.js | 2 ++ src/layers/alpr/overlay.test.mjs | 5 +++++ src/layers/localAdsb/index.js | 2 ++ src/layers/localAdsb/index.test.mjs | 1 + 4 files changed, 10 insertions(+) diff --git a/src/layers/alpr/markerState.js b/src/layers/alpr/markerState.js index 85a06ae5f..074111c0d 100644 --- a/src/layers/alpr/markerState.js +++ b/src/layers/alpr/markerState.js @@ -67,6 +67,8 @@ export function alprIconItem(carrier) { size: [size, size], disableDepthTest: Number.POSITIVE_INFINITY, show: marker.shown !== false, + // The context carrier: what a pick hands to point-and-ask. + meta: carrier, ...(canvas ? { color: PICK_TARGET_COLOR } : { scaleByDistance: SCALE_BY_DISTANCE }), diff --git a/src/layers/alpr/overlay.test.mjs b/src/layers/alpr/overlay.test.mjs index a938373ee..fee00882d 100644 --- a/src/layers/alpr/overlay.test.mjs +++ b/src/layers/alpr/overlay.test.mjs @@ -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.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').meta, + h.carrier('camera:0'), + 'a pick hands point-and-ask the context carrier', + ); assert.equal(directionWedgePositions(h.records[0]), null); }); diff --git a/src/layers/localAdsb/index.js b/src/layers/localAdsb/index.js index 1299a009b..5fdc41493 100644 --- a/src/layers/localAdsb/index.js +++ b/src/layers/localAdsb/index.js @@ -368,6 +368,8 @@ export function createLocalAdsbLayer({ show: !marker.modelOwnsVisual, disableDepthTest: Number.POSITIVE_INFINITY, displayRange: MARKER_RANGE, + // The context carrier: what a pick hands to point-and-ask. + meta: marker.carrier, }; } diff --git a/src/layers/localAdsb/index.test.mjs b/src/layers/localAdsb/index.test.mjs index 3d3f84a4f..2e2db8970 100644 --- a/src/layers/localAdsb/index.test.mjs +++ b/src/layers/localAdsb/index.test.mjs @@ -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(layerSet(draw, ':markers').spec.horizonCull, true); 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(typeof readEntityRecord(carrier)?.displayPosition, 'function');