Page MenuHomePhabricator

Suggestions in new Vector search form should wrap long words
Closed, ResolvedPublic2 Estimated Story Points

Description

I noticed that in the dropdown searchform-suggestions in the new Vector, long page names will overflow and remain hidden (see screenshot). This could easily be avoided by adding word-break: break-word; to it, as Minerva does with all text areas on small screens. Since the search bar and the dropdown can appear rather small when placed between the logo and the user menu, this area should definitely wrap the words. With hidden overflow, the suggestions are less useful, as people need to guess the missing word parts.

Searchform-suggestions Vector 2021-04-23.jpg (856×988 px, 213 KB)

QA Results - Beta

ACStatusDetails
1T280982#7147703

QA Results - Prod

ACStatusDetails
1T280982#7159993

QA Results - Beta

ACStatusDetails
1T280982#7341883

QA Results - Prod

ACStatusDetails
1T280982#7368986

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 683588 had a related patch set uploaded (by VolkerE; author: VolkerE):

[wvui@master] [typeahead-search][typeahead-suggestion] Wrap overlong words in title and footer

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

@Volker_E could you add some screenshots or a demo link for this?

Change 683588 merged by jenkins-bot:

[wvui@master] [typeahead-search][typeahead-suggestion] Wrap overlong words in title and footer

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

awesome, looks great. what are you looking for in terms of design review?

Change 697700 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update wvui to 0.2.0

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

Change 697700 merged by jenkins-bot:

[mediawiki/core@master] Update wvui to 0.2.0

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Search suggestions with long page names should wrap with word breaks.

Screen Shot 2021-06-09 at 10.47.50 PM.png (630×742 px, 176 KB)

Edtadros subscribed.

Assigning to you per standup.

This can be QAed in production today.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki, fawiki, zhwiki
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Search suggestions with long page names should wrap with word breaks.

Screen Shot 2021-06-16 at 2.11.44 PM.png (1×1 px, 1 MB)

Screen Shot 2021-06-16 at 2.12.07 PM.png (1×1 px, 720 KB)

Screen Shot 2021-06-16 at 2.12.21 PM.png (1×1 px, 878 KB)

Per T277534#7165409, I'm seeing the following in production when the interface language is different from the content language (e.g. https://en.wikipedia.org/wiki/Main_Page?useskinversion=2&uselang=he):

Screenshot 2021-06-21 at 12.17.11.png (107×542 px, 16 KB)

Hm, doesn’t seem like a satisfying explanation to me; I always have this happen on dewiki, where content language and interface language are both German!

I always have this happen on dewiki, where content language and interface language are both German!

Whereas I don't:

Screenshot 2021-06-21 at 14.29.41.png (115×786 px, 30 KB)

I moved this back to Needs More Work in the hope that our bug reports would lead us to a satisfying explanation.

So, your observation is actually easily explainable: the browser apparently does not know any working hyphenation for Hebrew specifically, just tried it on Firefox. Other languages work fine. While Chrome apparently does not provide hyphenation in this context at all. That’s why I already questioned the use of hyphens:auto several times; just use word-break as anywhere else and we should be fine on all browsers and in all languages.

EDIT: Seeing https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens, browser support for hyphenation is actually terrible. Please drop this (also from T171726) and consistently use word-break.

Hyphens are dependent on the languages enabled on OS/browser, correct. They are preferable over word-wrap/overflow-wrap solely for readability and skimmability and more widely for typographic reasons. MDN shows very well, why word-wrap: break-all doesn't play well in a language like German:

image.png (958×678 px, 85 KB)

As long as it does not work in Chrome (the by far most widely used browser), it should not even be an option. And while in normal text it might be reasonable to use it, in the context of a diff (T171726) it does more harm than good, as readers won’t be able to distinguish between actual hyphens in the text and automatic hyphens. I guess in the search, hyphenation could be considered (but please consistently, not just in the footer), as users can directly see if they typed a hyphen themselves, but it needs word-break as fallback for Chrome and unsupported languages.

