artasparks / glift

Go Lightweight Frontend
MIT License
115 stars 33 forks source link

When using problem-explanation for problems, maintain context #167

Open sartak opened 7 years ago

sartak commented 7 years ago

When I'm midway through a problem but can't figure out the next move, my only recourse is to use the problem-explanation (question mark in a circle) button and then replay the problem up to where I was. The fast-forward button seems to work well only for very linear problems - any branches cause it to stop there.

Instead of resetting to the beginning, it would be way more valuable to maintain the position in the tree, and allow the user to use the arrow buttons to navigate back to the beginning if required.

artasparks commented 7 years ago

That's a good idea! So, if I understand correctly, the idea is to propagate the current problem position in the answer-viewer.

sartak commented 7 years ago

Exactly. 😄

dfannius commented 7 years ago

I tried writing code to do this, but it became annoying to keep re-initializing the position whenever I switched back and forth, plus setting the initial position didn't seem to do what I wanted (it seemed to create a new root rather than just navigating to the desired node).

What I ended up doing was just changing the problem-explanation widget to, instead of switching to the game viewer, just toggle the display of good and bad variations just as the game viewer does. This is the behavior I originally wanted anyway (it's what Guo Juan's website does, which is what I am used to). My implementation was a bit of a hack (it seemed that I had to update both the sgfOptions and the controller), but maybe there is a more elegant way to accomplish the same thing.