Page MenuHomePhabricator

FlaggedRevs: Codex styles display unstyled in some conditions
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

image.png (918×292 px, 29 KB)

image.png (476×136 px, 9 KB)

It seems like while doing T191156: Convert FlaggedRevisions to Codex, some mistakes were made about how to require and load Codex styles reliably for all users. This happens in mundane cases like the one described above, but also in highly important cases like notices on top of pages.

This was first raised by me in T372694: Switch ruwiki to use FlaggedRevs detailed interface mode to not much avail. It seems like Codex styling is not supposed to not load or load only after the page gets loaded if the extension is configured properly, and there must be some sort of error preventing those styles from properly getting added. Tagging @Dogu and @Ladsgroup as people responsible.

Event Timeline

Restricted Application added subscribers: Base, Aklapper. · View Herald Transcript

Seems like the same issue affects a warning icon in https://ru.wikipedia.org/?oldid=139749417 which gets displayed for me as a logged-in user and doesn’t load at all for me logged-out. There might be some bigger issue here.

stjn renamed this task from FlaggedRevs Codex styles display unstyled in some conditions to Codex styles display unstyled in some conditions.Sep 19 2024, 10:38 PM
stjn added a project: MediaWiki-ResourceLoader.

Seeing as https://ru.wikipedia.org/w/index.php?title=Амстердам&action=edit&section=4 also changes once you run mw.loader.using( 'mediawiki.htmlform.codex.styles' ) in the console, it seems like a general problem with Codex loading for IP users and not just a problem in FlaggedRevs. Going to add ResourceLoader since it must be related to its presence/non-presence with Codex markup.

Codex styles are not loaded by default. If something on the page uses Codex, then you need to load the styles from your PHP or JS code. If some component doesn't do it, then that component needs fixing.

However, the Vector 2022 skin loads some Codex styles on all pages, as its search box uses Codex, so things may appear to work on Vector 2022 but not on other skins. Make sure to test on other skins when using Codex.

IMO the issues you've noticed are neither a Codex bug nor a ResourceLoader bug. FlaggedRevs just needs to load Codex styles in a couple more places.

The issues I’ve pointed to are not just FlaggedRevs issues, there are also MediaWiki core issues. Seeing as https://ru.wikipedia.org/w/index.php?title=Амстердам&action=edit&section=4 contains both FR and non-FR messages and, for example, anon warning gets displayed partially unstyled (without an icon). So there is clearly something wrong with this on a deeper level with MediaWiki and not just limited to FlaggedRevs (which has its own issues, I am more than sure given how poorly Codex rewrite was done).

Returning the most related tag as the above is clearly the misunderstanding of the extent of the issues with Codex CSS loading.

CCiufo-WMF subscribed.

The issues I’ve pointed to are not just FlaggedRevs issues, there are also MediaWiki core issues. Seeing as https://ru.wikipedia.org/w/index.php?title=Амстердам&action=edit&section=4 contains both FR and non-FR messages and, for example, anon warning gets displayed partially unstyled (without an icon). So there is clearly something wrong with this on a deeper level with MediaWiki and not just limited to FlaggedRevs (which has its own issues, I am more than sure given how poorly Codex rewrite was done).

I think the issues with FR and core messages is caused by what @matmarex described in T373602#10163720, but I'm not sure where it needs to be resolved. The anon warning won't be solved by loading Codex styles in FR alone. We probably need to be loading a subset of Codex styles on all skins, not just Vector 2022, if we expect them to be needed by certain features. I'm going to check my understanding with the team and report back here.

Looking into this a bit more, maybe there's an issue with the temp user banner specifically not loading the right styles. So we might need to fix what's loaded for that and for FR.

I was confusing anon users with temp users

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

[mediawiki/core@master] Add Codex message box style module to pages that need it

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

Update: we're discussing loading a subset of Codex styles (probably just message boxes for now) on page load for all skins. FlaggedRevs should still be updated to load the Codex components it needs though, following https://www.mediawiki.org/wiki/Codex#Loading_a_subset_of_Codex_components_(recommended_for_skins_and_extensions).

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

[mediawiki/extensions/FlaggedRevs@master] Load Codex message box styles for non-reviewers

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

CCiufo-WMF renamed this task from Codex styles display unstyled in some conditions to FlaggedRevs: Codex styles display unstyled in some conditions.Sep 20 2024, 5:12 PM
CCiufo-WMF added a subscriber: Jdlrobson.

Changing this back to a FlaggedRevs issue. The related issue of message styles not loading in other situations is being handled in T375246. FlaggedRevs should load the Codex styles it needs. Thanks @Jdlrobson for providing a patch.

Change #1074471 merged by jenkins-bot:

[mediawiki/core@master] Add Codex message box style module to pages that need it

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

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

[mediawiki/skins/Vector@master] Bump size of Vector performance budget to accomodate FlaggedRevs styles

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

Change #1074549 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Bump size of Vector performance budget to accomodate FlaggedRevs styles

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

Change #1074485 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@master] Load Codex message box styles for non-reviewers

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

Jdlrobson claimed this task.

A short term fix is riding the current change.
A longer term fix will ride next week's train! Thanks!

Note sure if this T373602 or T375246 is the most adequate to report the following.

When Live preview is enabled, the "preview warning" is no longer styled. The message "MediaWiki:Previewnote" is not embedded in a Codex box, but in a "div.mw-message-box-warning.mw-message-box" element. Therefore, it lacks the background color, the warning icon, etc.

(When Live preview is disabled, i.e. using regular previews, the message is embedded in a Codex box.)

Note sure if this T373602 or T375246 is the most adequate to report the following.

When Live preview is enabled, the "preview warning" is no longer styled. The message "MediaWiki:Previewnote" is not embedded in a Codex box, but in a "div.mw-message-box-warning.mw-message-box" element. Therefore, it lacks the background color, the warning icon, etc.

This is covered by https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1076234/