Announce node-red-contrib-msg-toggle (Feedback request)

Hi folks,

First my apologies to everybody waiting for developments on my other nodes, but have not much time and this one was just to much fun creating it ...

There was a nice proposal from @Steve-Mcl last week (see discussion) to have an inline clickable message switch. Had been playing with a similar idea some time ago, but had no idea to implement it at the time being.

So I implemented now the node-red-contrib-msg-toggle which allows me to easily test some of my other new developments. It is a simple checkbox that you can use to turn on/off message passing through at runtime (so no deploy required):

If you want to test it, you can install it directly from my Github repository:

npm install bartbutenaers/node-red-contrib-msg-toggle

As usual all 'constructive' feeback is very welcome! I assume some people won't like this node, but I would appreciate not having discussions here about 'why' I implemented this node. I am aware that the flow editor isn't a dashboard, I am aware that this can be implemented with a combination of other nodes, I am aware that Node-RED APIs might change in the future, ... Would be nice to have feedback on how I could improve my node further.

P.S. The thing I don't like about my implementation, is the fact that I had to use a DOM observer :woozy_face: Not a good solution, but I needed to have a reference to the DOM element, as soon as the node had been added to the flow editor (to be able to add my checkbox to it). However in the nodes:add the node hasn't been added to the SVG already, and I have no nodes:added event aferwards. If anybody has a better solution, please give me the golden tip!

Have fun with it !!
Bart

6 Likes

Correct me if i'm wrong; the discussion was about a passthrough of the message (ie. ignore the node), don't know if that makes a difference for your node, but it requires a different/overall implementation.

Hi @bakman2,
No you are right. The overal discussion was about ignoring nodes. But one of the side ideas was an extra switch you could insert. And in case I have interpreted that incorrectly, it was on my TODO list anyway so here it is ...

Regardless of the merits of the functionality, customising the appearance of the node like that is completely unsupported.

We reserve the right to change how the drawing code works at any time without worrying about it breaking things like this.

Breaking changes are likely to happen in 1.0 as we change the underlying CSS structure of the whole editor to tidy it up.

As for the functionality, let me repeat what I said in the previous thread:

None of that has changed in the four days since I posted it.