Topic on Extension talk:Lingo

Very strange: TOC showing at start of some pages when Lingo is enabled

7
Summary by Elcapitan68

The bug report is created on Phabricator https://phabricator.wikimedia.org/T348465. In the meanwhile, a CSS workaround is suggested.

Paulxu20 (talkcontribs)

I am using the vector 2022 skin and recently installed the Lingo extension, love it but I have this very strange problem, when I have Lingo enabled, I found that the TOC is displayed at the beginning of only some pages.. if I switch to the old vector (2010) skin, the TOC displays at the beginning of all pages (which is expected). Has anyone seen this issue or any idea where could be the problem? Below are the versions:

Product Version
MediaWiki 1.39.2
PHP 8.1.13 (fpm-fcgi)
MariaDB 10.6.11-MariaDB
ICU 67.1
Lua 5.1.5
Pygments 2.11.2
Elcapitan68 (talkcontribs)

Hi, @Paulxu20 Please, provide a link to a live page with the described TOC behavior or to a screenshot. Also, make sure your expectations about all pages are correct: by design, a table of contents is automatically generated on a page when more than three section headings are used (Manual:Table of contents)

Paulxu20 (talkcontribs)

Hi @Elcapitan68, thanks for the reply! Here is an example: https://papals.org/index.php?title=Test3, you can see on this page the TOC is appearing both at beginning of the page, as well as on the sidebar. And you are right, but I am under the impression that if the skin is vector 2010, the toc only appears at the beginning of the page, but if the skin is vector 2020, the toc only appears on the sidebar, no?

What is happening now is that the toc appears on both the beginning of the page and the sidebar when the skin is vector 2020, I am actually OK with this, but the problem is that it is not consistent, on some page it appears on both places, on some page it only appears on sidebar.

Pretty sure it has something to do with Lingo, because if you look at this test page https://papals.org/index.php?title=Test4, notice that it does not have the word "GU" (which is in the glossary list) on the page, and the toc only appears in sidebar. But on https://papals.org/index.php?title=Test3, it does have "GU" at beginning of the page, which triggered Lingo to render the tooltip, and the toc appears on both places.

Elcapitan68 (talkcontribs)

@Paulxu20, we should probably call it "vector-2022"? Indeed, it looks strange. The page Reading/Web/Desktop Improvements/Features/Table of contents describes the concept of the new TOC, saying that "We intentionally do not add the old table of contents to the article in addition to the new sidebar location". Please, let me know if you use caching (varnish / redis / cloudflare / file cache / etc.).

Paulxu20 (talkcontribs)

Hi @Elcapitan68, for caching APCu is used. In the LocalSettings.php it is set like this: $wgMainCacheType = CACHE_ACCEL;

I am not sure if this is the best caching option performance wise, but it has been working ok to me.

Elcapitan68 (talkcontribs)

@Paulxu20 I see. It looks like a side effect of the way src/LingoParser.php works. It re-renders the page injecting its elements and is not aware about the latest Vector specifics. I will create a ticket for investigating and fixing this.

In the meanwhile I suggest hiding the in-page TOC with CSS on MediaWiki:Vector-2022.css, like this:

#mw-content-text #toc {

  display: none;

}

Elcapitan68 (talkcontribs)