-
-
Notifications
You must be signed in to change notification settings - Fork 66
make sidebar sticky #20
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
Comments
Hi @v-python, sorry you had a not-so-friendly experience reporting this! In terms of stickying the sidebar, it's problematic because many time it prevents navbars with lots of items from being completely visible or users with smaller screens from seeing the entirety of the sidebar. Do we have any solutions to that? |
Sidebar content can be in independently scrollable container, with no constraints on height, limited to window height. If the window height is big enough for the sidebar content, no scrollbar appears. If the sidebar content exceeds the window height, you get an extra scrollbar for it. |
And that would allow you to scroll the sidebar content while still seeing the main content where you were, which might be helping to give you context for what you want to look for in the sidebar. And another annoyance I've had... you scroll to top to search the sidebar, but lose the context of where you were, if you don't find what you were looking for in the sidebar, and want to return to where you were in the main content, but you had to scroll away to find the sidebar. |
i reported this as a bug in 2018-05-07 https://bugs.python.org/issue33442. Do you need help resolving it ? I feel it should be easy to replicate and resolve as the python 2.7 documentation theme works fine. |
Yes, this is a volunteer project. We're happy to review pull requests. |
I'm also still skeptical of this change being "the best thing to do". @Mariatta, what are your thoughts? |
Mariatta was mentioned, but she's out of open source for the rest of September 2018. Be aware she might not get to this until October 2018. |
There's a patch in an issue on b.p.o here https://bugs.python.org/issue24712 that looks to work for 2.7. But nothing works in 3. We definitively need help here, front-end is not my thing þ |
There's an almost duplicate of this issue on b.p.o : https://bugs.python.org/issue32393, I mean if we make the menu sticky, let's not make it jitter. |
We merged the patch from https://bugs.python.org/issue24712 to the 2.7 branch it should no longer flicker. Still have to fix Python 3 version (I don't know how to do it). |
So this has been a fun bit of archaeology :) If you'll indulge me: Once upon a time, the custom CSS for the Python docs theme lived in a single file, Then, the docs switched to a new, lighter design, which introduced a second CSS file, Some time thereafter, someone noticed that the TOC in the sidebar was wont to ascend to the celestial heavens when scrolling the document, which made it inconvenient to quickly navigate it. Time and again, one had to scroll back to the top to peruse the TOC: status_quo.mp4(We're currently back to this state as of a7b271a.) And there was much furrowing of brows and stroking of chins, which resulted in intelligent scrolling being implemented unto the sidebar. And there was much rejoicing, for the sidebar would now stay to the side, instead of disappearing Up and Out: intelligent.mp4(This state can be recreated with dlukes@6d16fb2.) But lo! A fatal flaw slipped into this laudable endeavor. Crucial CSS properties were added to the older of the two CSS files instead of the newer. In due time, that older CSS file was removed, as it had run its course, and those crucial CSS properties with it. Without them, intelligent scrolling became but a shadow of its former self. Which is to say, it didn't work at all. In the meantime, people had started noticing that intelligent scrolling was prone to make their browsers all jittery. Even the Firefox Developer Console oracle was complaining "This site appears to use a scroll-linked positioning effect.", in the amber tones of a mild admonition. This was because intelligent scrolling relied on the dark arts of JavaScript to work its scrolling magic. And there was much complaining and hand-wringing. But web standards had evolved, and it was now possible to use modern CSS features, like the almighty Except in a dark twist of fate, it turned out this fix wasn't actually equivalent! For it made the sidebar completely unscrollable. And so, if it was higher than the viewport, the nether regions of the TOC became entirely unreachable: sticky_broken.mp4(This state can be recreated with dlukes@3ec5872.) I'll drop the storytelling tone, as it probably stopped being funny a while ago, if it ever was :) Key takeaways: the original "intelligent" scrolling can be easily restored, but it can be jittery and people seem to mind, so it's probably not worth it. Plus it's actually somewhat inconvenient, since if you want to scroll the TOC, you have to scroll the main document too. Replacing it with Instead, I propose the following "dumb" scrolling approach: use dumb.mp4(This state can be recreated with dlukes@5ee3053.) As a bonus, this gets rid of the warning in the Firefox console. For older browsers (which don't have Ultimately, this commit is what I ended up with. Can I open a PR? I really should have been doing something else today, but I got bitten by this annoyance one time too many, so here we are -- I'd at least like to make it count :) |
I guess I'll just do it and we'll see how it goes :) |
@dlukes Hahaha, thanks for the story time, I always appreciate archeology! |
All the relevant comments are over there https://bugs.python.org/issue28044 which got closed as soon as I added my comment, which isn't a particularly friendly sequence of events. If the issues there are outdated, they should be marked outdated and transferred here as part of the transition.
My comment is that the sidebar menus scroll off the top when you scroll down the page, so they are pretty useless, instead of helpful.
Nice implementation of sticky sidebar.
https://css-tricks.com/sticky-smooth-active-nav/#more-273952
I haven't looked at the patch, and don't know what R. David Murray doesn't like about how it works, but I find the Python sidebar extremely annoying because it scrolls off the top, and would rather it stayed around visible.
The text was updated successfully, but these errors were encountered: