acristescu / OnlineGo

Repo for the OnlineGo Android app.
https://play.google.com/store/apps/details?id=io.zenandroid.onlinego
GNU General Public License v3.0
207 stars 53 forks source link

Rework Tsumego section to remove the PuzzleSetFragment #174

Closed acristescu closed 3 months ago

acristescu commented 11 months ago

Rationale

  1. The Puzzle Set Fragment creates an extra step (and an extra thing to click) for the user before they can start doing what they want to do: solve puzzles.
  2. The screen also requires us to fetch the solutions one-by-one which spawns a lot of requests. We are gracefully allowed to use server resources as long as we keep the usage reasonable. We need to keep the number of requests to the server to the minimum, and even if we only do a request for the things on the screen and we somehow circumvent the throttling protection this is still not nice on our behalf.
  3. The Website can get around using this screen by relying on the starting_puzzle property of each collection to navigate the user to the first unsolved puzzle in the collection. We should emulate the behaviour.

Proposal

We need to modify the directory screen to look at the starting_puzzle property when the user clicks on a collection and navigate the user to the appropriate Tsumego screen. We should then remove the PuzzleSetFragment and related classes altogether. Potential caveat: we might need to refresh the data of the clicked collection with a single call to fetch it. It would be great if we could get away without it, but if not, that's not a biggie.

acristescu commented 11 months ago

@bqv can you please have a look at this and let me know if you have any thoughts on this and if you're interested in having a look at this? It's not a problem if you don't I can find the time to do it... eventually.

bqv commented 11 months ago

I actually just had the idea of removing that view, and instead having some form jump navigation in the tsumego screen (which doesn't render the board I suppose, to keep the API usage light). That would be an idle compromise after implementing your above? I just want to avoid limiting the user to "next"/"prev" navigation and the implicit jump to "first unsolved". I think I'll look into this though, sure

acristescu commented 11 months ago

Sure, the website also has this as you might notice. On the website it's powered by the https://online-go.com/api/v1/puzzles/2627/collection_summary call which is a lightweight call providing just the id and name of the puzzles in the collection. But we can do it even without that, as unlike the website we have the local database!

I suggest that to be a step 2 thing though. Removing the extra screen would be a intermediary step that could make the whole thing releasable (although I'd probably tinker with the UI a bit before actually sending this out).

acristescu commented 10 months ago

@bqv So is this issue something you'd be interested in working on or shall I add it to my backlog?

bqv commented 10 months ago

Sorry, I did make a start on it, I just got drawn away yesterday by circumstance. I'm still on it :)

acristescu commented 10 months ago

No rush, just wanted to know what I should be looking at. I'll have a go at the UI of the Directory screen.