sindresorhus/refined-github

Improve `expand-all-collapsed-code` #3472

Coder-256 posted onGitHub

Example URL: https://github.com/sindresorhus/refined-github/commit/86aad759940388a8de927c762e2025a8a2f0921d#diff-0730bb7c2e8f9ea2438b52e419dd86c9L42-L115

<img width="1387" alt="Screen Shot 2020-08-17 at 2 41 17 PM" src="https://user-images.githubusercontent.com/10134823/90431960-ccdde880-e097-11ea-98f9-0a4c79112cdb.png">

The way this currently works is that if you alt-click on any expand button, the whole file expands. There are a few ways I believe this could be improved:

  • Add a dedicated "Expand all" button somewhere in the file header (possibly under the ellipsis, but I think it deserves a dedicated space, even as just an icon)
  • Change the default behavior to only, yet fully, expand the bar you click on when holding alt. Often it is very tedious to fully expand the space between two parts of a file 20 lines at a time (in the link/screenshot, it takes 4 clicks for lines 43-114). The new alt-click behavior would be to fully expand just those lines, rather than the whole file.
  • Make it work properly with extend-diff-expander

  • Add a dedicated "Expand all" button

I wouldn't mind placing a button at the top and at the bottom of the file

<img width="1010" alt="" src="https://user-images.githubusercontent.com/1402241/90441216-7c36b180-e0d0-11ea-8652-875fcaf1efd3.png">

  • The new alt-click behavior would be to fully expand just those lines, rather than the whole file.

A button here would be easier to understand. I think the top/bottom buttons would be "expand whole file" while this button would be "expand whole cluster"

<img width="1387" alt="" src="https://user-images.githubusercontent.com/1402241/90441473-ed766480-e0d0-11ea-8495-bdcae790795f.png">

  • Make it work properly with extend-diff-expander

Indeed, that's an oversight. But if we add the buttons we can drop the alt-click behavior altogether

posted by fregante over 4 years ago

I think as a start we can can replace the alt-click with buttons at the top and bottom of each file. The second point can come later.

posted by fregante over 4 years ago

GitHub implemented this feature natively 🎉 #4149

posted by fregante about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests