Skip to content
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

Foldable sidebar #54

Closed
DonKoko opened this issue Apr 3, 2023 · 6 comments · Fixed by #78
Closed

Foldable sidebar #54

DonKoko opened this issue Apr 3, 2023 · 6 comments · Fixed by #78
Assignees
Labels
enhancement New feature or request

Comments

@DonKoko
Copy link
Contributor

DonKoko commented Apr 3, 2023

We need to implement the functionality to make the sidebar foldable.

Design

Open state:
image

Closed state:
image

@jurrejansen @carlosvirreira
We are missing some designs related to this, or at least I cannot find them

  • How does the user open the folded sidebar?
  • How does the user log-out when sidebar is folded?

Functionality

  1. The sidebar closes when clicking the icon on the right of the logo
    image
  2. The sidebar opens ( we are still waiting for designs for that)
  3. The sidebar opening/closing should be animated. I guess we can just do it with css, however we use Framer motion(https://www.framer.com/motion/) maybe that's easier?
  4. We should implement a cookie that remembers the user's last state of the sidebar, as we don't want them to have to close it every time. This can also be saved in the DB but for now a cookie is fine.
@DonKoko DonKoko added the enhancement New feature or request label Apr 3, 2023
@DonKoko DonKoko self-assigned this Apr 3, 2023
@jurrejansen
Copy link

jurrejansen commented Apr 3, 2023

Hi @DonKoko

I was thinking about taking a similar approach as Mailchimp

Screen.Recording.2023-04-03.at.11.59.10.mov

How does the user open the folded sidebar?

By hovering over the sidebar -> sidebar expands absolute -> with top right icon the user would be able to keep the sidebar in an open state (when clicked sidebar pushes the main content to the right)

How does the user log-out when sidebar is folded?

When hovered, the sidebar would always be in an open state

As you can see in the screen recording Mailchimp is not using an animation. I would be happy to prototype one or we can skip (for MVP).

The behaviour described above is a bit different than what I had in mind when doing the designs. Let me know if you're down with this or not. Then I'll update / expand the design where needed.

@DonKoko
Copy link
Contributor Author

DonKoko commented Apr 3, 2023

Okey i see. I personally find this very annoying functionality with this thing popping in and out the whole time, It just feels not so smooth, but I am open for giving it a test. Thanks for clarifying.

@hunar1312
Copy link
Collaborator

What are your views on this example of foldable sidebar @DonKoko ?

Demo: https://www.cssscript.com/demo/smooth-collapsible-sidebar-navigation/
Code: https://www.cssscript.com/smooth-collapsible-sidebar-navigation/

should we follow the same approach?

@DonKoko
Copy link
Contributor Author

DonKoko commented Apr 7, 2023

@hunar1312 yes, i like that its just a bunch of css. We do have already existing tooling to implement this tho using tailwind. So tailwind has all the classes to manage the folding and twMerge can help you dynamically merge classes.

Here is an example how you can dynamically merge tailwind classes based on a condition: https://github.com/Shelf-nu/shelf.nu/blob/dev/app/components/shared/button.tsx#L46-L48

@hunar1312
Copy link
Collaborator

Yes will implement that with tailwind only.
also, as of now we will be opening the hidden part of sidebar only on hovering on it?

@DonKoko
Copy link
Contributor Author

DonKoko commented Apr 7, 2023

Yes please check the comment/video from @jurrejansen above. He explained how it should behave.

@DonKoko DonKoko linked a pull request Apr 14, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants