Page MenuHomePhabricator

Enforce section name when editing a section
Open, Needs TriagePublic

Description

In a article when you click on the "Edit" link you edit just that section. So it adds the section name as a comment in the edit summary, for example as:

/* External links */

Then the user writes the edit summary after that. Example:

/* External links */ Removed a spam link.

This have two problems.

  1. The section comment can be removed or changed. This strips metadata.
  2. Breaks the browser's autocomplete feature.

The user would type "Fi" and the browser would present autocomplete suggestions based on previously entered edit summaries, such as "Fix typo", "Fix link", "Fix date", etc. But when you have "/* External links */" then the autocomplete don't find any history for that since it would have to be for every section name.

A solution would be enforce the the section in the comments and making it not possible to alter it.

Pseudocode

From:

<input type="text" name="summary" value="/* $section_name */ " />

To:

<span>$section_name</span>
<input type="hidden" name="section" value="$section_name" />
<input type="text" name="summary" />

Event Timeline

Frap renamed this task from Enforce section comments when editing a section to Enforce section name when editing a section.Oct 13 2017, 12:28 PM

I often remove or edit the autogenerated section comment, e.g. when I am actually deleting the section, or inserting another section above it, or editing the last section in an article to tweak the navboxes.

I often remove or edit the autogenerated section comment, e.g. when I am actually deleting the section, or inserting another section above it, or editing the last section in an article to tweak the navboxes.

Interesting use case. I did not consider that.
When deleting the entire section, I guess the autogenerated section comment should be left and appended with "Remove section".

When inserting a section one ought to use the Edit page button instead of edit the section, also when inserting navboxes at the bottom. But I guess different people use MediaWiki in different ways and this would break their way of interaction.

This definitely needs to be taken into consideration. Perhaps your use cuse breaks my entire proposal.

Anyone have any feedback?

When inserting a section one ought to use the Edit page button instead of edit the section, also when inserting navboxes at the bottom. But I guess different people use MediaWiki in different ways and this would break their way of interaction.

Too many users use edit section button when they actually add a new section. Then there is a wrong section name in edit summary. It's frustrating when you see this kind of behavior on a page you're watching, when you think someone has edited the section you're interested of.

This definitely needs to be taken into consideration. Perhaps your use cuse breaks my entire proposal.

Enforcing the section title might not be desirable, but you're definitely making a good point about browser autocompletion.

Too many users use edit section button when they actually add a new section. Then there is a wrong section name in edit summary. It's frustrating when you see this kind of behavior on a page you're watching, when you think someone has edited the section you're interested of.

There's actually a separate (super old) task about this, T22307: Generate automatic summary /* blah */ when I manually add a section heading when editing. I have a patch pending for that, but it seems to have gotten a bit stalled.

On certain websites such as GitHub there is a text entry field that is prepopulated but empty so that when you press backspace then it removes the prepopulated thing.

https://github.com/mediawiki
Click on the bar at the top in the menu. Where it says "This organization" and "Search". In the "Search" field press backspace and notice how "This organization gets erased.

This could be a cool solution.

When inserting a section one ought to use the Edit page button instead of edit the section, …
Anyone have any feedback?

At time of writing this, there is no longer any edit page button on mobile. And the section-name part of the edit summary is not just enforced, but is invisible. If I want to add a section, I have to switch to desktop view or leave an incorrect edit summary.

See, for example:

We recently disabled the ability to edit the whole article by clicking on the top-most edit pencil. … T232170

when inserting navboxes at the bottom

What would be cool is a section break that doesn't display as a heading, but does show an edit link. It would still need a name for use as a link anchor and in edit summaries. For example, before a navbox could be a break called [Navigation]. If the mechanism was flexible, then each wiki community could arrive at their own naming convention. Open question as to whether it should be listed in the TOC.