Prevent 'jumping out' and 'back in' when using notifications for the current topic

AI-generated summary

A discussion on improving notification navigation within a topic is underway. Matches proposes that when a user clicks on a notification for the current topic, the page should use a page anchor jump instead of a full page refresh. This would prevent the page from reloading and potentially losing the user’s place. sam agrees and notes that the in-page router should be smarter in handling this situation, although it may be complicated by posts being in memory but not in the DOM. codinghorror suggests that determining whether the user is already in the topic should be straightforward based on the URL, and sam plans to review the routing code. The discussion also touches on the potential impact of URL auto-change settings on this issue, with riking pointing out that checking the topic ID should be sufficient.

If I am reading a topic but haven’t reached a post yet, I will get a blue notification in the top right corner. If I click on this notification, and click on the ‘goto’ link, I see what looks like a page refresh and then it goes to the topic post (that is sometimes one post below the one I was reading)

Proposal: Check if I’m in the topic I’m about to jump to. If I am, cancel the page refresh style navigation and use a page anchor jump (or similar) instead to prevent the page from refreshing. (This process might need to address your page loads though, it might have to be topic + current page for the anchor)

3개의 좋아요

Yes we definitely want to get this fixed, our in page router should be much smarter here.

It does get a bit tricky cause sometimes posts are in memory but not in DOM.

This should be trivial to tell based on the URL though.

Yeah I am going to look through the routing code.

Even with url auto change disabled?

Uh, yeah… it just needs to check the topic ID. The auto-change is for the post number.