Page MenuHomePhabricator

Placeholder text in language menu dropdown in Vector 2022 cropped: "Search for a"
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

Go to https://en.wikipedia.org/wiki/Wikipedia:Sockpuppet_investigations/SPI/Cases?safemode=1

Click the "1 language" menu link. You'll get a "Search for a" message. I assume there was supposed to be some additional text.

Screen Shot 2022-09-26 at 7.03.51 PM.png (2×3 px, 1 MB)

Chrome Version 105.0.5195.125 (Official Build) (x86_64)
MacOS Monterey 12.5.1 (21G83)

Event Timeline

Filed upstream issue https://github.com/wikimedia/jquery.uls/issues/433
@Pginer-WMF - Could you please comment there on expected behavior for narrow mode?

Filed upstream issue https://github.com/wikimedia/jquery.uls/issues/433
@Pginer-WMF - Could you please comment there on expected behavior for narrow mode?

The Design systems team was working on defining min/ma width for menus. We may wan to align with the min-width used in this case.
We can also consider for the narrowest cases (one column) to use an alternative placeholder using only the text "Search". It would be more likely to fit and in such case and in such scenario searching is less relevant (short list of languages) so it may not be a problem to be a bit less specific with the label.

I'll check with the Design Systems team to identify which is the recommended min-width.

Aklapper renamed this task from Vector 2022's language menu says "Search for a" to Placeholder text in language menu dropdown in Vector 2022 cropped: "Search for a".Sep 27 2022, 9:53 AM
Nikerabbit set the point value for this task to 2.

It seems the current width for the selector is already wider than the min-width proposed by the Design Systems team for input fields (128px).
I think that some approaches to consider could be:

  • Avoid the input element to get cut before it is needed. Currently there is an unnecessary white gap that makes the placeholder to be cut earlier than needed.
  • Apply ellipsis-based cropping when text gets cropped.
  • For the most narrow version (and only there) use a simpler "Search" label instead. It is not as specific as the full text but may be less confusing than a cropped version of the full text. Given the button above mentions languages and the list below is a list of languages, the "Search" prompt may be clear in context.

en.wikipedia.org_wiki_Avocado_toast(iPad Air) (1).png (1×2 px, 753 KB)

  • Avoid the input element to get cut before it is needed. Currently there is an unnecessary white gap that makes the placeholder to be cut earlier than needed.

At the moment, the current font-size of the text input is 1.143em (rendered as 16px). We could start by reducing the font size to about 1em (rendered as 14px) and removing the padding on all sides of the text input. This doesn't introduce any detrimental effects to the ULS from my testing.

Screen Shot 2023-02-15 at 09.13.56 AM.png (656×1 px, 354 KB)

  • Apply ellipsis-based cropping when text gets cropped.

It is possible to add ellipsis onto a placeholder. The concern here would be that when the text field is in focus, the placeholder will still appear cropped given the size of the input field and length of the placeholder text. When out of focus, the placeholder will have the ellipsis in the event that the text overflows. I don't think this will have the intended effect as the text may still be rendered in a cropped way in either scenarios. See this Stackoverflow thread for more.

  • For the most narrow version (and only there) use a simpler "Search" label instead. It is not as specific as the full text but may be less confusing than a cropped version of the full text. Given the button above mentions languages and the list below is a list of languages, the "Search" prompt may be clear in context.

This would probably be best done programmatically based on the width of the search input field.

The first and third options seem best to go ahead with.

At the moment, the current font-size of the text input is 1.143em (rendered as 16px). We could start by reducing the font size to about 1em (rendered as 14px) and removing the padding on all sides of the text input. This doesn't introduce any detrimental effects to the ULS from my testing.

I'd recommend not reducing the font. 16px is expected to be the default font size at some point (it is already the default browser size) and the search input is the main element of focus to invite people to search for their language.

Wangombe changed the task status from Open to In Progress.Feb 20 2023, 9:45 AM
Wangombe claimed this task.

Change 895707 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/UniversalLanguageSelector@master] Remove padding from .uls-filterinput

https://gerrit.wikimedia.org/r/895707

Change 895707 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/UniversalLanguageSelector@master] Remove padding from .uls-filterinput

https://gerrit.wikimedia.org/r/895707

With this patch, here are results on following themes. Note that the 'X' (clear search field button still maintains its ideal position even after the change)
Timeless
Removing the padding somewhat makes the placeholder text make sense, i.e 'Search for a Lang...'

Screen Shot 2023-03-13 at 15.19.04 PM.png (666×489 px, 88 KB)
Screen Shot 2023-03-13 at 15.19.30 PM.png (606×486 px, 69 KB)

Vector (2022)
Screen Shot 2023-03-13 at 15.50.02 PM.png (450×419 px, 51 KB)

Vector Legacy (2010)
Screen Shot 2023-03-13 at 15.25.05 PM.png (389×664 px, 66 KB)

Screen Shot 2023-03-13 at 15.24.44 PM.png (448×458 px, 51 KB)

The next part of this fix would be to programmatically use a simpler "Search" label for the most narrow version of the ULS

Change 899478 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls from upstream

https://gerrit.wikimedia.org/r/899478

Change 899478 abandoned by Wangombe:

[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls from upstream

Reason:

Duplicate

https://gerrit.wikimedia.org/r/899478

Change 895707 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls from upstream

https://gerrit.wikimedia.org/r/895707

From testing, it appears of the 3 menu width options available (wide, middle, narrow), narrow was the one most affected by the crop of the placeholder text and this has not been fixed. The images below show the difference in the menu size. The wide version would have the same place holder as middle.

Screen Shot 2023-03-21 at 12.55.54 PM.png (379×330 px, 19 KB)

Screen Shot 2023-03-21 at 12.56.15 PM.png (388×1 px, 41 KB)

Change 902234 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls from upstream

https://gerrit.wikimedia.org/r/902234

Change 902306 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls from upstream

https://gerrit.wikimedia.org/r/902306

Change 902306 abandoned by Wangombe:

[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls from upstream

Reason:

Duplicate

https://gerrit.wikimedia.org/r/902306

Change 902234 merged by jenkins-bot:

[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls from upstream

https://gerrit.wikimedia.org/r/902234

Will resolve after adding a screenshot from the article in the issue description.

Done. Screenshot from the article in the description:

image.png (637×1 px, 165 KB)