Page MenuHomePhabricator

Sticky header: LTR Username text and icon looks out of place on sticky header user menu on RTL wikis
Closed, ResolvedPublic3 Estimated Story Points

Description

Steps to reproduce

  1. Go to https://fa.wikipedia.org/wiki/%DA%AF%D8%A7%D9%87%E2%80%8C%D8%B4%D9%85%D8%A7%D8%B1%DB%8C_%D9%87%D8%AC%D8%B1%DB%8C_%D8%AE%D9%88%D8%B1%D8%B4%DB%8C%D8%AF%DB%8C?vectorstickyheader=1
  2. Scroll down until sticky header appears
  3. Select user menu

Observed
Username appears aligned incorrectly. Icon is on the wrong side

Screen Shot 2021-12-17 at 4.14.13 PM.png (1×2 px, 515 KB)

Expected
Username should be right aligned and the icon should appear on the right

Developer notes

Remove the dir=auto on the #pt-userpage a element which is set here:
https://gerrit.wikimedia.org/g/mediawiki/core/+/826b6f6dacbc1834ef4aa6bf972852f9a03b4d98/includes/skins/SkinTemplate.php#1038

Inside Vector modern (only)

You'll need to use one of the existing hooks to do this.

QA steps

  • Navigate to a page locally as a logged-in user in modern Vector in a rtl language i.e. he (updating this config var in local settings will render page in rtl $wgLanguageCode = "he";)
  • Hover over the user menu and narrow the view port until the username is injected into the user menu dropdown
  • Note that the user name is right-aligned

Screen Shot 2022-03-30 at 3.33.27 PM.png (1×1 px, 278 KB)

QA Results - Beta

ACStatusDetails
1T297953#7830341

QA Results - Prod

ACStatusDetails
1T297953#7847013

Event Timeline

ovasileva lowered the priority of this task from High to Medium.Dec 20 2021, 6:35 PM

This also impacts the user menus at lower resolutions. I think this is working correctly except that the icon margin should be flipped in this scenario like so:

Screen Shot 2021-12-20 at 10.35.50 AM.png (658×414 px, 45 KB)

The dir is set to auto, meaning the direction is auto-detected meaning our flipping code doesn't kick in. This "automatic" behaviour creates a bit of a problem that I'm not sure how to fix.

It would be easiest to set this to the same direction as the interface texct, but I think that would look odd for a native speaker ?:

Screen Shot 2021-12-20 at 10.39.35 AM.png (674×414 px, 53 KB)

Jdlrobson renamed this task from Sticky header: Username appears incorrectly within sticky header user menu on RTL wikis to Sticky header: LTR Username text and icon looks out of place on sticky header user menu on RTL wikis.Dec 20 2021, 6:41 PM

This also impacts the user menus at lower resolutions. I think this is working correctly except that the icon margin should be flipped in this scenario like so:

Screen Shot 2021-12-20 at 10.35.50 AM.png (658×414 px, 45 KB)

The dir is set to auto, meaning the direction is auto-detected meaning our flipping code doesn't kick in. This "automatic" behaviour creates a bit of a problem that I'm not sure how to fix.

It would be easiest to set this to the same direction as the interface texct, but I think that would look odd for a native speaker ?:

Screen Shot 2021-12-20 at 10.39.35 AM.png (674×414 px, 53 KB)

@Amire80 - I wonder if you can give us some feedback on this one? What should the correct behavior here be?

cjming removed cjming as the assignee of this task.
cjming subscribed.

Not ready for analysis. Can move it back in when we have a clearer idea what we want to do.

The dir is set to auto, meaning the direction is auto-detected meaning our flipping code doesn't kick in. This "automatic" behaviour creates a bit of a problem that I'm not sure how to fix.

It would be easiest to set this to the same direction as the interface texct, but I think that would look odd for a native speaker ?:

Screen Shot 2021-12-20 at 10.39.35 AM.png (674×414 px, 53 KB)

This looks good to me. Right alignment + automatic direction is OK.

Change 775342 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Do not add dir attribute for username

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

Jdlrobson removed Edtadros as the assignee of this task.
Jdlrobson added a subscriber: Edtadros.
cjming updated the task description. (Show Details)
cjming moved this task from Code Review to QA on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.

Change 775342 merged by jenkins-bot:

[mediawiki/core@master] Do not add dir attribute for username

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

Test Result - Beta

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

Test Artifact(s):

QA Steps

Navigate to a page locally as a logged-in user in modern Vector in a rtl language i.e. he (updating this config var in local settings will render page in rtl $wgLanguageCode = "he";)
Hover over the user menu and narrow the view port until the username is injected into the user menu dropdown
✅ AC1: Note that the user name is right-aligned

Screen Shot 2022-04-04 at 4.17.30 PM.png (706×606 px, 73 KB)

Test Result - Prod

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

Test Artifact(s):

QA Steps

Navigate to a page locally as a logged-in user in modern Vector in a rtl language i.e. he (updating this config var in local settings will render page in rtl $wgLanguageCode = "he";)
Hover over the user menu and narrow the view port until the username is injected into the user menu dropdown
✅ AC1: Note that the user name is right-aligned

Screen Shot 2022-04-11 at 6.28.33 PM.png (508×688 px, 136 KB)