Page MenuHomePhabricator

[REQUEST] Review unparenthesised slash division in MobileFrontend and Minerva and update if necessary
Closed, ResolvedPublic2 Estimated Story Points

Description

What teams or group is this for?
MediaWiki core

Who is your main point of contact and contact preference?
@Krinkle

What are the details of your request? Include relevant timelines or deadlines

In August on T369669 we migrated bare division math to parens-division in Less stylesheet files in web team extensions, but it seems we either missed a few or reintroduced them later.
In T369669#10359330 @Krinkle asks:

Based on the search we originally shared, there appear to still be uses of unparenthesised slash division in MobileFrontend and Minerva. For example:
MobileFrontend - resources/mobile.startup/references/ReferencesDrawer.less
padding: @drawerPadding/2 @drawerPadding @drawerPadding @drawerPadding;
MinervaNeue - minerva.less/minerva.variables.less
@width-search-box: 375/16em;
MinervaNeue - resources/skins.minerva.base.styles/content/toc.less
@toctitle-vertical-padding: 1.4em / 2;
Are these false positives where the code is already compatible with Less.js v5 and its new default of math=parens-division?

How does the request fit withinin the departmental or foundation priorities?

Blocks switching ResourceLoader to math=parens-division (TODO: Phab ticket) and upgrading Less.js 5.0 (T288498)

Is this request urgent or time sensitive?

TBC

Requirement

Review and update any unparenthesized slash divisions in MobileFrontend and MinervaNeue Less stylesheet files to ensure compatibility with Less.js v5 and the math=parens-division requirement. Confirm that there are no regression errors in Pixel reports and that Beta matches Production for the affected features.

Files to Review:
• MobileFrontend: resources/mobile.startup/references/ReferencesDrawer.less
• padding: @drawerPadding/2 @drawerPadding @drawerPadding @drawerPadding;
• MinervaNeue: minerva.less/minerva.variables.less
@width-search-box: 375/16em;
• MinervaNeue: resources/skins.minerva.base.styles/content/toc.less
@toctitle-vertical-padding: 1.4em / 2;

BDD

Feature: Ensure Less.js v5 compatibility for MobileFrontend and MinervaNeue  

  Scenario: Unparenthesized slash divisions are updated  
    Given a user reviews Less stylesheet files in MobileFrontend and MinervaNeue  
    When unparenthesized slash divisions are found  
    Then they should be updated to use parentheses where needed  

  Scenario: No Pixel errors appear after changes  
    Given the Less stylesheet changes have been implemented  
    When test cases for reference drawer, table of contents, and search are executed  
    Then no errors should be reported in Pixel reports  

  Scenario: No visual differences between Beta and Production  
    Given the Less stylesheet changes have been implemented  
    When the reference drawer, table of contents, and search are compared between Beta and Production  
    Then there should be no unintended visual differences

Test Steps

Test Case 1: Verify no Pixel errors appear after Less updates

  1. Navigate to Pixel Reports.
  2. Review test cases for the following features:

• Reference Drawer
• Table of Contents
• Search

  1. AC1: Confirm that there are no errors related to Less updates in Pixel reports.

Test Case 2: Verify no visual differences between Beta and Production

  1. Open Beta and Production versions of the following pages:

• Reference Drawer (e.g., visit a page with references in both environments)
• Table of Contents (e.g., visit an article with multiple sections)
• Search (e.g., open the search bar in both environments)

  1. Compare the UI elements in both environments.
  2. Look for any unintended layout shifts, styling inconsistencies, or missing elements.
  3. AC2: Confirm that there are no unintended visual differences between Beta and Production.

Test case 3: Make sure https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1119720 passes CI

If https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1119720 is passing CI with no issues relating to our code this can be considered a pass.

QA

Confirm Pixel shows no errors relating to this change for test cases for the following features:

  • reference drawer
  • table of contents
  • search

https://pixel.wmcloud.org/reports/mobile/index.html

QA Results - Beta

ACStatusDetails
1T382931#10589715
2T382931#10589715
3T382931#10619825

QA Results - Prod

