Page MenuHomePhabricator

Expand all sections should show on resize
Closed, ResolvedPublic0 Estimated Story Points

Assigned To
Authored By
Jdlrobson
Feb 13 2024, 11:55 PM
Referenced Files
F44418264: screenshot 18.mov.gif
Apr 4 2024, 2:52 AM
F43463606: screenshot 12.mov.gif
Mar 26 2024, 9:15 PM
F42880038: screenshot 11.mov.gif
Mar 20 2024, 9:34 PM
F42638003: Screencast from 15-03-24 12:40:21 PM IST.webm
Mar 15 2024, 7:12 AM
F42633213: image.png
Mar 15 2024, 2:14 AM
F42633197: image.png
Mar 15 2024, 2:14 AM
F42632890: image.png
Mar 15 2024, 1:53 AM
F42609703: image.png
Mar 14 2024, 2:00 AM

Description

Discovered by @Edtadros in T350170#9530953

Steps to replicate the issue (include links if applicable):

What happens?:
Nothing.

What should have happened instead?:

The expand all sections setting should display.
(It shows if you refresh the page)

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

The logic in https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/src/mobile.special.mobileoptions.scripts.js#L168 should be revised. I would suggest unconditionally adding it and that adding CSS to hide/show #skin-client-prefs-mf-expand-sections

QA Results - Beta

ACStatusDetails
1✅T357486#9663644

QA Results - Prod

ACStatusDetails
1✅T357486#9686750

Event Timeline

ovasileva triaged this task as Medium priority.Feb 15 2024, 12:12 PM

@Jdlrobson my Special:MobileOptions on mediawiki docker setup looks like this

image.png (1,842×846 px, 220 KB)
, I followed https://www.mediawiki.org/wiki/Extension:MobileFrontend/en. Can you assist me with this?

@Rockingpenny4 I think you may need to run the following code from inside docker in the mediawiki core folder:

php maintenance/rebuildLocalisationCache.php --force

That should address the translation problems.
Then you should click the "mobile view" link in the bottom of the page!

Hope this is helpful!

@Jdlrobson thanks , that did the job , however I'm not seeing my local changes reflect on the browser for some reason , I followed this command as well

image.png (888×270 px, 34 KB)

From my guess here , isWideScreen() is not updated on browser resize but rather on page reload

image.png (849×202 px, 41 KB)
, due to which showExpandSectionsClientPreference is not given the value of 'true' here{F42633213}. However, I am not entirely sure as I am not able to console.log any debug statements to the browser. Also from the description , by adding CSS do you mean using media queries for it?

From my guess here , isWideScreen() is not updated on browser resize but rather on page reload

image.png (849×202 px, 41 KB)
, due to which showExpandSectionsClientPreference is not given the value of 'true' here
image.png (860×221 px, 19 KB)
. However, I am not entirely sure as I am not able to console.log any debug statements to the browser. Also from the description , by adding CSS do you mean using media queries for it?

Hi just a quick note to say that you will need to run npm start to makes sure any changes you make compile the JavaScript. Hope this helps! I can give you more pointers tomorrow!

Change 1011221 had a related patch set uploaded (by Rockingpenny4; author: Rockingpenny4):

[mediawiki/extensions/MobileFrontend@master] Fixes expand section visibility on browser resize

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

@Jdlrobson Thanks that worked , I have made a patch for the fix. Here is the relevant screencast:

Change 1010973 had a related patch set uploaded (by Rockingpenny4; author: Rockingpenny4):

[mediawiki/extensions/MobileFrontend@master] Fixes expand section visibility on browser resize

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

Change 1011221 abandoned by Rockingpenny4:

[mediawiki/extensions/MobileFrontend@master] Fixes expand section visibility on browser resize

Reason:

fails test

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

Change 1011221 restored by Jdlrobson:

[mediawiki/extensions/MobileFrontend@master] Fixes expand section visibility on browser resize

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

Thanks for sharing the screencast! Your fix looks good! I left you a comment about how we could simplify this a little more!

@Jdlrobson I have updated the patch according to the requested changes. Please review.

Thanks @Rockingpenny4 for the patch. It will be deployed this week as part of our deployments!

Moving to our sprint board so a QA engineer can test and verify the bug fix.

Jdlrobson set the point value for this task to 0.

Thanks a lot @Jdlrobson for your help , I will definitely keep the inputs in mind for future contributions.

@Jdlrobson can you add the version tag to this please.

Test Result - Beta

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

Test Artifact(s):

QA Steps

https://en.m.wikipedia.org/wiki/Special:MobileOptions
Resize browser
Nothing.
❌ The expand all sections setting should display.
The setting only shows if the page is refreshed. It also only disappears if you refresh the page.

screenshot 11.mov.gif (1,198×1,038 px, 3 MB)

@Edtadros looks like patch didn't go through. Trying again. Please test again in beta cluster when I give you the green light.

Change 1011221 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Fixes expand sections visibility on browser resize

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

Test Result - Beta

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

Test Artifact(s):

QA Steps

https://en.m.wikipedia.org/wiki/Special:MobileOptions or beta equivalent
Resize browser
✅ AC1: The expand all sections setting should display.

screenshot 12.mov.gif (980×768 px, 999 KB)

Great work, it looks and works as intended

Test Result - Prod

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

Test Artifact(s):

QA Steps

https://en.m.wikipedia.org/wiki/Special:MobileOptions or beta equivalent
Resize browser
✅ AC1: The expand all sections setting should display.

screenshot 18.mov.gif (864×966 px, 1 MB)

Change #1010973 abandoned by Rockingpenny4:

[mediawiki/extensions/MobileFrontend@master] Fixes expand section visibility on browser resize

Reason:

duplicate patch for I0212083fca450a12339ec7105eb61b4edce6f3de

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