Page MenuHomePhabricator

[RTL, TOC] The arrow before collapsible sections in sidebar is clipped
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Assigned To
Authored By
Jeeputer
Aug 5 2022, 11:58 AM
Referenced Files
F35535696: Screen Recording 2022-09-26 at 6.24.51 PM.mov.gif
Sep 27 2022, 1:29 AM
F35535694: Screen Recording 2022-09-26 at 6.24.16 PM.mov.gif
Sep 27 2022, 1:29 AM
F35527733: Screen Recording 2022-09-21 at 7.21.06 PM.mov.gif
Sep 22 2022, 2:22 AM
F35527731: Screen Recording 2022-09-21 at 7.18.43 PM.mov.gif
Sep 22 2022, 2:22 AM
F35526084: Screen Shot 2022-09-20 at 12.46.47 PM.png
Sep 20 2022, 4:47 PM
F35526080: Screen Shot 2022-09-20 at 12.36.37 PM.png
Sep 20 2022, 4:38 PM
F35490382: Screen Recording 2022-08-25 at 4.10.23 PM.mov.gif
Aug 25 2022, 11:11 PM
F35490381: Screen Recording 2022-08-25 at 4.09.49 PM.mov.gif
Aug 25 2022, 11:11 PM

Description

Steps to replicate:

  • see this Arabic article with vector 2022 skin.
  • go to the table of content on the right hand and find the level 2 heading named "وصف اللوح المحفوظ" and check the arrow before the section title.
  • now see this Persian article with the same skin.
  • again, go to the table of content and find level 2 heading named "بررسی اجمالی" and see the arrow before the title.
  • inspect .sidebar-toc class for both pages and check the padding values (right and left paddings are swapped for Persian Wikipedia using Common.css as explained below).

description and proposed solution:
As you can see, in the arwiki, which uses rtl configuration, the arrow before the collapsible section titles (level 2 headings which have level 3 subsections) is incorrectly shown. this issue is present in all rtl wikis such as hewiki (example).
The value entered for right and left padding in .sidebar-toc class is the same in all rtl and ltr wikis, while the right and left padding values should be swapped when the direction is different.
We earlier addressed the issue in fawiki (reported here) and implemented a temporary solution at w:fa:MediaWiki:Common.css#L-11:

.sidebar-toc {
	padding: 20px calc(15px + 0.75em) 20px 12px;
}

The value for right padding in rtl wikis should be calculated using calc(15px + 0.75em). in ltr wikis, this value is considered for left padding (for example, inspect .sidebar-toc class in this English article).

Developer notes

CSSJanus doesn't seem to flip calc values, so we should either:

  1. not use calc
  2. Per reporter suggestion add a rule .rtl .sidebar-toc { 20px 12px 20px calc(15px + 0.75em); }

QA asteps

QA Results - Beta

ACStatusDetails
1T314652#8183797

QA Results - Prod

ACStatusDetails
1T314652#8187278

QA Results - Beta

ACStatusDetails
1T314652#8252228

QA Results - Prod

ACStatusDetails
1T314652#8262908

Event Timeline

Jdlrobson renamed this task from The arrow before collapsible sections in sidebar TOC is shown in half to [RTL, TOC] The arrow before collapsible sections in sidebar is not clipped.Aug 16 2022, 7:25 AM
Jdlrobson updated the task description. (Show Details)
Jdlrobson renamed this task from [RTL, TOC] The arrow before collapsible sections in sidebar is not clipped to [RTL, TOC] The arrow before collapsible sections in sidebar is clipped.Aug 16 2022, 5:24 PM

Also worth trying is removing the shorthand for padding and using padding-left and padding-right separately. CSS-Janus might just flip the property names in that case and not worry about the values.

ovasileva raised the priority of this task from Medium to High.Aug 18 2022, 5:13 PM

Change 824693 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/skins/Vector@master] [RTL, TOC] The arrow before collapsible sections in sidebar is clipped

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

Quick fix submitted to Gerrit
Long term fix PR opened in cssjanus https://github.com/cssjanus/cssjanus/pull/89

Change 824693 merged by jenkins-bot:

[mediawiki/skins/Vector@master] [RTL, TOC] The arrow before collapsible sections in sidebar is clipped

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

