Page MenuHomePhabricator

In mobile view, if a reference contains a link, the link may be positioned improperly in the footnote tooltip
Closed, ResolvedPublic2 Estimated Story Points

Assigned To
Authored By
pajz
Feb 24 2019, 4:21 PM
Referenced Files
F29053787: T216961-1.png
May 15 2019, 2:31 AM
F29053786: T216961-0.png
May 15 2019, 2:31 AM
F28771355: Screen Shot 2019-04-25 at 16.09.02.png
Apr 25 2019, 2:13 PM
F28325436: Screen Shot 2019-03-04 at 9.53.50 AM.png
Mar 4 2019, 5:54 PM
F28325207: Screen Shot 2019-03-04 at 1.19.02 PM.png
Mar 4 2019, 5:27 PM
F28286457: Screen Shot 2019-02-26 at 10.48.40.png
Feb 26 2019, 9:49 AM

Description

Description

I have encountered the issue on both Android (Chrome) and on my desktop computer (Chrome). Since the particular footnote where I encountered it is formatted using a widespread reference template on dewiki, there may also be something wrong with the underlying template.

Steps to reproduce:

  1. Go to https://de.m.wikipedia.org/w/index.php?title=Axel_Krau%C3%9Fe&oldid=185986567&mobileaction=toggle_view_mobile
  2. Click on footnote [11].
  3. Compare the footnote tooltip (not sure how you call it) to the actual footnote 11 at the bottom of the page. Notice that, in the footnote tooltip, the link is in the wrong position entirely. It should actually be at the very beginning of the footnote.

Screenshot (Chrome 72.0.3626.105, Android 8.0.0):

Screenshot_20190224_122230.jpg (1×720 px, 150 KB)

Proposed solution

The <a> element in the footnote is picking up styling from the drawer header/title element .drawer.references .cite .text. If we add the following rules to .drawer.references .cite .text a (note there are styles defined at .drawer.references a but they are getting overridden), then we achieve the desired result:

text-transform: none;
letter-spacing: initial;
font-size: inherit;
color: #6699FF;
float: none;

*note, we use #6699FF for links on dark backgrounds, as defined in T169153.

Result:

de.m.wikipedia.org_w_index.php_title=Axel_Krau%C3%9Fe&oldid=185986567&mobileaction=toggle_view_mobile(iPhone 6_7_8) (3).png (1×750 px, 191 KB)

QA steps

On Thursday this will be deployed to German Wiki and you will be able to test in production using the QA steps above.
https://de.m.wikipedia.org/w/index.php?title=Axel_Krau%C3%9Fe&oldid=185986567&mobileaction=toggle_view_mobile

If time allows, ideally we should test this using beta cluster URL however you will need to coordinate with @pmiazga and ask him to SWAT a change to the beta cluster.

QA Results

ACStatusDetails
1T216961#5183357

Event Timeline

pajz renamed this task from In mobile view, if a reference contains a link, the link may be misformatted to In mobile view, if a reference contains a link, the link may be positioned improperly in the footnote tooltip.Feb 24 2019, 4:25 PM

@Jdlrobson do you know anything about this? Do we somehow transform the content?

Also, noticing that the external link icon is out of place, and also a bit difficult to see on the black background. Any idea if there is a task related to that?

@Alexhollender it looks like the problem is the letter-spacing CSS rule we use:

letter-spacing: 0.2em;

It causes the link to spill on to a second line which causes this problem.

Screen Shot 2019-02-25 at 1.44.29 PM.png (209×539 px, 45 KB)

Are there solutions here that involve removing letter-spacing ?

As @Jdlrobson mentions, the letter-spacing is only a problem because it causes the text to span 2 lines. If the text were longer, even without the letter-spacing, the problem would still occur (as with reference [6] in that article)

Screen Shot 2019-02-26 at 10.48.40.png (372×1 px, 98 KB)

The reason the link gets weird when it spans two lines is because it's floated left, causing it to take up 100% space when it spans multiple lines.

If we remove the float, the link defaults to display:inline; and the text can sit beside it no matter how many lines.

Screen Shot 2019-02-26 at 10.36.39.png (654×1 px, 324 KB)

I haven't looked into other consequences of the removing the float, but I think that could be a solution.

