When reviewing PRs, sometimes it's useful to view the entire file with the diffs in context. To do this, one needs to click the expand diff button multiple times until the entire file is exposed.
I'd like to be able to alt-click one of the expand markers in collapsed code and have all code blocks expand at once (perhaps limited to the current file). A similar feature was recently added to VSCode, btw, so there's precedence for this.
There is already a feature to view the file at the commit associated to the diff being viewed, but then the full code is shown unmarked, without the diff indicating what changed.
Also, please note that this is about expanding/collapsing code within a diff, rather than folding entire files, which was a previous feature and was removed after it was implemented directly by GitHub (see #1486). What I'm talking about is this:
IssueHunt Summary
expand-all-collapsed-code feature (#2151)IssueHunt has been backed by the following sponsors. Become a sponsor
@issuehunt has funded $50.00 to this issue.
Easiest solution: click all "expand" buttons until there are no more left, but this will cause multiple sequential loads and will look messy.
Ideal solution: load file from its "View file" link and then merge it with the current dom. This is probably a bit hard, especially on the split diff view.
Other solutions welcome
You can also clone the DOM node and replace it with the original one, then click on expand (from the original DOM tree) until there is no more left, and then put it back and remove the fake DOM node.
+1
I believe this is called unfold rather than expand in GH terms, because expand means expand/collapse of a file.
_Just wanted to add a comment to make the issue searchable with unfold tag. Thank you for the future implementation <3_
I believe this is called unfold rather than expand in GH terms
It doesn't look like it:

True, anyways, in their original blog post it was called unfold.. https://github.blog/2013-12-02-expanding-context-in-diffs/
Anyways, looking forward to seeing this feature :)
@adriantp has funded $10.00 to this issue.
Thanks, @tiramisu77 and @fregante! I just updated my extension to 19.9.19 and gave it a little test. It is indeed a little slow, as you noted in the PR comments, but considering that all you have to work with is UI elements, it works perfectly. Just alt-click one of the "expand" gutter buttons and all of the folded lines unfurl within a couple of seconds (depending on the size of the file and how many folded sections exist, obviously). Wonderful!
@sindresorhus has rewarded $54.00 to @tiramisu77. See it on IssueHunt
This seems to be just the thing I have been looking for. But how does one use it?
(I tried to Alt-click on the "expand" buttons at the side of the file, but it only expands as it would if I had clicked the button normally - no "expand all" to be seen.
Can someone please explain?
I just tried it and it still works. Here's a demo
Try refreshing the page before clicking the button, maybe that's the bug
And what you do is "Alt-Click" on this symbol? (That is, clicking when holding the Alt button?)
Does not work for me. Tested with Firefox and Chromium under Linux, and with Firefox (I believe) under Windows 10.
Would really like to have this working.
Not working for me either on macOS (trying option + click).
Really would like to use this tool!
me too! this is a big thing for me that is missing when viewing PR' but cannot get this to work on mac OS :(
I'm on Firefox/macOS and can always make it work.
alt and click here:
Click exclusively on the blue area in that screenshot, _not_ on the whole line, even if it highlights.
@fregante
Lucky you ;-)
I hold alt, and click in that blue box with the up-arrow and dots, and I get 20 more lines unfolding. Not all lines.
Firefox 68.10.0esr (64bit) on Windows 10.
Firefox 68 is not supported. Firefox 78 is the minimum version https://github.com/sindresorhus/refined-github/blob/f2a96713692c2227035b86a63714704d82b6f6bd/source/manifest.json#L8-L12
Linux users that can't make it work can try remapping the alt key: https://github.com/sindresorhus/refined-github/issues/3436#issuecomment-670446085
Most helpful comment
And what you do is "Alt-Click" on this symbol? (That is, clicking when holding the Alt button?)
Does not work for me. Tested with Firefox and Chromium under Linux, and with Firefox (I believe) under Windows 10.
Would really like to have this working.