Page MenuHomePhabricator

Hack to edit the 1st section of the page when the 0th section is empty doesn't work if the page has a TOC
Closed, ResolvedPublic

Description

Hack to edit the 1st section of the page when the 0th section is empty (see T51215 / rEMFR52c3e508c01a: Open first section in editor when lead section empty) doesn't work if the page has a TOC, because it is counted as a part of the 0th section.

Replication steps

Expected: Should I see a non-empty section?

Developer notes

A hack was previously added to avoid the situation where a page has no lead section and the top edit icon when clicked will show an empty section. Previously, clicking this edit icon would load the first section, on the basis that you can still edit the lead section by prefixing text above the heading.

For instance to edit

== Heading ==
Text

You can insert a lead paragraph like so:

Lead paragraph.
== Heading ==
Text

I don't think this hack is helpful, give its a hack, especially given we know lead paragraphs are useful (and help projects such as page previews) and pages which also have no lead section are in the minority.

However, if we want to restore this behaviour, please let us know!
If not, we should remove the broken code.

Details

Related Gerrit Patches:

Related Objects

StatusAssignedTask
OpenNone
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedmatmarex
Resolvedovasileva
Resolvedalexhollender
Resolvedphuedx
Resolvedovasileva
DuplicateNone
Resolvedovasileva
Resolvedphuedx
ResolvedNiedzielski
Resolvedovasileva
OpenJdlrobson
InvalidNone
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
OpenNone
OpenNone
OpenNone
Openovasileva
OpenNone
OpenNone
ResolvedDLynch

Event Timeline

matmarex created this task.Sep 25 2018, 9:55 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 25 2018, 9:55 AM
This comment was removed by Jdlrobson.
Jdlrobson updated the task description. (Show Details)

Thanks for expanding.

I actually agree that it would be best to remove this behavior; I didn't write that since I wasn't expecting you to agree ;) Would it be okay if I wrote a patch?

Jdlrobson added a subscriber: ovasileva.

Talking to @ovasileva and @alexhollender it sounds like we're likely going to be changing the edit pencil to point to the entire article.

Jdlrobson triaged this task as Normal priority.Nov 13 2018, 9:46 PM

Change 486136 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/MobileFrontend@master] mobile.editor: Make edit link always open lead section (0), never first section

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

Talking to @ovasileva and @alexhollender it sounds like we're likely going to be changing the edit pencil to point to the entire article.

(This is apparently part of T210659: [EPIC] AMC Navigation - Actions menu (primary actions) now)

Change 486136 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] mobile.editor: Make edit link always open lead section (0), never first section

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

matmarex closed this task as Resolved.Jan 25 2019, 1:03 AM
matmarex claimed this task.
matmarex removed a project: Patch-For-Review.