Collapse non-expandable iconless sidebar.group down to a separator#1944
Collapse non-expandable iconless sidebar.group down to a separator#1944dev-idkwhoami wants to merge 3 commits intolivewire:mainfrom
sidebar.group down to a separator#1944Conversation
… stay visible while collapsed.
There was a problem hiding this comment.
@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:
