[WIP] Add ability to collapse entire files in the diff view.

Review Request #9337 — Created Oct. 27, 2017 and discarded — Latest diff uploaded


Review Board


When viewing the diff of a review request not all files need to be
viewed, for example minified files don't need to be reviewed. It is
also helpful to have a way to hide files you have already reviewed.

Now files can be collapsed and expanded as the user wishes. Also,
minified files are collapsed by default.

In a previous commit clicking the new button whould hide the diff
information as well as the links to download the file. I have changed
it no longer hide the download links so that it matches files hidden
with the "Hide/Show whitespace changes" button.

I modified the function toggleWhitespaceOnlyChunks in
diffReviewableView.es6.js so it now takes in a boolean value to indicate
if the files should be shown or hidden. I made this change because I needed
the "Hide/Show whitespace changes" button to work with the button to hide/show
a specific file, and without specifying if files should be shown or hidden it
would have caused issues where clicking "Hide whitespace changes" would hide
some but show others if they were already individually hidden with the new

Unit tests have not been written yet.

Also it might be worth mentioning that because the existing
"Collapse changes" button reloads the page, any files that were
manually collapsed or expanded will return to their default state.