Why does the URL change as I scroll through a topic?



  • I noticed another annoyance with Discourse: I almost always follow forums through the e-mails they send out, and only click the link to go to the topic when I find something interesting to comment on. When I do that, I often scroll around to read the neighbouring messages before actually replying.
    On other forums, when I want to get back to the message where I re-entered the thread, I just need to click the address bar and press Enter (or click the Back button a few times if I wandered to other pages), but this obviously doesn't work with Discourse, because it keeps changing the URL (what is the point of this anyway? If I want to link to a particular message, there are better ways of getting the link).



  • My address bar isn't changing. It used to, but it hasn't for at least a day.


  • 🚽 Regular

    @ender said:

    (what is the point of this anyway? If I want to link to a particular message, there are better ways of getting the link).

    My best guess was to be back button friendly (although this would still be a complete WTF since it would literally step me back through the page I'm currently scrolling in) ...however, it looks like hitting the back button actually takes you to the last page, as expected ...so I have no fricken clue why this is except to make the address bar change in such a subtle way that it catches my peripheral vision as I'm scrolling and making me keep glancing up to the top of my screen.

    I know I haven't submitted a formal bug report here, mainly because by the time I got here most people have already submitted the ones I've noticed so far, but man, I've never been fan of most forum software, but this has to be, ALMOST the worst I've never encountered. I still consider it better than a "forum" I visited in 2000 or so which consisted of a blob of posts without any reply or quote functionality so most of the posts were just written without any context as to what it was referring to. This at least doesn't have that problem. But that's not saying much.


  • Banned

    @The_Quiet_One said:

    so I have no fricken clue why this is except to make the address bar change in such a subtle way that it catches my peripheral vision as I'm scrolling and making me keep glancing up to the top of my screen.

    Try clicking on a link to an external site, e.g. http://www.nambla.org/ then click the back button. A little clearer why the URL changes now?

    (Also helps when copying and pasting links, as the URL reflects your actual current position, not an arbitrary top.)



  • @The_Quiet_One said:

    My best guess was to be back button friendly

    It doesn't affect the back button.
    @codinghorror said:

    A little clearer why the URL changes now?
    ...no? Unless you mean that instead of my Back button taking me back to the exact place I was in the page (the way it works on every other site on the Internet), it instead takes me an arbitrary amount above where I started (which makes even less sense).


  • Banned

    @ender said:

    Unless you mean that instead of my Back button taking me back to the exact place I was in the page (the way it works on every other site on the Internet), it instead takes me an arbitrary amount above where I started (which makes even less sense).

    Yet again, this is due to @riking's patch to Discourse, which posits that it is better to show the target post in the top quadrant of the browser rather than the absolute top.

    You know @riking I'd love for you to pop in here and defend this feature you added, since I end up explaining it to people over and over..


  • 🚽 Regular

    @ender said:

    It doesn't affect the back button.

    Did you quote me out of context just so you could say that, or do you have trouble reading past a few words in everyone's posts?

    @codinghorror said:

    Try clicking on a link to an external site, e.g. http://www.nambla.org/ then click the back button. A little clearer why the URL changes now?

    Yes, it's another reason I hate this infinite scrolling bullcrap. Because infinite scrolling breaks the default behavior of bringing you back to a page with the scroll position saved which works on every browser, you have to hack it so when you return to the last page it takes you back to that place. This is all fine and dandy, but because I think infinite scrolling on a forum thread is a horrible UI decision, your defense for something like this is moot.

    As I said before, changes to an address bar while doing stuff like scrolling or typing is distracting. Because it's often happening right in the border of my peripheral vision I find myself glancing up and the address bar as it happens. Because the change is so subtle, I don't even notice it until I'm actually looking at it.

    Plus, you're making a URL based on the index of the reply within a topic. Which means if a prior post or posts are removed from the thread, then the entire index shifts, resulting in that link going to an entirely different reply.


  • Discourse touched me in a no-no place

    @The_Quiet_One said:

    Because it's often happening right in the border of my peripheral vision

    Glasses are good for something after all! I can hide the varying address bar while reading the content. Good job…



  • @dkf said:

    Glasses are good for something after all!

    Uh, your glasses must be really tiny.
    The entire monitor in front of my face fits inside the frame of my glasses, and I'm usually closer up than most people.


  • Discourse touched me in a no-no place

    @dhromed said:

    Uh, your glasses must be really tiny.

    Well, they are fairly small. Having nice glasses is one of the few things that I permit myself to be vain with.
    @dhromed said:
    The entire monitor in front of my face fits inside the frame of my glasses, and I'm usually closer up than most people.

    I can sit like that, but unless I'm playing a game I tend to sit so that the very top of the screen (with the menu bar and so on) is slightly excluded from easy vision. I want the part where I'm actually working to sit naturally for my foveæ. 👓


  • Discourse touched me in a no-no place

    No, because it opens in a new tab and the Back button doesn't do anything....

    This URL changing has no impact on the Back or Forward buttons, it just fills the history in Chrome. It should really be turned off IMO, or at least the option provided so users can turn it off if they wish to.


  • Banned

    @loopback0 said:

    This URL changing has no impact on the Back or Forward buttons

    It does, but its subtle, if you go to post#1, navigate down all the way to #300 then leave the site by following an external link. We have no way of taking you back to #300, you will go to an arbitrary spot on page #1.

    Personally, I agree this should be a setting (at least for the subset of users that make use of the browser history function), but getting the setting right is tricky, you must replaceState just prior to navigating away, or replace it with a # bookmark scheme. Also @codinghorror is not a fan of making this a site setting.



  • @codinghorror said:

    (Also helps when copying and pasting links, as the URL reflects your actual current position, not an arbitrary top.)

    Usually when I send a forum link to a friend, I want to link them to the thread itself, not to some arbitrary offset. Having to scroll all the way to the top or manually edit the URL just to do this is a bit odd.



  • @sam said:

    Personally, I agree this should be a setting (at least for the subset of users that make use of the browser history function),

    What subset? I would think 99% of people on [b]these[/b] forums use browser history, either from the actual history list (which I do at least once a week) or from the URL bar (since most browsers now implement history based URL prediction).

    Most forums list 20 or 30 posts per page. This system produces 20 or 30 times the number of history entries, for no real reason.


  • Banned

    @Daniel15 said:

    Usually when I send a forum link to a friend, I want to link them to the thread itself, not to some arbitrary offset. Having to scroll all the way to the top or manually edit the URL just to do this is a bit odd.

    If you are on page 5 of a traditionally paginated forum topic, your URL is going to read

    example.com/forum/topic?page=5

    So if you copy and paste the URL in your address bar you'd be linking them to an arbitrary offset, but one that doesn't tell them where in that "page" you wanted them to read, right?

    So what do you do?

    (Note that here you can click the topic title at any time to scroll to top, or right click the topic title to copy a link to the topic itself. There are also two permalinks on every post, the link icon and the post time in the upper right.)

    @tin said:

    from the URL bar

    In that case, which is typical, you'd just get standard autocomplete. The increase in history entries won't matter. It only matters if you actively browse history.



  • @codinghorror said:

    you'd just get standard autocomplete.

    Yes, and instead of listing thread pages I've seen, I get the last thread I've seen repeated 10 times.

    EG if I type in "forums.stea", I get a forum section I type in regularly, the hostname only, the forum index (because Steam forums have the real forums under a subdir despite the hostname), and 2 threads I have looked at a lot.
    If I type "what.the", I get the hostname only, and this thread and another repeated over and over. Obviously in both cases I can scroll for more, but the pattern follows.


  • Banned

    Guess it depends on the browser, you are using Safari? I use Chrome, Firefox (a little), IE11, and default iOS and android browsers regularly and see no oddities with autocomplete and Discourse. Here is a screenshot of typing "what.the" in the address bar autocomplete of the what I am on now, the iPad Air

    Looks fine to me.



  • And where you you suppose it built that "top hit" result from? I'd guess from the number of history entries.

    The whole history thing might be fine to you, but a few of us are quite annoyed by it. If it's not the intended behavior, it needs to be fixed. If it is, then whoever intended it to work like that is a dickhead.

    Edit: And no, I'm not using Safari. I already said what I'm using.



  • @codinghorror said:

    you'd just get standard autocomplete. The increase in history entries won't matter

    HAHAHAHAHA

    HAHAHAHA

    tears jaw muscle

    HAHHARGHGGNNN


  • Discourse touched me in a no-no place

    @codinghorror said:

    So if you copy and paste the URL in your address bar you'd be linking them to an arbitrary offset, but one that doesn't tell them where in that "page" you wanted them to read, right?

    So what do you do?


    Most forums have the facility to link to a specific post, and they don't need to screw with the URL or the history to do it. Even Discourse.

    @codinghorror said:

    (Note that here you can click the topic title at any time to scroll to top, or right click the topic title to copy a link to the topic itself. There are also two permalinks on every post, the link icon and the post time in the upper right.)

    Exactly - so why do you need to mess with the URL or history?


  • Banned

    This post is deleted!


  • Interesting difference: on mobile Safari this renders my history completely useless.
    On Safari OS X it's just a spammy list beneath the other open tabs. Anyway, it's easier to fix.
    Now I wonder what I have to block to prevent this bug.



  • Well, you need to file a bug with the browser vendor and tell them that replaceState should replace the history entry, not make a new one.

    pushState is for navigation, replaceState is for same-page state changes.


  • Banned

    It is actually more subtle than that, you need to submit a request to all vendors (firefox,chrome,opera,ie) to create a new variant of replaceState that allow you to bypass history checkpoints. For some apps current behavior is desirable, other's not.



  • In what case would having something show up in history but not on the back button be helpful?


  • Trolleybus Mechanic

    @ben_lubar said:

    In what case would having something show up in history but not on the back button be helpful?

    If you're a spammer or a malware producer. Poison someone's history with crap sites. They'll probably never notice even if they hit back. But now their address bar is poisoned and almost anything they type can be hijacked.


  • Banned

    I am pretty sure there is a same site origin policy in place (for both replaceState and pushState), you can't spam history with sites except the one you are on.



  • Well, spam is spam, isn't it?
    Seriously, how do I turn this 'feature' off without breaking the rest?
    I've got Disconnect (Safari) and GlimmerBlocker (all browsers) at hand on OS X.

    @sam said:

    [You] Sites can't spam history [with sites] except the one you are on.

    Fixed it for you.


  • Banned

    Ok, but how is this any different than the "poisoning" of URL history with visiting thousands of web pages with different titles?

    How many results did you expect there to be for "confidence"? And wouldn't most people simply use the address bar for 1) domain name full or partial matches or 2) web search terms? I just think it's a really weird and unusual use case to expect to navigate in the address bar via random keyword matches on web page <title> tags...

    I guess I'd be more open to this complaint if we heard more of it, but outside this forum, there is virtual silence on this issue across the dozens of Discourse instances (and even meta.discourse) that I monitor, for nearly a year and a half. This is not a new design element, was present in the very first public release of Discourse in Feb 2013.



  • @sam said:

    I am pretty sure there is a same site origin policy in place (for both replaceState and pushState), you can't spam history with sites except the one you are on.

    @codinghorror said:

    Ok, but how is this any different than the "poisoning" of URL history with visiting thousands of web pages with different titles?

    Interesting that you (two or three) assume everybody's fine with your brand of 'spamming' (your words) the more or less useful, more or less used info in someone's browser history.
    I'd guess Kant wouldn't be too happy about that, and Adams neither (since external means are necessary to regulate your exploitation).


  • Discourse touched me in a no-no place

    @codinghorror said:

    Ok, but how is this any different than the "poisoning" of URL history with visiting thousands of web pages with different titles?

    Different pages with different titles is one entry per page. This can be a couple of hundred entries per thread/page if you visit one of the larger threads. It's completely unnecessary.



  • @codinghorror said:

    I just think it's a really weird and unusual use case to expect to navigate in the address bar via random keyword matches on web page <title> tags...

    It's how Firefox works. It's how I get back to a page a lot of the time.



  • @codinghorror said:

    How many results did you expect there to be for "confidence"? And wouldn't most people simply use the address bar for 1) domain name full or partial matches or 2) web search terms? I just think it's a really weird and unusual use case to expect to navigate in the address bar via random keyword matches on web page &lt;title&gt; tags...

    Note that the topic title is also part of the URL. Do you think it's a really weird and unusual use case to expect to navigate in the address bar via random keyword matches on web page addresses?

    IMHO you should change the URL only when necessary (e.g., onbeforeunload) and not when scrolling.


  • Discourse touched me in a no-no place

    @fatbull said:

    Note that the topic title is also part of the URL.

    It's largely ignored when actually interpreting the URI if it's followed by the topic number.

    http://what.thedailywtf.com/t/why-does-the-url-change-as-i-scroll-through-a-topic will bring you back here
    http://what.thedailywtf.com/t/why-does-the-url-change-as-i-scroll-through-a-topic/532 will bring you back here
    http://what.thedailywtf.com/t/why-does-the-url-change-as-i-scroll-through-a-topic/531 won't.



  • Additionally,

    http://what.thedailywtf.com/t/why-does-the-url-change-as-i-scroll-through-a-topiX will 404

    And the first one won't bring you back if it's renamed.


  • BINNED

    @PJH said:

    http://what.thedailywtf.com/t/why-does-the-url-change-as-i-scroll-through-a-topic will bring you back here

    Wait... so, ok, I thought they are doing a URL rewrite that ignores the topic title and it's only used for prettyfication. But it turns out it actually gets parsed, so you don't need the topic ID after all. But if it's there it will use it, ignoring the title. But...

    What new spawn of madness have you unleashed here Discourse?


    Filed under: I understand the reasoning, but it could be confusing as all hell



  • @Onyx said:

    Wait... so, ok, I thought they are doing a URL rewrite that ignores the topic title and it's only used for prettyfication. But it turns out it actually gets parsed, so you don't need the topic ID after all. But if it's there it will use it, ignoring the title. But...

    I wonder what happens when two topics have the same title...



  • "Title has already been used"

    Well what did I expect.



  • New plan:

    1. preemptively create as many topics as possible with common words and phrases, in an attempt to squat on valuable posting real estate
    2. sell desirable topics to new front page users looking to increase their like/post ratio
    3. reinvest proceeds to purchase derivatives on like/post ratios of other, more respected forum members
    4. cycle until able to purchase discourse.org
    5. hire offshore developers to implement pagination

    Filed under: The bidding on "what's the deal with airline food?" starts at $5


  • Discourse-squatting?



  • @codinghorror said:

    If you are on page 5 of a traditionally paginated forum topic, your URL is going to read

    example.com/forum/topic?page=5

    Not necessarily, as that depends on the architecture of the site. There are various ways of implementing paging, some of which don't involve adding query string arguments to the URL. Now, that would admittedly be a very transparent way of showing the user which page they are on, and allowing them to directly navigate to a page using the URL, but it isn't the only way to implement paging.


  • Considered Harmful

    @abarker said:

    Not necessarily, as that depends on the architecture of the site. There are various ways of implementing paging, some of which don't involve adding query string arguments to the URL. Now, that would admittedly be a very transparent way of showing the user which page they are on, and allowing them to directly navigate to a page using the URL, but it isn't the only way to implement paging.

    I prefer example.com/forum/topic/5, which is fairly trivial to support.



  • @error said:

    I prefer example.com/forum/topic/5, which is fairly trivial to support.

    That would also be my preference, but my point was that there are paging methodologies which don't even require using the URL to indicate the page. The downside is that those schemes are more opaque to the end user, and make it harder to directly navigate to a given page. The second part isn't necessarily bad, because you don't need to worry about the client asking for a non-existent page.

    Anyway, I was really trying to disprove @codinghorror's argument that with you will have the page in the URL. What I should really have argued is: So what? On a topic with 20 post to a page, and 5 pages, you're talking 5 history entries, versus 100 from Discourse. In other words: Discourse is insanely spammy. You can try and justify it by comparing it to other forums, but you'd be wrong.



  • @dhromed said:

    It's how Firefox works. It's how I get back to a page a lot of the time.

    In all fairness, I must also present this screenshiot.


  • Considered Harmful

    @dhromed said:

    In all fairness, I must also present this screenshiot.

    So CS adds one history entry for every fifty Discourse adds?


    Filed under: Screenshiot



  • @dhromed said:

    In all fairness, I must also present this screenshiot.

    See my earlier comment:

    @abarker said:

    On a topic with 20 post to a page, and 5 pages, you're talking 5 history entries [in CS], versus 100 from Discourse. In other words: Discourse is insanely spammy. You can try and justify it by comparing it to other forums, but you'd be wrong.



  • I'm glad that Chrome's history page has a search box. Otherwise, I'd never be able to find pages from more than 24h ago.



  • I'll just leave this here:

    // ==UserScript==
    // @name       Break Discourse History spamming
    // @version    0.1
    // @include    http://what.thedailywtf.com/*
    // @match      http://what.thedailywtf.com/*
    // ==/UserScript==
    function breakDiscourseHistorySpamming() { window.history.replaceState = function() { return false; }; }
    var dscBreak = window.setTimeout(breakDiscourseHistorySpamming, 0);
    

    Only tested with TamperMonkey and Chrome (since I can't install Firefox add-ons at work and don't use Firefox at home), but it doesn't appear to break any other functionality of Discourse (besides the history spamming, of course).


    Filed under: [Don't disable pushState though, that breaks Discourse](#tag)

  • Banned

    note, this hack means the back button will not work properly when you navigate away from a topic



  • @sam said:

    note, this hack means the back button will not work properly when you navigate away from a topic

    small price to pay...


Log in to reply