From ff5943f7703a04ff5b728d0e4f91bf5c7a3e3936 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Sun, 10 Aug 2025 07:20:26 +1000 Subject: [PATCH] Reorder subgraph context menu items (#4870) Co-authored-by: github-actions --- src/lib/litegraph/src/LGraphCanvas.ts | 8 +++++--- src/locales/zh/commands.json | 2 +- src/locales/zh/main.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/litegraph/src/LGraphCanvas.ts b/src/lib/litegraph/src/LGraphCanvas.ts index b8ce87842..a325df864 100644 --- a/src/lib/litegraph/src/LGraphCanvas.ts +++ b/src/lib/litegraph/src/LGraphCanvas.ts @@ -8235,14 +8235,16 @@ export class LGraphCanvas 'Both in put and output slots were null when processing context menu.' ) + if (!_slot.nameLocked && !('link' in _slot && _slot.widget)) { + menu_info.push({ content: 'Rename Slot', slot }) + } + if (_slot.removable) { + menu_info.push(null) menu_info.push( _slot.locked ? 'Cannot remove' : { content: 'Remove Slot', slot } ) } - if (!_slot.nameLocked && !('link' in _slot && _slot.widget)) { - menu_info.push({ content: 'Rename Slot', slot }) - } if (node.getExtraSlotMenuOptions) { menu_info.push(...node.getExtraSlotMenuOptions(slot)) diff --git a/src/locales/zh/commands.json b/src/locales/zh/commands.json index 8c7a1c95c..194e23e9e 100644 --- a/src/locales/zh/commands.json +++ b/src/locales/zh/commands.json @@ -264,4 +264,4 @@ "label": "切换工作流侧边栏", "tooltip": "工作流" } -} +} \ No newline at end of file diff --git a/src/locales/zh/main.json b/src/locales/zh/main.json index acb3adf4f..189eb1f91 100644 --- a/src/locales/zh/main.json +++ b/src/locales/zh/main.json @@ -1648,4 +1648,4 @@ "exportWorkflow": "导出工作流", "saveWorkflow": "保存工作流" } -} +} \ No newline at end of file