Page MenuHomePhabricator

Allow reading accessibility settings menu to have different defaults for logged-in and logged-out users on desktop
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

  • We would like to begin bringing the reading accessibility settings menu that controls text, width, and night mode, out of beta and to logged-in and logged-out users. As part of this process, we might want to set different type defaults for logged-in and logged-out users during the rollout process so that we ensure a smooth rollout. Eventually, we would like to use the same defaults for all groups of users, allowing people to set their preferred text themselves.

User story

  • As a logged-out reader, I want to read text that is accessible, so that I can read quickly and easily

Requirements

  • The accessibility settings menu must have the ability to set different defaults for logged-in and logged-out users on desktop
  • In the future, both font sizes should be able to default to standard
  • We must have the ability to set a different default size for new accounts vs existing accounts
NOTE: defaults will be set in a separate ticket
  • Defaults:
  • Anonymous users will default to standard
  • Logged-in users will default to small

Refined Requirement

Implement different default text size settings in the Vector 2022 skin of Wikipedia’s accessibility menu to enhance readability based on user login status and account age:

  • Anonymous Users: Default to "Standard" text size.
  • New Logged-In Users: Default to "Standard" text size.
  • Existing Logged-In Users: Default to "Small" text size.

These defaults should be automatically applied and configurable within the accessibility settings menu to ensure a tailored reading experience for each user category.

BDD

Feature: Default Text Size Configuration Based on User Status

  Scenario: Default text size for anonymous users on desktop Vector 2022
    Given the user is not logged in on the desktop version of Wikipedia
    When the user accesses any article
    Then the text size should default to "Standard"

  Scenario: Default text size for new logged-in users on desktop Vector 2022
    Given the user has just created an account and logged in on the desktop version of Wikipedia
    When the user accesses any article for the first time
    Then the text size should default to "Standard"

  Scenario: Default text size for existing logged-in users on desktop Vector 2022
    Given the user is logged in and has previously set preferences on the desktop version of Wikipedia
    When the user accesses any article
    Then the text size should default to "Small"

Test Steps

Test Case 1: Default Text Size for Anonymous Users

  1. Open Wikipedia with the Vector 2022 skin without logging in and access any article page.
  2. AC1: Confirm that the text size is set to "Standard."

Test Case 2: Default Text Size for New Logged-In Users

  1. Navigate to Wikipedia.org with the Vector 2022 skin, complete the registration process to create a new account, and log in.
  2. Access any article page for the first time as a logged-in user.
  3. AC2: Confirm that the text size is set to "Standard."

Test Case 3: Default Text Size for Existing Logged-In Users

  1. Log into Wikipedia.org with the Vector 2022 skin with credentials of a user who has previously set preferences.
  2. Access any article page.
  3. AC3: Confirm that the text size is set to "Small."

Design

  • n/a

Acceptance criteria

  • All requirements are complete

Communication criteria - does this need an announcement or discussion?

  • No announcement needed, no visible user change

QA Results - Beta

ACStatusDetails
1T360098#9724864
2T360098#9724864
3T360098#9724864

QA Results - PROD

ACStatusDetails
1T360098#9746297
2T360098#9746297
3T360098#9746297

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
ovasileva set the point value for this task to 5.

Questions:

  • Is CUDCOND_ANON a defined condition or we need to request to be added, or is addressing it part of the ticket?
  • What are the specific technical details for implementing and storing the default settings (e.g., within code only or utilising a config file such as skin.json file)?
  • How and when will the deployment of the new default settings for users be carried out?
  • Are there any specific testing or validation criteria that should be considered during the development process?

Change #1016024 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/core@master] Add new conditional default for user options: anon

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

I have left some suggestions/questions on the patch

Moving back to doing to address the comments around temporary user accounts and add the second requested condition

Jdlrobson updated Other Assignee, added: Urbanecm.

Martin kindly offered to review this.

Martin +2ed the patch (thank you!), so this just needs a patch for Vector to make use of the new functionality :)

Martin +2ed the patch (thank you!), so this just needs a patch for Vector to make use of the new functionality :)

I can review it when it is ready, or write it if needed

Change #1016024 merged by jenkins-bot:

[mediawiki/core@master] Add new conditional default conditions for user options: anon and named

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

Change #1017164 had a related patch set uploaded (by Stoyofuku-wmf; author: Stoyofuku-wmf):

[mediawiki/skins/Vector@master] Update font size defaults for named and anonymous users

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

@SToyofuku-WMF, @Jdlrobson - just edited the task description to clarify that we will be changing the defaults themselves in a separate ticket. Apologies for the confusion! For this ticket, we just want the ability to have different defaults, but aren't ready to apply them just yet

SToyofuku-WMF subscribed.

Jan and I agreed that for now we'll leave the config as is and he'll QA the new functionality locally to ensure it works. Separately, I'm checking with Olga whether we want to update font size defaults on beta using this feature (if so, we'll do this in a separate ticket)

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

[operations/mediawiki-config@master] [beta] Set Vector 2022 font-size to 16px on beta

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

✅ The accessibility settings menu must have the ability to set different defaults for logged-in and logged-out users on desktop

I've confirmed this functionality locally by doing the following:

Added these two lines to my localSettings.php

	$wgDefaultUserOptions['vector-font-size'] = 1;
	$wgConditionalUserOptions['vector-font-size'] = [ [ 0, CUDCOND_NAMED ] ];

Which should set the default font-size for anonymous users to 16px, and logged-in to 14px.
I observed that

  • The font-size for anons changed to 16px.
  • The font-size for logged-in users who had changed their font-size, did not change.
  • The font-size for logged-in users who had not changed their font-size, did change.

✅ In the future, both font sizes should be able to default to standard

The options worked with small, medium and large font-size (options 0,1,2).

❌ We must have the ability to set a different default size for new accounts vs existing accounts

With the following config, I wan't able to change the font-size for newly registered users, (not sure if I'm using this config correctly).

$wgDefaultUserOptions['vector-font-size'] = 1;
$wgConditionalUserOptions['vector-font-size'] = [
	[ 0, [ CUDCOND_NAMED ] ],
	[ 2, [ CUDCOND_AFTER, '2024010100000' ] ]
];

✅ We must have the ability to set a different default size for new accounts vs existing accounts

Update: my config was missing a "0". The following config does work and changes the font-size for newly created accounts (tested for accounts created in 2024).
Note: It's important that the newly created account option come first since these conditional options are evaluated in order (and newly created accounts are also logged-in accounts).

$wgDefaultUserOptions['vector-font-size'] = 1;
$wgConditionalUserOptions['vector-font-size'] = [
	[ 2, [ CUDCOND_AFTER, '20240101000000' ] ],
	[ 0, [ CUDCOND_NAMED ] ],
];

Change #1017164 abandoned by Stoyofuku-wmf:

[mediawiki/skins/Vector@master] Update font size defaults for named and anonymous users

Reason:

Abandoning this for now as we don't want to change defaults for anybody yet - we'll continue this work potentially in beta or in a follow-up ticket and patch

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

will do the beta deploy as part of this ticket so we can test in beta in addition to locally

I don't have +2 rights, so Jan is going to +2 his own patch off of my +1 - then we can move this to QA

Change #1017345 merged by jenkins-bot:

[operations/mediawiki-config@master] [beta] Set Vector 2022 font-size to 16px on beta

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

@Jdrewniak / @SToyofuku-WMF , I have questions on the following two requirements:

In the future, both font sizes should be able to default to standard

Is this something that I can validate through the UI?

We must have the ability to set a different default size for new accounts vs existing accounts

Is this functionality working in beta, or is it planned for the future?

These were both validated by @Jdrewniak in T360098#9693678 and T360098#9693740

For the first one, I don't think there's any way to test this but considering that's current functionality from before this ticket I think we're okay

