Page MenuHomePhabricator

Text inflation algo on mobile causes unbreakable links to extend width of viewport and add lots of whitespace on the right
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Screenshot_20230118-121020.png (2×1 px, 421 KB)

  • I investigated and it turns out that there are pretty long external links in the section https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Ingleside,_Texas
  • Because mobile uses text inflation to up the fontsize of the main body, these links make the content wide, causing the viewport to become very wide, causing the CSS to add the right sidebar, making the readable text narrow, but the rest wide.

I verified this by adding the following CSS to a templatestyles stylesheet https://en.wikipedia.org/wiki/Template:Village_pump_page_header/styles.css

a {
	word-break: break-word !important;
}

I suggest we apply the word-break algo at least to a.external. However we should consider applying it to the entire content area of the Vector-2022 skin. Minverva has had this for years now, and we don't get many complaints, and it would fix the desktop skin issues on the mobile platform

Developer notes

Most updated CSS :
T327334#8569273

QA steps

Using a mobile device, load the desktop site (switch if need be)

QA Results - Beta

ACStatusDetails
1T327334#8689906
2T327334#8689906

QA Results - Prod

ACStatusDetails
1T327334#8712368
2T327334#8712368

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

I've moved that one to the correct page which is [[MediaWiki:Vector-2022.css]].

So, this has a harsh impact on the Shortcut template. See for example

image.png (266×1 px, 30 KB)

I can either recommend a similar change be limited to small screen sizes @media ( max-width: 719px ) or I can flip the expectation in that template to never break in TemplateStyles or hack it to allow breaks with <wbr> or similar at reasonable places (slashes and the colon). The TemplateStyles option is probably the more "hurts my soul" end state because at some point mbox templates will be divs and then I'll have to fight with how flex deals with images in the responsive skins.

I've modified the CSS in Vector-2022.css in the meantime to be the first option.

Hmm. how come shortcuts are external links ?

Hmm. how come shortcuts are external links ?

They're all redirects with &redirect=no. If there's a way to do that with an internal link I'd take it. :)

We can target a[rel="nofollow"] i guess. those should be true external links. Or a.external.free (plainlinks with not display text ?)

Some other things I can think of:

  1. I think we have some links to other wikis in shortcuts lying around. I can't be certain of that.
  2. Timeless has mostly gotten away without it.
  3. Maybe the parser could add a naked class when the wikitext has no inner text set?
  4. I've had to fix a few copy-pasted-from-URL internal links as well that were quite lengthy, mostly because the URL has been more convenient to get to than the page title. I do that myself. It might be less an issue now that we have the floating title for V22?

Maybe the parser could add a naked class when the wikitext has no inner text set?

I suspect that is what the .free class does. But i have trouble dechiperhing the parser on this front. its a gigantic set of options and possibilities.

Is this related to T327886 ? Do we need a more general solution than just links?

ovasileva triaged this task as Medium priority.Jan 26 2023, 8:58 PM

So, this has a harsh impact on the Shortcut template. See for example

image.png (266×1 px, 30 KB)

@Izno I was thinking a bit more about why this was happening... And some inspection shows that this is in part, a side effect of a trick that the table does. Basically, because the text cell tries to be 100% (per the requested styling), it will force the right cell to become as small as possible, even though there is space available. This could be fixed by converting mboxes to flex, or we can tell the browser to not apply this word breaking on tables (because it also has negative effects on wiki tables etc).

Currently I'm running with the following settings:

.mw-body-content {
	 -webkit-text-size-adjust: none;
	 text-size-adjust: none;
	 word-break: break-word;
}
.mw-body-content table {
	 word-break: normal;
}
a.external.free {
	word-break: break-all;
}

TheDJ's assessment seems pretty accurate, however changing word-break has caused us issues in the past across browsers (I can't find the task but there was such an instance on diffs), so it seems wise to think more deeply about this given this currently only impacts mobile users on select pages. @Izno perhaps we could try out TheDJs CSS rules in a logged in gadget to get them more battle tested before adding to MediaWiki core?

side effect of a trick that the table does

@TheDJ well of course the fact we're cheating is causing it. :) (It's not the only one specifically tied to the cheat that's shown up in the past few week, had to back and forth with Matma for the display-the-lead talk page work.)

That CSS posted there looks good to me to deploy either as some sort of gadget or even directly to core.

Currently I'm running with the following settings:

.mw-body-content {
	 -webkit-text-size-adjust: none;
	 text-size-adjust: none;
	 word-break: break-word;
}
.mw-body-content table {
	 word-break: normal;
}
a.external.free {
	word-break: break-all;
}

I've been running with these settings for about a month now and have not encountered many problems. I think it is a vast improvement and at least the link breaking a.external.free change should be implemented ASAP.

Jdlrobson raised the priority of this task from Medium to High.Feb 24 2023, 6:15 PM

Change 892051 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/skins/Vector@master] Vector: Break long bare external links

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

Change 892053 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/skins/Vector@master] Set word break for the entire content area

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

The example I gave in T329063 is now working better.

Screenshot_20230226-174848.png (1×864 px, 130 KB)
I assume this is due to the workaround mentioned by TheDJ on Jan 19 2023, 3:13 AM, so that looks good. Thanks.

Change 892051 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Vector: Break long bare external links

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

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Using a mobile device, load the desktop site (switch if need be)

❌ AC1: Check that there is no gray to the side of https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=1134542017#Ingleside,_Texas
The grey/gray to the right of the text is still present. I checked this in beta as well with the same result.

