Keep the context id in the app'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 own record.
This commit is contained in:
Sameh Khamis committed 2026-11-03 09:40:15 -08:00
1 parent 393a145137
commit 2394703c14
5 files changed
+18 -16

No files matched your search

+3 -3
View File
@@ -12,7 +12,7 @@ import {
localAdsbReceiverLine,
localAdsbStatus,
} from './index.js';
import { readEntityRecord } from '../../data/entityRecords.js';
import { entityRecord, readEntityRecord } from '../../data/entityRecords.js';
function fakeReceiver(initial = {}) {
const state = {
@@ -56,11 +56,11 @@ function fakeServices() {
render: { governorRequestRender() {} },
context: {
registerEntityContext(entity, metadata) {
entity.__gevContextId = metadata.id;
entityRecord(entity).contextId = metadata.id;
calls.registered.push(metadata);
},
selectEntityContext(entity) {
selected = { id: entity.__gevContextId, entity };
selected = { id: readEntityRecord(entity)?.contextId, entity };
calls.selected.push(selected.id);
return selected;
},