StylishThemes / GitHub Diff File Toggle


Version: 1.2.6+b395e6d updated

Summary: A userscript that adds a toggle to show or hide diff files


License: MIT

When viewing a commit diff, a file toggle button is added to each file header.


Click on the toggle button to either collapse or expand that file block:

In "enabled" mode, using Shift + Click will collapse or expand all file blocks to match the last clicked on toggle button.


An "accordion" mode was added which makes the toggles behave like an accordion.

  • When the page is initially open, the top-most file block will stay open while all other blocks will collapse.
  • When a collapsed block toggle is clicked, the file will expand and all other blocks will collapse.
  • All blocks can still be collapsed, but using Shift + click won't do anything.


This code is integrated into the GitHub Dark Script; it is available here separately. There is no need to install both.

Rating: 0