For the second one, it should be live on beta now (so we'd expect existing user accounts to have default small, and anonymous and new logged-in accounts to have the standard size)

Thanks @SToyofuku-WMF!

@ovasileva, before I update the description with BDD and Test Steps, I wanted to get your approval of the requirement v2 in the description. I wasn't sure how to incorporate the "In the future" requirement bullet, because I wasn't sure how this could be validated. Let me know what you think.

Thanks @SToyofuku-WMF!

@ovasileva, before I update the description with BDD and Test Steps, I wanted to get your approval of the requirement v2 in the description. I wasn't sure how to incorporate the "In the future" requirement bullet, because I wasn't sure how this could be validated. Let me know what you think.

@Edtadros - we can ignore that requirement for right now.

Edtadros removed Edtadros as the assignee of this task.EditedApr 18 2024, 12:09 AM
Edtadros subscribed.

Test Result - Beta

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

Test Artifact(s):

QA Steps

Test Steps

Test Case 1: Default Text Size for Anonymous Users

  1. Open Wikipedia with the Vector 2022 skin without logging in and access any article page.
  2. AC1: Confirm that the text size is set to "Standard."

screenshot 207.png (637×1 px, 197 KB)

Test Case 2: Default Text Size for New Logged-In Users

  1. Navigate to Wikipedia.org with the Vector 2022 skin, complete the registration process to create a new account, and log in.
  2. Access any article page for the first time as a logged-in user.
  3. AC2: Confirm that the text size is set to "Standard."

screenshot 218.png (637×1 px, 215 KB)

Test Case 3: Default Text Size for Existing Logged-In Users

  1. Log into Wikipedia.org with the Vector 2022 skin with credentials of a user who has previously set preferences.
  2. Access any article page.
  3. AC3: Confirm that the text size is set to "Small."

screenshot 217.png (637×1 px, 210 KB)

@ovasileva / @Jdlrobson , for testing this in production I will need to know what determines a new user. Is it the number of edits? Length of time since account creation? The creation of a new user in prod is not as easy as in beta and I'd like to use an existing QTE user if possible.

@Edtadros the "new" user is determined by the date the account was created. This date is set in the configuration (below). Currently beta has the date set to April 9th 2024, so anyone registered after that date is considered a new user. This value will change in production based on when we deploy this feature, so I think prod QA should be tied to the eventual deployment task.

// T360098 - change Vector font-size for anons, existing named users or newly created users.
$wgDefaultUserOptions['vector-font-size'] = 1;
$wgConditionalUserOptions['vector-font-size'] = [
	[ 1, [ CUDCOND_AFTER, '20240409000000' ] ],
	[ 0, [ CUDCOND_NAMED ] ],
];
This comment was removed by ovasileva.
ovasileva claimed this task.
ovasileva updated the task description. (Show Details)

Looks good. Resolving. Will test in production once we make the changes

@ovasileva As seen in the screenshots below, all text size were defaulted to "Small", even when it's anonymous and a new user login in En PROD Wiki.

Test Result - PROD

Status: ❌ FAIL
Environment: PROD
OS: macOS Sonoma 14.4.1
Browser: Chrome 124
Skin(s): Vector 2022
Device: MBA M2
Emulated Device:NA

Test Artifact(s):

QA Steps

Test Steps

Test Case 1: Default Text Size for Anonymous Users

  1. Open Wikipedia with the Vector 2022 skin without logging in and access any article page.
  2. AC1: Confirm that the text size is set to "Standard."

Test Link: https://en.wikipedia.org/w/index.php?title=Polar_bear&vectorclientpreferences=1

2024-04-24_12-21-03.png (1×3 px, 774 KB)

Test Case 2: Default Text Size for New Logged-In Users

  1. Navigate to Wikipedia.org with the Vector 2022 skin, complete the registration process to create a new account, and log in.
  2. Access any article page for the first time as a logged-in user.
  3. AC2: Confirm that the text size is set to "Standard."

Test Link: https://en.wikipedia.org/w/index.php?title=Polar_bear&vectorclientpreferences=1

2024-04-24_12-27-44.png (713×1 px, 154 KB)
2024-04-24_12-35-10.png (784×2 px, 385 KB)

Test Case 3: Default Text Size for Existing Logged-In Users

  1. Log into Wikipedia.org with the Vector 2022 skin with credentials of a user who has previously set preferences.
  2. Access any article page.
  3. AC3: Confirm that the text size is set to "Small."

Test Link: https://en.wikipedia.org/w/index.php?title=Polar_bear&vectorclientpreferences=1

2024-04-24_12-37-39.png (1×2 px, 731 KB)

This has only be enabled on beta cluster so far. We haven't deployed this to any production wikis.
https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1017345

@Jdlrobson so can the production testing for the deploy task be skipped? I think my interpretation of the requirement was that the text size would be defaulted, but it may be just that the ability to default is what this task is about.

You can skip. We could also enable this on test.wikipedia.org if @ovasileva wants to verify this now?