-
Notifications
You must be signed in to change notification settings - Fork 201
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
✨ NEW: Collapsible lists in sidebars #226
✨ NEW: Collapsible lists in sidebars #226
Conversation
Ooooo, nice! My only suggestion would be to make the "indicator" for collapse floated to the right -- like in Just the Docs. |
Thanks, @pradyunsg for the suggestion. Have added the change. Lemme know what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the look and 2 more suggestions:
- The current "slow" speed is too slow, and I think a faster animation (or no animation) would be much better. The user is trying to navigate the tree, and is not here to watch animations. :P
- The "chevron" feels too big and also gets hidden underneath the MacOS's hidden-unless-scrolling scrollbar. Inline suggestion to work around this below.
This looks really nice! Thanks @AakashGfude for the work! In general I think this functionality is just what we want and I like the minimalist approach. Agree with @pradyunsg's comments re: size and speed, I think some minor tweaks would improve things a bit How do buttons like these get added to sections? e.g. I noticed that the sub-sub-sections don't have the button so just curious how the behavior should be controlled. |
Thanks @pradyunsg for the detailes suggestions. will implement them.
I was doing it for the kids. but I guess I had the user base a bit wrong. 😅
@choldgraf at present the buttons are also assigned to |
@pradyunsg I probably would not go for too much margin values, because it varies between screens dimensions. on my laptop. the latest margin value already does a lot of separation. Mine is MacOS as well. but there seems to be an intrinsic margin for the scrollbar even when it's not visible. and the icon gets shifted left when the scrollbar appears. |
Looks good cheers @AakashGfude |
@chrisjsewell the opening/closing of lists don't work. and the sidebar goes back to functioning like before. the chevron icons are still there though. |
thanks for looking, yeh the main by is obviously that the site should still be useable if JavaScript is disabled, but it sounds like that is not an issue So, I've had a look now. A few issues:
|
Aweome @chrisjsewell . great points.
This sounds good.
We should definitely handle all expandable sections. not sure if it should be in theme.conf though. As this extra config may not be that useful or used. Everyone would probably just want all of their sections to be collapsible?
From the looks of it doing what just-the-docs does atm, won't change anything in comparison to present implementation from the user experience point of view? i.e., just-the-docs also navigates to the section and opens it up. Our navigation through the sidebar makes the whole sidebar jittery on a new page load, which makes the experience quite unpleasant in comparison to just-the-docs. We should probably fix this jitteriness first and then see? |
No it doesn't, not if you click directly on the chevron |
In just-the-docs, the chevrons are completely seperate (from the text), clickable SVGs, rather than fontawesome icons |
ahh yeah. did not click directly in the chevron to open up a different section. my bad. but clicking on a title to navigate to a different section is a bit unpleasant though 😬 . Which we can probably target as a separate issue in a later release :) |
have made only the icons clickable like just-in-docs now. for everyone to try and give feedback on. |
The feedback is that it doesn't look lol. Your chevrons are still underneath the links |
Oops haha. Sorry, in transit. Will reach a stable place and push the rearrangement of elements edit. Sorry for giving false hope. |
@chrisjsewell should be in a working state now. |
Yep the chevron only collapsing works now thanks. I wonder if we should make that more intuitive though? Something like the cursor icon changes when you hover over it? |
That's a good idea. some ways can be 1) increase the font size on hover 2) change color 3) change background-color |
TODO:
|
Have added color change when hovering on icons. Icon size increase and the border getting colored didn't look right. ideas on anything more dramatic are welcome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're making the collapsing chevrons recursive, I think we should also start with the deeper levels collapsed by default.
Looking better 😄 I would definitely like to control the initial collapsed level though (via a config value), i.e. I think for the documentation here, this is how the ToC should initialise: this would be something like |
Oh I just noticed this is similar to what @pradyunsg said, but yeh it should be configurable |
I think this looks really nice! Two quick thoughts:
|
Why should these alway be shown by default? |
I'm making the assumption:
I agree that in theory they could be clickable, we change how Sphinx handles the relationship between |
Also just a note - I wouldn't have a problem with this if the caret only showed up upon hover. If that was the case then I wouldn't mind one way or another - mostly I think it's just too visually-cluttered to have all the carets at once (at least at the top level) (this specific grouping of links is what made me think this) |
oh yeh just pre-approving, assuming the docs will be updated |
Yes, in the process of writing the documentation. |
cc2408e
to
2035454
Compare
Have written documentation but not sure how clear it is. Someone with better writing skills, please check 😬 . |
Yep looks fine to me. Let's get this show on the road! |
One question - I noticed that the default depth is 2. Which means that by default we'll show top-level chapters and each of their nested sections (but we won't show sub-sections). That deviates a bit from the typical Sphinx theme behavior, which only shows top-level behavior, right? My intuition is that we don't want the SBT to behave that different from most other Sphinx sites. What do you all think about setting the default level to |
Is this not also in some way controlled by the |
Ah - I always thought that |
Yeh not sure, never really thought about it TBH |
|
Also because we are explicitly specifying the
And I reckon we want this, otherwise, we won't be able to show sections(expand) at all, as it won't be there in the generated HTML itself. If the max depth were, for example, 1 |
I see, I guess the question is, should there ideally be any integrations with |
I think we can utilize |
Have made the default level as 1 now. |
For sure its more important when you don't have access to these collapsible ToCs But, I guess for maximum configuration, it would be ideal to be able to say "under this section I want everything collapsed, and for this section I want to uncollapse one level, ...", i.e. it would be used like a per-toctree |
I'm +1 on this as well (assuming this is how Sphinx expects us to use |
ah - just noticed a problem. If I'm on a page then its children are not collapsed: e.g.: https://sphinx-book-theme--226.org.readthedocs.build/en/226/reference/subchapter1b/index.html# when I click that link, the sub-pages underneath do not show up |
ooh yeah, grrr, forgot about this feature. :( |
@choldgraf, Have added the feature to expand immediate child ul as well on clicking a link, or page load. let me know how it feels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks great!
alright! Features in, tests happy, docs written, thumbs up given, let's merge it in and start playing around with it! 🎉 Thanks @AakashGfude for the improvement! |
cheers! |
I kinda wanna cut a little release...@chrisjsewell did the sidebars update give you any trouble? I wanted to make sure we didn't introduce any bugs when that one got merged. |
they look pretty good to me! |
A minimalistic collapsible TOC heading feature which looks like:
The transition speed of opening and closing the panel is in the "slow" setting and the speed can be increased.
One abruptness in the whole experience is that since the clicking on a heading leads to the loading of the heading page, the panel does not open/close (due to obvious reasons). Which we can either leave as it is, or go beast mode and make this theme a single page application (probably not)
Tests have not been implemented yet. Will do it once the design/functionality is finalized.
cc: @choldgraf @akhmerov @pradyunsg
fixes #112