Repository navigation
Description
Description
By default GitHub hides "large" diffs behind a "Load diff" link, nominally because the files are likely generated (such as lock files) or simply big enough to flood the page, however in my experience the thresholds / heuristics it uses to determine a diff should be collapsed are too permissive and fairly often hides relevant content, even hiding the "meat" of a PR (e.g. a particular class/module and its associated test files) and only displaying the secondary refactorings that aren't nearly as important as the hidden diffs.
Obviously there are some diffs that make sense to hide, even if GH's thresholds could be tuned, but what is particularly problematic is the "Load diff" UI is very nondescript. Scrolling through a large PR it's easy to miss, and ctrl-f-ing becomes useless when there are hidden diffs.
Some thoughts on potential improvements Refined could provide:
- Change the color / formatting of the hidden-diff block to make it stand out more
- Change the plain blue "Load diff" text to a larger and more visually obvious button element, possibly with a separate "Load all diffs" button alongside (see below)
- Add an indication that there are hidden diffs at the top of the page, similar to the "0 / n files viewed" element
- Change the UI of hidden-diff files in the sidebar, e.g. greying them out and/or adding a "load" / "load all" button in the sidebar
- Detect when the user attempts to ctrl+f while there are hidden diffs on the page and display a warning
I came across #825 while searching the repo and it's useful, however it's hard to discover this feature (it'd be much nicer to add a "Load All Diffs" button to the page, and there isn't a tooltip or other UX to help users realize alt-clicking will do something) and b) it doesn't address the initial issue of realizing there are hidden diffs in the first place.
Example URLs
Not the best examples, since the PRs aren't otherwise very large, but you can at least see the behavior:
Activity
fregante commentedon Jun 5, 2024
This has been an issue for the longest time and the solution is simple:
This might be a bit annoying for generated files like
package-lock.jsonbut it's otherwise obvious that large diffs take a large space on screen, even if hiddenabhishek-yadav-ravsab commentedon Sep 4, 2025
simonepri commentedon May 6, 2026
I'd like to contribute on this.
Do you think it would make sense to move the generated files at the end of the file list (instead of hiding them, possibly with some visual separation)?
On top of that, wdyt about just expanding all non-generated content? (maybe with some detection for pathological cases). I guess this last one is more controversial and is probably not need if we merge #9347 (i.e. people can just click the expand all button).
fregante commentedon May 6, 2026
It's too messy to sort files in the DOM because GitHub will load only files that are visible in the viewport.
I think GitHub's current logic already makes sense, it hides:
Neither one should be auto-expanded, also because it triggers an HTTP request and a delayed scroll, which is already pretty bad natively.
So the only fix for this issue would be a 1-line CSS rule in
refined-github.cssas previously described:simonepri commentedon May 6, 2026
I'm not sure I understood your idea here, you mean to make the part that says "Load Diff" taller for large, non-generated files?
fregante commentedon May 6, 2026
Yes, this was described in the initial issue:
fregante commentedon Jun 2, 2026
Done:
We have
toggle-everything-with-alt, but most likely it won't work due to deferred loading.I think this is covered by the cmd-f warning, which nowadays would be on all the time since GitHub only renders files in/near the viewport. So effectively most files will be "hidden" at any given time.