Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork66
Make sidebar scrollable and sticky (on modern browsers)#91
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Just make the sidebar stick to the top with CSS and show a scrollbar onoverflow. There's no fallback for older browsers -- since up to now,this didn't work for anyone (because "intelligent" scrolling has beenbroken for years), I assume improving the UX at least for modernbrowsers is still a net improvement.
the-knights-who-say-ni commentedNov 8, 2021
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed thePSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please followthe steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You cancheck yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
For more info, seemy comment on the associated issue. |
(The buidl artifact is available here for local tests :https://github.com/python/python-docs-theme/actions/runs/1434325782) |
Hmm, interesting. What OS/browser? I'm asking because I can't reproduce this on Linux on either Firefox or Chrome: The sidebar still overflows a bit as a result of the switch to Just to make sure: if you accesshttps://docs.python.org, I suppose the sidebar renders correctly?
Definitely worth a separate PR, if at all :) Personally, I don't think I've ever clicked it, but I've seen comments in threads concerning the Python docs theme from people who seem very fond of it, and removing it would undoubtedlybreak their workflow. |
dlukes commentedNov 25, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
OK, so right after I posted my previous reply, I accidentally stumbled upon a way to trigger the behavior you're experiencing... Sigh, typical. It's sort of weird though -- for some reason, the sidebar gets out of whack whenever a browser UI element pops up at the bottom (???), e.g. the search bar: Or the dev tools pane: I've no idea how or why this is happening but I'll investigate. (I'm guessing something funky is happening with the sidebar's JavaScript, which makes me want to get rid of the whole thing, but see above.) |
Oh, and zooming in on the page also triggers the behavior you've described. |
Sorry for the long turnaround, it's a busy time of the year, my wife and I are expecting a second daughter in a month or so, etc. :) Please take a look at the fix I just pushed, when you get a chance, and let me know if it works for you,@JulienPalard and@hugovk. It should even fix an existing bug in the placement of the «, which is meant to stay put vertically centered in the viewport, but gets out of whack when you adjust the zoom level of the page. Other than that, should I worry about what happens when using a browser that doesn't support viewport units? Especially w.r.t. to the collapse button -- honestly, I'd rather not put too much work into making it behave nicely on older browsers if it's going to be axed at some point in the future anyway. |
(a build artefact is available for local tests in the "Checks" tab) |
dlukes commentedDec 13, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks! I've noticed another issue though -- when the content is short, the sidebar still stretches to full viewport height. I mean, that's what the CSS says, so of course it does :) Here's what it looks like, my patch on the left, current version on the right: I assume we'd rather keep the current behavior? Adding so much empty space is not exactly broken, but it's definitely unnecessary. |
I've pushed a fix which relies on flexbox instead of floats for the sidebar layout. Let me know what you think. |
LGTM, tested on Firefox 95 (on Debian (desktop)) and on Firefox 91 (on Mobian (phone)). I'd appreciate if someone else could take a look at it before merging, I don't trust my skills at reviewing front-end. |
Thanks@dlukes for the PR ! |
Thank you for the assistance! If you have a minute, I'm just curious -- when can I expect this to land on the live website? Very roughly speaking of course -- next patch release, next minor release? Later than that? |
I released python-docs-theme v2022.1 with your commits, so it's just the time to wait for a new build on the backend, which is govenred bya daily cron, so 24h max. In fact the cron has already picked up some, likefr/3.9 so you can already see it online, 24h being the time for it to be fully deployed on all versions and all languages. |
Oh wow, great! |
Fixes#20.