Page MenuHomePhabricator

Transclusion of API help makes TOC float right on MediaWiki wiki (in non-Vector 2022)
Closed, ResolvedPublicBUG REPORT

Description

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

What happens?:
The TOC is (forcibly?) displayed and is floated right (in non-Vector-2022).

image.png (1,263×770 px, 162 KB)

What should have happened instead?:
At the least, it should not be floated right unless set to do so locally.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Caused by 189beaf2b4f13ca207df86eaa584edc697f6a3cf

The offending block is

.toc {
	float: right;
	margin: 0 0 1em 1em;
}

I'd recommend prefixing .toc with .skin-apioutput as .skin-apioutput .toc but any other suitable class is fine.

I can't tell from the patch whether the API help always-display TOC change adjustment will impact live wiki pages but I'm guessing not. In case the change does force the TOC outside of the context of the API help, it should instead probably follow whatever the local skin's setting is.

I'd also suggest moving the relevant CSS, once appropriately limited to the API help "namespace", to the @media width block. Floating is rarely appropriate on smaller displays.

(I might also suggest changing the min-width to 640px while we're here since that's the current mobile token; dealer's choice on converting the file to LESS to use that token directly. But this one is probably worth testing to see if it feels good.)

Event Timeline

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

[mediawiki/core@master] ApiHelp: Fix issues with TOC appearance when transcluded

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

Note that T359221 is a separate issue (if the transcluding page has a TOC for other reasons, then under Parsoid it will include headings from the transcluded Special:ApiHelp, while under the old parser it won't include them).

KineticPelagic changed the task status from Open to In Progress.EditedAug 11 2026, 4:12 AM
KineticPelagic subscribed.

Moving as part of my Clinic Duty rotation. I gave +1 on the patch.

Change #1324022 merged by jenkins-bot:

[mediawiki/core@master] ApiHelp: Fix issues with TOC appearance when transcluded

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