Originally posted here:
Having a collapse/expand all button towards the top of the sidebar would improve usability and discoverability, while also simplifying sidebars with too much content open.