-
Notifications
You must be signed in to change notification settings - Fork 91
Collapse non-expandable iconless sidebar.group down to a separator
#1944
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
base: main
Are you sure you want to change the base?
Collapse non-expandable iconless sidebar.group down to a separator
#1944
Conversation
… stay visible while collapsed.
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.
@dev-idkwhoami thanks for the PR! Look good to me. In future be sure to match code style by adding empty lines between elements.
Edit: when playing with it, I noticed that it caused a vertical layout shift.
So I have fixed it up so the padding is maintained to stop the layout shift.
sidebar.group down to a separator
|
You're right—totally forgot about code style. The vertical shift tripped me up a bit, but I think I just overthought it. Appreciate the help! |
|
@ganyicz and @joshhanley - lets do some more thinking on this. Why does our demo seem to work fine, but this doesn't?
Also from a ux perspective it concerns me to default to showing ALL the icons in the collapsed mode as it seems like a stressful user experience to go through twenty icon tooltips to find the one you want. whereas tools like chatgpt and such show a refined list of icons, just the few essentials in the collapsed sidebar and then you have to expand to get the full set. something I think we need to just put more thought into before hitting the button. thanks everyone! |



The scenario
If you add a sidebar.group without setting either an icon nor expandable, its items won’t be visible when the sidebar is collapsed.
Because the
in-data-flux-sidebar-collapsed-desktop:hiddenis applied to the root div of the sidebar.group component the heading & items vanish when the sidebar is collapsed.The code I used for this scenario:
The problem
This makes the sidebar groups with a simple text heading undesirable and confusing to any users.
The solution
The changes in the PR do the following:
in-data-flux-sidebar-collapsed-desktop:hiddena level down onto the sidebar group heading, as it would be to wide to show in collapsed form.flux:separatorthat will take the place of the heading to keep the items visually separated while the sidebar is collapsed.pt-2to the root div of the sidebar group while the sidebar is collapsed to create some space between the groups.All together this looks like this:
