Page MenuHomePhabricator

FOUC on Flow history pages (module mediawiki.interface.helpers.styles not loaded)
Closed, ResolvedPublic

Description

On for example https://www.mediawiki.org/w/index.php?title=Talk:Compatibility&action=history the

.comment--without-parentheses::before, .mw-changeslist-links::before, .mw-diff-bytes::before, .mw-tag-markers::before, .mw-uctop::before {
	content: '(';
}

.comment--without-parentheses::after, .mw-changeslist-links::after, .mw-diff-bytes::after, .mw-tag-markers::after, .mw-uctop::after {
	content: ')';
}

CSS rules are being loaded via JavaScript, causing a FOUC if the user has JavaScript enabled. With JavaScript disabled, the user does not see any parens at all.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The issue does not happen on the regular (non-Flow) pages.

The screenshots to illustrate the issue.

While loading- parentheses not displayedFinished loading
Screen Shot 2021-03-11 at 1.34.24 PM.png (226×1 px, 94 KB)
Screen Shot 2021-03-11 at 1.34.31 PM.png (332×1 px, 127 KB)

I'm assuming that the problem and solution is the same as T137383 / https://gerrit.wikimedia.org/r/294701

I've tried my best to investigate this, without any luck. Part of that might be because I'm not familiar with less. What I've found is:

omg, I figured it out: So, Flow does not load mediawiki.interface.helpers.styles at all. VisualEditor does. From https://phabricator.wikimedia.org/diffusion/EVED/browse/master/extension.json

"dependencies": [
	"ext.visualEditor.core",
	"ext.visualEditor.mediawiki",
	"ext.visualEditor.diffing",
	"mediawiki.Title",
	"mediawiki.interface.helpers.styles",
	"mediawiki.user",
	"mediawiki.util",
	"mediawiki.jqueryMsg",
	"mediawiki.storage",
	"mediawiki.pulsatingdot",
	"mediawiki.skinning.content.parsoid",
	"mediawiki.widgets",
	"ext.visualEditor.switching",
	"ext.visualEditor.welcome",
	"oojs-ui.styles.icons-editing-advanced"
]

If the user unchecks "Enable the visual editor and the new wikitext mode in Structured Discussions" in https://www.mediawiki.org/wiki/Special:Preferences#mw-prefsection-editing and then goes to https://www.mediawiki.org/w/index.php?title=Talk:Compatibility&action=history the parens aren't there.

...but this is still strange. From https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/actions/HistoryAction.php

$out->addModuleStyles( [
	'mediawiki.interface.helpers.styles',
	'mediawiki.action.history.styles',
	'mediawiki.special.changeslist',
] );

we can see that any action=history should load mediawiki.interface.helpers.styles. So why doesn't that happen?

Nirmos renamed this task from FOUC on Flow history pages to mediawiki.interface.helpers.styles not loaded on Flow history pages.Mar 12 2021, 5:50 AM
Nirmos renamed this task from mediawiki.interface.helpers.styles not loaded on Flow history pages to FOUC on Flow history pages (mediawiki.interface.helpers.styles not loaded).Mar 12 2021, 6:06 AM

When I reported this, the bug did not manifest on svwiki like https://sv.wikipedia.org/w/index.php?title=Wikipediadiskussion:Flow&action=history but now it's on svwiki too, which means the fault is in 1.36.0-wmf.34

Going through Flow patches in 1.36.0-wmf.34 we find https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Flow/+/668777/ but that looks unrelated to me, which makes me believe that the error is in some other extension or core.

Is there a list of all patches merged in 1.36.0-wmf.34?

Nirmos renamed this task from FOUC on Flow history pages (mediawiki.interface.helpers.styles not loaded) to FOUC on Flow history pages (module mediawiki.interface.helpers.styles not loaded).Mar 12 2021, 1:33 PM

Is there a list of all patches merged in 1.36.0-wmf.34?

https://github.com/wikimedia/mediawiki/compare/wmf/1.36.0-wmf.33...wmf/1.36.0-wmf.34 might be what you're looking for?

Is there a list of all patches merged in 1.36.0-wmf.34?

If you want to see all patches in extensions too: https://www.mediawiki.org/wiki/MediaWiki_1.36/wmf.34/Changelog

...but this is still strange. From https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/actions/HistoryAction.php

$out->addModuleStyles( [
	'mediawiki.interface.helpers.styles',
	'mediawiki.action.history.styles',
	'mediawiki.special.changeslist',
] );

we can see that any action=history should load mediawiki.interface.helpers.styles. So why doesn't that happen?

Flow probably replaces the entire history page, so that code probably isn't executed.

Change 671254 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Flow@master] Add some missing styles for Flow history pages

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

I don't think this is a new issue, I couldn't find any recent changes to the related code.

Change 671254 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Add some missing styles for Flow history pages

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

matmarex claimed this task.