The discussion addresses a bug where the Table of Contents (TOC) is missing after using the browser’s back button to return to a topic. Users Moin, Canapin, and Lilly report inconsistent behavior, with the TOC failing to display under certain conditions, such as when navigating via the back button or when moving from a topic with a TOC to one without. David confirms that a fix has been merged into Discourse core and will be live on Meta within an hour. The issue appears to depend on scroll position and navigation method. Moin later notes that the problem is resolved, and David attributes the fix to a recent DiscoTOC overhaul by a wesomerobot.
In another discourse forum, I observed the exact opposite. I visited a topic with toc from a pn and upon returning, I suddenly found myself back next to the 30th personal message, but with an empty toc instead of the navigation. Since that forum doesn’t use the most recent version I tried here but I was unable to replicate this issue. So maybe that is already fixed.
I just merged a fix into Discourse core which should resolve this issue. It should be live on Meta within an hour.
The bug depends on your scroll position in both the source and destination topic, so that might explain why it feels inconsistent to reproduce. If you were scrolled to the first post on both the source and destination topic, then the DiscoTOC display logic would be broken.
Nice catch. I’ve been using the TOC quite a bit lately with a couple of longer documents in particular and haven’t seen that behavior, but I was just able to reproduce it now based on what @Moin and @david said.
But now I can reproduce the other bug.
When you navigate from a topic with a toc to one without the navigation does not appear.
It works the same. The only difference is, that you don’t use the back button of the browser.
In mobile mode you can see the toc is the issue