To reproduce:
- Go to a board with the TOC.
- Click the 25th item
- Go to another page (e.g. by clicking topic history)
- Use the browser back button.
It will not take you back the topics you were previously looking at. @Quiddity reported infinite scroll was broken at that point, but @EBernhardson and I haven't been able to reproduce that.
This should be implemented by updating the url in the browser with replaceState while the user is scrolling. If a user comes back to the page the url should be read and the active topic should be jumped to.
See also T94623: Newly posted messages do not show when browser back button is used on Flow Board.