Page MenuHomePhabricator

Message boxes classes should carry `mw-`
Closed, ResolvedPublic3 Estimated Story Points

Description

'resources/src/mediawiki.skinning/messageBoxes.css' classes are from early times in MediaWiki core, where CSS class architecture wasn't yet a thing.

The classes should be turned into

  • messagebox => mw-message-box
  • errorbox => mw-error-box
  • warningbox => mw-warning-box

Without strong opinion if *-box is the right naming scheme, we're using *-container in a related, but slightly different context.
There would be also the possibility to use mw-error and mw-error--inline assuming that user notice boxes are the default way of exposing them.

TODO

  • Update includes/Html.php to add the new classes as above
  • Update resources/src/mediawiki.skinning/messageBoxes.less to use the new classes, but retain the existing classes with a comment explaining that these are supporting on-wiki content.
  • Update Vector to use the new method.
  • Write a Tech News entry (or write a draft and a desired announcement-time as a comment below)
  • Update the non-standard uses of success, errorbox and warningbox class to use the new methods
  • Drop CSS for successbox, errorbox and warningbox classes in core (April 2022)

QA

smoke test

Go to the login page on desktop and login with a bad username/password.
Expected: A box with a colored background should appear prompting you of your error.

Repeat for mobile (Minerva skin)

Related Objects

StatusSubtypeAssignedTask
Resolvedovasileva
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedStang
ResolvedStang
ResolvedNikerabbit
ResolvedNikerabbit
ResolvedNikerabbit
ResolvedWMDE-Fisch
ResolvedWMDE-Fisch
ResolvedSgs
ResolvedWMDE-Fisch
ResolvedLucas_Werkmeister_WMDE
ResolvedJdlrobson
ResolvedStang
Resolvedmatmarex
ResolvedSimoneThisDot
ResolvedEtonkovidova
ResolvedStang
ResolvedJdlrobson
ResolvedStang
ResolvedTacsipacsi
ResolvedSamwalton9-WMF
ResolvedSamwalton9-WMF
ResolvedJdlrobson
Resolvedabi_
DeclinedNone
ResolvedStang
ResolvedStang
ResolvedTacsipacsi
ResolvedTacsipacsi
OpenNone
ResolvedTacsipacsi
ResolvedSamwalton9-WMF
ResolvedSgs
ResolvedJdlrobson
OpenNone

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Quiddity subscribed.

Re: user-notice/Tech News - please let us know when this should be included, and what the entry should say. Thanks!

Untagging user-notice for now. I think this task lost steam.

I suggest the following

  1. Agree on what the new class should be (@Esanders and @Volker_E)
  2. Add the CSS class to resources/src/mediawiki.skinning/messageBoxes.less
  3. Send user notice, announcing deprecation of old classes in 1.38 and removal of support for those classes in 1.40

According to T299625#7637799 the class 'messagebox' is used for a custom message box on many wikis (https://global-search.toolforge.org/?q=%5B%22%27%5Dmessagebox&regex=1&namespaces=10&title=).

Changing the class without retaining the old class would fix the issue reported in T299625.
Either way I imagine this change is likely to be disruptive.

I'll talk to Ed/Volker about what the class should be, and then run a user notice so that we can begin working on thsis task.

According to T299625#7637799 the class 'messagebox' is used for a custom message box on many wikis (https://global-search.toolforge.org/?q=%5B%22%27%5Dmessagebox&regex=1&namespaces=10&title=).

Changing the class without retaining the old class would fix the issue reported in T299625.
Either way I imagine this change is likely to be disruptive.

I'll talk to Ed/Volker about what the class should be, and then run a user notice so that we can begin working on thsis task.

Just in case, I have a suspicion that in most wikis the 'messagebox' class is defined separately in Common.css, like this: https://si.wikipedia.org/wiki/MediaWiki:Common.css#L-591. Because until some time it was not in the core styles.

Just in case, I have a suspicion that in most wikis the 'messagebox' class is defined separately in Common.css, like this: https://si.wikipedia.org/wiki/MediaWiki:Common.css#L-591. Because until some time it was not in the core styles.

Yes, that's basically what Tacsipacsi said here:

Actually most of these uses are much older than the introduction of .messagebox in e15e45b38670 in September 2019, and just clash with the class in MW core. In fact, this change will fix what was broken in 1fd66a67edcd (see also mw:Topic:Vcxxk5h088xsv9va). But if you want to check everything, it’s not just stylesheets and scripts. My naïve regexp (doesn’t check for context) found more than 200,000 pages Wikimedia-wide. This certainly contains many false positives, but still I think the true positives (i.e. pages using these classes) are probably over 100,000. Fortunately most of these should be the legacy (non-MediaWiki) .messagebox clas, which doesn’t need fixings (.errorbox and .warningbox together account for “only” less than 4000), but they should still be checked if we want to make sure nothing breaks. Is it possible to introduce a feature flag to define the legacy class names, and progressively turn it off across Wikimedia as projects fix their uses? There should still be a hard deadline, of course, when the feature flag goes away, but this way it’s possible to remove the clashing classes on a wiki as soon as it’s fixed, follow the progress, and find the wikis that need help.

As a note regarding messagebox use specifically, the vast proportion (110k of 120k) on en.wp are substed user talk messages, mostly barnstars, WikiProject invitations, and the like (I've been working on the rest but specifically will not be removing those uses).

Change 755997 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] WIP: Untie Wikimedia message boxes from on-wiki messageboxes

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

Change 756031 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Drop messagebox, warningbox, errorbox classes

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

Jdlrobson added a project: MW-1.38-release.

Ed and Volker looking at the core patch. They have difference in opinions about what the class should be. Once that's done this is very for estimation and User-notice.

Change 757004 had a related patch set uploaded (by Catrope; author: Jdlrobson):

[mediawiki/core@wmf/1.38.0-wmf.18] Untie Wikimedia message boxes from on-wiki messageboxes

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

Change 757004 abandoned by Catrope:

[mediawiki/core@wmf/1.38.0-wmf.18] Untie Wikimedia message boxes from on-wiki messageboxes

Reason:

Accidentally cherry-picked a patch that was not yet merged in master

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

Change 755997 merged by jenkins-bot:

[mediawiki/core@master] Untie Wikimedia message boxes from on-wiki messageboxes

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

Change 757765 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Provide JavaScript method for creating message boxes

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

This is now blocked until at the very latest September (1.39 release) to give people reasonable time to address this.

However, I would like to aim for removing this in April, regardless of which extensions have been updated. I'll be leaving a note shortly.

I'll bring this back into the board nearer to the time.

Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)

Change 757765 abandoned by Jdlrobson:

[mediawiki/core@master] Provide JavaScript method for creating message boxes

Reason:

I've not heard from anyone championing this, so I'm happy not to include it.

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

@Jdlrobson How long will the classes be held in html caches? Are you having to do those weird 2 phase deployments where the class is retained but then updated and cleared based on regional traffic?

cjming moved this task from Code Review to QA on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
cjming updated the task description. (Show Details)
cjming subscribed.

Change 756031 merged by jenkins-bot:

[mediawiki/core@master] Drop messagebox, warningbox, errorbox classes

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

There will be a single deployment where we remove the classes. Based on Varnish cache (T124954#3703453) the old class will be around for 1-7 days in cached HTML.

For tech news: Following our announcement in T300314, MediaWiki code will no longer output warningbox, errorbox and successbox classes or styles associated with these classes. This should only impact wikis that are intentionally overriding default message styles. Please review any local definitions for these classes you may have.

For tech news: Following our announcement in T300314, MediaWiki code will no longer output warningbox, errorbox and successbox classes or styles associated with these classes. This should only impact wikis that are intentionally overriding default message styles. Please review any local definitions for these classes you may have.

Not only wikis overriding the styles are affected, but also those that use these classes in wikitext, since the CSS for them and messagebox is also dropped. Suggestion:

Message boxes produces by MediaWiki code will no longer have warningbox, errorbox and successbox classes. The styles for warningbox, errorbox, successbox and messagebox classes will also be removed. This only impacts wikis that use these classes in wikitext, or change their appearance. Please review any local usage and definitions for these classes you may have. This was previously announced in the 28 February issue of Tech News.

(Also tweaked the wording a bit to align with how Tech News entries usually look like.)

For Tech News, I've written it like this. I believe this is still accurate, and will be easier to translate. Please tell me (or edit it within ~24 hours) if there are any inaccuracies or concerns:

Message boxes produces by MediaWiki code will no longer have these CSS classes: successbox, errorbox, warningbox. The styles for those classes and messagebox will be removed from MediaWiki core. This only affects wikis that use these classes in wikitext, or change their appearance within site-wide CSS. Please review any local usage and definitions for these classes you may have. This was previously announced in the 28 February issue of Tech News.

Test Result - Beta

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

Test Artifact(s):

QA Steps

Go to the login page on desktop and login with a bad username/password.
✅ AC1: Expected: A box with a colored background should appear prompting you of your error.

Desktop (Vector)

Screen Shot 2022-04-19 at 8.09.45 AM.png (978×814 px, 124 KB)

Mobile (Minerva)

Screen Shot 2022-04-19 at 8.10.10 AM.png (1×1 px, 155 KB)

Jdlrobson added a subscriber: Edtadros.

I'll handle QA for this one.

Looks good on both Vector and Minerva on mediawiki.org

Screen Shot 2022-04-19 at 3.37.15 PM.png (1×2 px, 557 KB)
:
Screen Shot 2022-04-19 at 3.36.36 PM.png (1×2 px, 486 KB)

Thanks for everyone's help on this one!

Thanks @Jdlrobson for all your work on this massive CSS architecture cleanup!