New Feature: Forward and Backward Arrows

Forward and Backward arrows is the next most popular request from UserVoice, so I’m considering doing that next.

One thing I’m unsure about is this scenario:

  1. Make 5 moves: A, B, C, D, and E.
  2. Hit Back 2 times, and you’re back at C.
  3. Make a move (different than D)

At this point, I would expect that the forward button would become disabled and that E would be lost, as history would have essentially diverged.

Does this behavior seem reasonable?

Also, any thoughts on placement of the forward/backward arrows? Perhaps next to the calculate button?

Forward and backward buttons have been added to the right of the calculate next move button. Let me know what you think!

I ran into a couple subtleties while implementing this:

First, as mentioned above, if you hit back a few times and make a different move, the moves which were “backed out of” are lost. I don’t see any other way around this using forward and backward buttons.

Second, while active color and castling options are saved and restored when navigating the board history, changing these options do not add to the board history; they’re simply recorded in the current position. This took a little bit of experimentation to get it to feel right. I’m still not convinced it’s the best solution, so please let me know if it feels off.