Page MenuHomePhabricator

Lead paragraph transform does not apply in edit preview mode
Closed, ResolvedPublic3 Estimated Story Points

Description

When editing the preview does not correspond to the saved page. The infobox appears first in the preview not the lead paragraph:

Screen Shot 2020-03-25 at 10.31.43 AM.png (1×1 px, 472 KB)

Screen Shot 2020-03-25 at 10.31.51 AM.png (1×1 px, 262 KB)

Screen Shot 2020-03-25 at 10.31.54 AM.png (1×1 px, 667 KB)

Developer notes

We pass a parameter mobileformat "true" to the API in edit previews. MobileFrontend extends ApiParseExtender when this is present.

This could be a possible regression caused by T245160 if onOutputPageBeforeHTML is run inside API parse queries (although I think this is unlikely). It's more likely it doesn't know it's the lead section and the paragraph needs moving.

Acceptance criteria

  • Make sure the MobileFormatter applies transforms to all content in edit preview
  • To avoid spamming logstash with notices (and reopening T245160), disable the logging provided by $wgMFLogWrappedInfoboxes for API driven changes. A disableLogging function may be useful and called in ApiParseExtender.

Developer notes

During analysis please work out how the ApiParseExtender works and make sure it's providing suitable parameters to MobileFormatter and calling the right methods. Knowing exactly why the lead transform fails to apply will be useful to know.

Event Timeline

Other tasks about the lead paragraph transform not applying while editing:

ovasileva triaged this task as Medium priority.Apr 2 2020, 4:51 PM
ovasileva moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.

@Jdlrobson this ticket is so well written, thanks for the thoroughness!

@ovasileva is this ticket for the Editing team to complete?

It appears the Web team has ownership, so I am moving this on the Editing team board.

MBinder_WMF set the point value for this task to 3.Sep 22 2020, 5:29 PM
Jdlrobson added a subscriber: Peter.ovchyn.

Not clear if this is the responsibility of the editing or web team.

Change 763622 had a related patch set uploaded (by Bartosz Dziewoński; author: Esanders):

[mediawiki/extensions/MobileFrontend@master] Apply transformations to ApiParse output using onOutputPageBeforeHTML

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

We accidentally fixed this in the refactoring we've done to fix T219420.

Change 763622 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Apply transformations to ApiParse output using onOutputPageBeforeHTML

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