Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make collapsed diffs more visually distinct #7338

Open
dimo414 opened this issue Apr 23, 2024 · 0 comments
Open

Make collapsed diffs more visually distinct #7338

dimo414 opened this issue Apr 23, 2024 · 0 comments

Comments

@dimo414
Copy link

dimo414 commented Apr 23, 2024

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant