Page MenuHomePhabricator

Implement a uniform value across skins for font size in our instrumentation
Closed, ResolvedPublic3 Estimated Story Points

Description

NOTE: This should only be attempted at times when the schema is not being used for anything to avoid disruption.

Background

Currently, we have specific conditions in WikimediaEvents for the Vector 2022 and Minerva skins, which leads to less efficient code and potential issues in the future. The goal is to create a mechanism so all skins can have the same string that can be queried for the current event's font-size preference.

Currently mobile logs the following values: xlarge, large, small, regular
Desktop logs: 0, 1,2, 3

User story

As a data analyst I want consistent values across the mobile and desktop schemas for font-size

Requirement

Standardize font-size values logged by WikimediaEvents across mobile (Minerva) and desktop (Vector) skins. The mobile schema will align with the desktop values to ensure consistency in the instrumentation of font size preferences. No changes will be made to the Vector skin itself, and only WikimediaEvents will be updated to log uniform values for both mobile and desktop.

BDD

Feature: Standardize Font Size Values in WikimediaEvents Across Skins

  Scenario: Log consistent font-size values in WikimediaEvents for Minerva and Vector skins
    Given the user adjusts the font size in Minerva or Vector skin
    When the font size is logged in WikimediaEvents
    Then the mobile schema should log the values as shown below

    | Skin    | Text     | Logged Value |
    | Minerva | Standard |      1       |
    | Minerva | Medium   |      2       |
    | Minerva | Large    |      3       |
    | Vector  | Small    |      0       |
    | Vector  | Standard |      1       |
    | Vector  | Large    |      2       |

Test Steps

Test Case 1: Verify Standardized Font Size Logging in WikimediaEvents

  1. Adjust the font size in the Minerva skin.
  2. AC1: Confirm that font size adjustments in Minerva are logged as 1, 2, or 3 in WikimediaEvents.
  3. Adjust the font size in the Vector skin.
  4. AC2: Confirm that font size adjustments in Vector are logged as 0, 1, or 2 in WikimediaEvents.

Design

  • Add mockups and design requirements

Acceptance criteria

  • Add acceptance criteria

Communication criteria - does this need an announcement or discussion?

N/A

Rollback plan

N/A. We are not actively using the schema right now.

This task was created by Version 1.2.0 of the Web team task template using phabulous

Proposed Solution:

QA Results - Beta

ACStatusDetails
1T349862#10215554
2T349862#10215554

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

We can revisit this at a later date if needed.

ovasileva subscribed.

Re-opening since this would have prevented the issues in T364547: Year-end report on FY2023-24 KR WE2.1

ovasileva raised the priority of this task from Low to High.Jul 23 2024, 6:12 PM
ovasileva added a subscriber: jwang.

Fixing this will require a schema update which would be disruptive to @jwang analysis. Do we want to wait until that's done?

SToyofuku-WMF subscribed.

@Jdlrobson reassigning to you - hope it's okay. I think this is good and mostly groomed, but I wonder if you could fill in the task description a bit more with what the work would look like - it sounds like we would need to do more than simply adding a switch statement to the event logging code, so it'd be good to clear up:

  1. what the actual scope of this ticket is and
  2. whether we should do it or not

Just to clarify, is xlarge or 3 actually an option for font size? i dont that option in our UI...

@Jdlrobson reassigning to you - hope it's okay. I think this is good and mostly groomed, but I wonder if you could fill in the task description a bit more with what the work would look like - it sounds like we would need to do more than simply adding a switch statement to the event logging code, so it'd be good to clear up:

  1. what the actual scope of this ticket is and
  2. whether we should do it or not

@SToyofuku-WMF could you help clarify, why would this task be more than adding a switch statement? Isnt the current behavior just sending a string to the schema? So we are just updating the strings to be "0", "1", "2" consistently?

Change #1077073 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/extensions/WikimediaEvents@master] Make font-size values uniform across mobile/desktop

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

@bwang I believe I was referring to Jon's comment from last year:

It's currently by design that we use different preference keys for font size on different skins as the assumption is a user may want a different font size on mobile and desktop. If we want to change that this would require substantial refactoring so we should check on the requirement.

But no clue what the substantial refactoring requirement is and he seemed to not be worried when we estimated this ticekt

@bwang @SToyofuku-WMF

Just adding my two cents here, but I think we need to confirm with @jwang the mapping and the actual values she wants to see.

@jwang We are starting on this ticket. We are thinking of mapping the values from Minerva’s font sizes to match Vector’s format before logging. This way, regardless of the skin, the event logs the same “font size” consistently. Can you verify if this mapping works for data collection?

How the Mapping Looks:
• Vector’s “Small” (14px) → Log as 0
• Minerva’s “Standard” (16px) → Log as 1
• Vector’s “Standard” (16px) → Log as 1
• Minerva’s “Medium” (18px) → Log as 2
• Vector’s “Large” (18px) → Log as 2
• Minerva’s “Large” (20px) → Log as 3

Is this alright? Or would you prefer more explicit pixel values instead? Let us know what would be best.

• Vector’s “Small” (14px) → Log as 0
• Minerva’s “Standard” (16px) → Log as 1
• Vector’s “Standard” (16px) → Log as 1
• Minerva’s “Medium” (18px) → Log as 2
• Vector’s “Large” (18px) → Log as 2
• Minerva’s “Large” (20px) → Log as 3

Thanks, @KSarabia-WMF , The mapping looks good to me. Can we document this somewhere?

bwang removed bwang as the assignee of this task.Oct 2 2024, 2:11 PM
bwang subscribed.

