People have been asking for this ability for a long time back in the hay day of Flex and as you are asking now for the same ability in WAB. The issue is that though this seems like a very logical and maybe even simple request by end users, this is by no means a simple thing programmatically for developers. The complexity of the code that would be involved has made me table this enhancement many times back in my flex days. Just FYI from a developers perspective.
Is there a way to implement something similar to the AccordionContainer in Dojo in Web AppBuilder? The ability to group layers into folders or containers would be a huge help in web apps that have more than a small number of layers.