You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for loading all large diffs at once #825
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".
Need some help from other developers? Add your repositories on IssueHunt to raise funds.
IssueHunt has been backed by the following sponsors. Become a sponsor
Reacted by Ezra Jennings, santhoshbalakrishnan-okta, V, Jared Watts, Magnus Hiie, Roman Leventov, Dustin Lineweber, mtschoen-unity, Alexander Zaykov, David Pettigrew and 45 more
Reacted by Irit, Natasha Urbancic, Hafsa Batool and harisoyo
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?
@sgabler a feature branch can sometimes have many files changed drastically
Reacted by Dustin Lineweber, Gregory Seidman, George Hahn, Berk Soysal, Brian Bugh, ~, Sammy Lee, Henggang Cui, Daniele Orru', Danver Braganza and 7 more
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.
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!
Reacted by Henggang Cui, Dave Broers, David Wood and Arup Raton Roy
+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.
Reacted by Akankshya Purohit, Saku Erla and Henggang Cui
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. 😄
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();
It'll take a bit, but it'll click all of them for ya. No more going crazy clicking buttons.
Reacted by Martin Schayna, Anton, Ihor Poliakov, Aryeh Beitz, Nikita Amelchev, Mark Snijder, Tomas Pesek, Jeremy Cavner, Raul Villora Valencia, Ting Zhi and 4 more
Reacted by Raul Villora Valencia, harisoyo and Paul Larionov
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)
Reacted by Pavel 'Strajk' Dolecek and bbi-davidgalloway
Activity
[-]add support for loading all large diffs at once[/-][+]Add support for loading all large diffs at once[/+]sgabler commentedon Nov 22, 2017
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?
yakov116 commentedon Nov 22, 2017
@sgabler a feature branch can sometimes have many files changed drastically
monperrus commentedon Nov 22, 2017
hkdobrev commentedon Nov 22, 2017
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.
fregante commentedon Feb 14, 2018
➡️ This should follow #821, #991 and #1042
grgustaf commentedon Apr 12, 2018
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!
fregante commentedon Apr 12, 2018
No default, GitHub hid them because large diffs are heavy on their servers.
vchong commentedon May 16, 2018
+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.
leventov commentedon Oct 16, 2018
Anybody knows of any progress regarding this feature?
fregante commentedon Nov 24, 2018
#1042 was dropped because GitHub implemented it natively.
If anyone wants to send a PR, it's probably a matter of:
4 remaining items
BillGeoghegan commentedon Jul 8, 2019
I used this snippet in my console to see how well it would perform.
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. 😄
monperrus commentedon Jul 9, 2019
Cool! Any way to embed this in a GreaseMonkey/TamperMonkey script?
jm991 commentedon Jul 12, 2019
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:
It'll take a bit, but it'll click all of them for ya. No more going crazy clicking buttons.
monperrus commentedon Sep 3, 2019
Excellent, thanks a lot! Will that be activated by default?
fregante commentedon Sep 3, 2019
It's not a default but you can click on any "Load diff" while holding the
altkey, 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)issuehunt-oss commentedon Oct 31, 2019
@sindresorhus has rewarded $36.00 to @notlmn. See it on IssueHunt
aryehbeitz commentedon Mar 1, 2020
based on jm991's answer, I made it into a one liner:
jumasheff commentedon Mar 31, 2021
One more stuff:
document.querySelectorAll('.load-diff-button').forEach(node => node.click())Sourcejacobrask commentedon Feb 14, 2022
Try this if you have a large PR, it will schedule the clicks
cecton commentedon May 23, 2022
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.
cheap-glitch commentedon May 23, 2022
@cecton Sorry, but we don't do per-feature settings (it's a recipe for scope creep)