github_pr_tree icon indicating copy to clipboard operation
github_pr_tree copied to clipboard

[Feature request] Automatically collapse directories where all files are viewed

Open julioolvr opened this issue 5 years ago • 2 comments

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.

julioolvr avatar Jul 21 '20 14:07 julioolvr

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

berzniz avatar Aug 04 '20 08:08 berzniz

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 👍

julioolvr avatar Aug 04 '20 11:08 julioolvr