Page MenuHomePhabricator

TOC headline at top of screen sometimes isn't updated
Closed, ResolvedPublic

Description

This needs to always update, including when rendering a new topic from a TOC click.

I haven't figured out the reproduction steps yet.

Event Timeline

Mattflaschen-WMF raised the priority of this task from to Medium.
Mattflaschen-WMF updated the task description. (Show Details)
Mattflaschen-WMF changed Security from none to None.

I'm seeing the board.orderedTopicIds array get out of order, not sure yet if its due to similar logic to topic inserts or if the topic inserts are keying off the orderedTopicIds.

I'm going try getting orderedTopicIds array to consistently be in the correct order, and then replacing all of the code for choosing where to insert with one path(it has four right now) based off the orderedTopicIds and looking for an existing dom element closest to the topic being inserted in that list.

i should clarify, it looks like due to orderedTopicIds getting out of order the toc early-exits its search(finding an item lower than what we are looking for). This early exit occurs before we find the visible topic, so no toc update is performed. A quick patch could just remove the early exit and look for the closest position in the entire array. I think a better complete solution though is as I mentioned above.