ACStatusDetails
1Beta test only
2T382931#10678244
3Beta test only

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Jdlrobson-WMF moved this task from Q3 to Sprint Backlog on the Web-Team board.

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

[mediawiki/extensions/MobileFrontend@master] Fix bare math division

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

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

[mediawiki/skins/MinervaNeue@master] Fix bare math division

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

bwang removed bwang as the assignee of this task.Feb 27 2025, 4:11 PM
bwang subscribed.

Change #1123402 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Fix bare math division

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

Change #1123405 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Fix bare math division

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

Jdlrobson-WMF updated the task description. (Show Details)
Jdlrobson-WMF updated the task description. (Show Details)
Edtadros subscribed.

Status: ✅ PASS
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS MBA

Test Case 1: Verify no Pixel errors appear after Less updates

  1. Navigate to Pixel Reports.
  2. Review test cases for the following features:

• Reference Drawer
• Table of Contents
• Search

  1. ✅ AC1: Confirm that there are no errors related to the features above in Pixel reports.

Reference Drawer

screenshot 57.png (687×1 px, 80 KB)

There were no errors for Table of Contents
There were no errors for Search

Test Case 2: Verify no visual differences between Beta and Production

  1. Open Beta and Production versions of the following pages:

• Reference Drawer (e.g., visit a page with references in both environments).
• Table of Contents (e.g., visit an article with multiple sections).
• Search (e.g., open the search bar in both environments).

  1. Compare the UI elements in both environments.
  2. Look for any unintended layout shifts, styling inconsistencies, or missing elements.
  3. ✅ AC2: Confirm that there are no unintended visual differences between Beta and Production.

screenshot 13.mov.gif (980×1 px, 1 MB)

screenshot 14.mov.gif (980×1 px, 1 MB)

screenshot 15.mov.gif (980×1 px, 2 MB)

Timo: do you have what you need here? Can you resolve if so? If not, let us know what we missed!

@Jdlrobson-WMF I suggest reviewing the CI output of https://gerrit.wikimedia.org/r/1119720/.

See also: Less.js online demo for how Less.js supports unit-less values in divisions.

Alternatively, check out that patch locally and run vendor/bin/phpunit tests/phpunit/structure/ResourcesTest.php. It is mostly these two errors repeated over and over:

Less_Exception_Compiler: error evaluating function `unit`
The argument must be a number.
Have you forgotten parenthesis?
in minerva.variables.less on line 20, column 1

20| @font-size-minerva-small: unit( 14 / @font-size-browser, rem ); // …
21| @font-size-minerva-smallest: unit( 13 / @font-size-browser, rem ); // …

https://gerrit.wikimedia.org/g/mediawiki/skins/MinervaNeue/+/cf09861d7bf2b00e1b769aa58ba09730a8865232/minerva.less/minerva.variables.less#20

Less_Exception_Compiler: error evaluating function `unit`
The argument must be a number.
Have you forgotten parenthesis?
in variables.less on line 5, column 1

4| // smaller and will start horizontal scrolling instead.
5| @min-width-supported: unit( 300px / @font-size-browser, em );

https://codesearch.wmcloud.org/deployed/?q=min-width-supported%3A&files=&excludeFiles=&repos=mediawiki%2Fskins%2FVector

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

[mediawiki/skins/MinervaNeue@master] Add parenthesis for all division

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

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

[mediawiki/extensions/MobileFrontend@master] Add parenthesis for all division

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

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

[mediawiki/skins/Vector@master] Add parenthesis for all division

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

Change #1124497 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Add parenthesis for all division

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

Change #1124498 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Add parenthesis for all division

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

Jdlrobson-WMF changed the point value for this task from 2 to 1.Mar 5 2025, 6:21 PM

Estimation: Adjusting for remaining work following standup.

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

[mediawiki/extensions/WikimediaMessages@master] Add parenthesis for all division

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

Change #1124499 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Add parenthesis for all division

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

Change #1125191 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Add parenthesis for all division

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

Jdlrobson-WMF changed the point value for this task from 1 to 2.Mar 6 2025, 9:16 PM

(Reverting back to the original estimate as there was a lot of hidden complexity here)

@Jdlrobson, Test Case 3, looks like a dev validation.

@Jdlrobson, Test Case 3, looks like a dev validation.

Yes

Test case 3: Make sure https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1119720 passes CI

I can confirm it's a pass as patch has been merged.

Change #1126200 had a related patch set uploaded (by Krinkle; author: Hokwelum):

[mediawiki/skins/Vector@master] Fix missing parens in TableOfContents.less

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

Change #1126205 had a related patch set uploaded (by Hokwelum; author: Hokwelum):

[mediawiki/extensions/MultimediaViewer@master] Prepare Less styles for math=parens-division

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

Change #1126206 had a related patch set uploaded (by Hokwelum; author: Hokwelum):

[mediawiki/extensions/MediaSearch@master] Prepare Less styles for math=parens-division

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

Change #1126200 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Fix missing parens in TableOfContents.less

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

Change #1126205 merged by jenkins-bot:

[mediawiki/extensions/MultimediaViewer@master] Prepare Less styles for math=parens-division

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

Change #1126550 had a related patch set uploaded (by Jforrester; author: Hokwelum):

[mediawiki/skins/Vector@wmf/1.44.0-wmf.20] Fix missing parens in TableOfContents.less

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

Change #1126562 had a related patch set uploaded (by Gergő Tisza; author: Hokwelum):

[mediawiki/extensions/MultimediaViewer@wmf/1.44.0-wmf.20] Prepare Less styles for math=parens-division

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

Change #1126562 abandoned by Gergő Tisza:

[mediawiki/extensions/MultimediaViewer@wmf/1.44.0-wmf.20] Prepare Less styles for math=parens-division

Reason:

will revert the core change instead

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

Change #1126206 merged by Gergő Tisza:

[mediawiki/extensions/MediaSearch@master] Prepare Less styles for math=parens-division

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

Change #1126610 had a related patch set uploaded (by Hokwelum; author: Hokwelum):

[mediawiki/extensions/SearchVue@master] Prepare Less styles for math=parens-division

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

Change #1126610 merged by jenkins-bot:

[mediawiki/extensions/SearchVue@master] Prepare Less styles for math=parens-division

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

Jdlrobson-WMF claimed this task.

Given core patch is on next week's train I think we can call this resolved.

Change #1126550 abandoned by Jforrester:

[mediawiki/skins/Vector@wmf/1.44.0-wmf.20] Fix missing parens in TableOfContents.less

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

@Jdlrobson-WMF There are a couple of issues that I didn't catch when doing the beta testing because my focus was not on layout shifts.

Status: ❌ FAIL
Environment: enwiki
OS: macOS
Browser: Chrome
Device: MS

Test Case 2: Verify no visual differences between Beta and Production

  1. Open Beta and Production versions of the following pages:

• Reference Drawer (e.g., visit a page with references in both environments).
• Table of Contents (e.g., visit an article with multiple sections).
• Search (e.g., open the search bar in both environments).

  1. Compare the UI elements in both environments.
  2. Look for any unintended layout shifts, styling inconsistencies, or missing elements.
  3. ❌ AC2: Confirm that there are no unintended visual differences between Beta and Production.

For production testing we are only verifying that the UI elements have no issues

It appears that if the width is larger than the reference drawer, there is some text shifting. I went back and looked at beta and it looks like I missed it there too.

BrowserEmulated iPhoneEmulated iPad (landscape)
screenshot 33.mov.gif (1×1 px, 587 KB)
screenshot 34.mov.gif (1×1 px, 1 MB)
screenshot 32.mov.gif (782×1 px, 1 MB)

Table of contents appears OK.

screenshot 35.mov.gif (1×1 px, 1 MB)

Again, another one that I missed because I was focused on the elements vs. the transition of the elements. You can see that the magnifying glass does shift when clicking in and out of the search field. This is also present in beta.

screenshot 36.mov.gif (1×1 px, 1 MB)

These issues do not seem related to this change. I'll follow up on Slack to see we need to capture these as bugs.

Filed T390092: Mobile search icon moves on focus for the search bug.
I'll raise a bug for references too if you can help me replicate.