downforacross / downforacross.com

Web frontend for downforacross.com -- continuation of stevenhao/crosswordsio
https://downforacrosscom.downforacross1.now.sh
MIT License
220 stars 92 forks source link

Feature Suggestion : Move Undos #326

Open Apllify opened 1 month ago

Apllify commented 1 month ago

There are quite a few situations where the ability to revert a letter deletion/replacement would be a nice addition.

In cases of accidental overwrites for example, it would be faster than rewriting the previous answer and could have the benefit of preserving the author attribution of the affected cells.

Implementation-wise, this could be done by keeping a stack of recent actions for each player storing a cell position and two cell states : the pre-action state and the post-action state. Whenever an undo is called, it would look for the most recent action whose post-action state matches the current state of that cell (to prevent undoing moves that aren't the player's) and set the cell state to the pre-action state.