Screenshot 2023-03-06 at 5.00.48 PM.png (851×399 px, 133 KB)

✅ AC2: Check that text is zoomed out on https://en.wikipedia.org/w/index.php?title=User:RoySmith/sandbox&oldid=1138008943&useskin=vector2022 and none of the list items are clipped as described in T329063

Screenshot 2023-03-06 at 5.01.03 PM.png (849×398 px, 71 KB)

en.wikipedia.org_w_index.php_title=User_RoySmith_sandbox&oldid=1138008943&useskin=vector2022(iPhone 12 Pro).png (16×3 px, 2 MB)

I suspect the issue here is mw:Help:CirrusSearch#How_frequently_is_the_search_index_updated? Which is not a .free link

Will take a look. Cc @TheDJ

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

[mediawiki/skins/Vector@master] Break words for long links

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

Jdlrobson updated Other Assignee, added: Jdlrobson; removed: Jdrewniak.

Change 895370 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Break words for long links

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

@Jdlrobson Do you have opinions on disabling text inflation algo altogether ?

On the one hand, it makes the sizing match what you might expect as desktop user on mobile. On the other hand, it does increase readability of the desktop site when viewed on mobile.

Examples of VP/T with and without text inflation on an iPhone 14 Pro:

IMG_7394.PNG (2×1 px, 1 MB)

IMG_7395.PNG (2×1 px, 1 MB)

Could you post the URLs used to generate those? I tried scaling them to phone-size on my desktop, that's not a good comparison because the desktop's monitor doesn't have anywhere near the resolution my phone has.

@TheDJ personally I'd like to make progress in making Vector a fully responsive skin to solve that particular problem, particularly given users of the desktop site on mobile seem to expect different things around information density/font-size and are sensitive to any changes there.

Could you post the URLs used to generate those?

which ?

You posted two screenshots (IMG_7394.PNG and IMG_7395.PNG). How did you generate those, i.e. what do I have to do to view those two different versions of the page on my phone?

You posted two screenshots (IMG_7394.PNG and IMG_7395.PNG). How did you generate those, i.e. what do I have to do to view those two different versions of the page on my phone?

It's https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=1134542017#Ingleside,_Texas in a private session on mobile, but modified with the Safari browser inspector using developer mode to apply the patches we have merged over the last few days, and then the second one IMG_7395, also applies

.mw-body-content {
	 -webkit-text-size-adjust: none;
	 text-size-adjust: none;
}
QA Steps

Using a mobile device, load the desktop site (switch if need be)

❌ AC1: Check that there is no gray to the side of https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=1134542017#Ingleside,_Texas
The grey/gray to the right of the text is still present. I checked this in beta as well with the same result.

@Jdlrobson this still fails. I checked this on my phone with the same result. The screenshot below is using the device emulator in Chrome devtools.

Screenshot 2023-03-10 at 2.05.49 PM.png (846×390 px, 130 KB)

QA Steps

Using a mobile device, load the desktop site (switch if need be)

❌ AC1: Check that there is no gray to the side of https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=1134542017#Ingleside,_Texas
The grey/gray to the right of the text is still present. I checked this in beta as well with the same result.

@Jdlrobson this still fails. I checked this on my phone with the same result. The screenshot below is using the device emulator in Chrome devtools.

Screenshot 2023-03-10 at 2.05.49 PM.png (846×390 px, 130 KB)

Can you test on the beta cluster, please (https://en.wikipedia.beta.wmflabs.org/wiki/Talk:T327334)? The latest change hasn't been deployed yet. My understanding was QA in production is now being done post-sign off with our recent sprint change.

Test Result - Beta

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

Test Artifact(s):

QA Steps

Using a mobile device, load the desktop site (switch if need be)

✅ AC1: Check that there is no gray to the side of https://en.wikipedia.beta.wmflabs.org/wiki/Talk:T327334#Ingleside,_Texas

Screenshot 2023-03-13 at 3.07.54 PM.png (845×390 px, 168 KB)

✅ AC2: Check that text is zoomed out on https://en.wikipedia.beta.wmflabs.org/wiki/User:Edtadros-beta4/sandbox?useskin=vector2022 and none of the list items are clipped as described in T329063

en.wikipedia.beta.wmflabs.org_wiki_User_Edtadros-beta4_sandbox_useskin=vector2022(iPhone 12 Pro).png (2×1 px, 245 KB)

en.wikipedia.beta.wmflabs.org_wiki_User_Edtadros-beta4_sandbox_useskin=vector2022(iPhone 12 Pro) (1).png (16×3 px, 1 MB)

Edtadros closed this task as Resolved.EditedMar 20 2023, 11:57 PM
Edtadros removed ovasileva as the assignee of this task.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Using a mobile device, load the desktop site (switch if need be)

✅ AC1: Check that there is no gray to the side of https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=1134542017#Ingleside,_Texas

Screenshot 2023-03-20 at 4.55.38 PM.png (848×391 px, 181 KB)

✅ AC2: Check that text is zoomed out on https://en.wikipedia.org/w/index.php?title=User:RoySmith/sandbox&oldid=1138008943&useskin=vector2022 and none of the list items are clipped as described in T329063
Screenshot 2023-03-20 at 4.56.20 PM.png (846×394 px, 51 KB)

Change 892053 abandoned by Jdlrobson:

[mediawiki/skins/Vector@master] Set word break for the entire content area

Reason:

I don't think this is needed anymore, but please feel free to restore with new Phabricator ticket if it's still solving a problem.

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

Test wiki on Patch demo by TheDJ using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/42ba885d68/w/