Merge upstream main; retain CCTV opening and point navigation (#808)

Resolve gekh's P2 conflict by keeping both nearest-point and provisional
opening-camera navigation. Extend node:test coverage for the fallback and
move-end behavior. Preserve current upstream changes and PR #808 scope.

Tests: unrun (connector-only); CI pending.
This commit is contained in:
Kevin Rajan committed 2026-11-10 10:52:51 -06:00
commit aeee8aa6e0
793 files changed
+139572 -3308

No files matched your search

+37 -1
View File
@@ -26,13 +26,21 @@ function fixture() {
},
},
};
const selected = [];
parts.selection = {
setActiveCamera(cameraId) {
selected.push(cameraId);
state._activeCameraId = cameraId;
state._openingCameraProvisional = false;
},
};
const navigation = createNavigation({
state,
services: {},
parts,
source: {},
});
return { state, navigation };
return { state, navigation, selected };
}
test('nearest camera can be resolved from an explicit WGS84 target', () => {
@@ -59,3 +67,31 @@ test('invalid target coordinates fail closed', () => {
assert.equal(navigation.nearestCameraIdToPoint(lat, lon), null);
}
});
test('opening camera keeps viewer-nearest and first-record fallback', () => {
const { state, navigation } = fixture();
assert.equal(navigation.openingCameraId(), 'east');
state._viewer = null;
assert.equal(navigation.openingCameraId(), 'west');
state._records = [];
assert.equal(navigation.openingCameraId(), null);
});
test('settled move retargets only a provisional opening camera', () => {
const { state, navigation, selected } = fixture();
state._enabled = true;
state._openingCameraProvisional = true;
state._activeCameraId = 'west';
assert.equal(navigation.reopenNearestCamera(), true);
assert.deepEqual(selected, ['east']);
assert.equal(state._activeCameraId, 'east');
assert.equal(state._openingCameraProvisional, true);
assert.equal(navigation.reopenNearestCamera(), false);
state._activeCameraId = 'west';
state._openingCameraProvisional = false;
assert.equal(navigation.reopenNearestCamera(), false);
state._openingCameraProvisional = true;
state._enabled = false;
assert.equal(navigation.reopenNearestCamera(), false);
assert.deepEqual(selected, ['east']);
});