Page MenuHomePhabricator

Heading in banners rendered by WikidataPageBanner has broken section collapsing in mobile view.
Closed, ResolvedPublic

Description

On https://en.m.wikivoyage.org/wiki/London
London banner is collapsible.
The section headings, however are not as the h1 is inside #bodyContent

MobileFrontend should be updated to be cleverer at how it decides what to format and collapse on.
Unfortunately, this means going into MobileFormatter...

Event Timeline

Jdlrobson raised the priority of this task from to High.
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task to Epics on the Wikidata-Page-Banner board.
Jdlrobson added a subscriber: Jdlrobson.
Restricted Application added a project: Wikidata. · View Herald TranscriptAug 27 2015, 12:02 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Easiest thing to do I think is to change <(h[1-6])> and <(h[2-6])> turn off support for section collapsing in MobileFormatter.php on the h1 level. It's a rare edgecase any how.

If someone can fix I'll get this SWAT deployed tomorrow.

Sumit added a subscriber: Sumit.Aug 27 2015, 8:21 AM

Removing <h1> from list of tags defined in MobileFormatter::findTopHeading() would solve the problem. Would that however lead to side effects?

Hi together,

We should make sure, that this doesn't break anything. The list of h1s was added to fix both, T62478: Table of contents looks weird when only one lead section and T62479: Can't edit subsequent sections when a section is commented out. Isn't this needed anymore? Doesn't this has any side effects?

Btw.: Why does Wikivoyage (at least on the London page) doesn't have edit links for each section? And why is the ToC appended to the page-secondary box? :/

@Florian unfortunately it's all related :-/
Maybe the safest thing to try now is @Sumit suggestion but make the arrays for first headings configurable - that way we don't risk inadvertently breaking other wikis.

Florian claimed this task.Aug 27 2015, 4:27 PM

We should probably be more restrictive when taking a possible amount of h-tags in the DOM. Let me think about that :) If this doesn't work or is too hacky, +1 to your suggestion @Jdlrobson.

Change 234307 had a related patch set uploaded (by Florianschmidtwelzow):
Hotfix: Make the list of possible top headings configurable

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

Change 234314 had a related patch set uploaded (by Florianschmidtwelzow):
Be more restrictive when selecting the tag for the first heading

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

Change 234331 had a related patch set uploaded (by Jdlrobson):
Make the list of possible top headings configurable

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

Change 234307 merged by jenkins-bot:
Make the list of possible top headings configurable

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

Change 234331 merged by jenkins-bot:
Make the list of possible top headings configurable

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

Change 234330 had a related patch set uploaded (by Alex Monk):
Disable section collapsing on h1s in Wikivoyage

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

Change 234330 merged by jenkins-bot:
Disable section collapsing on h1s in Wikivoyage

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

Jdlrobson closed this task as Resolved.Aug 28 2015, 12:08 AM
Jdlrobson added a subscriber: Krenair.

Thanks to @Krenair this is all now working as expected.

Change 234314 abandoned by Florianschmidtwelzow:
Be more restrictive when selecting the tag for the first heading

Reason:
Ok, that's an argument.

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