Skip to content

Conversation

brush701
Copy link

This PR adds support for loading PGN files as well as a minimal test vault. Users can now use the pgn_file key in their Chesser yaml to load a game from a file. Comments are not displayed at this point, but the full history of a game is available.

@brush701
Copy link
Author

After a bit more user testing, there are a lot of conflicts possible between saving state in localStorage and setting the pgn key in the yaml. I'm proposing that we revert to the yaml as the source of truth, and added UI buttons to allow users to save the current game state to the yaml. This should achieve the same functionality (it does require the user to click save rather than auto-saving every move), but it's a breaking change for users and I imagine may be controversial. My experience so far is that the behavior is a lot more stable with this change.

@liamcain
Copy link
Collaborator

The main reason that the source of truth is in localStorage now instead of in the yaml is that in Live Preview, it's very easy to accidentally unload the board and lose the current board state. I like the manual save button idea, but it might still cause issues with de-syncing the chess game state from the chessboard.js state. It's been a while since I've touched the code, but I remember the issue bing that the undo/redo moves were losing state if you mutate the underlying codeblock while the board is rendered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants