feat(menu): global icon-picker visual layer + asset wizard

* iconHelpers.js (new): shared SVG library + renderSelectPicker /
  renderToggle helpers, injected once per editor session by MenuManager.
  Pulls the visual layer out of machineGroupControl so every node that
  loads /<node>/menu.js inherits the cards without per-node code.
* logger.js, physicalPosition.js: new initVisuals() step that upgrades
  the native checkbox + select to icon cards using the shared helpers.
  Native controls stay in the DOM (hidden) as the save targets.
* asset.js: rewrite the asset selector into a left->right wizard —
  chip strip (Supplier > Type > Model > Unit), per-stage type-to-filter
  combobox, node-aware spec strip + curve mini-chart sparkline. Models
  are server-side enriched with a slim previewCurve per softwareType
  (rotatingMachine Q-H, valve Cv, diffuser SOTE; measurement has no
  curve data yet). Hidden native selects remain canonical save targets.
* MenuManager: each menu's initEditor now owns its own initVisuals
  call so async-data menus (asset) can sequence visuals after loadData.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
znetsixe
2026-05-18 11:10:28 +02:00
parent af02d36b07
commit 34a4ef0610
5 changed files with 889 additions and 41 deletions

View File

@@ -3,6 +3,7 @@ const AssetMenu = require('./asset.js');
const LoggerMenu = require('./logger.js');
const PhysicalPositionMenu = require('./physicalPosition.js');
const AquonSamplesMenu = require('./aquonSamples.js');
const IconHelpers = require('./iconHelpers.js');
const ConfigManager = require('../configs');
class MenuManager {
@@ -138,6 +139,9 @@ class MenuManager {
window.EVOLV.nodes = window.EVOLV.nodes || {};
window.EVOLV.nodes.${nodeName} = window.EVOLV.nodes.${nodeName} || {};
// Shared icon-picker helpers (no-op if already loaded by another node)
${IconHelpers.getClientInitCode()}
// Initialize menu namespaces
${menuTypes.map(type => `window.EVOLV.nodes.${nodeName}.${type}Menu = window.EVOLV.nodes.${nodeName}.${type}Menu || {};`).join('\n ')}
@@ -163,6 +167,8 @@ class MenuManager {
try {
${menuTypes.map(type => `
try {
// initEditor is responsible for calling initVisuals
// at the right time (after any async data load).
if (window.EVOLV.nodes.${nodeName}.${type}Menu && window.EVOLV.nodes.${nodeName}.${type}Menu.initEditor) {
window.EVOLV.nodes.${nodeName}.${type}Menu.initEditor(node);
}