Also, my experiences with automatic hyphenation (mainly in MS Word) in German, English and Italian have not been very positive. Wrong hyphenation (which happens especially easily in long German composite words) amounts to a spelling mistake, and WP authors would not have the possibility to correct or prevent them; so imo it has been a good choice to not activate hyphens:auto for the main text area in Minerva so far …

@XanonymusX Sure, we've been very clearly adding hyphens in the past only around an acceptable outcome. One in-between solution I could see is to try out putting hyphens into @support parentheses and outside word-break: break-all. Possibly worth a try.

Updated word-wrap: break-all by word-break: break-all, which was original intention in comment.

Yes, but why would you go for break-all now? That one is the worst option available, as lined out in T171726 (at least for text, not sure if it would make any difference for mere search results). It needs break-word (and yes, as a fallback for hyphenation). There is also some confusion around whether to use word-break, word-wrap or overflow-wrap (Chrome does some weird things there), but that will need some browser testing. Search results and footer should act in the same way in any case.

@XanonymusX I came from a different type of typesetting in memory, you're right word-wrap: break-word; hyphens: auto; is the way to go.

And now I digged down further, the reason I wrote word-wrap is, that for supporting all browsers we need to combine both, once for Firefox then for the Blink armada:

image.png (1×1 px, 324 KB)

Change 709242 had a related patch set uploaded (by VolkerE; author: VolkerE):

[wvui@master] [typeahead-search] Wrap those results

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

Ideally, the result would be wrapped in the language it's about, like lang=de and dir=ltr in the example above. But that's out of reach for this task.

Change 709242 merged by jenkins-bot:

[wvui@master] [typeahead-search] Wrap those results

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

How far are we on this? The search suggestions footer still does not wrap correctly on Chrome, in any case.

@XanonymusX this is blocked on the next WVUI release which is unfortunately delayed due some rather important conversations. Hopefully we can get to this within the next 2 weeks.

Change 715153 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] Update WVUI to v0.3.0

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

Change 715153 merged by jenkins-bot:

[mediawiki/core@master] Update WVUI to v0.3.0

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

Volker_E moved this task from Backlog to Done on the WVUI board.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Search suggestions with long page names should wrap with word breaks.
@Volker_E I tried a few beta wiki and language combos. In Hebrew, we don't get the word-break hyphen.What is the correct behavior?

Screen Shot 2021-09-09 at 6.12.23 AM.png (403×1 px, 120 KB)

Screen Shot 2021-09-09 at 6.16.30 AM.png (403×1 px, 113 KB)

Screen Shot 2021-09-09 at 6.17.18 AM.png (403×1 px, 101 KB)

Screen Shot 2021-09-09 at 6.10.58 AM.png (403×1 px, 115 KB)

UPDATE: this is a pass per T280982#7342283

Jdlrobson assigned this task to Edtadros.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki, hewiki, dewiki, fawiki, kowiki
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Search suggestions with long page names should wrap with word breaks.

@ovasileva, please confirm that the behavior on fawiki and kowiki (pictured below) is correct, I'm assuming no hyphen just as with hewiki.

Screen Shot 2021-09-21 at 6.39.57 AM.png (491×1 px, 125 KB)

Screen Shot 2021-09-21 at 6.39.42 AM.png (491×1 px, 122 KB)

Screen Shot 2021-09-21 at 6.40.40 AM.png (491×1 px, 145 KB)

Screen Shot 2021-09-21 at 6.40.24 AM.png (491×1 px, 143 KB)

Screen Shot 2021-09-21 at 6.35.53 AM.png (491×1 px, 156 KB)

Screen Shot 2021-09-21 at 6.37.13 AM.png (491×1 px, 326 KB)

Screen Shot 2021-09-21 at 6.37.54 AM.png (491×1 px, 325 KB)

Screen Shot 2021-09-21 at 6.36.33 AM.png (491×1 px, 291 KB)

Test Result - Prod

Status: ✅ PASS
Environment: enwiki, hewiki, dewiki, fawiki, kowiki
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Search suggestions with long page names should wrap with word breaks.

@ovasileva, please confirm that the behavior on fawiki and kowiki (pictured below) is correct, I'm assuming no hyphen just as with hewiki.

This is expected as we defer to the browser for hyphenation. All done from our side!