Page MenuHomePhabricator

It should be possible to view source on protected pages in MobileFrontend Minerva
Closed, ResolvedPublic

Description

When a page is protected, on Minerva, there is no way to view the source of the article. A toast is shown telling the user it is protected, with no way to view the article wikitext. Sometimes the source is important (for example copying and pasting the content into a draft/user space).

e.g. visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Selenium_protected_test_2 in an incognito window and try to view the source of that article.
Constrast this with https://en.m.wikipedia.beta.wmflabs.org/wiki/Selenium_protected_test_2?action=edit

Original bug report


I tried clicking the locked pencil multiple times, but it did not work.

Surprisingly, it works on https://en.m.wikipedia.org/w/index.php?title=Module:Location_map

Design

Developer notes

Related: T106943
We could show a drawer similar to the drawer we show for blocked users; the one we show for clicking a red link; and the one to prompt users to login who click the watchstar.

The drawer could provide the explanation that the page is protected but offer an option to "view source" that opens the existing editor.

We'd probably need to make some updates to the logic for the editor, to allow it to operate in read only mode.

Also related: T150189, where we also added a link to a toast message

QA steps

QA Results - Beta

ACStatusDetails
1T208827#6765641

QA Results -Prod

ACStatusDetails
1T208827#6852688

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 6 2018, 3:36 AM

Hi @Capankajsmilyo I'm going to need some more information here!

  • What browser are you using (preferably a browser user agent!)
  • What happens when you try to look on desktop?
  • Do you see the following message when you click the edit icon at the bottom of the screen?

Jdlrobson updated the task description. (Show Details)Nov 6 2018, 8:51 PM

Hi @Capankajsmilyo I'm going to need some more information here!

  • What browser are you using (preferably a browser user agent!)
  • What happens when you try to look on desktop?
  • Do you see the following message when you click the edit icon at the bottom of the screen?

I'm using Chrome

When I try in desktop view, the button view source


It shows me the source correctly

I did not see any message while tapping the button in mobile view.

Jdlrobson renamed this task from View source not working for some pages in mobile view to It should be possible to view source on protected pages in Minerva.Nov 7 2018, 6:30 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: MinervaNeue.
ovasileva triaged this task as Medium priority.Nov 13 2018, 9:14 PM
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptMar 12 2019, 9:34 AM

FYI @iamjessklein — this kinda sits in-between reading and editing

Have known this issue for a while. The workaround is to click and hold the lock icon until menu appears. Then choose to open the page in a new tab, that will show the source text. But it'd be great to fix this.

To clarify: is this only the case for logged-out users? When logged in I am able to view the source of (and edit) https://en.m.wikipedia.org/wiki/Barack_Obama. When logged out I get the toast message "This page is protected to prevent vandalism." If this is only an issue for logged-out users we should update the task title and description.

(from Developer notes in description)
We could show a drawer similar to the drawer we show for blocked users; the one we show for clicking a red link; and the one to prompt users to login who click the watchstar.

The drawer could provide the explanation that the page is protected but offer an option to "view source" that opens the existing editor.

That sounds like a good idea to me:

Jdlrobson added a comment.EditedApr 23 2019, 12:53 AM

This is a problem for both logged in and out users. It is useful to view source of pages protected from vandalism regardless of login status. Some protection levels only apply to anons and some only apply to logged in.

@Jdlrobson thanks for clarifying. Can you give an example or two of a page that this issue occurs on for logged-in users? I was unable to find any.

@Capankajsmilyo does the mockup in T208827#5127816 look good to you? If so I would like to move this out of the design column.

Jdlrobson moved this task from Backlog to Bugs on the MinervaNeue board.Jan 17 2020, 11:23 PM
AntiCompositeNumber renamed this task from It should be possible to view source on protected pages in Minerva to It should be possible to view source on protected pages in MobileFrontend Minerva.Jan 23 2020, 3:43 PM

Minerva doesn't care what the edit button does, that's handled by MobileFrontend's editor.js.

Jdlrobson moved this task from Backlog to Team: web on the MobileFrontend board.Jul 24 2020, 2:48 AM
Yash4357 claimed this task.Jan 14 2021, 9:29 AM

