Page MenuHomePhabricator

"Enable responsive MonoBook design" should be a (renamed) core skin preference
Closed, ResolvedPublic

Description

Monobook has a user preference that causes Skin::isResponsive to return false . It was added after a backlash from a small group of editors on wiki when Monobook was adapted for mobile display. Some users preferred the "use desktop site" mode.

This preference disables the viewport tag and allows Monobook to serve different CSS and JS.

This is likely relevant to all skins that support a responsive mode, and will likely be needed on the new Vector skin which is being made more responsive.

I suggest we create an identical preference that says "Enable responsive mode where available" that appears under the list of skins and upstream the logic to core.

Event Timeline

So keep existing behaviour, but make this a MediaWiki core feature? Is there a way for skins to opt out?

I like this idea.

Skins can of course opt-out by changing the behaviour e.g. not calling parent::isResponsive but I think that would be discouraged as the user preference would save skin developers having to think about this (at minimum it would just drop the viewport tag meaning the skin functions perfectly well)

Skins can of course opt-out by changing the behaviour e.g. not calling parent::isResponsive but I think that would be discouraged as the user preference would save skin developers having to think about this (at minimum it would just drop the viewport tag meaning the skin functions perfectly well)

In my case, MediaWiki-skins-Mirage is responsive in all cases, not making it responsive would be a significant regression. Maybe that's just me doing something wrong, but having to support both responsive and non-responsive is just more work.

Screenshot_20210624-081127_Chrome.jpg (2×1 px, 290 KB)

I'm assuming if a skin is responsive, then by definition it works fine in a desktop browser? If so, a user opted into this preference the expectation would be similar to clicking "request desktop site" on a mobile browser. I envision this setting to remove the viewport to allow for zooming on a phone, nothing else. It looks to me like Mirage works fine in this mode, unless I'm missing something?

FWIW I think Monobook goes a little further, and drops a bunch of styles/HTML purely because of user expectations dating back to the old version. New skins wouldn't have to do that. Vector wouldn't be anyway :)

I'm assuming if a skin is responsive, then by definition it works fine in a desktop browser? If so, a user opted into this preference the expectation would be similar to clicking "request desktop site" on a mobile browser. I envision this setting to remove the viewport to allow for zooming on a phone, nothing else. It looks to me like Mirage works fine in this mode, unless I'm missing something?

It appears Mirage has the responsiveness set through MobileFrontend, which is also enabled on the Skinomatic 4000. I guess I never noticed that it doesn't use the core viewport tag, which explains why everything became so confusing. If it just functions as a "request desktop site" like feature, then I can only wholeheartedly support that.

BRB, need to set "responsive": true in skin.json. Whoops.

After https://gerrit.wikimedia.org/r/c/mediawiki/skins/MonoBook/+/701445/5/includes/SkinMonoBook.php Monobook's skin basically exists to override this, so it will be nice to see this disappear. I guess there's a question about whether we need to map the old preference to the new preference or whether it's acceptable to lean on a user-notice for this.

Suggested copy:
"Adapt skin to available viewport area (enable responsive mode)"

Change 701977 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/skins/MonoBook@master] monobook-responsive pref: Follow core preference if set

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

Change 701978 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/core@master] Provide preference to make skins responsive

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

After https://gerrit.wikimedia.org/r/c/mediawiki/skins/MonoBook/+/701445/5/includes/SkinMonoBook.php Monobook's skin basically exists to override this, so it will be nice to see this disappear. I guess there's a question about whether we need to map the old preference to the new preference or whether it's acceptable to lean on a user-notice for this.

I suggest to initially honor both. Send a notice that all those with 'monobook-responsive' should switch to the general pref, then after sometime TBD remove the preference from MonoBook OR write a script to automatically migrate users. I am not sure how many (active) people are using that preference though, and the numbers can give hint which way might be better.

Also, if by 'map old preference' you mean retaining and honoring 'monobook-responsive' pref somehow, I think that defeats the purpose of this task (which aims to simplify things) and will just be another technical debt since it will eventually have to be removed.

The above approach makes sense to me. The minor disruption to users is better than technical debt that doesn't get paid off. I will explore collecting some data around who is using this preference.

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

[mediawiki/skins/MonoBook@master] Drop MonoBook responsive preference

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

Change 701978 merged by jenkins-bot:

[mediawiki/core@master] Provide preference to make skins responsive

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

Change 701977 merged by jenkins-bot:

[mediawiki/skins/MonoBook@master] monobook-responsive pref: Follow core preference if set

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

Jdlrobson claimed this task.

Note when this preference is set, it will apply to MonoBook, Timeless as well as Minerva and these skins will operate as if running in "Desktop mode". I am making an assumption here that the users using this preference on MonoBook are using it on mobile devices and wish to bypass the viewport. If they are not, I am expecting this to lead to a very informative discussion/data point.

I've setup a user notice (T285991) and will remove the MonoBook preference option when that has run its course.

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

[mediawiki/skins/MonoBook@master] Drop MonoBook responsive preference

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

Note when this preference is set, it will apply to MonoBook...

Note this is not quite right, the new core pref will not apply to MonoBook yet (MonoBook does not set Skin->options['responsive'] unconditionally).

So for MonoBook users, only those with 'monobook-responsive' can have the experience for now (in other words no change for MonoBook). We however need to tell MonoBook users to migrate (those using the option; actually do nothing, since the core pref is checked by default) but more importantly we also need to tell those not using it intentionally to 'uncheck' the core preference; this is what will enable both sets to retain their exact current MonoBook experience when the MonoBook preference is removed.

Something's not quite right with the core preference. This worked before when tested it so I suspect GlobalPreferences may be to blame:

So it looks like it's working but it's not being reflected in the UI, and more importantly a user cannot opt back in.

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

[mediawiki/core@master] Make sure enable responsive mode UI reflects actual preference value

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

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

[mediawiki/core@wmf/1.37.0-wmf.15] Make sure enable responsive mode UI reflects actual preference value

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

Change 705515 merged by jenkins-bot:

[mediawiki/core@master] Make sure enable responsive mode UI reflects actual preference value

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

Change 706003 merged by jenkins-bot:

[mediawiki/core@wmf/1.37.0-wmf.15] Make sure enable responsive mode UI reflects actual preference value

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

Mentioned in SAL (#wikimedia-operations) [2021-07-22T23:35:00Z] <derick@deploy1002> Synchronized php-1.37.0-wmf.15/includes/preferences/DefaultPreferencesFactory.php: Backport: [[gerrit:706003|Make sure enable responsive mode UI reflects actual preference value (T285402)]] (duration: 00m 56s)

Change 702764 merged by jenkins-bot:

[mediawiki/skins/MonoBook@master] Drop MonoBook responsive preference

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

This will ride next week's train. Fingers crossed MonoBook users read the notice at T285991. I'll be keeping an eye on the Village pumps. Thanks @Ammarpad for the help with this one.

@Jdlrobson

How can I find out which skins support this responsive mode? Pretty sure Medik does not, which is why I set the following in the "LocalSettings.php" file:

$wgDefaultUserOptions['skin-responsive'] = 0;
$wgHiddenPrefs[] = 'skin-responsive';

This assumes that no skin supporting this mode is installed for the wiki. This option uses quite a lot of space on the special page "Preferences," which is why I rather not show it if this feature is not supported anyway.

Thanks a lot for this info! Wow, quite a bunch of skins.