Skip to content

GitHub toggle expanders

Rob Garrison edited this page Oct 24, 2022 · 22 revisions

A userscript that toggles all expanders when one expander is shift-clicked

  • This userscript works on repository commit, release, pull request & compare pages.
  • Toggle expanders ()
    • Click to toggle a single expander as normally.
    • Use Shift + Click on an expander to toggle all expanders within a date block (New behavior in v2.0.0)
    • Use (Ctrl or ) + Shift + Click on an expander to toggle all expanders on the page (New behavior in v2.0.0).
    • Example page: https://github.com/torvalds/linux/commits/master (Shift + click on a commit title ellipsis).
  • Resolved Outdated reviews (added v1.1.0; updated v2.0.0)
    • Click to toggle the resolved review as normally.
    • Use Shift + Click to toggle all outdated blocks within a single review.
    • Use (Ctrl or ) + Shift + Click to toggle all resolved blocks on the page.
  • The script was inspired by this thread: https://github.com/dear-github/dear-github/issues/193 and pull #22.
  • Click this link to install from GitHub; or, install from GreasyFork or OpenUserJS.

  • Compare pages

    • Click to toggle a single expander as normally.
    • Use Shift + Click on an expander to toggle all expanders on the page.
    • In this case, adding the Ctrl key does not change the behavior. As requested.
  • As mentioned in issue #135, the state of the toggle expander is not shown by the button itself. If you use Stylus, you can add, and adjust the following css to change the color:

    .Details--on .ellipsis-expander {
      background: var(--color-scale-blue-2);
    }

Screenshot

Expanders

github-toggle-expanders

Outdated Reviews

github-toggle-expanders-outdated

Change Log

Version 2.1.0 (2022-10-24)

  • Fix resolved comments toggling.
  • Update dependencies.

Version 2.0.1 (2020-12-18)

Version 2.0.0 (2019-09-02)

Update to use new GitHub class names:

  • Changed commit, release & pull request behavior:
    • Using Shift + Click on an expander only toggles the other expanders within a date block.
    • Using (Ctrl or ) + Shift + Click on an expander now toggles all expanders.
  • Fixes issues #100, #101 & #87.

Version 1.2.0 (2019-06-13)

  • Allow shift-click only on compare. Fixes issue #87.

Version 1.1.4 (2019-02-16)

  • Update GitHub icon.

Version 1.1.3 (2018-08-15)

Version 1.1.2 (2018-08-13)

Version 1.1.1 (2018-01-18)

  • Update assets.
  • Fix lint issue.

Version 1.1.0 (2017-06-15)

  • Add support for toggling outdated pull request reviews. See pull #22; thanks @cmalard!

Version 1.0.6 (2017-05-16)

  • Change license to MIT.

Version 1.0.5 (2017-05-14)

  • Update to work in releases pages; thanks @darkred!

Version 1.0.4 (2017-03-25)

  • Fix linting.

Version 1.0.3 (2017-01-11)

  • Clean up closest function.
  • Use classList toggle.

Version 1.0.2 (2016-09-29)

  • Target selectors inside of commit lists. Fixes issue #8.

Version 1.0.0 - 1.0.1 (2016-09-17)

  • Initial commit.
  • Fix URL.
Clone this wiki locally