@Jdlrobson @Jdrewniak: ok, thanks for that information. I think I should create a separate ticket for the external link icon issue. Any ideas on the main issue?

Notice that, in the footnote tooltip, the link is in the wrong position entirely. It should actually be at the very beginning of the footnote.

To clarify what I'm understanding to be the main point of this task, if you compare footnote 11 on https://de.m.wikipedia.org/wiki/Axel_Krau%C3%9Fe:

screenshotcontent (as read by user)note
desktop
Screen Shot 2019-03-04 at 1.19.02 PM.png (92×835 px, 40 KB)
11. Einstimmig: Axel Krauße wird Intendant in Ansbach. In: nachtkritik.de. 12. Februar 2019, abgerufen am 24. Februar 2019.link comes first, styled without any changes to letter casing
mobile
de.m.wikipedia.org_w_index.php_title=Axel_Krau%C3%9Fe&oldid=185986567&mobileaction=toggle_view_mobile(iPhone 6_7_8).png (1×750 px, 180 KB)
[11] In: nachtkritik.de. 12. Februar 2019, abgerufen am EINSTIMMIG: AXEL KRAUSSE WIRD INTENDANT IN ANSBACH. 24. Februar 2019.link comes after "In: nachtkritik.de. 12. Februar 2019, abgerufen am", is rendered in uppercase, is not styled as a link, and it's icon is misaligned.

The link should come first. As Jan points out in T216961#4984077 there is a conflicting float. Removing that rule makes it look like this:

Screen Shot 2019-03-04 at 9.53.50 AM.png (152×512 px, 26 KB)

ok, the proposed solution looks good to me. Moving this out of design.

In addition to the float being picked up from the drawer header/title's CSS (.drawer.references .cite .text), it is also picking up other styling rules, which makes the link look different from the rest of the content (letter-spacing, font-size, text-transform). Perhaps we could add the following CSS to .drawer.references .cite .text a:

text-transform: none;
letter-spacing: initial;
font-size: inherit;
color: #6699FF;
float: none;

Note, we use #6699FF for links on dark backgrounds, as defined in T169153. Result:

de.m.wikipedia.org_w_index.php_title=Axel_Krau%C3%9Fe&oldid=185986567&mobileaction=toggle_view_mobile(iPhone 6_7_8) (3).png (1×750 px, 191 KB)

Since this is in upcoming, maybe we can change the color of the links to a better blue as well while we're at it? T217660
..reads @alexhollender commend above, oh! yeah. I'll mark that task as duplicate...

Change 506424 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/extensions/MobileFrontend@master] Fix display of nested reference drawers

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

Change 506425 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/skins/MinervaNeue@master] Adds lighter color external link icon for reference drawers

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

I think those two patches fix this nicely :)

Screen Shot 2019-04-25 at 16.09.02.png (1×1 px, 795 KB)

@alexhollender @Jdrewniak did I miss a comment about the icon in the top left being converted to white from gray (is that intentional)?

@Jdlrobson nice catch, I don't believe that was intentional.

@Jdlrobson I hope that's an issue with my setup and not a change I made, since it appears that way for me on master (images might be cached though) and I don't think I touched any code that would change that icon.

Change 506424 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Fix display of nested reference drawers

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

Change 506425 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Adds a light-blue variant to the external link icon

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

This just needs QA steps, but I'm having a hard time tracking down similar references other than the exact one in the description.

Change 508631 had a related patch set uploaded (by Pmiazga; owner: Jdlrobson):
[operations/mediawiki-config@master] beta: Enable content provider on de beta cluster for QA purposes

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

Change 508631 merged by jenkins-bot:
[operations/mediawiki-config@master] beta: Enable content provider on de beta cluster for QA purposes

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

Test Result

Status: ✅ PASS
OS: macOS Mojave
Browser: Chrome
Device: MBP
Emulated Device: iPhoneX

Test Artifact(s):

QA Steps

  1. Go to https://de.m.wikipedia.org/w/index.php?title=Axel_Krau%C3%9Fe&oldid=185986567&mobileaction=toggle_view_mobile
  2. Click on footnote [11].
  3. Compare the footnote tooltip to the proposed solution in this task description

✅ Beta:

T216961-0.png (2×1 px, 521 KB)

✅ German Prod Wiki:

T216961-1.png (2×1 px, 467 KB)