Page MenuHomePhabricator

Mobile VE no longer restores section hash fragment after section editing
Closed, ResolvedPublic

Description

Mobile VE no longer restores section hash fragment after section editing.

Actual behavior

  1. Edit the body of a section
  2. Publish changes
  3. ⚠️ View is scrolled to the top of the article in read mode

Expected behavior

  1. Edit the body of a section
  2. Publish changes
  3. ✅ View is scrolled to the top of the section I was just editing

Video
https://youtu.be/fikbhfZjmJE

QA Results

ACStatusDetails
1T234868#5856482

Event Timeline

matmarex added subscribers: Niedzielski, pmiazga.

When we save the page, we get the new page HTML from the action=parse API, and we search that HTML for the section number we used for editing (e.g. "9" in https://en.m.wikipedia.org/wiki/Frederick_Law_Olmsted#/editor/9) to get the section id (e.g. "U.S._park_designer" in https://en.m.wikipedia.org/wiki/Frederick_Law_Olmsted#U.S._park_designer).

As it turns out, in Minerva the API returns different HTML, which prevents us from finding the right section. Compare:

This seems unintentional, and might be a bug in 54060a3c (T206265: Bug: Section edit links should be hidden for blocked users).

Change 541597 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] ApiParse: Use the right Skin object for building section edit links

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

Change 541598 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/skins/MinervaNeue@master] Allow passing context to MinervaPagePermissions

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

Krinkle added a subscriber: Krinkle.

[mediawiki/core@master] ApiParse: Use the right Skin object for building section edit links

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

Assigned to @Krinkle.

Change 541597 merged by jenkins-bot:
[mediawiki/core@master] ApiParse: Use the right Skin object for building section edit links

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

Change 541598 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Allow passing context to MinervaPagePermissions

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

Edtadros added a subscriber: Edtadros.

Test Result

Status:
OS: macOS Catalina
Browser: Chrome
Device: MBP
Emulated Device: iPhoneX

Test Artifact(s):

QA Steps

Edit the body of a section
Publish changes
❓ AC1: View is scrolled to the top of the section I was just editing

Dog - Wikipedia, the free encyclopedia.gif (480×222 px, 3 MB)

This doesn't scroll the section at the top of the view but towards the top of the view. I tried it with starting the edit while the section was near the bottom of the view and when it publishes it goes back to the location/view in the gif above.

Dog - Wikipedia, the free encyclopedia (1).gif (480×222 px, 3 MB)

Edtadros updated the task description. (Show Details)

@Edtadros Does that also happen to you when directly viewing the page, i.e. after clicking this link: https://en.m.wikipedia.beta.wmflabs.org/wiki/Dog#Biology? if so, it's out of scope (but maybe another task should be filed).

I could reproduce something similar and it appears to be caused by the annoying survey box loading late and shifting the page's contents:

After loading the page…The offset of the header suspiciously matches the height of the annoying survey box
image.png (1×640 px, 103 KB)
image.png (1×640 px, 528 KB)

Luckily we don't have that in production (and I hope we never will, why is that even there?).

@matmarex this does happen by just going to the link you provided.

en.m.wikipedia.beta.wmflabs.org_wiki_Dog(iPhone X).png (2×1 px, 388 KB)

Seems like this is also in QA on the Editing board so will untag the Web kanban board for now. Feel free to add us again if this is premature/there's more needed from our side.