Page MenuHomePhabricator

In ruwiki, on mobile, hatnotes sometimes go after the first paragraph
Open, Needs TriagePublic

Description

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

https://ru.wikipedia.org/w/index.php?title=%D0%98%D1%81%D1%82%D0%BE%D0%BC%D0%B8%D0%BD,_%D0%9A%D0%BE%D0%BD%D1%81%D1%82%D0%B0%D0%BD%D1%82%D0%B8%D0%BD_%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&direction=next&oldid=96534177

(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=%D0%98%D1%81%D1%82%D0%BE%D0%BC%D0%B8%D0%BD,_%D0%9A%D0%BE%D0%BD%D1%81%D1%82%D0%B0%D0%BD%D1%82%D0%B8%D0%BD_%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D1%87&direction=next&oldid=96534177

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):


So, the hatnote is moved down together with the infobox, while it should be left above the first paragraph (expected):

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

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 27 2018, 8:11 PM
Jdrewniak updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)Nov 28 2018, 6:44 PM
Jdlrobson added a subscriber: Jdlrobson.

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.