Page MenuHomePhabricator

Section collapsing applies to namespaces it should not apply to in mobile
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

Related: T374883: Section collapsing should not apply to certain pages

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

What happens?:
In Parsoid the summary section is collapsed. In legacy parser it isn't.

What should have happened instead?:
It was a previous product decision to not apply section collapsing to certain pages frequented by editors.

This was achieved using the MFNamespacesWithoutCollapsibleSections configuration option. While it appears to apply to legacy parser it also needs to be used in MobileFrontend's onArticleParserOptions hook.

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

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

Event Timeline

ovasileva triaged this task as Medium priority.Oct 22 2025, 11:46 AM
ovasileva moved this task from Incoming/Inbox to Backlog on the Reader Growth Team board.
Jdlrobson-WMF renamed this task from Section collapsing applies to pages it should not apply to in mobile to Section collapsing applies to namespaces it should not apply to in mobile.Oct 23 2025, 4:55 PM
Jdlrobson-WMF updated the task description. (Show Details)
HSwan-WMF set the point value for this task to 3.Dec 10 2025, 5:32 PM

Change #1219599 had a related patch set uploaded (by LWatson; author: LWatson):

[mediawiki/extensions/MobileFrontend@master] Disable collapsible sections in certain namespaces for mobile and Parsoid

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

There was a hiccup with CI checks. Phan test failed because of an undeclared method in SpecialMobileEditWatchlist (SpecialMobileEditWatchlist::getWatchlistInfo). This patch restored the method and now CI checks pass.

Hm; the patch logic does prevent a call to $parserOptions->setCollapsibleSections() but this doesn't seem to actually prevent section collapsing on parsoid renderings.

I still get collapsible sections on file description pages when testing this patch. Steps to reproduce:

  • ensure that MobileFrontend and ParserMigration are installed locally
  • download a local copy of File:Münster, Schlossplatz, Herbstsend, Kettenkarussell -- 2024 -- 6459.jpg from Commons
  • upload it to your local test wiki
  • edit the File: page to include at least one section, for instance:
xxx

== Summary ==
adsfdfsadfsadsfafdsafdsadsffaaaafdsafdsfds
  • view the page in mobile view, both without and with useparsoid=1

Expected results:

  • both legacy and parsoid renderings should not provide for collapsible sections

Actual results:

  • legacy rendering has no collapsible sections but parsoid has collapsible "Summary" section both with and without this patch

It's possible I'm misunderstanding the purpose of this patch?

Change #1219599 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Add namespace-specific collapsible section handlng for Parsoid mobile

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

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

[mediawiki/extensions/MobileFrontend@wmf/1.46.0-wmf.11] Add namespace-specific collapsible section handlng for Parsoid mobile

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

Etonkovidova subscribed.

Hm; the patch logic does prevent a call to $parserOptions->setCollapsibleSections() but this doesn't seem to actually prevent section collapsing on parsoid renderings.

I still get collapsible sections on file description pages when testing this patch. Steps to reproduce:

  • ensure that MobileFrontend and ParserMigration are installed locally
  • download a local copy of File:Münster, Schlossplatz, Herbstsend, Kettenkarussell -- 2024 -- 6459.jpg from Commons
  • upload it to your local test wiki
  • edit the File: page to include at least one section, for instance:
xxx

== Summary ==
adsfdfsadfsadsfafdsafdsadsffaaaafdsafdsfds
  • view the page in mobile view, both without and with useparsoid=1

Expected results:

  • both legacy and parsoid renderings should not provide for collapsible sections

Actual results:

  • legacy rendering has no collapsible sections but parsoid has collapsible "Summary" section both with and without this patch

I checked the File:Münster, Schlossplatz, Herbstsend, Kettenkarussell -- 2024 -- 6459.jpg on enwiki beta - did not see any issues - with &useparsoid=1 the sections are not collapsed.

It seems that in current production enwiki wmf.11, File pages that have the template Non-free_use_rationale_video_cover (hastemplate:"Non-free_use_rationale_video_cover" - enwiki betalabs doesn't have File pages with that template) display the issue. It''s worth to check several examples after deployment the fix to production.

Note:
In Desktop mode there is an interesting option in the Tools menu - "Expand all" -

Screenshot 2026-01-16 at 5.36.29 PM.png (1×2 px, 2 MB)

As far as I could see, the "Expand all" option doesn't do anything and it's not present in mobile view.

Change #1227849 abandoned by Jdlrobson:

[mediawiki/extensions/MobileFrontend@wmf/1.46.0-wmf.11] Add namespace-specific collapsible section handlng for Parsoid mobile

Reason:


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