API Explorer: how to collapse left navigation tree

In the API Explorer, is there a way to collapse the API tags in the left-hand navigation tree by default?

I have too many services, so having the API tags expanded is not ideal. I would like to see the following on loading the API Explorer page:


My application is Blazor WASM.

It’s not a built-in feature but you should be able to implement it yourself by adding a local file at /modules/ui/custom.js which will let you run custom js after the page is loaded and simulate clicking every expanded button with something like:

document.querySelectorAll('nav[aria-label=Sidebar] button').forEach(el => {
    requestAnimationFrame(() => {
        if (el.parentElement.childElementCount == 2) {