Page MenuHomePhabricator

Sections in Parsoid HTML should be collapsed by default
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

In Parsoid sections are currently expanded by default. This is the last blocker for enabling Parsoid on mobile views on Wikivoyage projects.

User story

AS a user I want Parsoid HTML to respect my preference for collapsed sections.

Requirements

  • Solution is CSS only. While the existing non-parsoid view has JavaScript for restoring expanding sections, we do not want to apply it to Parsoid HTML.
  • Solution must be restricted to below the tablet breakpoint. Sections should be expanded by default on tablets and desktop resolution.
  • Solution should respect the mf-expand-sections-clientpref-1 and mf-expand-sections-clientpref-0 class on the HTML element. When mf-expand-sections-clientpref-0 is present sections should be collapsed below the tablet breakpoint
  • mf-expand-sections-clientpref-0 is present by default on the HTML element.
  • Solution should be scoped to Parsoid HTML. Should not interfere with non-Parsoid HTML.

BDD

  • Feature: Collapsed Sections in Parsoid HTML

Scenario: Sections collapse by default based on user preference

Given a user is viewing Parsoid HTML on a mobile device
When "expand all sections" is not selected in settings
Then sections should be collapsed by default

Test Steps

On a mobile browser (make sure screen is approx 400px):

On a mobile browser (make sure screen is approx 400px):

Design

  • Add mockups and design requirements

Communication criteria - does this need an announcement or discussion?

N/A

Rollback plan

N/A

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

QA Results - Beta

ACStatusDetails
1T371539#10119572
2T371539#10119572

QA Results - PROD

ACStatusDetails
1T371539#10135991
2T371539#10135991

Event Timeline

@Jdlrobson @ovasileva not sure why Olga is assigned to this - we estimated, but wanted to make sure there are not any remaining product/design questions before this is picked up

Jdlrobson removed ovasileva as the assignee of this task.EditedAug 1 2024, 6:09 PM
Jdlrobson added a subscriber: ovasileva.

I think that's accidental as a result of creating a subtask. This should be ready for estimation now to work on.

It may make sense to wait until T367240 is complete before starting this, even though this is the one that will be blocking CTT visual diff testing

I think both tickets could likely be done in the same sprint without any problems. It would be nice to complete all this migration work during sprint 4 (to unblock Wikivoyage mobile deployment).

At risk of being carried over to next sprint.

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

[mediawiki/extensions/MobileFrontend@master] Sections in Parsoid HTML should be collapsed by default

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

Change #1067439 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Sections in Parsoid HTML should be collapsed by default

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

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

[mediawiki/extensions/MobileFrontend@master] Section expansion in Parsoid

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

Change #1068870 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Restore border for section headings in Parsoid; handle NULL preference value

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

GMikesell-WMF updated Other Assignee, added: Edtadros.
GMikesell-WMF added a subscriber: Edtadros.

@Jdlrobson Please review AC1 below. It doesn't expand when selecting the setting as seen in the gif below but AC2 works as designed.

Test Result - Beta

Status:❌ FAIL - AC1
Environment: Beta
OS: macOS Sonoma 14.6.1
Browser: Chrome 128
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://en.m.wikivoyage.beta.wmflabs.org/wiki/Spain?useparsoid=1
https://en.m.wikivoyage.beta.wmflabs.org/wiki/Special:Preferences#mw-prefsection-misc

Test Steps

On a mobile browser (make sure screen is approx 400px):

Visit the settings page
Make sure "expand all sections" is selected.
Visit https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1 and confirm all sections are expanded by default.
❌ AC1: On a mobile browser (make sure screen is approx 400px):

Beta: https://en.m.wikivoyage.beta.wmflabs.org/wiki/Spain?useparsoid=1
42 sec gif

2024-09-03_13-27-29.mp4.gif (480×496 px, 1 MB)

Visit the settings page
Make sure "expand all sections" is not selected.
✅ AC2: Visit https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1 and confirm all sections are collapsed by default.

Beta: https://en.m.wikivoyage.beta.wmflabs.org/wiki/Spain?useparsoid=1
37 sec gif

2024-09-03_13-26-18.mp4.gif (484×496 px, 2 MB)

@GMikesell-WMF looks like you are changing the wrong preference.
Please use the setting at the bottom of this screenshot on https://en.m.wikivoyage.beta.wmflabs.org/w/index.php?title=Special:MobileOptions

Screenshot 2024-09-03 at 2.54.12 PM.png (596×499 px, 44 KB)

@Jdlrobson Sounds good, thanks! It now Passes.

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS Sonoma 14.6.1
Browser: Chrome 128
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://en.m.wikivoyage.beta.wmflabs.org/wiki/Spain?useparsoid=1
https://en.m.wikivoyage.beta.wmflabs.org/w/index.php?title=Special:MobileOptions

Test Steps

On a mobile browser (make sure screen is approx 400px):

Visit the settings page
Make sure "expand all sections" is selected.
Visit https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1 and confirm all sections are expanded by default.
✅ AC1: On a mobile browser (make sure screen is approx 400px):

Beta: https://en.m.wikivoyage.beta.wmflabs.org/wiki/Spain?useparsoid=1

2024-09-04_14-04-42.mp4.gif (596×598 px, 3 MB)

Visit the settings page
Make sure "expand all sections" is not selected.
✅ AC2: Visit https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1 and confirm all sections are collapsed by default.

Beta: https://en.m.wikivoyage.beta.wmflabs.org/wiki/Spain?useparsoid=1

2024-09-04_14-09-30.mp4.gif (556×580 px, 3 MB)

GMikesell-WMF updated Other Assignee, removed: Edtadros.
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF subscribed.

Test Result - PROD

Status: ✅ PASS
Environment: PROD
OS: macOS Sonoma 14.6.1
Browser: Chrome 128
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1
https://en.m.wikivoyage.org/wiki/index.php?title=Special:MobileOptions

Test Steps

On a mobile browser (make sure screen is approx 400px):

Visit the settings page
Make sure "expand all sections" is selected.
Visit https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1 and confirm all sections are expanded by default.
✅ AC1: On a mobile browser (make sure screen is approx 400px):

https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1

2024-09-10_15-29-10.mp4.gif (610×496 px, 2 MB)

Visit the settings page
Make sure "expand all sections" is not selected.
✅ AC2: Visit https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1 and confirm all sections are collapsed by default.

https://en.m.wikivoyage.org/wiki/Spain?useparsoid=1

2024-09-10_15-29-39.mp4.gif (612×486 px, 2 MB)

This also looks good!