Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarter sidebar default scroll state #2218

Closed
RunDevelopment opened this issue Mar 29, 2023 · 2 comments
Closed

Smarter sidebar default scroll state #2218

RunDevelopment opened this issue Mar 29, 2023 · 2 comments
Labels
enhancement Improved functionality help wanted Contributions are especially encouraged
Milestone

Comments

@RunDevelopment
Copy link
Contributor

Search Terms

theme, scroll, scroll state, side bar, sidebar

Problem

Since 0.23, every (non-class) function is its own page. This makes it harder to see the documentation of multiple functions quickly (e.g. to skim through what a library has to offer) since the sidebar does not remember its scroll state between navigations, so you have to scroll down to the correct spot each time.

Example:
Here, I scrolled down to see SomeType.
image

After clicking it, the sidebar scrolled back up.
image

Suggested Solution

I can think of 2 ways to address this problem:

  1. Don't change the scroll state of the sidebar if the sidebar's content doesn't change between navigations.
    This is could be trivially implemented if something like React client-side routing were to be used. Of course, adding client-side routing would likely be non-trivial, but it would also have additional advantages (such as no page flickering during loads).

  2. When loading the page, scroll the sidebar such that the current element is visible.
    This is similar to the behavior of IDEs like VSCode that scroll to the currently selected file in their file explorer.

@RunDevelopment RunDevelopment added the enhancement Improved functionality label Mar 29, 2023
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 1, 2023

Client side rendering doesn't play nicely with static html pages aren't served from a webpage, which is a feature I'm loath to give up...

I think the second solution would be a good change

@Gerrit0 Gerrit0 added the help wanted Contributions are especially encouraged label Apr 1, 2023
@Gerrit0 Gerrit0 added this to the v0.24 milestone Apr 3, 2023
@Gerrit0 Gerrit0 mentioned this issue Apr 3, 2023
8 tasks
@Gerrit0 Gerrit0 closed this as completed in 0b9ed4f Apr 8, 2023
@RunDevelopment
Copy link
Contributor Author

Thank you @Gerrit0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

2 participants