online-go / online-go.com

Source code for the Online-Go.com web interface
https://online-go.com/
GNU Affero General Public License v3.0
1.27k stars 345 forks source link

When refreshing the game list, it forgets the current page number #313

Open viridium opened 7 years ago

viridium commented 7 years ago

Can the page number be remembered through page refreshes (and implicitly through browser navigation events)?

anoek commented 7 years ago

I think this would produce some annoying behaviors, I think that if you manually refresh (which there should be no reason to do generally speaking), then it'd be nice to keep your page, whenever you are navigating there I think you generally want to start on page 1 as the lists update a lot. (Ie, if you went and played a game, went back to the watch page, it'd be weird to start on page 5)

viridium commented 7 years ago

What if I hit the Back button because the game I just opened is not to my liking? Should I have to manually go back to page 5 to continue looking for games to watch?

anoek commented 7 years ago

Fair enough, and encoding this on the url would mitigate what i was thinking.. or not thinking as the case may be.

anoek commented 2 years ago

This issue has been marked stale and will be closed soon without further activity. To keep the issue open, please respond to the comment to keep the discussion going.

viridium commented 2 years ago

Mnnnooooooooooooo!

benjaminpjones commented 2 years ago

Linking similar issue #1398

pt8o commented 3 months ago

I've personally wanted something like this and also thought we could just push the page and page_size into the URL params, so I started investigating. What could get messy is that there are a lot of parameters that get sent in the request for the list of games. Do we want those all encoded in the URL? It could get cluttered.

In addition to page (number) and page_size, there's also alt_player (opponent id), height and width (board size), ranked, annulled, ordering, source (not sure what this one is), and ended__isnull.

If we put all of these in the URL params then that adds a whole lot of clutter to the URL, which might not be so bad nowadays (happens a lot in online shopping for example).

On the other hand if we exclude some of these from the URL params then we could get into situations where the user's browser history doesn't reflect their app state. For example a user clicks through to the 3rd page of their unfiltered games, and then filters only ranked=true games. But then if they press back in the browser, they'll end up on the 3rd page of ranked=true games, because the table filters are saved in the settings. So they state they ended "back" at is different from the state they actually were at in real life. :thinking:

I'm inclined to just put all of the query params into the URL and let the URL get super long but I'm curious what you think @anoek

viridium commented 3 months ago

user experience > URL hygiene

On Tue, Aug 13, 2024, 12:41 AM Lucas Huang @.***> wrote:

I've personally wanted something like this and also thought we could just push the page and page_size into the URL params, so I started investigating. What could get messy is that there are a lot of parameters that get sent in the request for the list of games. Do we want those all encoded in the URL? It could get cluttered.

In addition to page (number) and page_size, there's also alt_player (opponent id), height and width (board size), ranked, annulled, ordering, source (not sure what this one is), and ended__isnull.

If we put all of these in the URL params then that adds a whole lot of clutter to the URL, which might not be so bad nowadays (happens a lot in online shopping for example).

On the other hand if we exclude some of these from the URL params then we could get into situations where the user's browser history doesn't reflect their app state. For example a user clicks through to the 3rd page of their unfiltered games, and then filters only ranked=true games. But then if they press back in the browser, they'll end up on the 3rd page of ranked=true games, because the table filters are saved in the settings. So they state they ended "back" at is different from the state they actually were at in real life. 🤔

I'm inclined to just put all of the query params into the URL and let the URL get super long but I'm curious what you think @anoek https://github.com/anoek

— Reply to this email directly, view it on GitHub https://github.com/online-go/online-go.com/issues/313#issuecomment-2285327714, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHGJ2PHDEUKUI32ALLTBEDZRGFAHAVCNFSM6AAAAABMNNH4ESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBVGMZDONZRGQ . You are receiving this because you authored the thread.Message ID: @.***>