-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
FEATURE: Improve user experience for Dimension Switcher #3451
FEATURE: Improve user experience for Dimension Switcher #3451
Conversation
This commit extracts the DimensionSelector to an own component. The component gets an additional property to render only the Select without any label. The DimensionSwitcher now renders a single DimensionSelector if we have just one dimension and the old dropdown if we have multiple.
Eventually, also migrate to TS... depends on the amount of time as the Feature Freeze is close and we can do it also later. |
a7e70ee
to
9b6ec7b
Compare
9b6ec7b
to
73b78ef
Compare
The tests work now:
|
The only thing that puzzles me currently is the positioning of the icon. Sadly, the Selectbox can not only render the Icon in the header. When you add the icon to the options, all items will have the icon. Maybe that would be a nice flag for the select box to render the icon just in the header. But I think the CSS stuff can be perhaps also be a thing after feature freeze. |
This commit adds the headerIcon property for the SelectBox and the showIcon prop for the ListPreviewElement and SelectBox_Option_SingleLine. With these new properties it is possible to render an icon only inside the header, even when the option has no icon definded.
Ok, just did it and added a new prop to be able to render just an icon inside the header. But that solves a lot of CSS issues and would be nice to have it in other places as well. |
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.
Love the feature, left some comments
packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/index.js
Outdated
Show resolved
Hide resolved
packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js
Outdated
Show resolved
Hide resolved
packages/neos-ui/src/Containers/PrimaryToolbar/DimensionSwitcher/DimensionSelector.js
Outdated
Show resolved
Hide resolved
Thanks for the valuable feedback. I introduced the |
the spacing to the arrow was previously a bit prettier ;) (noticed it even without comparison) thanks for this pr @markusguenther this was previously hard to use ^^ |
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.
In functionality point of view it is working great!
I already tried to remove the padding right today but was not successful yet. Try it later this evening when I am back home. |
17ca57c
to
f3c21f1
Compare
Ah now i see your point... hmm, guess if you have just one single dimension value you would normally create no dimension and then would see no drop down at all. In your case it does not make so much sense. |
I think @mhsdesign's point was, that you can still use the dropdown menu if you have only one dimension available. And with only one dimension avaialble, i dont know if we still need the dropdown. Because we have no other dimension that we could switch too. |
uups yes sorry i was brain dumb - too much sun you can leave it as you proposed ^^ |
Good point.. I have not thought about that 😅 |
Bit confused that the linter fails in a file I did not change 🤔 To be honest, your point is also valid, but I am uncertain if it were more confusion to configure a dimension and then see nothing in the UI. For this case, I would need to add another component that is no dropdown or button and just shows the dimension. So that you can see it but not change it. An easy workaround would be to disable the select box if we have just one item. |
Hm. Wouldn't that be a bit confusing for the editor? Otherwise, this would be a good workaround IMO. |
@markusguenther If you still fine with that, we can use your idea. So if only one dimension is available, the checkbox will be disabled. It shouldn't be confusing for the editor. Because in general the editor should know how many dimensions the website has where he is working on. |
What I did
To improve the UX, we want to have just one layer when we have just one dimension configured.
Currently, the Dimension Selector is inside a dropdown.
How I did it
I separated the DimensionSelector into an own component and added a property to render the Selector without the label.
The DimensionSwitcher now renders a single DimensionSelector if we have only one dimension and for multiple Dimensions we use the old way.
How to verify it
Test the Backend with one and multiple dimensions.
Open To-dos
Related: #3413