Make a new bookmark in your browser. Set the name to Close all PR files
(or something else you like) and set the URL to:
javascript:void((function(d){d.querySelectorAll('div:not(.Details--on) > div.file-header > div.file-actions > button').forEach(function(x){x.click()});})(document));
Click the bookmark to close all files in your PR.
Based on ideas from @yardensachs and @benjamincharity.
very helpful. thanks Lars.
btw do you know if there exists a reverse of this bookmarklet?
I'm interested in expanding all files and look out for any comments left out which was not addressed in new commits.
It can be very helpful in code reviews and checking all the comments.