Page MenuHomePhabricator

Enable wikis to configure whether to display page indicators which show that the page being viewed is protected
Closed, ResolvedPublic

Description

Description:

The current practice for protecting a page is to:

  1. change the status to protected via the protection form
  2. add a protection template to the page

The purpose of this task is to discuss and decide if MediaWiki should automatically add some similar/equivalent notice to the page (rather than an editor adding a protection template to the page manually).

Indicators already present

  • Wikibase displays an indicator today on pages with structured data (Q, P, L spaces on Wikidata, all images on Commons with/including SDC)
  • "View source" rather than "Edit" for other pages
Tradeoffs

Downsides of editors adding templates manually:

  • Requires extra editor attention
    • Either an editor needs to add/remove or the project needs to spin up a bot; neither scale
    • Without attention, protection status of the page is not accurately reflected in an obvious way (besides the current indication, see "already present" above)
  • Adds two extra edits to a page's history (one when the page is protected to add the template, and a second one, after the protection expires, to remove it) in addition to the protection revision history lines
  • When added to a template, requires all transclusions to update
  • Clutters source
  • Inconsistent behavior across wikis causes confusion
  • A common pattern for admins on English Wikipedia: a page is protected with Twinkle, automatically adding the template, but the page needs to be further reverted to remove vandalism, requiring another edit to re-add the template again

[➕ please feel free to add more here]

Downsides of MediaWiki adding notices automatically:

  • Currently the template that adds the indicator also adds a category for the level of protection. Maybe that should be another task that should be solved with this one.

[➕ please feel free to add more here]


See Also:

Details

Reference
bz10347
Related Changes in Gerrit:

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Earwig updated the task description. (Show Details)

Change #1033697 had a related patch set uploaded (by Sohom Datta; author: Sohom Datta):

[mediawiki/core@master] [WIP] Add protection indicators to mediawiki/core

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

I would like the mediawiki platform to be involved in this, and to look at the patch from Sohom as this change feels like and adjustment to the "platform" and touches code in Article.php which is traditionally outside the scope of the web team.

Jdlrobson raised the priority of this task from Lowest to Low.May 20 2024, 3:54 PM

+ @mwilliams and @JScherer-WMF to coordinarte review from DST and Web design perspective as it appears this task involves proposed addition of visible indicators of protected status to core. Per the most recent patch the changes proposed are:

  • Add a disabled by default feature flag 'EnableProtectionIndicators'
  • When the config flag is enabled, show a lock indicator at the top

of the page.

  • The lock icon should be overridable by the content of the page
  • The indicator has a predictable ID which could be potentially used to style the icon using the onwiki Common.css file.
  • The lock icon by default links to https://www.mediawiki.org/wiki/Help:Protection. However

this link can be customized per wiki per protection level using a
empty message (for example: protection-sysop-helppage)

It would be extremely helpful if screenshots could be added (and/or a patchdemo created) to show what the proposed change is for design review. Curious if for example how the proposed change differs from the exisitng padlock style, position, and behaviour as the current protected enwiki pages like this one:

image.png (312×1 px, 70 KB)

In T12347#9841301, @RHo wrote:

It would be extremely helpful if screenshots could be added (and/or a patchdemo created) to show what the proposed change is for design review. Curious if for example how the proposed change differs from the exisitng padlock style, position, and behaviour as the current protected enwiki pages like this one:

image.png (312×1 px, 70 KB)

A wiki exists at https://patchdemo.wmflabs.org/wikis/0ab533954a/ now :) (This is how it looks like on a semi-protected page and a fully protected page)

Thanks for sharing @Soda! I'm seeing the same icon (Lock with nothing in it) for both semi-protected and fully protected. Is that to be expected as any update to the icon to visually communicate its protection level would be at a higher/ more specific presentation level?

Thanks for sharing @Soda! I'm seeing the same icon (Lock with nothing in it) for both semi-protected and fully protected. Is that to be expected as any update to the icon to visually communicate its protection level would be at a higher/ more specific presentation level?

The default implementation in the patch is to show the same icon with a different tooltip. However, the expectation is the communities will be able to customize the icon for each protection level using some mechanism (since currently, every community has different icons for showing the status of different protection levels).

In my patch, this can be done through a wiki's common.css file, for example, adding the following piece of CSS

#mw-indicator-protection-sysop > a.mw-protection-indicator-icon--lock {
    background-color: rgba(0,0,0,0);
    mask-image: none !important;
    background-image: url('https://upload.wikimedia.org/wikipedia/en/thumb/4/44/Full-protection-shackle.svg/30px-Full-protection-shackle.svg.png');
    background-repeat: no-repeat;
    background-size: contain;
}

