Page MenuHomePhabricator

Section link should be added to the edit summary when editing the lead section
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
On mobile, using the edit button to edit the lead does not add a section link to the edit summary. Compare that with desktop where, if one uses the "Add an [edit] link for the lead section of a page" gadget, "/* top */" is added to the beginning of the edit summary. Mobile's behaviour should match desktop's, and its own when editing any other part of an article where a section link is added to the beginning of the edit summary.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

Benefits (why should this be implemented?):
For the same reason this is implememted for the other section edit buttons. So it's obvious to anyone reading the revision history that the edit they are looking at only modified the lead section

Event Timeline

Please clarify what you mean by "on mobile". Are you using the Wikipedia app, if so for what operating system? Are you using the Mobile Web?

Please provide a diff of the edit that was made, and information on what you think it should have said instead.

I've already specified above I'm referring to Mobile Web (EDIT:I did not actually, but I thought I did. I'm sorry about that) So, as you can see in this edit when editing a section, a link to that section is added to the beginning of the edit summary. However, when I edited the lead by using its dedicated button, no such link was added. Instead, no section was added at all as if I was using the "Edit full page" button (like I did here). Here's an example of an edit to the lead section on desktop (done with the gadget I mentioned above). As you can see, a section link to the "top" section is added, which when clicked takes you to the top of the page, aka the lead section.

There is no actual section on the page called "top" - and no one else would be able to follow it using that link. However, this all seems to be something that your gadget is handling, not part of mobile. Have you checked with the gadget maintainers?

There is no actual section on the page called "top" - and no one else would be able to follow it using that link. However, this all seems to be something that your gadget is handling, not part of mobile. Have you checked with the gadget maintainers?

There is no section named "top" but there is an anchor named top. You can verify this yourself here (EDIT: This revision might make it more obvious) by clicking the link in section "Test2". Note that I tested it while logged out too. The anchor at #top always exists. It's not the gadget that adds it.

This comment was removed by Nardog.

However, this all seems to be something that your gadget is handling, not part of mobile.

If by any chance you're referring to having a button for editing the lead section, then no. That is a feature of mobile (mobile web at least). The gadget only adds that feature to desktop.

Ah yes there is that anchor link.

Here's what my testing has found - have you seen otherwise?

In desktop, with that gadget - the script is inserting a special link to the page, with that edit summary built in e.g. "https://en.wikipedia.org/w/index.php?title=Todd_Van_Poppel&action=edit&section=0&summary=/*%20top%20*/%20"

In MOBILE that gadget is not creating that link. Are you seeing that link, but it doesn't work? This seems to be that the gadget didn't rewrite that section of the page, like you expected.

Mobile comes with a built-in, "edit lead" button - that has nothing to do with that gadget.

So some options:

a) You could take this up with your project gadget maintainers
b) This could be changed to a feature request, that you would like the mobile web to inject a special edit summary when using that top edit button.

If we're missing something, please elabortate

Yes, I think that's mostly right. The gadget is completely irrelevant to this issue as it's not what's creating the edit button on mobile (afaict it has no effect on the mobile layout AT ALL). I only brought it up as an example of the correct behavior. Note that what you're describing also happens on desktop when you click on any other edit section link. The gadget is only emulating desktop's normal behavior.

Mobile at the moment acts like this. If you click the button to edit any section (other than the lead), the edit summary appears blank in the preview, but when you save, you see that a section link has been added to the beginning of your edit summary (compare that with desktop where you can see the "/* section name */" while saving your edit).
However, this is not done when you use the button to edit the lead section for some reason. This is what I hope is corrected.

The original post refers to an enwiki gadget "Add an [edit] link for the lead section of a page" at https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-gadgets.

The gadget makes an edit link like https://en.wikipedia.org/w/index.php?title=Example&action=edit&section=0&summary=/*%20top%20*/%20

summary=/*%20top%20*/ prefills the edit summary with "/* top */ " which makes a link like https://en.wikipedia.org/wiki/Example#top to an anchor called "top". This anchor is near the top of the page in Vector Legacy but is not present in Vector 2022.
Compare https://en.wikipedia.org/wiki/Example?useskin=vector#top
and https://en.wikipedia.org/wiki/Example?useskin=vector-2022#top

The mobile version already has an edit link for the lead section so the enwiki gadget doesn't do anything there. I don't think mobile should add a link to an English anchor which isn't even in the current default skin. If the poster wants the enwiki gadget to add such an anchor for mobile by modifying the already present lead section edit link in mobile then it can be suggested at https://en.wikipedia.org/wiki/MediaWiki_talk:Gadget-edittop.js.

Isn't even in the current default skin

