Page MenuHomePhabricator

Edit intro is not shown when a user switches from wikitext editor to visualeditor
Closed, ResolvedPublic1 Story Points

Description

Copy/pasting from https://www.mediawiki.org/w/index.php?title=Topic:Tnczofamrpfpiqtd&action=history:

Problem

As a user, when I click the button to switch to visualeditor I expect to see an edit notice (if it exists).

Steps to reproduce

Go to https://en.wikipedia.org/w/index.php?title=Buu
Click edit (make sure this leads to wikitext editor, meta + shift + e), and see edit notice
Click pencil icon
Click "switch to visual editing"
Expected output

A popup with an edit notice containing some text (if it exists).

Actual output

No popup with an edit notice.

It probably happens consistently when the user is logged out:

Banana
lemon
A good guess is probably that the "switched" notice is higher priority than the edit notice so it gets hidden and the edit notice might get discarded. It would also be odd (and a worse user experience) for it to show both notices simultaneously. Although the edit notice should probably be higher priority than the "switched" notice.

An easy way to replicate is to use it on protected pages, and force a switch to visualeditor using a keyboard shortcut (e.g. alt + shift + v).

You can see that the API response contains the text, it is simply not used for some reason:

{

"Visualeditor": {
    "result": "success",
    "notices": ["<div class=\"floatleft\"><img alt=\"AnonEditWarning.svg\" src=\"//upload.wikimedia.org/wikipedia/en/thumb/d/de/AnonEditWarning.svg/9px-AnonEditWarning.svg.png\" width=\"9\" height=\"20\" srcset=\"//upload.wikimedia.org/wikipedia/en/thumb/d/de/AnonEditWarning.svg/13px-AnonEditWarning.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/d/de/AnonEditWarning.svg/18px-AnonEditWarning.svg.png 2x\" data-file-width=\"9\" data-file-height=\"20\" /></div> <span style=\"color:#d33; font-weight:bold;\">You are not logged in.</span> Your <a href=\"/wiki/IP_address\" title=\"IP address\">IP address</a> will be publicly visible if you make any edits. If you <span class=\"plainlinks\"><b><a class=\"external text\" href=\"//en.wikipedia.org/w/index.php?title=Special:UserLogin&returnto=Banana\">log in</a></b> or <b><a class=\"external text\" href=\"//en.wikipedia.org/w/index.php?title=Special:UserLogin/signup&campaign=anoneditwarning&returnto=Banana\">create an account</a></b></span>, your edits will be attributed to a user name, among <a href=\"/wiki/Wikipedia:Why_create_an_account%3F\" title=\"Wikipedia:Why create an account?\">other benefits</a>.\n", "<div id=\"semiprotectedpagewarning\">\n<p><b>Note:</b> This page has been <a href=\"/wiki/Wikipedia:Protection_policy#Semi-protection\" title=\"Wikipedia:Protection policy\">semi-protected</a> so that only <a href=\"/wiki/Wikipedia:User_access_levels#Autoconfirmed_users\" title=\"Wikipedia:User access levels\">autoconfirmed users</a> can edit it. If you need any help getting started with editing, see the <a href=\"/wiki/Wikipedia:New_contributors%27_help_page\" title=\"Wikipedia:New contributors' help page\">New contributors' help page</a>.\n</p>\n<hr class=\"fmbox-warning-ruler\" style=\"color: #BB7070; background-color: #BB7070;\"/>\n</div>\n<li class=\"mw-logline-protect\"> 16:34, 14 August 2014 <a href=\"/wiki/User:SlimVirgin\" class=\"mw-userlink\" title=\"User:SlimVirgin\"><bdi>SlimVirgin</bdi></a> <span class=\"mw-usertoollinks\">(<a href=\"/wiki/User_talk:SlimVirgin\" class=\"mw-usertoollinks-talk\" title=\"User talk:SlimVirgin\">talk</a>\u00a0| <a href=\"/wiki/Special:Contributions/SlimVirgin\" class=\"mw-usertoollinks-contribs\" title=\"Special:Contributions/SlimVirgin\">contribs</a>)</span> changed protection level for <a href=\"/wiki/Banana\" title=\"Banana\">Banana</a> \u200e\u200e[edit=autoconfirmed] (indefinite)\u200e[move=sysop] (indefinite) <span class=\"comment\">(Persistent <a href=\"/wiki/Wikipedia:Vandalism\" title=\"Wikipedia:Vandalism\">vandalism</a>: restoring protection per request)</span> <span class=\"mw-logevent-actionlink\">(<a href=\"/w/index.php?title=Banana&action=history&offset=20140814163456\" title=\"Banana\">hist</a>)</span> </li>\n<a href=\"/w/index.php?title=Special:Log&page=Banana&type=protect\" title=\"Special:Log\">View full log</a>"],
}

}

The DJ suggests: Perhaps is is a race condition or something.

Event Timeline

Elitre created this task.Apr 12 2017, 4:57 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 12 2017, 4:57 PM
Jdforrester-WMF triaged this task as High priority.Apr 18 2017, 7:24 PM
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Change 349262 had a related patch set uploaded (by Esanders):
[mediawiki/extensions/VisualEditor@master] Load notices when switching, just don't show them

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

It is deliberate that we don't notices when switching as it would conflict with the "switched" popup, however this was done by disabling the loading of notices which is wrong.

Change 349262 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Load notices when switching, just don't show them

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

Jdforrester-WMF closed this task as Resolved.Apr 20 2017, 9:37 PM
Jdforrester-WMF removed a project: Patch-For-Review.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptApr 20 2017, 9:37 PM