Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Persisting the state in the markdown itself #16

Open
MohamedBassem opened this issue Nov 1, 2022 · 2 comments
Open

[Proposal] Persisting the state in the markdown itself #16

MohamedBassem opened this issue Nov 1, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@MohamedBassem
Copy link

MohamedBassem commented Nov 1, 2022

Hi, I noticed that the state is currently being persisted in local storage. I found this a bit confusing specially because my moves don't get synced to my other devices. So I'm wondering, have you considered persisting the state in the markdown block itself?

Basically, everytime the user does a move, update the markdown block with the new PGN/FEN. I've implemented this in my fork (https://github.com/MohamedBassem/Chesser) and I'm happy to send a pull request if you think that this is a better approach than using local storage.

Here's a video with the feature in action

Chesser.mov
@MohamedBassem MohamedBassem added the enhancement New feature or request label Nov 1, 2022
@Bencbabcock
Copy link

This is awesome! how would I go about adding this to my vault?

@liamcain
Copy link
Collaborator

liamcain commented Nov 9, 2022

I had originally implemented the state saving feature by persisting to the markdown itself, but afaik, it requires rebuilding the game state each time. This ran into some issues with the chessboard not properly handling undo/redo, some issues with the arrow shapes not being serialized correctly, and some other issues that I can't recall right now. I had some future plans to just switch to adding a "save" button that would dump the localStorage data to the markdown manually, but I never got around to adding that feature.

I'm open to accepting a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants