Page MenuHomePhabricator

Cannot collapse MobileFrontend sections once open on slow/unstable connections
Open, LowPublicBUG REPORT

Description

Found during work in T377389. Not a big deal since the content is readable and that's the main goal of this code, but might be something we want to fix or at least document.

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

What happens?:

  • The class is added to the section element rather than toggled, so the section stays open.

What should have happened instead?:
The section should collapse again

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

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

Event Timeline

I think the JS function has only ever added the class rather than toggling.

https://gerrit.wikimedia.org/g/mediawiki/extensions/MobileFrontend/+/080d7aca89a03a4cfb0f1df822e65704064dd13c/includes/Transforms/MakeSectionsTransform.php#288 could be updated to do block.previousSibling.classList.toggle('open-block') instead now we can rely on more modern JS.

Note without the offline step, this will lead to the section requiring two clicks to open.

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

[mediawiki/extensions/MobileFrontend@master] Toggler: Keep expanded sections when initialising

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

Change #1196802 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/MobileFrontend@master] Toggler: Keep expanded sections when initialising

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

egardner subscribed.

Hi @Func, thanks for your interest here. The Reader Growth team is currently re-considering some behavior around mobile sections as part of an A/B test. We are not going to merge any unrelated changes at the time being but may revisit in the future (once we have results from the test).

See https://phabricator.wikimedia.org/T408046 for more context.