nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

Adding 2 buttons to minimize the sidebars on nodejs > learn "docs

Open kshitjj opened this issue 1 year ago • 7 comments

Enter your suggestions in details:

What is the problem this feature will solve?

the sidebars are not minimizable, which causes the body to have less width, which cramps the body.

image

What is the feature you are proposing to solve the problem?

adding two buttons, which would allow a dev to minimize the sidebars.

kshitjj avatar Jun 04 '24 10:06 kshitjj

@ovflowd can we use an arrow icon as content for the buttons?

dtsuper3 avatar Jun 07 '24 11:06 dtsuper3

I'd say so? But we could use arrow-left-end-on-rectangle and arrow-right-end-on-rectangle from https://heroicons.com/

ovflowd avatar Jun 07 '24 11:06 ovflowd

@ovflowd This feature to minimize the sidebar requires client-side interactivity due to that reason we have to introduce a state to control whether the sidebar is minimized. Can I use "use client" in LearnLayout? I will then add a new class in ArticleLayout based on this state to control the grid widths. Untitled

dtsuper3 avatar Jun 07 '24 18:06 dtsuper3

Hmmm, wouldn't add an use client on the Metabar and the Sidebar components be enough? 👀

ovflowd avatar Jun 07 '24 19:06 ovflowd

I'm also curious how this effort may relate to https://github.com/nodejs/nodejs.org/pull/6821

bmuenzenmeyer avatar Jun 07 '24 20:06 bmuenzenmeyer

#6821 modifies the default behavior while this behavior is opt-in (hide the sidebar if needed). It seems like we are going with open as the default sidebar state here. #6821 also keeps the metabar below the article up to a larger breakpoint than before to give more space to the article. Sidebar controls could still be used on the left sidebar in that case.

I'm actually curious to see where the state control buttons will be placed (in both open and closed states) without appearing clunky or crowding the header as we are not moving the sidebars up in z axis here and the sidebar state affects the width occupied by the article.

abizek avatar Jun 08 '24 00:06 abizek

I believe, as @abizek, the best approach would be for #6821 to be the default behavior. And then the feature described on this issue only works on non-mobile screens.

And if you hide the meta bar/sidebar, well, on mobile screens, they become respectively on the bottom of the article and the select button.

ovflowd avatar Jun 08 '24 08:06 ovflowd

Do we still want to follow-up here? Or was #6821 enough?

ovflowd avatar Jul 20 '24 15:07 ovflowd

#6821 fixes the issue

kshitjj avatar Jul 22 '24 18:07 kshitjj