Skip to content

Add support for loading all large diffs at once #825

Closed

Description

@monperrus

Issuehunt badges

by default larges diffs are not shown. If a PR contains many large diffs, one has to go over them one by one and there is a risk to miss something in a code review.

It would be great to have a button at the top "load all diffs".


IssueHunt Summary

notlmn notlmn has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

Activity

  1. changed the title [-]add support for loading all large diffs at once[/-] [+]Add support for loading all large diffs at once[/+] on Nov 22, 2017
  2. sgabler commented on Nov 22, 2017

    @sgabler

    Just curious: when do you need to check those large diffs? For me, those are usually auto-generated files that I can safely skip. What is your scenario?

  3. yakov116 commented on Nov 22, 2017

    @yakov116
    Member

    @sgabler a feature branch can sometimes have many files changed drastically

  4. monperrus commented on Nov 22, 2017

    @monperrus
    Author
  5. hkdobrev commented on Nov 22, 2017

    @hkdobrev
    Contributor

    I think GitHub had something like this the first time they've stopped rendering large diffs, but they've removed it. It was putting too much load for them to render them.

  6. fregante commented on Feb 14, 2018

    @fregante
    Member

    ➡️ This should follow #821, #991 and #1042

  7. grgustaf commented on Apr 12, 2018

    @grgustaf

    Thumbs up on this... in particular it's frustrating that I do a painstaking code review, and the biggest file in the patch gets collapsed like this so that the author doesn't even notice all my comments in there as they leaf through. I'd suggest that diffs with comments be opened/loaded by default!

  8. fregante commented on Apr 12, 2018

    @fregante
    Member

    No default, GitHub hid them because large diffs are heavy on their servers.

  9. vchong commented on May 16, 2018

    @vchong

    +1 for a button at the top to "load all diffs". An additional possible use case is having to search for all occurrences of a particular string/function/etc in the diff, and hiding the large diffs hides some/all of these occurrences.

  10. leventov commented on Oct 16, 2018

    @leventov

    Anybody knows of any progress regarding this feature?

  11. fregante commented on Nov 24, 2018

    @fregante
    Member

    #1042 was dropped because GitHub implemented it natively.

    If anyone wants to send a PR, it's probably a matter of:

    • restore+rename the feature
    • replace the selectors
  12. added
    small
    on Feb 13, 2019
  13. 4 remaining items

  14. BillGeoghegan commented on Jul 8, 2019

    @BillGeoghegan

    I used this snippet in my console to see how well it would perform.

    document.querySelectorAll('[aria-label="Display the rich diff"]').forEach(button => {
      button.click();
    });
    

    The result... It performed sort of poorly with about ~100 backstop references in one PR loading their diff all at once, but it was certainly a lot faster than clicking all the diff buttons. 😄

  15. monperrus commented on Jul 9, 2019

    @monperrus
    Author

    Cool! Any way to embed this in a GreaseMonkey/TamperMonkey script?

  16. jm991 commented on Jul 12, 2019

    @jm991

    FWIW I have this issue on my team almost daily (games team) and I wrote some hacky JS to click all the buttons. Just press Ctrl+Shift+I in Chrome (Inspect) and run this in the console:

     var buttons = document.getElementsByClassName('load-diff-button');
    
     for(var i = 0; i < buttons.length; i++)  
         buttons[i].click();
    

    image

    It'll take a bit, but it'll click all of them for ya. No more going crazy clicking buttons.

  17. monperrus commented on Sep 3, 2019

    @monperrus
    Author

    Excellent, thanks a lot! Will that be activated by default?

  18. fregante commented on Sep 3, 2019

    @fregante
    Member

    It's not a default but you can click on any "Load diff" while holding the alt key, and all the collapsed diffs will be loaded — as long as they appear in the dom at that time (huge PRs may be paginated so you might find more "Load diff"s later)

  19. issuehunt-oss commented on Oct 31, 2019

    @issuehunt-oss

    @sindresorhus has rewarded $36.00 to @notlmn. See it on IssueHunt

    • 💰 Total deposit: $40.00
    • 🎉 Repository reward(0%): $0.00
    • 🔧 Service fee(10%): $4.00
  20. added and removed
    💵 Funded on Issuehunt
    on Oct 31, 2019
  21. aryehbeitz commented on Mar 1, 2020

    @aryehbeitz

    based on jm991's answer, I made it into a one liner:

    Array.from(document.getElementsByClassName('load-diff-button')).map(button => button.click())
    
  22. jumasheff commented on Mar 31, 2021

    @jumasheff

    One more stuff: document.querySelectorAll('.load-diff-button').forEach(node => node.click()) Source

  23. jacobrask commented on Feb 14, 2022

    @jacobrask

    Try this if you have a large PR, it will schedule the clicks

    document.querySelectorAll('[aria-label="Display the rich diff"]').forEach(button => {
      requestIdleCallback(() => button.click())
    })
    
  24. cecton commented on May 23, 2022

    @cecton

    It would be very nice to have a setting to enable this by default so the user don't have to press alt and click on one at all.

  25. cheap-glitch commented on May 23, 2022

    @cheap-glitch
    Contributor

    @cecton Sorry, but we don't do per-feature settings (it's a recipe for scope creep)

  26. locked and limited conversation to collaborators on May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedenhancementsmall

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions