Page MenuHomePhabricator

[Bug] Table of content too large on mobile Wikidata
Closed, ResolvedPublic

Description

The table of content somehow also contains all subsections we have for sitelinks but doesn't display them. The elements take some space nevertheless through margins so that the table of content has a lot of empty space. It shouldn't contain these invisible elements.

Details

Related Gerrit Patches:
mediawiki/extensions/MobileFrontend : masterSelect headlines by class="mw-headline" instead of <span> element
mediawiki/extensions/MobileFrontend : masterOnly add sections if an actual section heading has been found
mediawiki/extensions/Wikibase : masterAdd class="mw-editsection" to headlines on entity pages

Event Timeline

Bene created this task.Aug 31 2015, 4:09 PM
Bene claimed this task.
Bene raised the priority of this task from to Medium.
Bene updated the task description. (Show Details)
Bene added subscribers: gerritbot, Moushira, Jdlrobson and 8 others.

Change 250960 had a related patch set uploaded (by Bene):
Only add sections if an actual section heading has been found

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

Bene moved this task from Review to Doing on the Wikidata-Sprint-2015-11-03 board.Nov 5 2015, 8:36 AM

@Bene whats the status here?

Tobi_WMDE_SW set Security to None.
Tobi_WMDE_SW moved this task from Proposed to Doing on the Wikidata-Sprint-2015-11-17 board.
Bene removed Bene as the assignee of this task.Nov 17 2015, 2:45 PM
Bene added a subscriber: Jonas.

Looking for a solution, maybe @adrianheine @thiemowmde or @Jonas want to have a look?

The issue here is that we have an empty <span> in the sitelink heading for counting the number of sitelinks (gets filled in js) which is found by MobileFrontend and put into the table of contents. I submitted a patch to MobileFrontend which skips empty <span> which is stuck in review so maybe we want to fix this inside of Wikibase instead.

Bene claimed this task.Nov 17 2015, 2:45 PM

How can an empty <span> be an issue? Core's headlines contain two spans. How does MobileFrontend filter these? Are they adding all <span>s to the TOC and do not use a class name for filtering?

Patches for review:

I'm also thinking about revisiting the HTML Wikibase produces, and probably add a <span class="mw-headline">…</span> to all <h3> headlines. This would still produce the same very long TOC, but all elements will be visible then.

Change 253935 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Add class="mw-editsection" to headlines on entity pages

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

Change 253935 merged by jenkins-bot:
Add class="mw-editsection" to headlines on entity pages

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

Bene reassigned this task from Bene to thiemowmde.Nov 19 2015, 2:00 PM

Change 250960 abandoned by Bene:
Only add sections if an actual section heading has been found

Reason:
In favour of https://gerrit.wikimedia.org/r/#/c/253621/

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

Change 253621 had a related patch set uploaded (by Florianschmidtwelzow):
Select headlines by class="mw-headline" instead of <span> element

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

daniel added a subscriber: daniel.Nov 30 2015, 1:30 PM

Waiting for https://gerrit.wikimedia.org/r/253621 to be merged by the mobile frontend folks

Change 253621 merged by jenkins-bot:
Select headlines by class="mw-headline" instead of <span> element

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

Jdlrobson closed this task as Resolved.Nov 30 2015, 9:29 PM
Jdlrobson added a subscriber: Jdlrobson.