Change 656392 had a related patch set uploaded (by Yash9265; owner: Yash9265):
[mediawiki/extensions/MobileFrontend@master] View Source on protected pages in MobileFrontend Minerva.

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

Jdlrobson reassigned this task from Yash4357 to Edtadros.Jan 20 2021, 8:40 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: Yash4357.

Change 656392 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] View Source on protected pages in MobileFrontend Minerva.

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

Edtadros reassigned this task from Edtadros to Jdlrobson.Jan 21 2021, 3:15 PM
Edtadros added a subscriber: Edtadros.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Selenium_protected_test_2
Note the padlock on edit icon
Click edit
Click view source
✅ AC1: It should be possible to see the source of the article.

@Jdlrobson, you can view the source, but the page is a bit garbled. I can pass this based on the criteria, but I wanted to point out the garbling. Let me know your thoughts.

The "garbled" interface text comes from https://en.wikipedia.beta.wmflabs.org/wiki/Template:Protected_page_text via https://en.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Protectedpagetext That template uses a table for layout and uses position:relative. This is fine on a desktop-size display, but doesn't work well on mobile. Similar effects occur opening the desktop site at a smaller size or high zoom level:

The text displays fine at desktop resolution on the mobile site:

As this issue is caused by on-wiki interface text (not MediaWiki code), it shouldn't affect the status of this patch. However, we should let the communities know that they may wish to update MediaWiki:Protectedpagetext accordingly.

Johan added a subscriber: Johan.Jan 22 2021, 9:46 AM

Something like this for Tech News? (Plus links.)

Minerva is the skin Wikimedia wikis use for mobile traffic. When a page is protected and you can't edit it you can't see the source wikicode on Minerva on mobile devices. This is being fixed. Some text might overlap. This is because your community needs to update MediaWiki:Protectedpagetext to work on mobile. You can read more.

Something like this for Tech News? (Plus links.)

Minerva is the skin Wikimedia wikis use for mobile traffic. When a page is protected and you can't edit it you can't see the source wikicode on Minerva on mobile devices. This is being fixed. Some text might overlap. This is because your community needs to update MediaWiki:Protectedpagetext to work on mobile. You can read more.

Sounds good. Perhaps https://www.mediawiki.org/wiki/Recommendations_for_mobile_friendly_articles_on_Wikimedia_wikis#Inline_styles_should_not_use_properties_that_impact_sizing_and_positioning and https://www.mediawiki.org/wiki/Recommendations_for_mobile_friendly_articles_on_Wikimedia_wikis#Avoid_tables_for_anything_except_data may be helpful links.

Jdlrobson reassigned this task from Jdlrobson to Edtadros.Jan 26 2021, 6:14 PM
AlexisJazz added subscribers: Xaosflux, AlexisJazz.EditedJan 28 2021, 11:46 PM

The "garbled" interface text comes from https://en.wikipedia.beta.wmflabs.org/wiki/Template:Protected_page_text via https://en.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Protectedpagetext That template uses a table for layout and uses position:relative. This is fine on a desktop-size display, but doesn't work well on mobile. Similar effects occur opening the desktop site at a smaller size or high zoom level:
As this issue is caused by on-wiki interface text (not MediaWiki code), it shouldn't affect the status of this patch. However, we should let the communities know that they may wish to update MediaWiki:Protectedpagetext accordingly.

@Xaosflux already fixed this half a year ago: https://en.wikipedia.org/w/index.php?title=Template:Protected_page_text&diff=962915348&oldid=946650479. I just updated the template on beta. All pages on https://www.wikidata.org/wiki/Q16323045#sitelinks-wikipedia except kowiki, mywiki, zhwiki, enwikinews, zhwiktionary and metawiki include "position:relative".

Edtadros reassigned this task from Edtadros to ovasileva.Tue, Feb 23, 2:36 PM

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Selenium_protected_test_2
Note the padlock on edit icon
Click edit
Click view source
✅ AC1: It should be possible to see the source of the article.

Edtadros updated the task description. (Show Details)Tue, Feb 23, 2:38 PM
ovasileva closed this task as Resolved.Tue, Feb 23, 2:42 PM

all done