The approach in MobileFrontend looks for a paragraph and an infobox (where infobox now includes block images since T258201), and switches them around. This approach requires us to list the likely types of block elements that could come before a paragraph, and our current filter of class=infobox|thumb is not exhaustive. Many images are wrapped in various containers (T261993) and there are other types of block elements we would want to move down.
The approach in mobile apps just moves the lead paragraph (and all siblings up to the next paragraph) to the top of the page, regardless of what is above it. It then only has to detect templates at the top of the page which should stay at the top, currently this is just class=hatnote. For MF we should probably also include class=mbox and others we are aware of (mboxes are just hidden in mobile apps, hence not included in their code).
For as many pages in the list of candidate pages below:
- Visit the page on enwiki and on this patchdemo
- Check that the lead paragraph remains at the top of the page or that it has moved to the top of the page
- On https://it.m.wikipedia.org/wiki/Organo_a_pompa there are two hat notes, one with the hatnote class and the other an ambox. Both templates are using TemplateStyles which could be related. Make sure the hatnotes are hoisted.
List of candidate pages
- Any of https://pageviews.toolforge.org/topviews/?project=en.wikipedia.org&platform=all-access&date=last-month&excludes=
QA Results - Beta