[Feature request] Automatically collapse directories where all files are viewed
When I'm reviewing a big PR I usually close each directory in the tree once I'm done reviewing all files in it. But when I refresh the page (for any reason, say the person that opened the PR pushed new updates) the tree is fully expanded again. It would be very useful to be able to automatically collapse the tree to only show directories with unviewed files.
Thanks for the suggestion @julioolvr
I'm wondering if storing the latest tree state in localstorage (only of the last PR viewed) will provide a better experience than automatically collapsing the tree. My thinking is that collapsing a tree because of a click somewhere else is indirect and confusing.
Will storing the latest tree state work for your use case? If so, I'm open for accepting a PR for this
That's a very good point - and yeah, that'd definitely work for my use case. The code seems pretty straightforward, I'll give it a shot at creating a PR 👍