Page MenuHomePhabricator

close button is not horizontally flipped for surveys displayed in RTL languages
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
jsn.sherman
Apr 7 2022, 6:12 PM
Referenced Files
F35104962: image.png
May 7 2022, 12:48 AM
F35104960: image.png
May 7 2022, 12:48 AM
F35105012: image.png
May 7 2022, 12:48 AM
F35104978: image.png
May 7 2022, 12:48 AM
F35104999: image.png
May 7 2022, 12:48 AM
F35104958: image.png
May 7 2022, 12:48 AM
F35104976: image.png
May 7 2022, 12:48 AM
F35105009: image.png
May 7 2022, 12:48 AM

Description

steps to reproduce
On a wiki (local, beta, or production) with a quicksurvey configured, set your language preference to an RTL language, such as Hebrew.
Navigate to a survey and note that the close button is displayed in the upper right hand corner of the survey panel; the same location as in LTR languages, such as English:

Screenshot_20220330-194933.png (459×483 px, 135 KB)

It should display in the upper-left corner instead, something like:

close-button-rtl.png (459×483 px, 86 KB)

(note that the above image is just a quick mockop to demonstrate the principle of the problem)

Event Timeline

Change 788718 had a related patch set uploaded (by Eigyan; author: Eigyan):

[mediawiki/extensions/QuickSurveys@master] [WIP]: Close button not flipped in RTL languages

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

WIP results

Screen Shot 2022-05-03 at 10.49.12 AM.png (612×690 px, 76 KB)

Screen Shot 2022-05-03 at 10.48.44 AM.png (598×652 px, 62 KB)

So far the code update is working as expected I will continue to test other survey configs and make sure the change is bullet-proof.

eigyan updated the task description. (Show Details)

It was suggested in the engineering meeting, per @jsn.sherman , that I move the new htmlDirection prop higher up the DOM tree to effect the entire panel element rather than just the survey content and this change made it possible for the privacy policy to follow RTL properly. See screenshot below:

Screen Shot 2022-05-03 at 1.38.10 PM.png (588×738 px, 63 KB)

Change 788718 merged by jenkins-bot:

[mediawiki/extensions/QuickSurveys@master] QuickSurveys: Close button not flipped in RTL languages

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

@eigyan,

Using the following urls: https://en.wikipedia.beta.wmflabs.org/wiki/Apple?quicksurvey=true; https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Olomouck%C3%A9_tvar%C5%AF%C5%BEky&quicksurvey=T294363-1

I have verified when an RTL language (such as Hebrew) is displaying a survey, the X button (close button) is displaying in the upper-left corner of the survey.


@aminalhazwani:
Since there was a change to the survey layout I am passing this ticket to Design Review to get your final approval of the layout change for the X button, if it meets your approval you can pass this ticket to Product Sign Off.


Compatibility Testing was performed on the following:
Desktop – Chrome version 101 Windows 10 and 11 / Microsoft Edge version 101 Windows 10 and 11 / Firefox version 99 Windows 10 and 11 / Opera version 86 Windows 10 and 11 / Safari version 15.3 Mac OS Monterrey.
Mobile Devices – Android version 12 Samsung Galaxy S22 phone / Android version 4.4 Galaxy Tab 4 tablet / iOS version 15 iPad Pro 9th generation / iOS version 15.3 iPhone 13 Pro phone.


Below are screenshots of the X button change:
(NOTE: please disregard blurriness of screenshots, this is due to device simulation and is not related to the code change):

image.png (576×1 px, 115 KB)

image.png (482×1 px, 523 KB)

image.png (925×492 px, 190 KB)

image.png (891×697 px, 495 KB)

image.png (894×700 px, 460 KB)

image.png (924×499 px, 237 KB)

image.png (919×490 px, 227 KB)

image.png (916×468 px, 256 KB)

image.png (907×467 px, 228 KB)

image.png (912×619 px, 461 KB)

image.png (901×598 px, 434 KB)

image.png (723×997 px, 555 KB)

image.png (866×1 px, 817 KB)

image.png (799×1 px, 598 KB)

image.png (700×1 px, 464 KB)

image.png (675×1 px, 420 KB)