Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.92 KB

README.md

File metadata and controls

42 lines (29 loc) · 1.92 KB

githubCollapseJunk

Install

Automatically collapses low-value "junk" files on GitHub PR diff pages, so you can focus on the files that actually need review.

alt text

Junk buckets detected out of the box:

  • Test files (*_test.go)
  • package-lock.json, go.mod, go.sum
  • *.svg files
  • Deleted files
  • Renamed files with no content changes
  • Binary files
  • Files GitHub marks too large to render
  • Generated files GitHub doesn't render by default
  • .ts files generated by tygo (start with // Code generated by tygo. DO NOT EDIT.)
  • and more!

Adds a "Collapse Junk" button next to "Submit comments" that toggles all detected junk files between collapsed and expanded.

It also updates the "changed lines" counts at the top of the page to no longer count junk files towards a PR's size, with a hover/focus tooltip on that count showing the original, pre-exclusion totals. Note that this only updates once you view the Changes page on the PR.

alt text

Works great in conjunction with the File Tree Colors script.

To-do / Features to add

  • Add a "force collapse" and "force open" button?

These will involve creating settings that the user can configure.

  • Disable the auto-collapsing of files in the file tree.
  • Configure the ability to disable the auto-hiding of junk files upon page load.
  • Configure the different classifications of junk files. (Disabling/enabling)
    • Maybe allow for the addition of new ones?
  • Be able to mark some files as viewed when pressing the button, or upon loading.
    • What is the mechanism for this? An arrow-dropdown on the button?
    • Maybe four sections, in a 2x2 grid: "Upon page load" and "Upon button press" on the top, and on the side is "Collapse" and "Mark as viewed"