Here is the main documentation for the mapping if we are going with the approach we discussed in estimation around just doing a couple of switch statements. I also added it in the metrics section on the web team page for folks that might not have datahub access currently.

Change #1077073 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Make font-size values uniform across mobile/desktop

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

Edtadros removed Edtadros as the assignee of this task.EditedOct 9 2024, 7:46 PM

Test Result - Beta

Status: ❌ FAIL ✅ PASS
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Standardized Font Size Logging in WikimediaEvents

  1. Adjust the font size in the Minerva skin.
  2. ✅ AC1: Confirm that font size adjustments in Minerva are logged as 1, 2, or 3 in WikimediaEvents.
StatusSkinTextExpected ValueActual ValueScreenshot
MinervaStandard13 1
screenshot 65.png (1×1 px, 342 KB)
MinervaMedium21 2
screenshot 66.png (1×1 px, 344 KB)
MinervaLarge32 3
screenshot 67.png (1×1 px, 346 KB)
  1. Adjust the font size in the Vector skin.
  2. ✅ AC2: Confirm that font size adjustments in Vector are logged as 0, 1, or 2 in WikimediaEvents.
StatusSkinTextExpected ValueActual ValueScreenshot
VectorSmall00
screenshot 56.png (1×1 px, 465 KB)
VectorStandard11
screenshot 55.png (1×1 px, 433 KB)
VectorLarge22
screenshot 57.png (1×1 px, 436 KB)

❌ AC1: Confirm that font size adjustments in Minerva are logged as 1, 2, or 3 in WikimediaEvents.

It looks like the settings page is logging the value /before/ the click rather than after. This is probably the correct behaviour because it reflects the font size at the time of the click. @Edtadros can you add an additional step where you click something /after/ changing the setting e.g. the hamburger icon?

I've updated T349862#10215554 with the correct screenshots and set it to PASS.

@jwang - do you want to sign off on this one or should I go ahead and resolve it?

Hi, the font field looks good. It reflects the font value when the page was loaded.

Which font option the user clicked is logged in the action_source in mediawiki_web_ui_actions schema ( OR event.name in MobileWebUIActionsTracking).
Do we plan to also update them? Right not, it's still logging as skin-client-pref-mf-font-size-value-regular, skin-client-pref-mf-font-size-value-small, skin-client-pref-mf-font-size-value-large.

image.png (326×952 px, 36 KB)

Query

SELECT distinct action_source, action_subtype
FROM mediawiki_web_ui_actions 
WHERE agent.client_platform_family='mobile_browser'
AND year=2024 and month=10 and day=15 and hour=1
AND action='click'
AND action_source LIKE 'skin-client-pref-mf-font-size%'

action_source is the ID of the element that led to the click (similar to how the donate links are logged as ca-sitesupport. There are no plans to change them as part of the ticket.

If it was important to make these more readable it is possible, but would likely be a relatively big undertaking given how the code is written and would likely require an overhaul of how our click tracking and menu links work.

Hi, @Jdlrobson

If the labels small, regular, and large in the action_source can be changed to numbers that reflect the font values (1, 2, 3), that would be great. However, I understand if that’s a significant undertaking.

Currently, these labels do not correspond with either the option values in the interface or the font sizes in the font field, which makes mapping them quite challenging.

Understood. When visiting https://en.m.wikipedia.org/wiki/Special:MobileOptions:

  • Clicking "skin-client-pref-mf-font-size-value-small" corresponds with the standard control
  • Clicking "skin-client-pref-mf-font-size-value-regular" corresponds with the medium control
  • Clicking "skin-client-pref-mf-font-size-value-large" corresponds with the large control

I can see why this is confusing.

Fixing this however will require several changes that will likely span 2 sprints since it has the potential to break user experience (e.g. cause people to get the wrong font size) so we'd need to do this carefully. In this ticket, we assumed the more important values related to the font size in every event which was easier to fix so focused our efforts there. Alternatively we could add additional code for this specific use case, if engineers think that it is an acceptable approach here and comfortable with the associated maintenance cost.

I didn't realize we were using data from the Special:MobileOptions form - I had thought we were using the font value in every event to understand usage, but if this is impacting analysis significantly for you we can create a new this form and @ovasileva can prioritize it against other work.

Thanks for the explanation, @Jdlrobson. Agree it's not within the scope of this ticket. I am going to resolve this ticket.

As for the click events, given the complexity and risk, I think we can keep it as is. I have also documented the click events on datahub for future reference.

Test Result - Prod

Status: ✅ PASS
Environment: testwiki, enwiki
OS: macOS
Browser: Chrome
Device: MS MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Standardized Font Size Logging in WikimediaEvents

  1. Adjust the font size in the Minerva skin.
  2. ✅ AC1: Confirm that font size adjustments in Minerva are logged as 1, 2, or 3 in WikimediaEvents.
StatusSkinTextExpected ValueActual ValueScreenshot
MinervaStandard11
screenshot 104.png (1×1 px, 189 KB)
MinervaMedium22
screenshot 105.png (1×1 px, 177 KB)
MinervaLarge33
screenshot 106.png (1×1 px, 177 KB)
  1. Adjust the font size in the Vector skin.
  2. ✅ AC2: Confirm that font size adjustments in Vector are logged as 0, 1, or 2 in WikimediaEvents.
StatusSkinTextExpected ValueActual ValueScreenshot
VectorSmall00
screenshot 107.png (1×1 px, 192 KB)
VectorStandard11
screenshot 108.png (1×1 px, 221 KB)
VectorLarge22
screenshot 109.png (1×1 px, 320 KB)