Page MenuHomePhabricator

Adjust table of collapsing auto-collapse algorithm for articles with few top level sections
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

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

  • Go to a page with a small amount of top level sections and lots of subsections in Vector 2022

e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Table_of_contents_collapsing_test

What happens?:

  • The table of contents appears collapsed by default

What should have happened instead?:
We currently collapse sections when the number of sections is greater than 28

We currently count number of sections to determine collapsing, but I think we should also count the number of top level sections. IN the case of this article it's 2.
Perhaps we can only collapse if number of top level sections is greater than 3 ?

Software version (skip for WMF-hosted wikis like Wikipedia):

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

Event Timeline

ovasileva triaged this task as Medium priority.Mar 24 2023, 4:41 PM
ovasileva moved this task from Incoming to Current Quarter on the Web-Team-Backlog board.
ovasileva set the point value for this task to 2.Mar 30 2023, 5:39 PM

Change 905546 had a related patch set uploaded (by Mabualruz; author: Mabualruz):

[mediawiki/skins/Vector@master] Adjust table of collapsing auto-collapse algorithm for articles with few top level sections

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

Change 905546 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Adjust table of collapsing auto-collapse algorithm for articles with few top level sections

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

Edtadros subscribed.

Test Result - Beta

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

Test Artifact(s):

QA Steps

✅ AC1: Collapse section headings if there are more than 3.

Screenshot 2023-04-10 at 7.53.06 AM.png (1×1 px, 111 KB)

Screenshot 2023-04-10 at 7.50.19 AM.png (1×1 px, 159 KB)

Screenshot 2023-04-10 at 7.55.34 AM.png (1×1 px, 131 KB)

Screenshot 2023-04-10 at 7.54.40 AM.png (1×1 px, 141 KB)

Screenshot 2023-04-10 at 7.52.13 AM.png (1×1 px, 137 KB)

Looks good in beta. @Edtadros - can you also take a look in production?

Test Result - Prod

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

Test Artifact(s):

QA Steps

AC1: Collapse section headings if there are more than 3 AND more than 27 sections overall.
❌ 3 collapsible sections - 28 overall sections
@Jdlrobson, should this be expanded since the total number of top-level sections is 3 vs more-than-3? the second image is with them expanded (manually) to verify the number of sections total

Screenshot 2023-04-13 at 8.47.09 AM.png (928×541 px, 143 KB)
Screenshot 2023-04-13 at 8.47.01 AM.png (1×487 px, 210 KB)

✅ 3 collapsible sections - 27 overall sections

Screenshot 2023-04-13 at 8.37.21 AM.png (1×604 px, 262 KB)

✅ 4 collapsible sections - 27 overall sections

Screenshot 2023-04-13 at 8.39.38 AM.png (1×574 px, 263 KB)

✅ 4 collapsible sections - 28 overall sections

❌ 3 collapsible sections - 28 overall sections

Introduction is also a heading here, so that's 4 top level sections. Whether they are collapsible shouldn't matter, so that's a pass.

Edtadros removed Jdlrobson as the assignee of this task.

Thanks @Jdlrobson Passing and resolving this.