feat(ui): render the CCTV calibration readout and its pose editor from the store

presentCctvCalibration() joins the panel view: ADJUST, SAVE CAL, RESET CAL
and the seven pose chips render from the gev-cctv store. The inline editor
is store state: starting an edit publishes its field, starting value and
finish(), and the CctvCalValue chip renders the number input. The draft is
set once on mount so a refresh while typing keeps it; each edit gets its
own input. Commit and cancel rules, the captured base pose and the camera
guards stay with CctvControls.

formField.js had no other user and is removed.
This commit is contained in:
Sameh Khamis committed 2026-10-30 21:45:24 -07:00
1 parent 5b8cb40fce
commit 6c7035f617
13 files changed
+337 -240

No files matched your search

+18 -5
View File
@@ -2,19 +2,32 @@ 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.
* The CCTV panel's buttons, CAL chip, meta line and calibration readout 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 and summary itself.
*/
export const useCctvStore = defineStore('gev-cctv', () => {
/** The presented panel; null until the controls first render. */
const view = shallowRef(null);
/**
* The pose value being typed: `{field, label, ariaLabel, step, value,
* finish(commit, typedText)}`, or null.
*/
const calEdit = shallowRef(null);
/** @param {object} next A fresh presentation; every publish re-renders. */
function publish(next) {
view.value = markRaw(next);
}
return { view, publish };
let editCount = 0;
/** @param {object|null} edit Each edit gets its own `id`, and input. */
function setCalEdit(edit) {
calEdit.value = edit ? markRaw({ ...edit, id: ++editCount }) : null;
}
return { view, calEdit, publish, setCalEdit };
});