feat(sidebar): add collapsible root sidebar groups - #2784
Conversation
|
@sy-records is attempting to deploy a commit to the Docsify Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Thanks for taking this long-requested feature on @sy-records !
Here is my test sandbox:
https://codesandbox.io/p/devbox/vibrant-brattain-hj7935
I am concerned that the introduction of using bold to mark new expandable/collapsible sections might be confusing for users and add visual complexity to the sidebar.
One alternative would be to use the existing Chevron indicators to show expandable/collapsible sections (with existing rotation behavior), and do so without little additional visual complexity. Here is a quick mockup:
What do you think?
|
You might also find this closed issue a helpful reference @sy-records : #1564 I am not suggesting additional functionality at this point, but the comment by jhildenbiddle was also quite insightful for future consideration re: initial expaned/collapsed state. |
|
The bold text represents the original logic; now it simply supports clicking to expand or collapse it and marks its status so you don鈥檛 have to click repeatedly when viewing it. Using a V-shaped indicator will change the current style. |
|
I am not sure I follow, if bold text is used, and is also in multiple locations, this will likely be confusing for users re: cue of feedback. If I understand correctly possible, I suggest we use the established chevon feedback which is also used by other similar sidebar navs like Docusaurus https://docusaurus.io/docs/category/guides. If bold is only possible I suggest setting aside this feature as the downsides would outweigh the possible upsides to me. |
|
I added logic to the sidebar-chevron. |
|
Oh that is starting to work much better @sy-records ! Sorry if I was not clear before but along with adding the Chevrons would be removing the bold styling. Once that is done, manually collapsible items will have a visual cue that they can expand/collapse and have the exact same style of the other items present in the sidebar as to not give any confusing visual cues. This is going to be a great new feature! |
Summary
Related issue, if any:
Fixes #900
What kind of change does this PR introduce?
For any code change,
Does this PR introduce a breaking change?
Tested in the following browsers: