From 49b85e3f73643886c6b0c9091104e9eef2752d38 Mon Sep 17 00:00:00 2001 From: GogoVega <92022724+GogoVega@users.noreply.github.com> Date: Mon, 17 Nov 2025 09:52:18 +0100 Subject: [PATCH 1/2] Allow actions show-next-tab and previous to loop --- .../@node-red/editor-client/src/js/ui/common/tabs.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js index d9dc4b289..544a8636c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js @@ -607,6 +607,9 @@ RED.tabs = (function() { while(previous.length > 0 && previous.hasClass("hide-tab")) { previous = previous.prev(); } + if (previous.length === 0) { + previous = ul.find("li.red-ui-tab:not(.hide-tab)").last(); + } return previous; } function findNextVisibleTab(li) { @@ -617,6 +620,9 @@ RED.tabs = (function() { while(next.length > 0 && next.hasClass("hide-tab")) { next = next.next(); } + if (next.length === 0) { + next = ul.find("li.red-ui-tab:not(.hide-tab)").first(); + } return next; } function showTab(id) { From 2c7a15ecb2a2b5c09463be9fea88fc151a4b05dc Mon Sep 17 00:00:00 2001 From: GogoVega <92022724+GogoVega@users.noreply.github.com> Date: Sun, 7 Dec 2025 12:04:59 +0100 Subject: [PATCH 2/2] Move the logic to the right place --- .../@node-red/editor-client/src/js/ui/common/tabs.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js index 544a8636c..7ae05e770 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js @@ -443,12 +443,18 @@ RED.tabs = (function() { } function activatePreviousTab() { var previous = findPreviousVisibleTab(); + if (previous.length === 0) { + previous = ul.find("li.red-ui-tab:not(.hide-tab)").last(); + } if (previous.length > 0) { activateTab(previous.find("a")); } } function activateNextTab() { var next = findNextVisibleTab(); + if (next.length === 0) { + next = ul.find("li.red-ui-tab:not(.hide-tab)").first(); + } if (next.length > 0) { activateTab(next.find("a")); } @@ -607,9 +613,6 @@ RED.tabs = (function() { while(previous.length > 0 && previous.hasClass("hide-tab")) { previous = previous.prev(); } - if (previous.length === 0) { - previous = ul.find("li.red-ui-tab:not(.hide-tab)").last(); - } return previous; } function findNextVisibleTab(li) { @@ -620,9 +623,6 @@ RED.tabs = (function() { while(next.length > 0 && next.hasClass("hide-tab")) { next = next.next(); } - if (next.length === 0) { - next = ul.find("li.red-ui-tab:not(.hide-tab)").first(); - } return next; } function showTab(id) {