I've made a custom NodeRed UI for my phone specifically (smart home like), where I just have 1 dashboard/site with groups for different topics such as Light and Cooling etc., and I'd like all groups to be collapsed by default when I enter the site.
Use ui-control node to detect connection events and then send the group object to collapse/hide all groups required. Read help text for ui-control node in sidebar.