Should URL change as you scroll?

A number of times, I’ve started reading a topic and then wanted to share it after I started reading it (either on the on the forums themselves or on social media). Only to remember that the URL I copied doesn’t take users to the top of the topic. Just wondering if others have experienced this.

Does it make sense that the URL bar changes? I would expect that the share icon under each post would be used if users explicitly want to link users to a specific reply.


If you are reading post #50 why should copying the URL take someone else to post #1?

In traditional old school forum software you would be on “page 3” or similar so copying the URL would take you to the top of that page, not the first post in the topic.


Good point.

:philosoraptor: Maybe can make URL will change only if user clic on the message. (?)

I mean same behavior when you push “J” or “K” from your keyboard

1 Like

@codinghorror are you really justifying behavior of discourse on standard practice from old school forum software :wink:

Even take this post for example, why would I want to take someone directly to SidV’s reply? The context of the content is lost.

From my perspective, it’s like reading an article on CNN, getting down to comments section when I realize I want to share the article I was reading. But instead of sending users to the top of the article, it would deep link a user straight to the comment I was reading when I decided to share.

I see the point about old school forum software, but I think it’s more a limitation of the old school forum software. The replies should have clear mechanisms (as they do) to grab the specific URL. I don’t think we should be changing URL behavior for content that is PART of a thread.

Would be curious to hear others’ perspectives.

I think this is a really false comparison as CNN is an editorially driven news site. On a discussion site, it would be like

I am reading the comments and I get to a really interesting comment I want to share

Fair that CNN is not the best comparison. Though for our community, typically a user would be lost without the first post. And there is a fair amount of news being shared.

I think the biggest question is what would a user expect to happen. Are there other sites that would mimic this behavior as a user scrolls? Would a user expect that the URL that they are copying or sharing from their mobile device be that of a reply? Or is this something that we as admins and expert users recognize and have deemed as useful.

And what would users who click on the link expect, who might not be familiar with the Discourse platform.

1 Like

Principle of least surprise – as a browser user I expect that the current URL is that of the page, not the part of the page I’m currently reading.

When I started using Discourse I frequently got caught out by this issue @charleswalter described. Now I know to trim off the comment number at the end of the URL when sharing a discussion. New users frequently don’t though.

Personally l think the URL in the browser should link to the beginning of the conversation. Sharing a link to an individual comment would still be possible using the link button.


I do that sometimes. More often I right-click copy-link-address on the topic title in the header.

1 Like

It’s better web practice to do it the way we do. If you follow a link, change your mind and click “Back”, you’ll be taken back to the last post you were looking at as opposed to the top topic.

1 Like

@erlend_sh i thought most browsers rememeber where you were for back button functionality. Again, I just tested on cnn, clicked on a related link at the bottom, and the back button took me right to where I was. This was on my iphone safari browser at least

1 Like

I assume what you’re talking about is the back-button bringing you back to a cached version of that HTML page. It doesn’t work the same way with JavaScript apps; they’re not cached the same way, and your position on a page isn’t as easily understandable by a browser. They need to be told exactly what is going on, and that’s what we’re doing when we update the URL.

Hopefully that’s somewhat understandable. @eviltrout is the expert on this.


Just want to add - what Discourse is doing is very clever, and certainly serves a purpose. I just think it’s such an unusual behaviour in relation to other websites that it produces unexpected (and usually unwanted) effects for the user.

Very insightful @erlend_sh @eviltrout. i never noticed the back button behavior in js apps and can understand it. Wasnt completely clear if the address bar needs to use replacestate in the history api.

I could get behind this, but perhaps we should reconsider a persistent topic action bar to encourage sharing the discussion. Also including buttons for replying to the topic, going to the category home, starting a new topic. This of course would be a whole other discussion…