will show the English Wikipedia's fully protected icon for fully protected pages. However, this is a bit clunky, and if we can come up with a better mechanism that will be great :)

The default implementation in the patch is to show the same icon with a different tooltip.

Screenshot from 2024-05-29 18-37-14.png (266×805 px, 20 KB)

v/s

Screenshot from 2024-05-29 18-37-00.png (266×805 px, 20 KB)

Thanks for the additional details! The design and layout of what you are proposing seems good to me as it maps to the spacing and positioning of the current lock icon and seems flexible to swap out with the icon needed.

As far as the specific process and the CSS required to swap it out - I don't quite have the context or expertise to comment on that.

just remembering that we did have an aspirational idea early on that we would communicate whether or not a page is locked/protected within the Edit button (similar to what we do in Minerva)

image.png (775×1 px, 459 KB)

I feel like communicating that within the edit button makes more sense than adding an additional indicator for it

I would strongly prefer this over keeping it separated out. Fundamentally, the salient piece of information for most editors regarding protection status is "Can I, with my current permissions, edit this page?" And that piece of information is most logically presented at the point when someone seeks to enter the editing workflow, which is the edit button.

Yes, a separate solution will be needed for Wikidata, but we should not let the exception define the rule. Overall, this is a great design. Also: This is a huge design decision, so I'd suggest (a) making a separate Phabricator ticket to track it, and (b) consulting with the community on Meta to seek out additional perspectives.

I feel like an edit icon lock button should reflect if that editor is able to edit that page (i.e. there would be no lock icon for an extended confirmed user on an extended confirmed protected page because they can edit through that protection.

Whereas a standalone lock icon should reflect if that page has any kind of protection at all.

So these might be slightly different concepts.

I would strongly prefer [communicating if you can edit the page within the edit button] over keeping it separated out. Fundamentally, the salient piece of information for most editors regarding protection status is "Can I, with my current permissions, edit this page?" And that piece of information is most logically presented at the point when someone seeks to enter the editing workflow, which is the edit button.

We already do this – the "Edit" button turns into "View source" if you can't edit. However, it seems that people desire to know the protection status even if they can edit the page themselves.

We need to separate "people" out into readers and editors. For readers, the protection level has minor salience for information literacy purposes, as it can indicate e.g. how wary they should be of information on the page. For editors, the "can I edit?" question is primary, but the overall protection level still has some value for understanding the overall situation with the page (and can be accessed through the notice in the edit window or through the page information page).

We need to separate "people" out into readers and editors. For readers, the protection level has minor salience for information literacy purposes, as it can indicate e.g. how wary they should be of information on the page. For editors, the "can I edit?" question is primary, but the overall protection level still has some value for understanding the overall situation with the page (and can be accessed through the notice in the edit window or through the page information page).

I think combining protection icons with edit icons is a different task. My implementation simply implements the existing enwiki system (that relies on templates) into core.

Change #1033697 merged by jenkins-bot:

[mediawiki/core@master] Add protection indicators to mediawiki/core

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

Quiddity subscribed.

Hi, thanks for adding the User-notice tag. For a Tech News entry, please could someone suggest what needs to be communicated to editors, and also when it is best to announce it?
I.e. Are there any immediately visible changes in next week's deployment train that technical editors (or interface admins) will need to prepare for, at any or all wikis?
Plus, is there any documentation that can be linked to from the entry? (or if documentation still needs to be written/updated, should we postpone the Tech News entry until it is ready?) Thanks.

There is no immediate impact to the wikis since the feature is disabled by default. As far as I can tell, this feature isn't documented yet.

MediaWiki can now display a page indicator automatically while a page is protected. This feature is disabled by default. It can be enabled by community request.

Thank you for the reply and the draft @JJMC89 , much appreciated.
I will postpone including this in Tech News for now, in the hopes that someone can write/update the related documentation.

It might even be best if we wait until a single wiki with a familiar expert has enabled the feature and updated their local templates, so that other wikis can more easily follow an example (rather than having to piece it together from clues)? -- E.g. Are you (JJMC89) or anyone planning on requesting this at Enwiki soon and then updating/replacing Enwiki's templates?
In other words: I welcome any of your advice on when exactly to include this in Tech News. :)

Thank you for the reply and the draft @JJMC89 , much appreciated.
I will postpone including this in Tech News for now, in the hopes that someone can write/update the related documentation.

