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.
Description
Details
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | Jdlrobson | T78430 [Epic] Getting Wikidata to render nicely on mobile web | |||
| Resolved | Bene | T95884 Fix table of contents on mobile Wikidata | |||
| Resolved | Bene | T95889 Show collapsible sections for Statements and Sitelinks | |||
| Resolved | thiemowmde | T110902 [Bug] Table of content too large on mobile Wikidata |
Event Timeline
Change 250960 had a related patch set uploaded (by Bene):
Only add sections if an actual section heading has been found
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.
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:
- https://gerrit.wikimedia.org/r/253621 (preferred)
- https://gerrit.wikimedia.org/r/250960 (probably obsolete if the other patch is merged)
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
Change 253935 merged by jenkins-bot:
Add class="mw-editsection" to headlines on entity pages
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/
Change 253621 had a related patch set uploaded (by Florianschmidtwelzow):
Select headlines by class="mw-headline" instead of <span> element
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