Page MenuHomePhabricator

LeadParagraph: In ruwiki, on mobile, hatnotes sometimes go after the first paragraph
Open, LowPublic

Description

In ruwiki, infoboxes often go before hatnotes in source code, which results in this on desktop:

image.png (302×1 px, 159 KB)
https://ru.wikipedia.org/w/index.php?title=Истомин,_Константин_Иванович&direction=prev&oldid=96534230

(notice the infobox is on one level with the hatnote). Nothing wrong with this.

However on mobile...
https://ru.m.wikipedia.org/w/index.php?title=Истомин,_Константин_Иванович&direction=prev&oldid=96534230

After T143139: [EPIC] Move first paragraph <p> above infobox template on small screens & T145216: MobileFormatter should relocate first paragraph ahead of infobox & T150325: Move first paragraph before infobox on stable are done, this results in this on mobile (actual):

image.png (361×1 px, 138 KB)

So, the hatnote is moved down together with the infobox, while it should be left above the first paragraph (expected):
image.png (476×1 px, 179 KB)

Right now our hatnotes have dablink & rellink classes, but we can add hatnote for unification reasons if asked for.

Event Timeline

Jdlrobson subscribed.

Hi @Jack_who_built_the_house per https://www.mediawiki.org/wiki/Recommendations_for_mobile_friendly_articles_on_Wikimedia_wikis#Use_consistent_ordering_for_hatnotes,_ambox_and_infobox_templates documents the expected order. When this order is not used, these problems will happen.

The lead paragraph algorithm will ignore things marked as hatnote but we can't special case for every single class across all the projects we support.

I've been fixing similar problems myself on Wikivoyage.

The problem is that adding the class hatnote doesn't help, I've tried that on https://ru.m.wikipedia.org/w/index.php?title=Истомин,_Константин_Иванович&oldid=96534177.

In our project, we don't have a consensus whether infoboxes should go after hatnotes or before, so we have both cases.

This doesn't oseem to be happening any more.. did this get fixed on wiki?

@Jack_who_built_the_house: Could you please answer the last comment? Thanks in advance!

Thanks for the ping. Yep, this is still happening (something was wrong with the links, I fixed them). Examples of articles where this is currently happening: https://ru.m.wikipedia.org/wiki/Кутузов,_Михаил_Илларионович, https://ru.m.wikipedia.org/wiki/Барклай-де-Толли,_Михаил_Богданович.

Jdlrobson renamed this task from In ruwiki, on mobile, hatnotes sometimes go after the first paragraph to LeadParagraph: In ruwiki, on mobile, hatnotes sometimes go after the first paragraph.Apr 6 2021, 7:35 PM
ovasileva moved this task from Incoming to Triaged but Future on the Web-Team-Backlog board.
ovasileva subscribed.