From 2060f109b670f3c69dc7e17a3f081f301514b563 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Tue, 23 Jun 2026 18:49:17 +0200 Subject: [PATCH] Show numeric sub-variation edge values as bare numbers Numeric dependsOn values (merge-type variations) are RFC edge values, not ATTR names. Display them as the number, not as "ATTR: N" or "subvariation N". --- static/components/PaneCP.js | 13 +++++++------ static/components/PaneSubObjects.js | 10 +++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/static/components/PaneCP.js b/static/components/PaneCP.js index f273f5c..916843c 100644 --- a/static/components/PaneCP.js +++ b/static/components/PaneCP.js @@ -15,12 +15,13 @@ function shortView(node) { }; case 'instrument': return { typeTag: 'instrument', label: node.name, meta: [] }; - case 'variation': - return { - typeTag: 'variation', - label: node.dependsOn ? `ATTR: ${node.dependsOn}` : '(root variation)', - meta: [], - }; + case 'variation': { + const dep = node.dependsOn; + const label = dep == null ? '(root variation)' + : isNaN(Number(dep)) ? `ATTR: ${dep}` + : String(dep); + return { typeTag: 'variation', label, meta: [] }; + } case 'label_spec': return { typeTag: 'label', label: node.label ?? '(no label)', meta: [] }; case 'bar': diff --git a/static/components/PaneSubObjects.js b/static/components/PaneSubObjects.js index 6c1de30..2d82073 100644 --- a/static/components/PaneSubObjects.js +++ b/static/components/PaneSubObjects.js @@ -40,9 +40,13 @@ export const PaneSubObjects = { ...node.labelSpecs.map(ls => ({ kind: 'label_spec', node: ls, label: ls.label ?? '(no label)', })), - ...node.subvariations.map((sv, idx) => ({ - kind: 'variation', node: sv, label: `subvariation ${idx + 1}`, - })), + ...node.subvariations.map((sv, idx) => { + const dep = sv.dependsOn; + const label = dep == null ? `subvariation ${idx + 1}` + : isNaN(Number(dep)) ? `ATTR: ${dep}` + : String(dep); + return { kind: 'variation', node: sv, label, hasChildren: true }; + }), ]; } if (node.type === 'bar') {