# TODO - [ ] **MAJOR** Implement configuration manager: - configuration is a set of signals (that can be organized in group and subgroup) that are used to configure a system or a sub system - with configuration manager user should be able to: - Define and manage configuration sets: delete (keep server side copy of deleted config), create (specifying default to parameters, mandatory, optional etc), edit (with versioning git style) and compare set - user can fork an existing config instance to create a new one - user can compare two instances: show unified diff or side by side diff - etc... - Create, delete (keep server cache), edit (git style versioning) and compare configuration instances: meaning set actual value to a configuration set - user can fork an existing config instance to create a new one - user can compare two instances: show unified diff or side by side diff - etc... - [x] user can apply and save configuration instances from manager - [x] **instance snapshot**: create a new instance from the current live value of all of a set's target signals (optional label, else auto name) — exposed in the config editor (⎙ Snapshot), control loop (`action.config.snapshot`) and logic editor (`action.config.snapshot`) - [x] **live diff**: compare a stored instance against current signal values ("Diff vs current" button → `/config/instances/{id}/livediff`) - [x] git-style versioning for config sets and instances: fork any revision, click to view, promote to current, with unified / side-by-side diff (shared `VersionTree`) - [x] in logic editor and control loop add nodes to read/write/create/apply config instances - [x] **apply** and **read** config-instance nodes in both control logic (server Go) and panel logic (client TS) - [x] **create / write** nodes (mutate versioned instances from automation) in both engines - [x] **Config Selector** panel widget: operator picks an instance of a chosen set (optionally a subset) from a combo, writing its id to a panel-local string variable; apply/read/write panel-logic nodes can read their instance dynamically from that variable ("From variable" source) - [x] support for all supported types (number, bools, enums, arrays, string etc) - [x] ux elements for config set - [x] the configuration editor should automatically get type and info from signal when possible (type is read-only, auto-derived from the bound signal) - [x] a slick tree drag and drop editor to order elements and organize in group and sub-groups - [x] possibility to customise unit, max, min etc - [x] export / import a config set as JSON - [x] full-screen config window - [x] ux elements for config instances: - automatically use the correct setting widget depending on the type (e.g. combo for enum, nubmer input for number): - for arrays: import csv option, display points as mini plot (+ open dialog plot with more info), manual enter points via table like interface - automatically fill with default or existing values (when forking an existing instance) - explicity show errors/missing info and give additional info on hover - [x] add advanced validation / transformation framework to configurations using custom CUE rules: - [x] backend runs validation / transformation rules (real CUE via `cuelang.org/go`; `internal/confmgr/cue.go`). Rules are a third versioned `Kind` bound to a set; evaluated on instance create/update — violations block the save, concrete derivations transform & persist the values - [x] user can create/edit/delete/compare rules from webui (Rules tab in ConfigManager; git-style versioning + side-by-side/unified source diff) - [x] integrate syntax highlight (hand-rolled `CueEditor.tsx`, mirroring `LuaEditor`) - [x] integrate autocomplete for signals names and cue grammars (param keys + target signals + CUE keywords/types; Ctrl+Space) - [ ] ~~integrate cue lsp~~ — descoped: a separate language-server process does not fit the no-npm / single portable-binary architecture - [x] when validation fails the error is propagated to the user (live `/config/rules/check` panel while editing; save returns the structured violation) - [x] all actions tracked via history (versioned rules) + audit (`config.rule.create/update/delete/promote/fork`) - [ ] Improve UX: - Config editor: - [x] Instance should be filtered by config set (combo box) (`ConfigManager.tsx` InstancesManager: `setFilter` combo in the instance list head, shown when >1 set; empty-set hint) - [x] Validation rules should also be filtered by config set (combo box) (`ConfigManager.tsx` RulesManager: `setFilter` combo mirroring instances, shown when >1 set; empty-set hint; `Meta.setId` surfaced via `List`) - [x] Validation rules can be enabled / disabled — disabled rules are skipped when an instance is created/updated/applied (`Enabled *bool`, nil=enabled for legacy; `IsEnabled()`; `rulesForSet` skips disabled; UI checkbox + list `off` badge) - [x] Rule editor preview button — runs the working (unsaved) source against a live signal snapshot of the set without persisting it, showing the input snapshot JSON and processed output JSON (`POST /config/rules/preview` → `previewConfigRule`; `RulePreviewView`) - [ ] Synthetic editor: - [x] color code the node link by type - [x] edges color depends on type (e.g. float) including arrays (scalar = slate, array = purple) - [x] input / outputs are color coded (out port = node's type; in port = accepted type, gray when it accepts either) - [x] can not connect input / output that are not compatible (definite scalar↔array mismatch blocked; unknown/any always allowed) - [x] hover on a block in error should show the reason - [x] add proper array functionality - [x] add shortcut to add Signals (S) and nodes (N) with HUD - [ ] Panels: - [x] in view mode the widgets should have no border/bg but blend with background - [ ] add widgets such as toggle switch, table and other industrial hmi widgets - [x] toggle switch (`web/src/widgets/Toggle.tsx`; read+write bool control, configurable on/off value+label, confirm dialog) - [x] table widget (`web/src/widgets/TableWidget.tsx`; multi-signal value table, one row per bound signal, configurable columns name/value/unit/status/time, optional header + title, per-signal value format + row-label overrides; blends in view mode) - [ ] other industrial hmi widgets - [x] widget panel exposes an editable Widget ID field (default = generated uuid) for easier logic interaction (`PropertiesPane.tsx` `IdInput`; `EditMode.renameWidgetId` propagates the rename to `action.widget` logic refs + plot-layout leaves; rejects empty/duplicate ids) - [x] add container widgets: labelled/title pane, tab panes, collapsable panes (`web/src/widgets/Container.tsx`; decorative grouping frame rendered behind widgets, accent/bg options; `pane` variant = title + view-mode collapse; `tabs` variant = tab bar where each contained widget is assigned a tab via its "Tab" field and only the active tab shows; geometric membership via `web/src/lib/containers.ts`) - [x] moving container widget should move the widgets on it — starting a move (drag or arrow nudge) on a container snapshots the widgets geometrically inside it (centre-inside, transitive through nested containers) and moves them by the same delta; membership is captured at move start so widgets never re-parent mid-move (`withContainedWidgets` in `web/src/lib/containers.ts`, used by `EditCanvas` drag-start + `EditMode` arrow nudge) - [x] plot pane: - [x] add toolbar (hover toolbar in `PlotWidget`, `.plot-toolbar`) - [x] add time window selector to toolbar (Auto/15s/30s/1m/5m/15m/1h rolling-window override, live windowed plot types) - [x] plot x-axis synchronised (shared uPlot cursor crosshair across all linked timeseries plots + zoom/pan range sync in historical mode; per-plot 🔗 link/unlink toolbar toggle; `web/src/lib/plotSync.ts`) - [x] cursors and measuraments (📏 measure mode: click cursor A then B → on-canvas A/B lines + readout panel with Δt/rate and per-signal value@A→value@B and Δ) - [x] pause/resume (local toolbar pause, OR'd with panel-logic pause; buffers persist across plot-type/window changes) - [x] save screenshot (PNG export — uPlot canvas / ECharts getDataURL) - [x] clean ui: - [x] create small statusbar where connection widget and other status related info will be placed (bottom `.statusbar`: connection chip + current panel name + history indicator) - [x] group advanced items (audit/control loops/config manager etc) in a tool menu or something similar to not fill the toolbar (⋯ Tools ▾ dropdown) - [x] make the toolbar as clean as possible (toolbar-right now: History · 📖 · zoom · Tools · Edit) - [x] panel-selection list: the whole row is clickable to open a panel (not just the name text); `onClick` moved to the `