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

FEATURE: Improve user experience for Dimension Switcher #3451

Merged

Conversation

markusguenther
Copy link
Member

@markusguenther markusguenther commented Mar 30, 2023

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

  • Adjust the tests
  • Add a Dimension Icon for the single dimension
  • little CSS tweaks

Related: #3413

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.
@github-actions github-actions bot added Feature Label to mark the change as feature 8.3 labels Mar 30, 2023
@markusguenther
Copy link
Member Author

Eventually, also migrate to TS... depends on the amount of time as the Feature Freeze is close and we can do it also later.

@markusguenther
Copy link
Member Author

Current State:
Screenshot 2023-03-30 at 11 56 10

@markusguenther markusguenther force-pushed the feature/dimensionswitcher-enhancement branch 2 times, most recently from a7e70ee to 9b6ec7b Compare March 30, 2023 11:58
@markusguenther markusguenther force-pushed the feature/dimensionswitcher-enhancement branch from 9b6ec7b to 73b78ef Compare March 30, 2023 12:15
@markusguenther
Copy link
Member Author

@markusguenther
Copy link
Member Author

Also added the Icon. So just some CSS glitches left, but the feature itself is done.
Screenshot 2023-03-30 at 14 46 52

@markusguenther
Copy link
Member Author

markusguenther commented Mar 30, 2023

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.
@markusguenther
Copy link
Member Author

markusguenther commented Mar 30, 2023

Ok, just did it and added a new prop to be able to render just an icon inside the header.
If this is not wanted, we can remove the two commits again.

But that solves a lot of CSS issues and would be nice to have it in other places as well.

@markusguenther markusguenther changed the title Feature: Improve user expierence for Dimension Switcher FEATURE: Improve user experience for Dimension Switcher Mar 30, 2023
Copy link
Member

@Sebobo Sebobo left a 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

@markusguenther
Copy link
Member Author

Love the feature, left some comments

Thanks for the valuable feedback. I introduced the headerIcon prop later in my local development and with that, I could drop the showIcon props now. So, it is less expanded and has the same value.

@mhsdesign
Copy link
Member

the spacing to the arrow was previously a bit prettier ;) (noticed it even without comparison)

image

image

thanks for this pr @markusguenther this was previously hard to use ^^

@mhsdesign
Copy link
Member

is it intentional that we still show the dropdown, if there is only one dimension?

image

image

@crydotsnake crydotsnake self-requested a review April 1, 2023 15:20
@crydotsnake crydotsnake linked an issue Apr 1, 2023 that may be closed by this pull request
@crydotsnake
Copy link
Member

crydotsnake commented Apr 1, 2023

is it intentional that we still show the dropdown, if there is only one dimension?

image

image

As an idea, we could disable the dropdown if there is really only one dimension available.

Copy link
Member

@crydotsnake crydotsnake left a 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!

@markusguenther
Copy link
Member Author

I already tried to remove the padding right today but was not successful yet. Try it later this evening when I am back home.

@markusguenther markusguenther force-pushed the feature/dimensionswitcher-enhancement branch from 17ca57c to f3c21f1 Compare April 2, 2023 19:18
@markusguenther
Copy link
Member Author

is it intentional that we still show the dropdown, if there is only one dimension?
image
image

As an idea, we could disable the dropdown if there is really only one dimension available.

Don't get the point because this PR shows a single drop down when we have only one dimension, no dropdown for no dimension and the old behavior if we have more than one dimension.

Single:
Screenshot 2023-04-02 at 21 13 14

Multi:
Screenshot 2023-04-02 at 21 12 45

Screenshot 2023-04-02 at 21 12 38

@markusguenther
Copy link
Member Author

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.

@crydotsnake
Copy link
Member

is it intentional that we still show the dropdown, if there is only one dimension?
image
image

As an idea, we could disable the dropdown if there is really only one dimension available.

Don't get the point because this PR shows a single drop down when we have only one dimension, no dropdown for no dimension and the old behavior if we have more than one dimension.

Single: Screenshot 2023-04-02 at 21 13 14

Multi: Screenshot 2023-04-02 at 21 12 45

Screenshot 2023-04-02 at 21 12 38

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.

@mhsdesign
Copy link
Member

mhsdesign commented Apr 2, 2023

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.

uups yes sorry i was brain dumb - too much sun

you can leave it as you proposed ^^

@crydotsnake
Copy link
Member

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.

Good point.. I have not thought about that 😅

@markusguenther
Copy link
Member Author

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.
Then it would look like that.

Screenshot 2023-04-02 at 21 41 48

@crydotsnake
Copy link
Member

An easy workaround would be to disable the select box if we have just one item.
Then it would look like that.

Hm. Wouldn't that be a bit confusing for the editor? Otherwise, this would be a good workaround IMO.

@crydotsnake
Copy link
Member

crydotsnake commented Apr 11, 2023

An easy workaround would be to disable the select box if we have just one item.
Then it would look like that.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.3 Feature Label to mark the change as feature UI & UX
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

FEATURE: Usability Improvements for Dimensions Menu
4 participants