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

Settings: simplify language picker component #41938

Closed
rickybanister opened this issue May 7, 2020 · 11 comments · Fixed by #44368
Closed

Settings: simplify language picker component #41938

rickybanister opened this issue May 7, 2020 · 11 comments · Fixed by #44368
Labels

Comments

@rickybanister
Copy link

The language picker in the general settings screen is a custom dropdown:

Screen Shot 2020-05-07 at 9 53 35 AM

It has the word 'CHANGE' inside the box indicating it can be clicked, but this doesn't seem necessary. We can make it look exactly like the timezone picker just below.

Something like this:

image

@davemart-in
Copy link
Contributor

If we remove the word "CHANGE", I assume we will still need to use a custom dropdown component here @rickybanister. To clarify, the focus for this issue is around visually consistent not component consistency, right?

@rickybanister
Copy link
Author

I hacked the inspector to create my mockup above, we likely do not need a custom select menu. We could try using a standard select menu with just the language name in text.

Or EN - English if the code and language name are helpful.

We should check on accessibility best practices as well though and make sure we can properly render all language names natively in the picker, that kind of thing.

@davemart-in
Copy link
Contributor

Alright, if we're talking about replacing the component, I'll move this to the backlog, as I don't think it's super high priority.

@rickybanister
Copy link
Author

I do think my initial proposal is lighter weight—to just remove the word 'change' from the dropdown and make the height and font-weight align.

It's not very important, I just don't really understand why this element is so different to begin with :)

@davemart-in
Copy link
Contributor

I was chatting with Gary about this and he brought up that this language UI has a completely different UI once you click in which has a search Ui baked in.

@pento
Copy link
Contributor

pento commented Jun 2, 2020

As Dave mentioned, the popup for this provides a better UI than a standard dropdown, which includes search.

Interestingly, the search functionality is quite comprehensive. I can search for languages by their English name, their localised name (including non-latin character sets), and their name in my UI language.

Given how unwieldy it would be if we replaced this with a standard dropdown (or a SelectDropdown, which provides largely the same functionality), I'm inclined to think it needs a more comprehensive solution.

Site timezones have worked around this issue by suggesting an option, we could do the same based on the browser's language settings.

Alternatively, it appears that Gutenberg is close to merging exactly the UI component we could use here. Of course, this runs into the problem of how we manage ad-hoc mixing of WordPress components into existing Calypso UIs (vs examples like Gutenboarding, where the UI was created entirely with WordPress components), but I suspect that's a simpler problem to solve than creating a new searchable dropdown component.

@rickybanister
Copy link
Author

Thanks for looking into this. The real impetus of this issue was the visual appearance of the select menu itself. We can probably do about 10 minutes of css work to make it the same size, height of a regular select and remove the 'change' text. We can keep the popup as is for now.

Longer term I think we are likely to see much more adoption of gutenberg primitives and components, to the point where we consume all of gutenberg within calypso. We would only maintain our own components for elements that serve no purpose in core (like an upgrade nudge or something). We don't need to move in that direction immediately, but whenever practical we should consider doing so. Maintaining less code over time will benefit engineering, and a more cohesive experience across wp-admin, the editor, and wpcom will benefit customers very directly. It's worth stating explicitly that there is no 'brand value' in having different UI components. We can apply a sense of brand through color and typography in a more sustainable way than through proprietary interaction patterns.

@davemart-in davemart-in added [Size] M Medium sized issue [Size] S Small sized issue and removed [Size] M Medium sized issue labels Jun 12, 2020
@ncardeli
Copy link
Contributor

I can take a look at this, following @rickybanister proposal to remove the "change" text and make it look like a regular select.

@ncardeli
Copy link
Contributor

I took a closer look at this issue and have a couple of questions:

  1. Should the language picker match the height of the timezone select (40px)?

If so, I think it would look too cramped, specially when the selected language has both a language code and a subcode (for example, ES MX - Español de México).

48px height
imagen

vs

40px height
imagen

  1. Should the language picker and the select match the font size, weight and color? I think they should

Matching font size, weight and color
imagen

vs

Non-matching
imagen

To sum up, this is how I feel it would look best (48px height and matching font):

imagen

@rickybanister
Copy link
Author

If we remove the br from the language code I think it looks just fine and has plenty of breathing room.

Removing font-weight; 600; as well will help it align. There's no reason this should look different from other dropdowns.

Screen Shot 2020-07-21 at 9 23 13 AM

@ncardeli
Copy link
Contributor

Ok, let's get this done 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants