Page MenuHomePhabricator

Enable section collapsing on Parsoid HTML
Open, MediumPublic3 Estimated Story Points

Description

Background

Follow up work to T359001

User story

As a reader on office wikimedia and other projects using Parsoid I want to be able to collapse sections.

Requirements

  • JavaScript/CSS has been added that allows sections to be collapsed or expanded.
  • The code is guarded so it only applies to Parsoid views.
  • The sections are expanded by default (pending no decision on T363933 we will do the simplest possible thing here in the mean time)
  • Section collapsing has appropriate semantics indicating the expanded/collapsed status of a section, and that the header is a button. Reference the original accessibility implementation of section collapsing to confirm

Note: Remembering collapsed/expanded sections on back button is not in scope for this ticket.

QA steps

  • If I view a page with sections, I can expand and collapse sections by clicking on the heading or the up/down arrow.
  • I can use "Find in page" on text in collapsed sections.

Rollback plan

None necessary due to feature flag.

This task was created by Version 1.0.0 of the Web team task template

QA Results - Beta

ACStatusDetails
1T363934#9942531

Event Timeline

Jdlrobson set the point value for this task to 3.

We have some proof of concepts. Scope should be relatively tight.

Picking up ahead of next week's sprint - will gladly put down if something higher priority is needed

There are now higher priority things that can be worked on - putting this down, but I reviewed the proofs of concept (first attempt and second) and agree with the approach. I think some analysis needs to be done on whether jQuery should be avoided entirely considering the current state, but however this is done, it should work

I would say that any new code by web team should not be using jQuery.

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

[mediawiki/extensions/MobileFrontend@master] POC: Enable section collapsing

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

bwang removed bwang as the assignee of this task.Tue, Jun 11, 5:22 PM
bwang moved this task from Doing to Code Review on the Web-Team-Backlog (FY2023-24 Q4 Sprint 5) board.
bwang subscribed.

Steph could you please take over review? This change looks good to me codewise, and I think you have all the background needed to review this! Thanks in advance!

Change #1040239 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Enable section collapsing

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

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

[mediawiki/extensions/MobileFrontend@master] Extend section header bottom border to include edit button

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

Change #1043885 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Extend section header bottom border to include edit button

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

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test link: https://en.m.wikipedia.beta.wmflabs.org/wiki/Harry_Potter

✅ AC1: I can expand and collapse sections by clicking on the heading or the up/down arrow.

2024-07-01_13-31-30.mp4.gif (726×1 px, 841 KB)

✅ AC2: I can use "Find in page" on text in collapsed sections.

2024-07-01_13-32-31.mp4.gif (600×1 px, 2 MB)

GMikesell-WMF assigned this task to ovasileva.
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF subscribed.