Hi, I propose that instead of solving this (probably hard) problem, we can erase it and implement another scenario that is probably more appropriate. The better scenario can be placing the ">" ("expand") and "˅" (hide) at the end of that heading. This way, these signs would be placed at right hand side of a heading text in LTR languages and at the left hand side of the heading in RTL languages. So the required space will automatically be provided because there is always some padding at these places.
It should be noted that the scenario of "> and ˅ after text" is much more prevalent than placing them before text, in the contemporary Internet pages.

Test Result - Beta

Status: ✅ PASS
Environment: beta/ (arbeta)
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: Verify that in RTL the arrow for subsections does not get clipped.

Screen Recording 2022-08-24 at 7.14.54 PM.mov.gif (652×1 px, 978 KB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: arwiki, fawiki
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: Verify that in RTL the arrow for subsections does not get clipped.

Screen Recording 2022-08-25 at 4.09.49 PM.mov.gif (512×544 px, 118 KB)

Screen Recording 2022-08-25 at 4.10.23 PM.mov.gif (512×544 px, 114 KB)

Looks good, resolving!

Today, the same problem raised again in Farsi Wikipedia, (for example see ToC in https://ar.wikipedia.org/wiki/%D8%AC%D8%AF%D8%A7%D8%A1_%D9%86%D9%82%D8%B7%D9%8A the arrows after rendering are in half.

To solve this problem, we should apply «padding-right: 6px;» to the class "sidebar-toc-contents". I tested that in the inspector of my browser, and results in showing signs correctly and fully.

ovasileva subscribed.
Jdlrobson subscribed.

The body.rtl .sidebar-toc rule is being flipped. It needs to be prefixed with noflip

since the change done on variable sidebar-toc-left-padding does not use calc statement anymore and pre-calculate the value, cssjanus flips values properly which resulted on double flips. with the submitted fix.

Change 833075 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/skins/Vector@master] [RTL, TOC] The arrow before collapsible sections in sidebar is clipped

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

@bwang The Bengali issue appears to be because the color of the icon is not transparent. Can we safely add the rule .sidebar-toc-toggle { color: transparent; } ?

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

[mediawiki/skins/Vector@master] Table of contents: Hide accessible label using color transparent

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

Change 833075 merged by jenkins-bot:

[mediawiki/skins/Vector@master] [RTL, TOC] The arrow before collapsible sections in sidebar is clipped

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

Change 833098 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Table of contents: Hide accessible label using color transparent

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

@ovasileva @Jdlrobson I'm still seeing this issue on Arabic Wikipedia (link to page). Additionally, when a section is collapsed the arrow is significantly smaller than it should be.

Screen Shot 2022-09-20 at 12.36.37 PM.png (1×428 px, 98 KB)

@alexhollender_WMF this is broken in production. THe fix is only on beta cluster.

@alexhollender_WMF this is broken in production. THe fix is only on beta cluster.

ah whoops sorry. looks great on beta:

Screen Shot 2022-09-20 at 12.46.47 PM.png (1×960 px, 217 KB)

On Farsi Wikipedia we made a temporary css style solution at https://fa.wikipedia.org/wiki/%D9%85%D8%AF%DB%8C%D8%A7%D9%88%DB%8C%DA%A9%DB%8C:Common.css
So in this right-to-left Wikipedia this problem is solved temporarily. But in Arabic Wikipedia (that is also rtl) this style does not applied, and so the signs are clipped. But this problem should not be solved via .css page and needs a global-Wiki action.

Test Result - Beta

Status: ✅ PASS
Environment: beta (arwiki, fawiki)
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: Verify that in RTL the arrow for subsections does not get clipped.
fawiki-beta

Screen Recording 2022-09-21 at 7.18.43 PM.mov.gif (914×570 px, 308 KB)

arwiki-beta

Screen Recording 2022-09-21 at 7.21.06 PM.mov.gif (914×634 px, 157 KB)

Test Result - Prod

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

Test Artifact(s):

QA Steps

✅ AC1: Verify that the arrow for subsections does not get clipped.
arwiki

Screen Recording 2022-09-26 at 6.24.16 PM.mov.gif (914×634 px, 236 KB)

bnwiki

Screen Recording 2022-09-26 at 6.24.51 PM.mov.gif (914×634 px, 337 KB)