Add sidebar tab on app start not working

Hi all,

I'm trying to add a custom tab as the application starts (as shown it this doc RED.sidebar : Node-RED) but the side bar won't load unless I "wait" for the editor to finish loading (so I presume).

Currently I added setTimeout(...,100) to allow the editor to load so RED.sidebar.addTab(...) will work.
This issue happens for RED.notify(...) as well.

What should I do to ensure that the RED.sidebar.addTab will work when the app initializing.


HI @dannyhuly

Where are you calling RED.sidebar.addTab?

I don't need to wait, or delay its loading.
I instantiate the tab on the onpaletteadd callback in the HTML file.

in my main HTML file I reference some of my Core js files which exposes stuff.

<script type="text/javascript" src="resources/node-red-contrib-zwave-js/UITab/client.js" ></script>


const ZwaveJsUI = (function() {
    function init() {

        /* init stuff */

            id: 'zwave-js',
            label: ' ZWave JS',
            name: 'Z-Wave JS',
            content: ParentContainer,
            enableOnEdit: true,
            iconClass: 'fa fa-feed'
    return {init: init}


RED.nodes.registerType('zwave-js', {
     /* Other required Stuff */
    onpaletteadd: ZwaveJsUI.init,

I'm importing a js file via the editorTheme editor configuration settings

I like the tab to be added regardless of any nodes

I was able to resolve this by adding new event based on the 'workspace:change event.

I added this js file to the array.

// editor-loaded-event.js'workspace:change', () => {'workspace:change', () => {});'editor:loaded');

The editor:loaded event will trigger only once after the app is ready.

Usage:'editor:loaded', () => {
    RED.notify('hello world');
});'editor:loaded', () => {
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.