feat(ui): render the CCTV camera picker from the store

The picker's options are data: CctvControls computes the cameras in view
and the closing note for those left out, keeps a focused picker's list and
prepends a camera activated under it, and publishes the options, disabled
state and selection. CctvPicker renders them keyed by camera id and
applies the selection once the options are in place; it updates only when
the controls publish, as the old picker did on layer notifications. A
picker about to be disabled no longer counts as focused.

This completes the CCTV panel: everything it shows is rendered from the
gev-cctv store.
This commit is contained in:
Sameh Khamis committed 2026-10-30 22:05:41 -07:00
1 parent eef3dec759
commit ce343c1c6d
10 files changed
+257 -196

No files matched your search

-15
View File
@@ -149,21 +149,6 @@ test('the buttons stay the elements the controls listen on', async (t) => {
assert.equal(byId('cctv-nearest-btn').disabled, true);
});
test('re-renders leave the picker options the controls fill alone', async (t) => {
const { controls, byId } = panel(t);
const select = byId('cctv-camera-select');
const option = document.createElement('option');
option.value = 'a';
option.textContent = 'Austin · Congress Ave';
select.append(option);
for (const enabled of [true, false, true]) {
controls._renderCctvState({ enabled, count: 1, cameraIndex: [] });
await nextTick();
}
assert.equal(select.options.length, 1);
assert.equal(select.options[0].value, 'a');
});
test('FOCUS waits for an active camera while the other buttons work', () => {
const loaded = { enabled: true, count: 2, cameraIndex: [] };
const view = presentCctvPanel(loaded, true);