Page MenuHomePhabricator

TOC is shown unstyled and inline on Special:EditWatchlist
Closed, ResolvedPublicBUG REPORT

Description

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

What happens?:
The table of contents is unstyled and shown inline:

image.png (1×3 px, 234 KB)

What should have happened instead?:
The TOC should look like the one on article pages and be floating at the left-hand side.

Other information (browser name/version, screenshots, etc.):
The issue seems to appear on all special pages that have ToC, for example: Diff (fixed in T311529), EditWatchlist (only if 31+ pages on the watchlist from 2 or more namespaces).

The issue affects also the main page (and AFAIK only the main page apart from specials) at https://pl.wikimedia.org/wiki/Strona_g%C5%82%C3%B3wna?useskin=vector-2022&uselang=en

This seems to be related to T308216

QA Results - Beta

ACStatusDetails
1T316007#8551932

QA Results - Prod

ACStatusDetails
1T316007#8567056

Event Timeline

Jdlrobson subscribed.

The table of contents should be showing in sidebar so hopefully this is just a case of updating how the code adds a table of contents to the page.

matmarex subscribed.

The bug affects Special:EditWatchlist too, which isn't covered by the other task (and the patch there doesn't fix it). Not sure if there are any other special pages that are affected.

matmarex renamed this task from TOC is shown unstyled and inline on special pages to TOC is shown unstyled and inline on Special:EditWatchlist, maybe other special pages.Aug 25 2022, 12:38 AM
matmarex updated the task description. (Show Details)

Everything calling Linker::tocList has to add the mediawiki.toc resourceloader module? (Or there must be a way to allow OutputPage::isTOCEnabled returning true without coming from the parser)
https://codesearch.wmcloud.org/search/?q=%5CbLinker%5Cs*%3A%3A%5Cs*(tocLine%7CtocList)%5Cs*%5C(&i=nope&files=&excludeFiles=&repos=

But even with mw.loader.using( [ 'mediawiki.toc' ] ); it does not looks as expected.

The TOC is only showing when watching more as 30 titles in two different subject namespaces


The TOC on https://en.wikipedia.org/wiki/Special:SpecialPages is faked in the system message (https://en.wikipedia.org/wiki/MediaWiki:Specialpages-summary) I would not expect it to work as mediawiki-generated ones

Jdlrobson renamed this task from TOC is shown unstyled and inline on Special:EditWatchlist, maybe other special pages to TOC is shown unstyled and inline on Special:EditWatchlist.Aug 26 2022, 4:22 PM

It looks like only Special:EditWatchlist is impacted by this issue.. The Special:EditWatchlist uses Linker::tocList to create a table of contents for the page:
https://gerrit.wikimedia.org/g/mediawiki/core/+/2014984d407a42d63c0d8d3ee66a232a5e25c96a/includes/specials/SpecialEditWatchlist.php#686

If we're okay with the inline table of contents, the easiest thing here would be to make mediawiki.special.watchlist a ResourceLoaderSkinModule with features set to `['toc']`

if we want it in the sidebar it's likely a little more complicated, but presumably will involve calling OutputPage::setSections

ovasileva triaged this task as Medium priority.Aug 29 2022, 5:47 PM
LGoto lowered the priority of this task from Medium to Low.Aug 29 2022, 5:48 PM

Change 828108 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] SpecialEditWatchlist: Register table of contents in way that respects skin

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

Jdlrobson added a subscriber: cscott.

I'd like @cscott to take a look at this. The current approach feels hacky and this even more so. Not sure what would be better though at this point.

We'll reach out over email and possibly setup a meeting.

Probably related to T317333 and T293513, but the fact that this code is manually generating TOC HTML from scratch is quite... unusual. Some refactoring is needed here.

Work here is blocked on T317333 and he responsibility of the web team if we want to fix it.

Change 828108 abandoned by Jdlrobson:

[mediawiki/core@master] SpecialEditWatchlist: Register table of contents in way that respects skin

Reason:

Not working on this right now.

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

Change 834409 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] SpecialEditWatchlist: Register table of contents in way that respects skin

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

Web team notes that this will initially make Special:EditWatchlist appear unstyled on vector-2022 because they're not shipping their new CSS for Special pages, but this can be fixed..

Change 834409 merged by jenkins-bot:

[mediawiki/core@master] SpecialEditWatchlist: Register table of contents in way that respects skin

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: On EditWatchlist (only if 31+ pages on the watchlist from 2 or more namespaces) TOC should look like the one on article pages and be floating at the left-hand side.

Screenshot 2023-01-23 at 7.04.03 PM.png (796×1 px, 207 KB)

Screenshot 2023-01-23 at 7.03.24 PM.png (710×1 px, 193 KB)

Screenshot 2023-01-23 at 7.03.49 PM.png (844×1 px, 228 KB)

Screenshot 2023-01-23 at 7.03.14 PM.png (835×1 px, 226 KB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: On EditWatchlist (only if 31+ pages on the watchlist from 2 or more namespaces) TOC should look like the one on article pages and be floating on the left-hand side.

Screenshot 2023-01-28 at 6.38.26 PM.png (993×938 px, 173 KB)

Screenshot 2023-01-28 at 6.37.17 PM.png (995×1 px, 230 KB)

Screenshot 2023-01-28 at 6.37.04 PM.png (993×1 px, 238 KB)