Page MenuHomePhabricator

Update mobile settings to use client side preferences
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
None
Authored By
Jdlrobson
Oct 31 2023, 4:25 PM
Referenced Files
F41902416: screenshot 265.mov.gif
Feb 14 2024, 10:52 PM
F41902379: screenshot 262.mov.gif
Feb 14 2024, 10:52 PM
F41902378: screenshot 263.mov.gif
Feb 14 2024, 10:52 PM
F41902352: screenshot 522.png
Feb 14 2024, 10:52 PM
F41902351: screenshot 523.png
Feb 14 2024, 10:52 PM
F41902340: screenshot 521.png
Feb 14 2024, 10:52 PM
F41902337: screenshot 520.png
Feb 14 2024, 10:52 PM
F41902286: screenshot 261.mov.gif
Feb 14 2024, 10:52 PM

Description

The expand all sections setting shows at low resolutions on https://en.m.wikipedia.org/wiki/Special:MobileOptions and the code lives in MobileFrontend (resources/dist/mobile.special.mobileoptions.scripts.js)

Screenshot 2023-10-31 at 9.23.12 AM.png (99×1 px, 15 KB)

In preparation for introducing the new client preference interface we will need to update this entire page to use Codex and the client preferences API.

TODO

Following the discussion in T350418.

  • Finalize support for toggle switches in the @wikimedia/mediawiki.skins.clientpreferences library. (e.g. https://gerrit.wikimedia.org/r/991442)
  • Update the existing code to use the new @wikimedia/mediawiki.skins.clientpreferences library.
  • Remove the OOUI font size controller dropdown in favor of the @wikimedia/mediawiki.skins.clientpreferences produced radio buttons
  • The control for font size should render as radio buttons rather than a dropdown
  • The expand all sections toggle should render as a toggle switch.

[]x Replace the existing AMC toggle with the Codex equivalent for consistency.

QA steps

Resize to desktop browser (logged out):

  • Visiting Special:MobileOptions no night mode options should be available.
  • Visiting Special:MobileOptions a font size option should be available with 4 options. Selecting a font size will show a toast notification. Visiting an article page will show the article in that desired font size.
  • No expand sections setting is shown.
  • No advanced mode should be available.

Resize the browser to a mobile resolution (still logged out)

  • When resizing the browser a "Expand sections" setting is provided. Selecting it will show a toast notification. Visiting an article at mobile resolution will show the article with sections expanded by default.

When logged in

  • A new advanced option appears
  • Enabling the advanced mobile mode AMC should reload the page and show a new menu in the top right next to the existing notification (bell icon)
  • Disabling the advanced mobile mode AMC should reload the page and only a notification (bell icon) in the top right.

(You will require a separate test environment for the following tests) and is blocked on T356074.

After visiting Special:MobileOptions:

  • The default is light mode for anonymous users
  • The default is light mode for logged in users
  • I should see options to change night mode on Special:MobileOptions
  • When enabled, certain parts of the UI should reflect a darker color theme. Note: not all UI is expected to be in night mode at this point so look for any indication that a night mode has been enabled.
  • When auto mode is selected, night mode is enabled when configured at the operating system level.
  • When light mode is selected, I should get the default experience.
  • The controls work for anonymous users and logged in users
  • The user preference should only impact the Minerva skin (turning on dark mode for Minerva will not turn on dark mode for Vector)

QA Results - Beta

ACStatusDetails
1T350170#9530953
2✅ 👀T350170#9530953 please review comments
3T350170#9530953
4T350170#9530953
5✅ 👀T350170#9530953 please review comments
6T350170#9530953
7T350170#9530953
8T350170#9530953
9T350170#9530953
10T350170#9530953
11T350170#9530953
12T350170#9530953
13T350170#9530953
14T350170#9530953
15T350170#9530953
16T350170#9530953

QA Results - Prod

Event Timeline

Jdlrobson set the point value for this task to 3.Nov 9 2023, 6:38 PM
ovasileva raised the priority of this task from Medium to High.Jan 8 2024, 6:38 PM

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

[mediawiki/extensions/MobileFrontend@master] [POC] Mobile settings page uses Vector client preference library

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

bwang lowered the priority of this task from High to Medium.Jan 29 2024, 6:42 PM

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

[mediawiki/skins/Vector@master] Client preferences accept a callback

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

Change 994283 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Client preferences accept a callback

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

Jdlrobson renamed this task from Mobile expand all sections should be a client side preference to Update mobile settings to use client side preferences.Jan 31 2024, 11:56 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: Jdrewniak.

I stand corrected. This is not ready for review - it is blocked on T355118 so I can get it working with logged in users!

Jdlrobson raised the priority of this task from Medium to High.
Jdlrobson added a subscriber: Mabualruz.

@Mabualruz will review.

Change 989978 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Mobile settings page uses Vector client preference library

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

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps
NOTE: I'm passing this because the functionality in scope for this task is passed. There are two issues with a 👀 that look unrelated but should be reviewed before closing this

Resize to desktop browser (logged out):

✅ AC1: Visiting Special:MobileOptions no night mode options should be available.

MobileDesktop
screenshot 472.png (868×400 px, 33 KB)
screenshot 473.png (378×1 px, 35 KB)

✅ 👀 AC2: Visiting Special:MobileOptions a font size option should be available with 4 options. Selecting a font size will show a toast notification. Visiting an article page will show the article in that desired font size.
@Jdlrobson I'm pretty sure that it's only 3 options and this is a typo but I have to ask.
Mobile:

SmallRegularLarge
screenshot 232.mov.gif (866×400 px, 301 KB)
screenshot 233.mov.gif (866×400 px, 384 KB)
screenshot 231.mov.gif (866×400 px, 470 KB)

Desktop:

SmallRegularLarge
screenshot 235.mov.gif (534×1 px, 442 KB)
screenshot 236.mov.gif (534×1 px, 563 KB)
screenshot 237.mov.gif (534×1 px, 760 KB)

✅ AC3: No expand sections setting is shown.
See AC1
✅ AC4: No advanced mode should be available.
See AC1

Resize the browser to a mobile resolution (still logged out)

✅ 👀 AC5: When resizing the browser a "Expand sections" setting is provided. Selecting it will show a toast notification. Visiting an article at mobile resolution will show the article with sections expanded by default.
@Jdlrobson, everything functions as expected. The only issue is that the "Expand sections" is does not appear when the browser is resized. The page needs to be reloaded for that option to become visible. While this functions, it seems that the option should appear without a reload.

Expand OnExpand Off
screenshot 238.mov.gif (876×402 px, 1 MB)
screenshot 239.mov.gif (876×402 px, 935 KB)

When logged in

✅ AC6: A new advanced option appears

screenshot 475.png (880×406 px, 67 KB)
screenshot 476.png (878×403 px, 66 KB)

✅ AC7: Enabling the advanced mobile mode AMC should reload the page and show a new menu in the top right next to the existing notification (bell icon)
See AC6
@Jdlrobson, Unrelated to the option and the menu, it takes two clicks for the toggle to show the correct state

screenshot 240.mov.gif (876×402 px, 402 KB)

✅ AC8: Disabling the advanced mobile mode AMC should reload the page and only a notification (bell icon) in the top right.
See AC6

(You will require a separate test environment for the following tests) and is blocked on T356074.

After visiting Special:MobileOptions:

✅ AC9: The default is light mode for anonymous users

screenshot 478.png (878×408 px, 51 KB)

✅ AC10: The default is light mode for logged in users

screenshot 477.png (873×404 px, 71 KB)

✅ AC11: I should see options to change night mode on Special:MobileOptions
See AC9 and AC10

✅ AC12: When enabled, certain parts of the UI should reflect a darker color theme. Note: not all UI is expected to be in night mode at this point so look for any indication that a night mode has been enabled.

screenshot 479.png (878×403 px, 51 KB)

✅ AC13: When auto mode is selected, night mode is enabled when configured at the operating system level.

screenshot 480.png (769×507 px, 76 KB)

screenshot 481.png (768×464 px, 77 KB)

✅ AC14: When light mode is selected, I should get the default experience.
See AC9 AC10

✅ AC15: The controls work for anonymous users and logged in users

AnonLogged In
screenshot 241.mov.gif (876×480 px, 534 KB)
screenshot 242.mov.gif (876×480 px, 615 KB)

✅ AC16: The user preference should only impact the Minerva skin (turning on dark mode for Minerva will not turn on dark mode for Vector)

screenshot 243.mov.gif (970×1 px, 784 KB)

Looks good! Should get an engineer to check the remaining to-do's before resolving.

Jdlrobson updated the task description. (Show Details)

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Sonoma
Browser: Chrome, Firefox
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

Resize to desktop browser (logged out):

✅ AC1: Visiting Special:MobileOptions no night mode options should be available.

MobileDesktop
screenshot 518.png (934×431 px, 32 KB)
screenshot 519.png (578×1 px, 45 KB)

✅ AC2: Visiting Special:MobileOptions a font size option should be available with 4 options. Selecting a font size will show a toast notification. Visiting an article page will show the article in that desired font size.

MobileDesktop
screenshot 256.mov.gif (848×394 px, 290 KB)
screenshot 257.mov.gif (546×1 px, 370 KB)

✅ AC3: No expand sections setting is shown.
See AC1
✅ AC4: No advanced mode should be available.
See AC1

Resize the browser to a mobile resolution (still logged out)

✅ AC5: When resizing the browser a "Expand sections" setting is provided. Selecting it will show a toast notification. Visiting an article at mobile resolution will show the article with sections expanded by default.
@Jdlrobson, everything functions as expected. The only issue is that the "Expand sections" is does not appear when the browser is resized. The page needs to be reloaded for that option to become visible. While this functions, it seems that the option should appear without a reload.

Expand OnExpand Off
screenshot 259.mov.gif (848×388 px, 1 MB)
screenshot 258.mov.gif (848×388 px, 650 KB)

When logged in

✅ AC6: A new advanced option appears

screenshot 260.mov.gif (848×388 px, 183 KB)
screenshot 261.mov.gif (848×388 px, 158 KB)

✅ AC7: Enabling the advanced mobile mode AMC should reload the page and show a new menu in the top right next to the existing notification (bell icon)
See AC6

screenshot 240.mov.gif (876×402 px, 402 KB)

✅ AC8: Disabling the advanced mobile mode AMC should reload the page and only a notification (bell icon) in the top right.
See AC6

(You will require a separate test environment for the following tests) and is blocked on T356074.

After visiting Special:MobileOptions:

✅ AC9: The default is light mode for anonymous users

screenshot 520.png (817×379 px, 50 KB)

✅ AC10: The default is light mode for logged in users

screenshot 521.png (846×391 px, 66 KB)

✅ AC11: I should see options to change night mode on Special:MobileOptions
See AC9 and AC10

✅ AC12: When enabled, certain parts of the UI should reflect a darker color theme. Note: not all UI is expected to be in night mode at this point so look for any indication that a night mode has been enabled.

screenshot 523.png (811×378 px, 51 KB)
screenshot 522.png (845×389 px, 67 KB)

✅ AC13: When auto mode is selected, night mode is enabled when configured at the operating system level.

screenshot 263.mov.gif (998×482 px, 372 KB)
screenshot 262.mov.gif (998×482 px, 491 KB)

✅ AC14: When light mode is selected, I should get the default experience.
See AC9 AC10

✅ AC15: The controls work for anonymous users and logged in users
See AC13

✅ AC16: The user preference should only impact the Minerva skin (turning on dark mode for Minerva will not turn on dark mode for Vector)

screenshot 265.mov.gif (1×1 px, 366 KB)