feat(ui): render the CCTV panel's buttons, CAL chip and meta line from a store

CctvControls presents the switch, navigation and toggle buttons, the CAL
chip and the meta line with a pure presentCctvPanel() and publishes them
to the gev-cctv store; CctvPanel renders them. The controls keep their
listeners on the same elements, and still write the picker, frame, source
badge, calibration readout and summary, which carry no bindings.

A page that imports ui/cctv with its own markup no longer has these
elements painted for it, as with Street Level.
This commit is contained in:
Sameh Khamis committed 2026-10-30 20:57:03 -07:00
1 parent e6aee52ea0
commit 5b8cb40fce
14 files changed
+469 -215

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { defineStore } from 'pinia';
import { markRaw, shallowRef } from 'vue';
/**
* The CCTV panel's buttons, CAL chip and meta line as its view renders them.
* CctvControls presents them (`presentCctvPanel()`) and publishes here; it
* keeps its listeners on the buttons and paints the picker, frame, source
* badge, calibration readout and summary itself.
*/
export const useCctvStore = defineStore('gev-cctv', () => {
/** The presented panel; null until the controls first render. */
const view = shallowRef(null);
/** @param {object} next A fresh presentation; every publish re-renders. */
function publish(next) {
view.value = markRaw(next);
}
return { view, publish };
});