TL;DR: Fixes a bug in undo/redo that happens when you click a fill suggestion!
The builder doesn't explicitly keep track of grid state entry patterns (used by the autofill), but they are de facto updated/captured anywhere fromCells() is called, including in the undo stack. However, they are not captured when you click on a fill word. This means clicking on a fill word causes the undo stack to get out of sync with the grid state until the next time you enter a letter or do something else that calls fromCells().
Solution here is to explicitly define what on the grid state matters for undo/redo -- hopefully an allowlist kind of model will be safer (at the expense of a small amount of extra maintenance when adding new undo-able stuff to the grid state).
TL;DR: Fixes a bug in undo/redo that happens when you click a fill suggestion!
The builder doesn't explicitly keep track of grid state entry patterns (used by the autofill), but they are de facto updated/captured anywhere
fromCells()
is called, including in the undo stack. However, they are not captured when you click on a fill word. This means clicking on a fill word causes the undo stack to get out of sync with the grid state until the next time you enter a letter or do something else that callsfromCells()
.Solution here is to explicitly define what on the grid state matters for undo/redo -- hopefully an allowlist kind of model will be safer (at the expense of a small amount of extra maintenance when adding new undo-able stuff to the grid state).