I've started a draft for the documentation at https://www.mediawiki.org/wiki/User:Sohom_Datta/protection_indicators lmk if I should include anything else (for example, do we want to include the config flag/request process?).

It might even be best if we wait until a single wiki with a familiar expert has enabled the feature and updated their local templates, so that other wikis can more easily follow an example (rather than having to piece it together from clues)? -- E.g. Are you (JJMC89) or anyone planning on requesting this at Enwiki soon and then updating/replacing Enwiki's templates?
In other words: I welcome any of your advice on when exactly to include this in Tech News. :)

I'll be happy to help with any migration efforts if any community is interested (tho maybe starting with smaller wikis might be easier than immediately starting with enwiki 🙂)

I've started a draft for the documentation at https://www.mediawiki.org/wiki/User:Sohom_Datta/protection_indicators lmk if I should include anything else

That's a great start!
I think it might be good to include an example of a completed-change (if that's available yet, or can be done before this is announced more widely?). E.g. links to related to page-edit diffs from a single project -- I assume that would make it easier for someone semi-technical to adapt the examples for a local change.

(for example, do we want to include the config flag/request process?).

Yes that sounds good. Perhaps just re-use the proposed wording for the Tech News entry? I.e. Just add this to the top of the page as a good summary:

MediaWiki can now display a page indicator automatically while a page is protected. This feature is disabled by default. It can be enabled by community request.

In other words...
If I understand correctly, each wiki community will need to EITHER:

  1. Ignore it, and nothing will change
  2. They have local templates [and want to change to use this new system, because [BENEFIT?]], so they need to follow the instructions in "Preparing for the change" to update them
  3. They don't have local templates, and can automatically get these features if they make a config-request.
  4. PLUS, if any wikis wants to use CSS instead of templates to change the icons that are used, then they should follow the instructions in the last section.

It might be good to tweak the page-structure to be clearer about those 3 (or 4) options.

Lastly, I suggest clarifying whether this new feature uses the same icon design for all protection types, or unique padlock icons for [many? all?!?] protection-types. Perhaps with image-examples embedded.

Hope that helps!

@Soda btw. should we perhaps set the default for WMF to false, and then flip the default for MW core to true ? I think it is good to have features like this enabled by default for new installs, otherwise most MW installs will never use them.

Samwalton9-WMF renamed this task from Should protection status indicators be handled by MediaWiki core (vs. templates)? to Enable wikis to configure whether to display page indicators which show that the page being viewed is protected.Sep 26 2025, 11:35 AM

Renamed this task to reflect the patch that was merged here - I think we can mark this as resolved? Any potential future work seems to be captured in T405719 and T405718, and it's then up to each wiki to decide if they want to request a config change.

Given that it seems like only azwiki has done so, I wonder if some additional communications might be helpful.

TheDJ claimed this task.

I agree

How should we word this for Tech News? Thank you in advance.

Hello, how might we word this for Tech News?

I added it to https://meta.wikimedia.org/wiki/Tech/News/2025/46 using the wording proposed a long while ago by @JJMC89:

MediaWiki can now display a page indicator automatically while a page is protected. This feature is disabled by default. It can be enabled by community request.


I've started a draft for the documentation at https://www.mediawiki.org/wiki/User:Sohom_Datta/protection_indicators lmk if I should include anything else (for example, do we want to include the config flag/request process?).

This looks very nice, would it be okay to move it to the normal help namespace, as 'Help:Protection_indicators' or something? (Note that all content in the help namespace is under the CC0 license, so you should be the one to move it if you're okay with that.)

We could link to it from the Tech News message, instead of https://www.mediawiki.org/wiki/Help:Page_status_indicators.

The help page (for MediaWiki users) should also be cross-linked with https://www.mediawiki.org/wiki/Manual:$wgEnableProtectionIndicators (which is the manual for site owners).

I've started a draft for the documentation at https://www.mediawiki.org/wiki/User:Sohom_Datta/protection_indicators lmk if I should include anything else (for example, do we want to include the config flag/request process?).

This looks very nice, would it be okay to move it to the normal help namespace, as 'Help:Protection_indicators' or something? (Note that all content in the help namespace is under the CC0 license, so you should be the one to move it if you're okay with that.)

We could link to it from the Tech News message, instead of https://www.mediawiki.org/wiki/Help:Page_status_indicators.

The help page (for MediaWiki users) should also be cross-linked with https://www.mediawiki.org/wiki/Manual:$wgEnableProtectionIndicators (which is the manual for site owners).

Works by me! (also moved)

Thanks, I updated the Tech News note to use that page, and linked it in a few others places on MW.org.