Page MenuHomePhabricator

Use of dir=auto in WVUI breaks search interface is broken in wikis mixing LTR and RTL languages
Closed, ResolvedPublic3 Estimated Story Points

Description

To reproduce:

  • Go to Meta (example link)
  • Enable new Vector and new search
  • Switch user language to Hebrew. Look carefully at the search box: the placeholder says "search Meta", aligned to the right, and with the Hebrew word חיפוש on the right like so:

Screen Shot 2021-08-02 at 1.00.57 PM.png (122×996 px, 8 KB)

  • Click the search box. Observe: The placeholder jumps to the other side, and the Hebrew word חיפוש is now on the left.

image.png (71×655 px, 2 KB)

Expected: The placeholder is supposed to remain in the same place and in the same visual word order.

This happens in all wikis when using them in a language whose direction is different from its content language, e.g. English Wikipedia with Hebrew user language and vice versa. It's particularly relevant for multilingual wikis, like Wikidata, Commons, and Meta.

Developer notes

This issue lies in WVUI and its usage of dir="auto". This overrides the default language and direction set by Vector.

  • A change in WVUI is required.
  • Codex has implemented a 1:1 HTML attribute copy of the false WVUI way. Needs a patch equal to WVUI.

QA Steps

  1. Visit https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?uselang=he
  2. Verify that the placeholder text is aligned to the right (near the magnifying glass)
  3. Focus the search input
  4. Verify that the placeholder text is still aligned to the right (near the magnifying glass)

QA Results - Beta

ACStatusDetails
1T279674#7560476
2T279674#7560476

QA Results - Prod

ACStatusDetails
1T279674#7579259
2T279674#7579259

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Amire80 updated the task description. (Show Details)
IKhitron renamed this task from New Vector search interface is broken in LTR wikis with RTL interface language to New Vector search interface is broken in LTR wikis with RTL interface language and vice versa.Apr 8 2021, 3:12 PM
ovasileva triaged this task as Medium priority.Jun 7 2021, 4:00 PM
Jdlrobson renamed this task from New Vector search interface is broken in LTR wikis with RTL interface language and vice versa to Use of dir=auto in WVUI breaks search interface is broken in wikis mixing LTR and RTL languages.Aug 2 2021, 8:06 PM
Jdlrobson removed ovasileva as the assignee of this task.
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task from Triaged but Future to unsed on the Web-Team-Backlog board.
Jdlrobson added a subscriber: ovasileva.

@Jdlrobson, pay attention, the second screenshot you've added is irrelevant.

Jdlrobson updated the task description. (Show Details)

@IKhitron are you familiar with the WVUI library and how we transition to it? The first screenshot is the search before WVUI has been loaded and the second shows WVUI after it is loared and I think this is important context to understanding this issue. Why do you think it is irrelevant? Is there another bug occurring here that we need to understand?

@IKhitron are you familiar with the WVUI library and how we transition to it? The first screenshot is the search before WVUI has been loaded and the second shows WVUI after it is loared and I think this is important context to understanding this issue. Why do you think it is irrelevant? Is there another bug occurring here that we need to understand?

No, I don't. I say so, because it does not show the problem I asked Amir to fix. This

image.png (71×655 px, 2 KB)

screenshot does show the wrong words order -
-חיפוש בMeta
instead of
Meta-חיפוש ב.

The screenshot is not meant to be an exact duplication of the steps that Amir has been presented, it was meant to communicate to developers the shift of the placeholder from right to left.

Having the right screenshot isn't necessary for fixing this bug but I've updated it for you since you pointed it out.

Jdlrobson set the point value for this task to 2.Oct 25 2021, 5:49 PM
Jdlrobson changed the point value for this task from 2 to 3.
cjming removed cjming as the assignee of this task.Nov 2 2021, 4:49 PM
cjming subscribed.

Change 737815 had a related patch set uploaded (by Nray; author: Nray):

[wvui@master] Remove \"dir=auto\" attribute from TypeaheadSearch and Input components

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

nray subscribed.

Change 737815 merged by jenkins-bot:

[wvui@master] Remove \"dir=auto\" attribute from TypeaheadSearch and Input components

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

This has been merged but won't be released until the next release of WVUI

Thanks @nray! This wrong attribute has been brought over into new Codex library as well, so let's make sure, we're keeping the code in sync between those two.

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

[design/codex@main] TextInput: Remove `dir=\"auto\"` attribute for i18n

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

Thank you. When there be the next release of WVUI?

We could make a quick patch release, it would currently only contain this patch. Would like to checkin with @Catrope first on the progress for https://gerrit.wikimedia.org/r/c/wvui/+/738470 as a combined patch release would be preferable. With such, it would be either end of the coming or second-next week until it's released and put into MW core to production use.

Change 738501 merged by jenkins-bot:

[design/codex@main] TextInput: Remove `dir=\"auto\"` attribute for i18n

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

We could make a quick patch release, it would currently only contain this patch. Would like to checkin with @Catrope first on the progress for https://gerrit.wikimedia.org/r/c/wvui/+/738470 as a combined patch release would be preferable. With such, it would be either end of the coming or second-next week until it's released and put into MW core to production use.

It's blocked on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/739341, which is in turn blocked on @Krinkle's review of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/739340. Once those core patches land, we can land the WVUI externalization patch, and at that point I would like to do a release.

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

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

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

Change 740293 merged by jenkins-bot:

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

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

The new WVUI has released so this can now be QAed.

Test Result - Beta

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

Test Artifact(s):

QA Steps

Go to https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?uselang=he
✅ AC1: Verify that the placeholder text is aligned to the right (near the magnifying glass)

Screen Shot 2021-12-09 at 9.14.29 AM.png (405×855 px, 85 KB)

Focus the search input
✅ AC2: Verify that the placeholder text is still aligned to the right (near the magnifying glass)
Screen Shot 2021-12-09 at 9.14.48 AM.png (405×867 px, 86 KB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: hewiki
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Go to https://he.wikipedia.org/wiki/Main_Page
✅ AC1: Verify that the placeholder text is aligned to the right (near the magnifying glass)

Screen Shot 2021-12-18 at 12.44.26 PM.png (349×856 px, 87 KB)

Focus the search input
✅ AC2: Verify that the placeholder text is still aligned to the right (near the magnifying glass)
Screen Shot 2021-12-18 at 12.44.56 PM.png (345×857 px, 87 KB)

Is there a reason this is now working on hewiki but not on fawiki?

I will do more investigations and get back to you, but as a start: the URL you provided works, but as soon as I remove the safemode=1 bit it fails to work (screenshot below).

image.png (102×1 px, 13 KB)

I tried with a different account and it worked.

The problem is with a CSS-only gadget that I use to change the default font of the wiki: https://fa.wikipedia.org/wiki/MediaWiki:Gadget-pfont.css

I fixed it in this edit

Thanks for double-checking @Huji! Looks like this one is all done