osks / jskom

jskom is a web based LysKOM client, written in Javascript. It uses httpkom for communication with the LysKOM server.
https://jskom.osd.se/
MIT License
10 stars 3 forks source link

Update URL when changing text #13

Closed dentarg closed 12 years ago

dentarg commented 12 years ago

After choosing a conference to read you end up at an URL like https://jskom.lysator.liu.se/conferences/9621/unread. You continue to read texts by clicking on links to other texts and soon your deep in some thread. You are reading a reply to a text, and in the middle you feel the need to read the original text again and you hit the back button in your browser... you shouldn't have done that, because now you are back at https://jskom.lysator.liu.se/.

I can see that texts have their own URLs so let's use them.

(I know that if I enter the URL to a text, say https://jskom.lysator.liu.se/texts/19691223, and then starts clicking links to other text, the URL is updated correctly.)

osks commented 12 years ago

I tried doing it that way at first (in the backbone.js based version), but that messes up the reload button instead. Like this: If the URL changes for each text you read, a reload at say /texts/12345678 would mean that we lose the "reading mode" and just show text 12345678. I found that more annoying than not being able to use forward/back for that scenario. It would also mean that you can't really use the back button for going back to the "unread conferences" page.

An alternative and improvement would perhaps be to add buttons - and keybindings - for the back/forward scenario. (There is the 'p' and 'n' bindings now, but they're not that good yet.)

(LysKOM isn't state-less, so it will never be perfect in all cases. There are also technical problems with implementing the changing URL solution in AngularJS.)

dentarg commented 12 years ago

Is reload really more common than back?

Also I didn't notice any difference between "reading mode" and just a text.

osks commented 12 years ago

I didn't say it was more common.

"Reading mode" reads unread texts in a conference. It only shows texts that are unread and marks them as read. There is a button for "Next unread text" (which has the common "space" key bound to it).

osks commented 12 years ago

This has been implemented by using URLs like /conferences/14506/unread?text=12345678. Both history and reload works.