godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Make sidebar categories collapsible

Open YuriSizov opened this issue 3 years ago • 6 comments

An alternative for https://github.com/godotengine/godot-docs/pull/5948. I like it more.

https://user-images.githubusercontent.com/11782833/179815915-9366498c-cabd-43f9-af9d-6c049664a3c1.mp4

YuriSizov avatar Jul 19 '22 13:07 YuriSizov

Is the current category always un-collpased? I.e. if I'm landing on a page from Google? Likewise, maybe the first category should be expanded by default when on the start page?

mhilbrunner avatar Jul 19 '22 15:07 mhilbrunner

Is the current category always un-collpased? I.e. if I'm landing on a page from Google?

Yes, the category that the page belongs to is expanded by default.

Likewise, maybe the first category should be expanded by default when on the start page?

Well, sure, I don't mind but it also doesn't really matter IMO.


It does look a bit idle and not clear that you can interact with the titles on the main landing page, that is true. But as several people suggested on Twitter, I should probably add an arrow/chevron/plus character to indicate that they are expandable.

YuriSizov avatar Jul 19 '22 15:07 YuriSizov

It does look a bit idle and not clear that you can interact with the titles on the main landing page, that is true. But as several people suggested on Twitter, I should probably add an arrow/chevron/plus character to indicate that they are expandable.

I agree with that, besides that this does look cleaner IMO :)

mhilbrunner avatar Jul 19 '22 16:07 mhilbrunner

Added an arrow to better indicate that sections can be toggled. The video in the OP is updated.

Some people on Twitter complain that auto-hiding other sections when you open another one is not something they'd enjoy. Opinions? I think it's okay to auto-hide, as it keeps the list focused and you don't really need to work with multiple sections at the same time. You need to get to the article you want as fast as possible.

YuriSizov avatar Jul 19 '22 17:07 YuriSizov

Some people on Twitter complain that auto-hiding other sections when you open another one is not something they'd enjoy. Opinions? I think it's okay to auto-hide, as it keeps the list focused and you don't really need to work with multiple sections at the same time. You need to get to the article you want as fast as possible.

I'm neutral about this. I much prefer accordion setups that don't automatically fold other sections when you unfold one of them, but our setup involves a really long list. So I think this behavior makes sense here.

I think we can merge this for now. We can change the behavior to not automatically fold other sections if there's significant demand.

Calinou avatar Jul 19 '22 18:07 Calinou

I'd also like Akien to give this a glance, but I agree with both of you and think this is a good improvement.

mhilbrunner avatar Jul 19 '22 18:07 mhilbrunner

Updated based on suggestions.

  1. "General" is now collapsed into "About" (the dedicated "About" page still exists for those who may have stored a direct link to it).
  2. "Development" is now "Engine Development". This does collide with its own subsection, though. Can clean it up later, I suppose, as this doesn't affect any links (the link for that subsection is "development/cpp").
  3. On the home page the "About" section is unfolded by default. This also acts as a nice hint that you can unfold other sections to see their content.

I've not touched the class reference section, as we already have a different PR that would split those classes into several categories, and that solves the ambiguous "Godot API" problem.

chrome_2022-11-17_20-49-22

Edit: I'll remove the 3.5 cherrypick for the time being. We need to see what the feedback would be on this one anyway, and later we can pick it or port it by hand.

YuriSizov avatar Nov 17 '22 17:11 YuriSizov

Thanks!

akien-mga avatar Nov 17 '22 20:11 akien-mga

After this change, it was necessary for me to update Sphinx. Sphinx 4.0.2 didn't have the required functionality and I couldn't open the categories after compiling locally. A pip3 install -r requirements.txt did the trick.

Sauermann avatar Nov 19 '22 21:11 Sauermann

This is a purely frontend solution, it shouldn't depend on anything from sphinx, other than the layout of the page. So yeah, a good idea to verify that your local install matches the requirements.

YuriSizov avatar Nov 19 '22 21:11 YuriSizov