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

Use URL-encoded storage #5

Open
erikhuizinga opened this issue Nov 27, 2022 · 1 comment
Open

Use URL-encoded storage #5

erikhuizinga opened this issue Nov 27, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@erikhuizinga
Copy link
Owner

Currently the browser's local storage is used as storage. This is not portable and not flexible. Investigate and implement using the URL as a data source, instead, or additionally.

  • I don't want to implement storage on some server, so I want to keep it on the client side.
  • As a user I expect Ranstax to be in the state that I left when I open Ranstax again, so that I can continue where I left off.
    • This implies that the user navigating to the root app URL without any URL-encoded data should lead the app to loading the expected state from somewhere. E.g. local storage could be used for that.
    • Loading this local state updates the URL-encoded state.
  • Since URLs can be used outside of Ranstax (e.g. as bookmarks, or be shared online (they should be)), they should be versioned and Ranstax should be able to migrate them forward.
    • Note that the URL encoding model / version is separate from the data that it encodes, as that might be versioned too.

This should also play nice with the browser's history: https://developer.mozilla.org/en-US/docs/Web/API/History_API. The expected and intended behaviour when the user navigates back/forward should be clear and accessible.

Some thoughts, not the definitive proposal, and not sure if possible with the history API:

  • When the user interacts with Ranstax in a way that mutates the URL-encoded state, the URL is updated, but the browser history is not.
  • When a user navigates back, they go back to the previous page before loading Ranstax. They don't load the previous Ranstax state.
  • Forward: they go to the latest state in Ranstax, either loaded from the URL or from local storage.
@erikhuizinga erikhuizinga added the enhancement New feature or request label Nov 27, 2022
@erikhuizinga erikhuizinga self-assigned this Nov 27, 2022
@erikhuizinga
Copy link
Owner Author

User comment on BGG that gives feedback that also touches this subject: https://boardgamegeek.com/thread/2973974/article/41531047#41531047

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

1 participant