Allow groups to be hidden and made visible via ui_control

I am trying to use the relatively new feature allowing groups to be hidden or made visible via the UI_Control node.

The only documentation I found is in the release notes. Are there any more details available. I have an UI with multiple tabs and up to 20 groups in each tab. What I want is to move from one tab to another and move focus to one on the 20 groups in the tab. I use a UI Control node to which I send a payload of {tab:“Temperatures”,group:{hide:“Group_1”,show:“Group_1”,focus:true}}. I can move to different groups based on a selection in another tab.

It moves to right tab but I cannot get to get the UI to focus on the group defined in the payload. I see some move of focus in the Temperatures tab but not always and i do not see a pattern in what is happen.

Is the valid use of this feature? If not, is there anyone who has an idea of another way of solving this problem?

Thanks in advance.

Mats

Yes. I need to fix the docs. The group name is the id in the JavaScript which is actually the tabName_groupName

I got this working now. Found a bug in my code … The only issue is that if there are two simultaneous users and one is using the feature of moving to a tab and set focus on a specific group the action will be done for both users. As I understand this in the nature of how Node-RED works and might be difficult to change.

Basically yes - the dashboard is not really multi-user.
But… when client’s connect they do get a socketid which every widget does send back as msg.socketid. If the socketid is present the control will only go to the relevant client.

How to use the socket id to provide multi user experience?

The socket.id indicates which session an input came from so if necessary a response can be sent back just to that session. Eg a change of tab, so one user changing tabs doesn’t change everyone else’s screen.

could you please write an example of what should be sent into the UI_Control node?

sending a 0 will switch to tab 0, and as per the readme - to control a group send a message like

{"group": {"hide": ["tab_name_group_name_with_underscores"], "show": ["reveal_another_group"], "focus": true}}

thank you

Hi @dceejay

Bit of a noob here so sorry in advance :slight_smile:

I have hit rather an unusual snag when running this logic {"group":{"hide":["Application_UI_Strega_UI"],"show":["Netvox_Leak_UI"],"focus":true}}

It has permanently hidden the Strega UI even if I delete all nodes. The only way to retrieve the group in the UI is to rename it "StregaUI" ??

I am pushing the JSON in with a Dashboard button and the control ui is set to "Connect, lost, change events"

Any pointers would be great

Hi,
not sure what the actual question is. If you are telling it to hide the group using the connect, lost, change events then it will be hidden... so to me that is working. What are you trying to do ?

I think I have muddled myself tbh!

I have an "Applications" tab with Groups set up that summaries multiple devices. Each device has a dashboard ui in a group within another tab "ApplicationUI". I am trying to link through to the ApplicationsUI tab and filter out the other groups which I think I have now managed with this: { "group": { "hide": [ "ApplicationUI_Wavetrend_Temp_UI", "ApplicationUI_Netvox_Leak_UI", "ApplicationUI_Strega_UI" ], "show": [ "ApplicationUI_Switchee_UI" ], "focus": true } }

I also want to try and use this method or similar to set a "Published" or "Unpublished" state that shows or removes the dashboard ui and save that state on future session so that when viewing the "ApplicationUI" tab without the filtered view from above I can only see groups set to published and those set to unpublished remain hidden.

Am I expecting too much from this node? And also is there a better way to "hide": ALL groups instead of defining each one as this could get messy as I increase the number of devices?

Thank you for responding on a weekend btw!