mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
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:
1 parent
393a145137
commit
2394703c14
5 files changed
+18
-16
No files matched your search
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user