Page MenuHomePhabricator

Show table of contents on all namespaces on Minerva
Closed, ResolvedPublic

Description

Mobile site is missing the table of contents on mon-main namespaces when viewed at tablet or desktop resolution.

For example, https://en.m.wikipedia.org/wiki/Mona_Lisa has a table of contents:

image.png (1×1 px, 498 KB)

But a nearly identical page https://en.m.wikipedia.org/wiki/User:Editingtester/mona_lisa9 has just empty space where the TOC should be:
image.png (1×1 px, 509 KB)

The element is actually present in page source, but it's empty:

image.png (1×1 px, 431 KB)

(I noticed this issue during usability testing of VE with @iamjessklein, I thought it was some random thing, but since then I ran into it on my local testing wiki too.)

Event Timeline

I see the bug locally with pages titled "Sections" and "Testwiki:Sections" (where "Testwiki" is the project namespace), both with the same content:

== Foo ==
<div class="box" style="background: beige">
== Squirrels ==
Whatever
== Cats ==
derp asdf asdf asdf
== Kittens ==
Whatever
== Dogs ==
hmph
</div>

== Bar ==
foo

I didn't have time to investigate yet, not sure if it's related to page titles/namespaces or something else.

Change 462662 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/skins/MinervaNeue@master] Allow mobile TOC on pages in all namespaces

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

ovasileva triaged this task as Medium priority.Sep 25 2018, 4:00 PM

@alexhollender @ovasileva the above patch adds table of contents to all pages. Cool?

@Jdlrobson is this for larger screens only, or mobile as well? Also I assume we should QA such a broad change?

A patch exists that adds the table of contents to all namespaces.
I've put this patch on staging
Here's some examples of how it impacts the talk page: https://reading-web-staging.wmflabs.org/wiki/Talk:Mercia
and user page: https://reading-web-staging.wmflabs.org/wiki/User:Jdlrobson#

I just need a green light to merge the code or some feedback if there are any namespaces where table of contents does not make sense (although I should point out with this patch the table of contents behaviour would become consistent with desktop)

looks good to me

some feedback if there are any namespaces where table of contents does not make sense

to clarify: you're saying that if there are namespaces on desktop where we've chosen not to include a table of contents, that will be respected here? And since you raised the question: are there reasons specific to Minerva in your opinion that would cause us to reconsider showing the table of contents in a given namespace?

to clarify: you're saying that if there are namespaces on desktop where we've chosen not to include a table of contents, that will be respected here?

I believe so. Editors can also disable table of contents via NOTOC

: are there reasons specific to Minerva in your opinion that would cause us to reconsider showing the table of contents in a given namespace

Not in my opinion.

Additional note: They will also only show on tablet and desktop mode NOT mobile

Jdlrobson renamed this task from Mobile site is missing the table of contents on some pages to Show table of contents on all namespaces on Minerva.Sep 25 2018, 6:24 PM
Jdlrobson moved this task from Incoming to Triaged but Future on the Web-Team-Backlog board.

Change 462662 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Allow mobile TOC on pages in all namespaces

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

@Jdlrobson reminder to add QA instructions to tasks when you move them to Design Review or QA

@Jdlrobson: checked for that article on mobile site using desktop browser. The table of contents is now showing up there. However, there is no TOC on an actual mobile device (iPhone). I think the original report was also mentioning something about that:

"On an actual mobile device, you can only navigate the page by swiping to scroll and it takes forever to find anything on it."

So I am assuming that part is not being fixed by this patch?

Correct. Table of contents is not shown on mobile

@Ryasmeen Sorry, I think I was a bit confused when filing this bug report. I experienced this issue on a tablet and didn't know the phone experience is different. (It turns out that on a phone, there is no TOC, and instead all of the sections are collapsed.)

Looks good, thanks all