Page MenuHomePhabricator

MobileFrontend displays second paragraph as first paragraph on dewiki (Moving article lead is broken)
Closed, ResolvedPublic

Description

Apparently there is something broken with the automatic moving of the first paragraph of article above infoboxes on mobile (T143139): if you look at this article on dewiki, it is actually the second paragraph to be put in front, not the first one, resulting in a very confusing lead section (it is the same on most, but not all, dewiki articles with infoboxes I have checked). I do not encounter this behaviour on enwiki, so no idea what the cause is.

Event Timeline

Aklapper renamed this task from Moving article lead is broken on dewiki to MobileFrontend displays second paragraph as first paragraph on dewiki (Moving article lead is broken).Sep 19 2020, 2:44 PM
Aklapper added a project: MobileFrontend.

Details:

  • The current heuristic for finding the first non-empty paragraph (and moving it to the top if necessary) works fine for >90% of all pages (e.g. most random pages), but sometimes fails:
    • Sometimes it moves the second paragraph to the top, not the first, and thus swaps the paragraphs. This is quite confusing for readers.
    • Sometimes it leaves the Infobox at the top and moves no paragraph to the top. This is inconvenient for readers.
  • It looks like these problems often (but not always) occur when the wikitext contains an image or an infobox before the first paragraph.
  • I couldn't find any articles with these problems in other Wikipedias than dewiki (but I only looked at about ten articles in non-de wikis).
  • The problem is present in the HTML delivered by the server, so it's not a CSS or JavaScript problem.

Examples:

Also see: Wikipedia:Technik/Werkstatt (in German), Wikipedia:Fragen_zur_Wikipedia (in German)

A similar problem on ruwiki was fixed in 2018: T188825

Can this be triaged as Unbreak now? High profile pages with 1000s of daily views are affected such as https://de.m.wikipedia.org/wiki/Deutschland
Over 50% of page views are now mobile.

Ammarpad triaged this task as High priority.EditedSep 20 2020, 3:34 PM
Ammarpad subscribed.

This is very confusing, and often people only read the first paragraph of an article. In such cases, this bug will give them distorted view of the article

This comment was removed by Esanders.

Verified locally that this fix made after the UBN during last weeks train will resolve this issue: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/627892

I'll schedule that for a backport asap, so we don't have to wait until Thursday.

Scheduled for 1100UTC (12 hours from now).

Sounds good. When is this going to be live on dewiki? I'd like to have a look at some of the pages I listed above. Will I have to purge the pages after the fix is deployed?

Deployment is happening now. I don't think you would need to re-parse the wikitext, as the lead paragraph transform happens after that.

For reference, the cause of this issue was inline templates which use TemplateStyles in lead paragraph. The logic which "ingores" the TemplateStyles tag for the purpose of checking if a paragraph is empty was broken during a UBN patch. As de.wiki uses TemplateStyles on {{IPA}}, this was triggering on lots of pages.

This has been deployed.

@Chrisahn I tested the pages you listed and they all seem to be fine.

Some of the issues you identified are pre-existing issues such as the paragraph not being hoisted on https://de.m.wikipedia.org/wiki/Eppstein. This would be fixed by T262093, which is currently in review.

Esanders claimed this task.