Using the back button on the browser doesn't take you to exactly where you were

Just noticed that after I inspected someone’s profile, I was returned to the forum proper and not to the “screen” where I was reading a post. Only slightly inconvenient, as I remembered the thread details, but when there is a lot of scrolling to get back to where you were, my mouse will start to complain.
Sums, sticking up for animals everywhere…
PS Is it a function of the website, or the browser? (ie11).

You’re using the full screen version on a computer, not the mobile version, right? If so, I guess that by “forum proper” you mean it resets the list on the left back to the top and clears the thread display on the right, correct? Not much that can be done about that, I’m afraid. But I’ll bear it in mind in case any ideas come to me one day…

Does this need to be quarantined? :wink:

No, it was just me. Just realised I’m being over-protective by trying to avoid criticisms being splashed around too much. Instead of seeing it as an opportunity to help develop our new site. Always try to make comments helpful by suggesting solutions where I can, but I’m no Kinetic…

Aran Jones: Does this need to be quarantined?

Gary Stokes: No, it was just me.

Et voila! Now everyone can read…

trying to avoid criticisms being splashed around too much

We see them as constructive suggestions…:slight_smile:

That’s what I realized…

@Kinetic: You can encode the current topic into the URL, so that back will work properly for that. Doing it for the left list seems slightly trickier, but I think the HTML5 History API stuff will fix that for you.

(Sorry, I’ve not been a web dev for over a decade now, so I don’t have anything more useful!)

Refresh also breaks things in a similar way, but I /think/ the fixes for history navigation would also address that.

In trying to find a reference for the history API, I found http://diveintohtml5.info/history.html, which seems to be pretty decent. I think that’ll do the needful.

That’s gold, Kev - diolch o galon i ti :seren:

@wondersheep: yeah, I guess this falls under the heading of “stuff that I’m fully aware is suboptimal, but unfortunately isn’t anywhere near the top of my to-do list yet”. At the moment, I don’t even have enough development time to fix the really pressing things that need doing on the forum, let alone the stuff that we could easily live without. So, although I agree 100% that the address bar and back button should do what the browser designers bloody well intended them to do, I’m afraid that circumstances are forcing me to be pragmatic about this and many other things - so as always, I’d like to respectfully ask y’all to be patient with me. :slight_smile:

For the record, topic info is encoded into URLs - behind the javascripty magic, the items on the left are real links which work if you open them in a new tab. It’s just that those URLs don’t (yet) make it into the address bar during normal usage. :slight_smile:

I have an interesting issue that I’ve noticed a few times.

When I open my computer and Firefox just opens on whatever pages were open when I closed it, I often get a page full of script instead of the forum. Refreshing the page sorts it out no problem.

I also get the same thing occasionally on the back button in the browser.

Once it’shappened once, and you know you can refresh your way out of it, it’s not a problem, so I don’t think it’s a pressing probelm, but the first time it happened I thought the site had fallen over.

@Kinetic
Needing to set priorities is understood :slight_smile:
Just supplying what is potentially useful info (I have no idea if you’d thought of using the History API or not), ready for when it bubbles to the top.

We’re appreciating your input a great deal, Kev - Ifan just wants to be clear that he’s not ignoring anyone, and he’s being kind enough to do it without shouting ‘It’s Aran’s fault! He won’t LET me!’ (which happens, er, to be the truth…;-)).

I had a couple of minutes spare, so had a look at this, and I /think/ that what’s needed at the most basic level is:

| if ($(event.target).data(‘updateright’)) {
|+ if (window.history && window.history.pushState) {
|+ window.history.pushState(null, null, $(event.target).attr(‘href’));
|+ }
|
| $(’#right_panel_update’).html(_this.spinner);

inside the
MessageInterface.prototype.setupEvents = function() {
block. It was somewhat difficult for me to test, because CORS stops my local version working against the live site, but (using #URLs as a placebo) it seems to do the right thing for me. It’d benefit from having the pop implemented as well, of course, but I think it’d take me too long to understand the forum’s code well enough to do that, and the above seems to do all that’s needed for back/refresh to work (unless I badly misunderstood something :)).

Diolch yn fawr Kev, thanks for taking the time to try and figure it out - legend! Lege

Yeah, I can see it being a bit tricky to figure out what’s going on in the JS - partly because it’s not hugely well structured, but also because by the time you see it on the live site, Rails has taken the original CoffeeScript, which is in all separate files with comments and stuff, and produced a monolithic, comment-free, auto-generated file that’s bound to be trickier to make sense of. If you do happen to be at all interested - and this is entirely up to you! - I’d be more than happy to have a chat with you about it at some point, and explain / show the original code. :slight_smile:

When I saw the monolith with jQuery and your code merged I was worried that it’d come from coffeescript - sorry that means the patch doesn’t directly apply. I’m happy to take a look at the coffeescript if you’d like me to supply a patch that does apply properly.

I’m somewhat concerned that if you do show me the code, there’s a significant chance I’ll want to start scratching some itches…

(Trying to cache enough of the site locally to be able to start to edit the JS, and then test the result without being able to access the live posts was an interesting challenge, and if that didn’t stop me…)

Iestyn wrote: page full of script instead of the forum

I’ve just added a one-line fix for that, but I have no idea if it’s really a fix - if you (or anyone else) sees that again, could you tell me please? Thanks! :slight_smile:

Kev: PM’d you :slight_smile: