Keep the context id in Core's entity records instead of on picked objects

registerEntityContext stamped __gevContextId on the entities, primitives and
carriers it registered, and selection and pick resolution read it back. It
is now the contextId field of the entity's Core record.
This commit is contained in:
Sameh Khamis committed 2026-11-03 09:40:15 -08:00
1 parent 07c8d7a17c
commit 42b17ffab6
5 files changed
+18 -16

No files matched your search

+4 -4
View File
@@ -1303,7 +1303,7 @@ test('control_cockpit delegates selected-flight adoption to the canonical cockpi
scene: { canvas: { addEventListener() {}, removeEventListener() {} } },
camera: { moveEnd: { addEventListener() {} } },
};
const recordCarrier = { __gevContextId: 'selected-flight-for-cockpit-enter' };
const recordCarrier = {};
const record = registerEntityContext(recordCarrier, {
id: 'abc123',
layerId: 'flights',
@@ -1444,10 +1444,10 @@ test('control_cockpit rolls Contacts back when the turn becomes stale at commit'
test('control_cockpit adopts the newest selection after Contacts settles', async () => {
globalThis.window = globalThis.window || { clearTimeout, setTimeout, requestIdleCallback: null };
const contextStore = getContextStore();
const first = registerEntityContext({ __gevContextId: 'cockpit-selection-first' }, {
const first = registerEntityContext({}, {
id: 'first', layerId: 'flights', label: 'FIRST',
});
const second = registerEntityContext({ __gevContextId: 'cockpit-selection-second' }, {
const second = registerEntityContext({}, {
id: 'second', layerId: 'flights', label: 'SECOND',
});
contextStore.selectedEntityId = first.id;
@@ -1713,7 +1713,7 @@ test('control_cockpit enter skips selected non-flight context', async () => {
scene: { canvas: { addEventListener() {}, removeEventListener() {} } },
camera: { moveEnd: { addEventListener() {} } },
};
const recordCarrier = { __gevContextId: 'selected-non-flight-cockpit-enter' };
const recordCarrier = {};
const record = registerEntityContext(recordCarrier, {
id: 'poi-001',
layerId: 'local-datacenters',