Page MenuHomePhabricator

Current section highlighting in TOC doesn't work after update
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

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

What happens?:
The first section is highlighted as the current section.

What should have happened instead?:
The first visible section should be highlighted as the current section.

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

Additional QA

Steps to reproduce

  1. Open a (longer) talk page in the new Vector 2022 with the floating TOC.
  2. Scroll down a bit (so the first few ==sections== aren't on screen). Look at which section heading is highlighted in bold.
  3. Use the Reply tool to post a comment in any visible part of the page (doesn't have to be the one shown in bold).
  4. Don't touch the mouse/trackpad yet.
  5. Look at the TOC. Where's the bold?
  6. Watch the TOC while you scroll *up* a little (a couple of comments' worth should be enough). Why is the first ==section== in bold, even though it's still not visible on screen?

Reproduced in Chrome/macOS. Probably happens everywhere.

Developer notes

Although we update the TOC elements after an edit via the wikipage.tableOfContents hook, sectionObserver which is responsible for detecting intersection changes with the sections when scrolling remains unaware of any edits to the content's elements. We should probably move the wikipage.tableOfContents hook listener to main.js where it can trigger updates to both the TOC and sectionObserver.

There is a method, setElements, on sectionObserver,js that should be called with the updated list of sections we need to track after an edit.

https://phabricator.wikimedia.org/T316037#8643073
https://phabricator.wikimedia.org/T316037#8655226

QA Results - Beta

ACStatusDetails
1T316037#8643073

QA Results - Prod

ACStatusDetails
1T316037#8655226

Event Timeline

ovasileva triaged this task as Medium priority.Aug 24 2022, 9:16 AM
ovasileva added a project: Web-Team-Backlog.

Same underlying issue as T316033 I expect

Is it? If that has been fixed, then this hasn't.

Hopefully the root cause is the same as T317353. There's still a problem with the JS wiring.

Given some confusion today: This is a web team bug not an editing team bug. Should be prioritized accordingly by Olga.

discussed at the web+editing meeting — another aspect of this issue:

  1. add a reply to a talk page topic
  2. (the active section highlight will be lost, which we already know)
  3. click on another section in the TOC
  4. scroll the page down
  5. unexpected: the TOC scrolls back up to the top and highlights the second link

Seems like this is reproducable without an edit. Tested in Firefox in private mode (not logged in, without custom styles).

Step 1. Visit discussion page with specifc section e.g.: https://pl.wikipedia.org/w/index.php?title=Dyskusja_wikipedysty:Nux&oldid=69025086&useskin=vector-2022#Growth_team_newsletter_#22

Result: Section item is not highlighted (though the section is in view). Probably the same as T317353 as JR already mentioned.

obraz.png (1×1 px, 302 KB)

Note that this is not specific to new discussion pages.

For example Polish Village Pump suffers from the same problems:
https://pl.wikipedia.org/w/index.php?title=Wikipedia:Kawiarenka/Kwestie_techniczne&oldid=69022931&useskin=vector-2022#Nie_dzia%C5%82a_stary_pasek_narz%C4%99dzi

obraz.png (1×1 px, 286 KB)

@Nux I wonder if the issue you describe is specific to Talk pages? If I navigate here the corresponding section in the table of contents is highlighted https://fr.wikipedia.org/wiki/Paris#Toponymie

Screen Shot 2022-12-13 at 8.34.06 AM.png (894×1 px, 838 KB)

@Nux I wonder if the issue you describe is specific to Talk pages? If I navigate here the corresponding section in the table of contents is highlighted https://fr.wikipedia.org/wiki/Paris#Toponymie

Same on my end. Works fine here in FF:
https://www.mediawiki.org/wiki/Reading/Web/Desktop_Improvements/Updates#March_2022:_Development_of_the_Table_of_Contents

matmarex subscribed.

@Nux The issue with talk pages on pl.wikipedia.org is actually most likely this one: T324869: Wrong headings are bolded in the ToC, and doesn't affect most other projects. See that task for details.

LGoto set the point value for this task to 3.Feb 9 2023, 6:45 PM

@Jdlrobson could you link the associated patch in Gerrit?

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

[mediawiki/skins/Vector@master] SectionObserver should be updated at certain points in MediaWiki lifecycle

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

Change 889652 merged by jenkins-bot:

[mediawiki/skins/Vector@master] SectionObserver should be updated at certain points in MediaWiki lifecycle

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

Test Result - Beta

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

Test Artifact(s):

QA Steps
  1. Open a (longer) talk page in the new Vector 2022 with the floating TOC.
  2. Scroll down a bit (so the first few ==sections== aren't on screen). Look at which section heading is highlighted in bold.
  3. Use the Reply tool to post a comment in any visible part of the page (doesn't have to be the one shown in bold).
  4. Don't touch the mouse/trackpad yet.
  5. ✅ AC1: The first visible section should be bold in the TOC.

Screen Recording 2023-02-23 at 6.35.21 PM.mov.gif (1×1 px, 1 MB)

Screenshot 2023-02-23 at 6.32.58 PM.png (348×1 px, 160 KB)

Test Result - Prod

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

Test Artifact(s):

QA Steps
  1. Open a (longer) talk page in the new Vector 2022 with the floating TOC.
  2. Scroll down a bit (so the first few ==sections== aren't on screen). Look at which section heading is highlighted in bold.
  3. Use the Reply tool to post a comment in any visible part of the page (doesn't have to be the one shown in bold).
  4. Don't touch the mouse/trackpad yet.
  5. ✅ AC1: The first visible section should be bold in the TOC.

Screen Recording 2023-02-28 at 7.26.59 PM.mov.gif (1×1 px, 1 MB)

Looks good, resolving