This is false, I tested Vector2022 while logged out and the anchor is there. (EDIT: To add to this, I tested the example you provided as well and it scrolled up, so your own example debunks what you said)

English anchor

The anchor is in English, but that shouldn't be a problem aince the anchor exists on non English wikipedias too. If you think editors will be puzzled by it I don't agree with that either because the gadget is also available on non English wikipedias. E.g. I know for a fact that the Greek Wikipedia has the gadget and that using it there adds "/* top */" to your edit summary. If it were such a confusing name, don't you think those editors would have either removed the gadget from their WP, or asked for internationalized versions of the anchor?

summary=/*%20top%20*/ prefills the edit summary with "/* top */ " which makes a link like https://en.wikipedia.org/wiki/Example#top to an anchor called "top". This anchor is near the top of the page in Vector Legacy but is not present in Vector 2022.
Compare https://en.wikipedia.org/wiki/Example?useskin=vector#top
and https://en.wikipedia.org/wiki/Example?useskin=vector-2022#top

But a link to #top scrolls to the top of the page, even if there's no element with the anchor/ID top, which AFAIU is a legacy/non-standardized browser feature. The default signature links to #top when inserted on your own user talk page (presumably to avoid the selflink bolding).

https://en.wikipedia.org/wiki/Example?useskin=vector#top goes to NEAR the top of the page, between the tabs and heading since the html says <a id="top"></a> there.

https://en.wikipedia.org/wiki/Example?useskin=vector-2022#top goes to the absolute top of the page since there is no such anchor on the page. The html does not say id="top" anywhere so #top is ignored.

You reported this as a mobile issue at Phabricator. This indicates you want the mobile version of all MediaWiki installations in all languages to make a link ending with #top when the lead section is edited. I strongly oppose that. The link goes to a non-existent anchor in the default skin and I cannot imagine wikis in non-Latin scripts would want such a link which does nothing. If your concern is only with the behaviour of the enwiki gadget then the discussion belongs at https://en.wikipedia.org/wiki/MediaWiki_talk:Gadget-edittop.js and not here. Specific gadgets are not part of MediaWiki which only provides the ability to make gadgets.

https://en.wikipedia.org/wiki/Example?useskin=vector-2022#top goes to the absolute top of the page since there is no such anchor on the page. The html does not say id="top" anywhere so #top is ignored.

It's not ignored. If you focus the address bar and press Enter/Return it scrolls to the top of the page. That doesn't happen with #foo or whatever.

The html does not say id="top" anywhere so #top is ignored.

That's not how that works. If #top were ignored, it wouldn't scroll up when clicking on it. Try it on my sandbox. #top and #Top scroll up, #asd goes nowhere because it doesn't exist. This is how it works on every skin. Mobile, Vector legacy and Vector2022 all act the same exact way.

I cannot imagine wikis in non-Latin scripts would want such a link which does nothing.

Have you been reading what I'm saying? The Greek WP (non-latin in case you didn't know) already has the gadget and therefore already has links to #top in its edit summaries. If those editors didn't want that, they'd have disabled the gadget.

FWIW AWB also adds /* top */ if only the lead section was modified.

An anchor is certain code in the html. There is no anchor saying "top" in Vector 2022. However, I didn't know the HTML specification https://html.spec.whatwg.org/multipage/browsing-the-web.html#scrolling-to-a-fragment:top-of-the-document-2 says:
"10. If decodedFragment is an ASCII case-insensitive match for the string top, then return the top of the document."

So #top does do something different if it's clicked on the page itself: Go to the top instead of staying. If it's clicked from another page, as it usually would be in an edit summary, then it does the same as if there was no anchor: Go to the top of the linked page.

The Greek and Latin alphabet are similar. Here are three lowercase letters of the Greek alphabet: τορ. Uppercase version: ΤΟΡ. I can understand the Greek gadget hasn't removed "top". Even if it may not mean the same in Greek, it's clearly letters to them, and English is taught in Greek schools so I assume most Greeks (maybe not old Greeks) know the English word "top". Most non-Latin scripts are completely different and I imagine "top" in edit summaries would look weird in a lot of wikis.

"Τορ" would be pronounced "Tor" in Greek. Just because the letters look similar does not mean they perform the same function. In any case that's irrelevant. I used Greek as an example because it's my native language. The Chinese WP also has the Gadget and no such argument can be made for their writing system. If you're still concerned, how about you ask those editors themselves. I think that their inclusion of the gadget in their WPs shows that your concerns are overblown.

I checked a few more. The Japanese, Korean and Farsi WPs all have the gadget too. I stopped checking after that.

This also applies to desktop since someone might change the URL by hand to point to the lead as suggested in an English WP help page.