Page MenuHomePhabricator

Editing/section collapsing edge cases
Closed, ResolvedPublic3 Estimated Story Points

Description

There are a couple of edge cases where the MobileFormatter fails which breaks editing. We will fix this to ensure editing is possible.

Scenario 1

Some users have used <div> in their talk pages.
Theses pages are not recognized by the mobile site, in other words the pencil icon is not displayed beside sections titles. We can't edit sections, we are obligate to edit the whole page.

Sample: https://fr.m.wikipedia.org/wiki/Discussion_utilisateur:Gratus
@Gratus uses https://fr.wikipedia.org/w/index.php?title=Utilisateur:Gratus/Acceuil_PDD&action=edit at the top of his talk page.
Other sample: https://fr.m.wikipedia.org/wiki/Discussion_utilisateur:Mathis73

At the opposite, this talk page is is well recognized: https://fr.m.wikipedia.org/wiki/Discussion_utilisateur:Speculos

Another example:

Scenario 2

This hasn't been seen in the wild, but if you create a page with the following wikitext:

a
=====5=====
====4====
======6======

e.g. https://m.mediawiki.org/wiki/User:Jdlrobson/tba

Sections 4 and 6 are editable, but not the section 5.

Replicate locally using:

$wgMFContentProviderClass = 'MobileFrontend\ContentProviders\MwApiContentProvider';
$wgMFMwApiContentProviderBaseUri = "https://mediawiki.org/w/api.php";

Acceptance criteria

  • The edit icon should load the entire page in the wikitext editor on pages where no sections are found
  • If a page is malformed and the first heading is nested deeper than a heading that follows e.g. an h3 before a h2 then do not wrap sections. The edit icon should also load the entire page in the wikitext editor.

Related: T157995

Event Timeline

Jdlrobson subscribed.

This may be fixed in the Thursday deploy... T152055

Jdlrobson triaged this task as Medium priority.May 23 2017, 10:03 PM

The fix that will be deployed later should remove the formatting issues, but I don't think it's going to allow these to be editable.

I think the best we could do here is make the edit link at the top apply to the whole page..
We don't have a good way to render edit icons/links in wrapped sections other than the talk overlay e.g. https://fr.m.wikipedia.org/wiki/Utilisateur:Gratus#/talk/1

Jdlrobson lowered the priority of this task from Medium to Low.May 26 2017, 7:12 PM
Jdlrobson renamed this task from <div> in talk pages break edit sections links to Not possible to edit sub sections.May 30 2017, 4:03 PM
Jdlrobson raised the priority of this task from Low to Medium.
Jdlrobson updated the task description. (Show Details)
Jdlrobson renamed this task from Not possible to edit sub sections to Not possible to edit sub sections on pages with wrapped section headings.Jun 2 2017, 8:20 PM
Jdlrobson renamed this task from Not possible to edit sub sections on pages with wrapped section headings to Editing edge cases.Jun 5 2017, 10:02 PM
Jdlrobson renamed this task from Editing edge cases to Editing/section collapsing edge cases.
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: bmansurov.
Jdlrobson set the point value for this task to 3.

@Jdlrobson why did you move this task from To Do list to Upcoming?

There's a lot of stuff inflight right now in sign off and needs more work. Let's get that wrapped up before committing to new work.

The edit icon should load the entire page in the wikitext editor on pages where no sections are found

Is it practical to avoid showing an edit icon if it's not at a true section?

Jdlrobson lowered the priority of this task from Medium to Low.Oct 31 2017, 11:40 PM
Jdlrobson claimed this task.

The fix to T179356 also took care of this - as the edit icon was always there apparently, it was just hidden by CSS. Scenarios 1 and 2 are now editable.