Add the ability to collapse or minimize diffs in commits and pull requests (BB-8221)

Issue #7086 open
Virgilio Favero Neto
created an issue

Hi there,

It would be great if we could collapse the diff of a file when reviewing a pull request. That would allow us to reduce the scrolling area as we go reviewing.

Is this feature already on your roadmap?


Comments (46)

  1. Oliver Shaw

    +1 -- Could see this having a small positive effect on traffic if it were to only display large diffs after requesting them (hide all over 2MB or 1000 lines for example)

  2. Joshua Swanson

    Since it appears this is not going to be done, I've written a quick bookmarklet to do it for me - you may also find it useful, so I'll share it here:

    javascript:(function() {$(".diff-container .heading").find(".aui-buttons:first").append($("<button>").addClass('aui-button').text('Minimize').click(function(e){$('div.diff-container').find(".diff-content-container").toggle();}));})()

    This adds a little "button" to each diff that lets you easily minimize it

  3. Gerson Goulart

    +1. And in all honestly, even if this is not considered to be the feature with the most aggregated value there is, in four years this could have been implemented, could it not? Team, Bitbucket is awesome but this would be a very welcome refinement.

  4. Tristan Warner-Smith

    There are files across many different platforms that are necessarily in source control but unnecessary to review. I've already seen a request to exclude certain files from PRs get the WONT FIX tag, but the ability to manually collapse a file seems like a no-brainer for those of us with these types of files. We've got a 'Show more lines', please, please add a collapse option that simply brings a thousand line file commit to it's minimum displayable.

    I won't even complain if it's hidden in the ... menu.

  5. Sam Lobel

    Quick PSA: The easiest way to get this set up is add a bookmark to javascript which does this for you. Joshua Swanson's comment works as of me writing this. Right-click on your bookmark bar, select "New Bookmark", name it whatever you want, and then in the "location" field copy this code:

    javascript:(function() {$(".diff-container .heading").find(".aui-buttons:first").append($("<button>").addClass('aui-button').text('Minimize').click(function(e){$('div.diff-container').find(".diff-content-container").toggle();}));})()

    Then, you can just click that bookmark any time you want minimize buttons to show up.

  6. Abraham Bah

    +1 Remove large files from the diff and display a warning label instead. Something like Content truncated due to large file size. Click here to view the full diff

  7. Log in to comment