Page MenuHomePhabricator

Add a simple feature flag to Vector for font size
Closed, ResolvedPublic3 Estimated Story Points

Description

Currently the font size for articles is 14px. We would like to eventually bump it to 16px. As a starting point we'd like to introduce a feature flag that allows us to do extensive QA of the site and determine what breaks.

Acceptance criteria

  • For now the feature flag will support 2 states: Current font-size, New font-size
  • The default font size is the current font size
  • When the feature flag is enabled, instead of font-size 14px apply font-size 16px. Do not worry about optimizing any feature. The goal is to see what breaks.
  • It should be possible to increase the font size using the code mw.user.clientPrefs.set('vector-feature-custom-font-size', 'enabled') in a gadget or by running the code in the developer console.
  • It should be possible to increase font size using a query string parameter ?VectorCustomFontSize=1

QA steps

As an anonymous user run the following code in developer console and check the font size changes:

mw.user.clientPrefs.set('vector-feature-custom-font-size', 'enabled')

Sign off steps

  • Arrange a QA task to exploratory test the site with the new font size. T345756
  • Create a task for managing how the font-size can be changed for logged in user - T345664

QA Results - Beta

QA Results - Prod

Event Timeline

Jdlrobson renamed this task from Add a simple feature flag for font size to Add a simple feature flag to Vector for font size.Aug 9 2023, 9:03 PM

Change 949137 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/skins/Vector@master] Add font size feature flag

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

Change 949137 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Add font size feature flag

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

Change 952490 had a related patch set uploaded (by Jdrewniak; author: Jdrewniak):

[mediawiki/skins/Vector@master] Make Vector feature flag compatible with clientPrefs

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

Change 952490 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Make Vector feature flag compatible with clientPrefs

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

Edtadros subscribed.

Test Result - Beta

Status: ❓Need More Info
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: For now the feature flag will support 2 states: Current font-size, New font-size
✅ AC2: The default font size is the current font size
✅ AC3When the feature flag is enabled, instead of font-size 14px apply font-size 16px. Do not worry about optimizing any feature. The goal is to see what breaks.
❓ AC4: It should be possible to increase the font size using the code mw.user.clientPref.set( 'vector-font-size', '1' ); in a gadget or by running the code in the developer console.
@Jdrewniak, I ran the code above in console and got an error. I changed it to clientPrefs and I no longer get the error, but it returns false and does nothing to the page. Not sure how to validate this.

Screenshot 2023-08-28 at 9.43.41 AM.png (125×554 px, 17 KB)

✅ AC5: It should be possible to increase font size using a query string parameter ?VectorCustomFontSize=1

Screenshot 2023-08-28 at 9.37.39 AM.png (641×1 px, 256 KB)

Screenshot 2023-08-28 at 9.38.08 AM.png (605×1 px, 238 KB)

@Edtadros sorry my bad, the correct code is mw.user.clientPrefs.set( 'vector-font-size', '1' ); (clientPref with an 's' at the end) to turn the font-size feature on, and mw.user.clientPrefs.set( 'vector-font-size', '0' ); to turn it off.

Test Result - Beta

Status: ❌ FAIL
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

❌ AC4: It should be possible to increase the font size using the code mw.user.clientPrefs.set( 'vector-font-size', '1' ); in a gadget or by running the code in the developer console.

@Jdrewniak The font in the body of the article doesn't change. The AC mentions gadgets. The only two gadgets are the UTC time that appears to the left of the user icon, and the [edit] link in the lead section. it doesn't appear any fonts changed when I ran the command in the console. I'm leaving this in QA since instead of moving it to "Needs more work" since it's not the current sprint.

Screenshot 2023-08-28 at 6.25.07 PM.png (983×1 px, 374 KB)

Screenshot 2023-08-28 at 6.30.03 PM.png (947×1 px, 413 KB)

Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)

Test Result - Beta

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

Test Artifact(s):

QA Steps

✅ AC4: It should be possible to increase the font size using the code mw.user.clientPrefs.set('vector-feature-custom-font-size', 'enabled'); by running the code in the developer console.

screenshot.mov.gif (1×2 px, 843 KB)

Edtadros closed this task as Resolved.EditedSep 7 2023, 11:56 PM
Edtadros removed Edtadros as the assignee of this task.

Test Result - Beta

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

Test Artifact(s):

QA Steps

✅ AC1: For now the feature flag will support 2 states: Current font-size, New font-size
✅ AC2: The default font size is the current font size
✅ AC3: When the feature flag is enabled, instead of font-size 14px apply font-size 16px. Do not worry about optimizing any feature. The goal is to see what breaks.
✅ AC4: It should be possible to increase the font size using the code mw.user.clientPrefs.set('vector-feature-custom-font-size', 'enabled'); by running the code in the developer console.
✅ AC5: It should be possible to increase font size using a query string parameter ?VectorCustomFontSize=1

Untitled.mov.gif (1×2 px, 3 MB)

screenshot 4.png (1×2 px, 832 KB)

screenshot 3.png (1×2 px, 890 KB)