question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make `toggle-files-button` feature persistent across pages

See original GitHub issue

Currently the toggle-file-button feature is not extremely useful, as it basically gets you to the readme quicker, and that’s it. Ever since a new link popped up on the right side of the page, it might make sense to remove this feature as mentioned in #3580 and #3587.

But I think it would be very nice to keep this feature, and to give more usefulness by making it persist during navigation – meaning if the file list is toggled off, it will be off when reloading or navigating to a different repo page.

I seldom browse the repo files directly on GitHub, so having the list hidden by default would save quite a bit of scrolling (and yes I do know and use “Hide Files on GitHub”, but it doesn’t really help with this kind of repo for example).

Feature checklist:

  1. It doesn’t already exist as a userscript or extension.
  2. It makes sense as a default for everyone: if you hide the files on a repo page, there’s a good chance you might want it hidden on the other pages as well. Otherwise if you just want to jump to the readme, there’s a link for that.
  3. It doesn’t require options: if the list is open, it stays open ; if it’s closed it stays closed.
  4. It doesn’t require a lot of view/UI, code and effort to maintain: no new UI, but the business logic might be a tad tricky (I tried a naive implementation by adding a check in init() but it creates some annoying jitter on page load)
  5. It doesn’t require an external server.
  6. It doesn’t require too much HTTP traffic.
  7. It doesn’t enhance “Projects”

I’m willing to try implementing this if you accept it as a valid feature request.

Thank you for maintaining and improving this indispensable extension! 👍

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
fregantecommented, Sep 22, 2020

I agree, the reason we wanted to drop the feature was due to the Readme link already existing. However even that, only exists on the root of the repository.

Good point, let’s not drop the feature for this reason.

1reaction
fregantecommented, Sep 22, 2020

I think we can apply this suggestion.

  1. Update the feature to use elementReady: https://github.com/sindresorhus/refined-github/issues/2671
  2. Use the cache to remember whether the file list was closed
Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I retain toggle state across website? - Stack Overflow
Just put the javascript in the head. That way it executes it before the page loads, preventing the flickering (because head loads before...
Read more >
Feature Toggles (aka Feature Flags) - Martin Fowler
With a Toggle Configuration file you can now re-configure a feature flag by simply changing that file rather than re-building application code itself....
Read more >
.toggle() | jQuery API Documentation
When a duration, a plain object, or a single "complete" function is provided, .toggle() becomes an animation method. The .toggle() method animates the...
Read more >
View a page at a time, side by side - Microsoft Support
Tip: You don't need to go to the ribbon to switch between viewing a page and viewing thumbnails. With a mouse, press Ctrl...
Read more >
Add interactive buttons in InDesign - Adobe Support
You can create buttons that perform an action when the document is exported ... Toggles between showing and hiding specified buttons in the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found