VisualEditor: Deal with en.wikipedia.org's edit notice system
Closed, ResolvedPublic

bzimport set Reference to bz43013.
He7d3r created this task.Via LegacyDec 12 2012, 3:06 PM
MZMcBride added a comment.Via ConduitDec 12 2012, 3:48 PM

Yes, I just came to report the same. Confirming that VisualEditor on the English Wikipedia currently states there are two notices when only one is visible.

Eloquence added a comment.Via ConduitDec 12 2012, 6:29 PM

It looks to me like it counts the edit notice as such even when none is present?

Separately but relatedly, it would probably be nicer to have features such as adding edit notices in the proposed metadata flyout, as opposed to showing a red link notice to users with the right to create notices.

Krinkle added a comment.Via ConduitDec 12 2012, 7:07 PM

It counts 2 because there are 2. One from VisualEditor (the default alpha-warning) and one from en.wikipedia.org.

English Wikipedia has this self-invented wikitext-organised edit notice system. Long story short, it means there is never not a notice. It always shows something.

In this case the edit notice that it loads is the following html:

<div id="editnotice-area" class="editnotice-area" style="clear: both; width: 100%;"><div class="editnotice-namespace" style="width: 100%;"> </div><div class="editnotice-link editnotice-redlink sysop-show accountcreator-show" style="clear: both; float: right; margin: 0px 0.8em; padding: 0; line-height: 1em; display: none;"> <small><a href="/w/index.php?title=Template:Editnotices/Page/You_Can%27t_Make_a_Heart_Love_Somebody&amp;action=edit&amp;redlink=1" class="new" title="Template:Editnotices/Page/You Can't Make a Heart Love Somebody (page does not exist)">Page notice</a></small> </div><div style="clear: both;"></div> </div>

English Wikipedia uses Template:Editnotices to maintain their notices (embedded from a one-liner in the MediaWiki namespace) since they don't want to restrict it to sysops. Aside from that they want to advertise this template and make it easy to find. So when there is no edit notice, the template outputs a link to create one. This is not created by MediaWiki nor by VisualEditor.

However it isn't a mini-notice with a red link for most users. It is only visible to sysops and account creators (via the CSS class sysop-show and accountcreator-show), so for regular users it is just empty.

Jdforrester-WMF added a comment.Via ConduitDec 12 2012, 7:17 PM

So, as a way around this, could we have a hacky exception? Or should we push upstream and suggest that core editnotices are adjusted so that every wiki has enwiki's system? (Presumably this would need a new Editnotice: namespace if they want general availability.)

Krinkle added a comment.Via ConduitDec 12 2012, 8:57 PM

The only thing we need in core for en.wikipedia to drop this (assuming they still actively want to have these red links) is to show a red link to where the edit notice can be edited/created. Once that is in core, the enwiki's template doesn't have to generate it and thus the actual edit notice will be empty.

As a workaround, I'll work on implementing a small jQuery plugin to calculate the visible text in an element. Then we can simply iterate over the edit notices in VE and ignore the ones with no visible text.

Krinkle added a comment.Via ConduitDec 13 2012, 12:27 AM

Change-Id: I65447da8b88a9bae9c24ff155544ff66b3fe9100

Catrope added a comment.Via ConduitDec 13 2012, 12:56 AM

(In reply to comment #6)

Change-Id: I65447da8b88a9bae9c24ff155544ff66b3fe9100

Merged by Trevor

Krinkle added a comment.Via ConduitDec 28 2012, 4:51 PM
  • Bug 43460 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitJan 7 2013, 5:10 PM

Tagging with deploy-train cycle.

Eloquence added a comment.Via ConduitDec 17 2013, 6:43 PM

Regression; this is happening again on en.wp.

Elitre added a comment.Via ConduitFeb 19 2014, 7:04 PM

Bug 55951 is possibly a duplicate?

mxn added a comment.Via ConduitFeb 20 2014, 7:11 AM

I've proposed a client-side workaround at [[MediaWiki talk:Common.css#Edit notices and VisualEditor]].

Jdforrester-WMF added a comment.Via ConduitMar 10 2014, 10:20 PM
  • Bug 61335 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitMar 10 2014, 11:57 PM
  • Bug 55951 has been marked as a duplicate of this bug. ***
Krinkle added a comment.Via ConduitMar 12 2014, 9:49 PM

(In reply to Erik Moeller from comment #10)

Regression; this is happening again on en.wp.

The system is an en.wikipedia hack, and can't be fixed from within VisualEditor without it knowing more than it should about English Wikipedia.

It comes down to their Editnotice system explicitly creating an edit notice to tell sysops "there are no edit notices on this page, click here to create one", which they present as... an edit notice.

Thus MediaWiki, and by extend VisualEditor, show it as an edit notice.

Last year I put a system in place that allows them to hide these using a css class.

(In reply to Minh Nguyễn from comment #12)

I've proposed a client-side workaround at [[MediaWiki talk:Common.css#Edit
notices and VisualEditor]].

That css was adopted by en.wikipedia as of https://en.wikipedia.org/w/index.php?title=MediaWiki%3ACommon.css&diff=562641575&oldid=560030040 and that fixed it for them, last year with this:

/**

  • Hide the redlink generated by {{Editnotice}},
  • this overrides the ".sysop-show { display: none; }" above that applies
  • to the same link as well. */

.ve-init-mw-viewPageTarget-toolbar-editNotices-notice .editnotice-redlink {

display: none !important;

}

Commit https://gerrit.wikimedia.org/r/#/c/90378/ accidentally removed this class, thus the above CSS rule no longer applies.

The CSS proposed by Minh on [[MediaWiki talk:Common.css#Edit

notices and VisualEditor]] is a bit too generic in my opinion, I would recommend against that.

Krinkle added a comment.Via ConduitMar 12 2014, 9:54 PM

Looks like we do have a replacement class that isn't too generic:

.ve-ui-mwNoticesPopupTool-item ...

Though it is an internal class, not one I'd recommend we promote as an API for wikis to use. Let's use that as a temporary replacement, and add another one soon for the long term.

gerritbot added a comment.Via ConduitMar 12 2014, 10:11 PM

Change 118369 had a related patch set uploaded by Krinkle:
mw.Target: Add class "mw-ve-editNotice" to edit notices

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

gerritbot added a comment.Via ConduitMar 12 2014, 10:15 PM

Change 118369 merged by jenkins-bot:
mw.Target: Add class "mw-ve-editNotice" to edit notices

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

Jdforrester-WMF added a comment.Via ConduitMar 12 2014, 10:40 PM

Fixed on-wiki.

Spinningspark added a comment.Via ConduitAug 11 2014, 12:39 PM

This is still occuring. Pages with no edit notices pop up with "1 notice" when VE is launched. It is not even useful in providing a link to where I *can* add an edit notice.

ori set Security to None.
Krinkle moved this task to Done on the VisualEditor-Performance workboard.Via WebMar 19 2015, 10:35 PM

Add Comment