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

+14 -1
View File
@@ -5,7 +5,8 @@ import { markRaw, shallowRef } from 'vue';
* The CCTV panel as its view renders it. CctvControls presents the buttons,
* CAL chip, meta line and calibration readout (`presentCctvPanel()`), runs
* the frame preview, source badge and typed summary, and publishes them
* here; it keeps its listeners on the buttons and fills the picker itself.
* here, with the camera picker's options; it keeps its listeners on the
* panel's controls.
*/
export const useCctvStore = defineStore('gev-cctv', () => {
/** The presented panel; null until the controls first render. */
@@ -23,6 +24,11 @@ export const useCctvStore = defineStore('gev-cctv', () => {
const live = shallowRef(false);
/** `{label, state}` for the source badge; null until first synced. */
const sourceBadge = shallowRef(null);
/**
* The camera picker: `{options: [{value, label}], note, disabled,
* selection: {value}|{index}|null}`; null until first rendered.
*/
const picker = shallowRef(null);
/** The scene summary as typed so far; null until the first one. */
const summary = shallowRef(null);
@@ -53,6 +59,11 @@ export const useCctvStore = defineStore('gev-cctv', () => {
sourceBadge.value = markRaw(next);
}
/** @param {object} next */
function setPicker(next) {
picker.value = markRaw(next);
}
/** @param {string} text */
function setSummary(text) {
summary.value = text;
@@ -65,11 +76,13 @@ export const useCctvStore = defineStore('gev-cctv', () => {
live,
sourceBadge,
summary,
picker,
publish,
setCalEdit,
setFrame,
setLive,
setSourceBadge,
setSummary,
setPicker,
};
});