Page MenuHomePhabricator

Create API for client side preference manipulation
Closed, ResolvedPublic5 Estimated Story PointsFeature

Description

Feature summary (what you would like to be able to do and where):

In T339268 we propose an inline script to replace the existing system and support multiple client preferences.

This needs to be complemented by a client API inside mediawiki core

todo

  • The new API should make use of tulle existing mediawiki.user module
  • The new API should match the proposal in the decision record.
  • Vector should use the new API

QA Steps

  • Go to https://en.wikipedia.beta.wmflabs.org/wiki/Spain in an incognito window
  • Run mw.user.clientPrefs.set('vector-feature-limited-width', '0') in JS console. It should visually resize the article and return true.
  • Run `mw.user.clientPrefs.set('vector-feature-limited-width', '1') in JS it should restore the article and return true
  • Run mw.user.clientPrefs.set('vector-feature-darkfoo', '1' ) in JS is should return false.

QA Results - Beta

ACStatusDetails
1T341720
2T341720
3T341720

Event Timeline

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

[mediawiki/core@master] Add API for client side preferences

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

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

[mediawiki/core@master] core - client side preferences inline script

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

Change 932819 merged by jenkins-bot:

[mediawiki/core@master] core - client side preferences inline script

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

Jdlrobson added subscribers: Edtadros, Mhurd, Catrope.

Hey @Mhurd adding you since @Edtadros is winding down. Feel free to reassign to George if they'll be handling QA.

Status: ✅ PASS
Environment: Beta
OS: macOS Ventura, Windows 11
Browser: Chrome 116, FireFox 115, Edge 115, Safari 16.5
Device: MBP
Emulated Device:BrowserStack for Windows 11
Test Links: https://en.wikipedia.beta.wmflabs.org/wiki/Spain

✅AC1: mw.user.clientPrefs.set('vector-feature-limited-width', '0') in JS console. It should visually resize the article and return true.

T341720_CoreSkin_PreferenceManipulation_ApiVector1.png (1×3 px, 431 KB)

✅AC2: mw.user.clientPrefs.set('vector-feature-limited-width', '1') in JS it should restore the article and return true

T341720_CoreSkin_PreferenceManipulation_ApiVector2.png (1×3 px, 414 KB)

✅AC3: mw.user.clientPrefs.set('vector-feature-darkfoo', '1' ) in JS is should return false.
T341720_CoreSkin_PreferenceManipulation_ApiVector3.png (1×3 px, 425 KB)

Same as above with the different browsers.

FireFoxSafariEdge
T341720_CoreSkin_PreferenceManipulation_ApiVector5.png (1×3 px, 466 KB)
T341720_CoreSkin_PreferenceManipulation_ApiVector4.png (1×2 px, 396 KB)
T341720_CoreSkin_PreferenceManipulation_ApiVector6.png (1×2 px, 1 MB)

Change 939782 abandoned by Jdlrobson:

[mediawiki/core@master] Add API for client side preferences

Reason:

Done in a9045f21f7d9

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