From 1a7cd90c325035cc29e97fb3143309775fdff92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Thu, 14 May 2026 09:10:57 +0300 Subject: [PATCH] feat(graph): nd() helper supports when+limits fields; showLegend renders them --- docs/automation-graph.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/automation-graph.html b/docs/automation-graph.html index f4bd21a3..4a64522c 100644 --- a/docs/automation-graph.html +++ b/docs/automation-graph.html @@ -325,8 +325,21 @@ const CATEGORY_LABELS = { mcp: 'MCP-сервер', lefthook: 'Lefthook job', memory: 'Memory-файл' }; -function nd(desc, reportsTo, manages, together, conflicts) { - return { desc, reportsTo, manages, together, conflicts: conflicts || [] }; +function nd(desc, when, limits, reportsTo, manages, together, conflicts) { + // Backward-compat: old 5-arg signature was nd(desc, reportsTo, manages, together, conflicts). + // If 2nd arg is an array, treat as old-style call and shift args. + if (Array.isArray(when)) { + return { + desc, + when: '', + limits: '', + reportsTo: when, + manages: limits, + together: reportsTo, + conflicts: (manages || []), + }; + } + return { desc, when: when || '', limits: limits || '', reportsTo, manages, together, conflicts: conflicts || [] }; } const NODE_DETAILS = { @@ -918,6 +931,8 @@ function showLegend(nodeId) { `● ${catLabel}`; document.getElementById('ld-desc').textContent = details.desc; + document.getElementById('ld-when').textContent = details.when || '—'; + document.getElementById('ld-limits').textContent = details.limits || 'без особых ограничений'; const ldReports = document.getElementById('ld-reports'); ldReports.innerHTML = details.reportsTo.length