-
Notifications
You must be signed in to change notification settings - Fork 1
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
Store selection state in URL hash #95
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andy-sweet
changed the title
[WIP] Store selection state in URL hash
Store selection state in URL hash
Jun 5, 2024
andy-sweet
commented
Jun 5, 2024
andy-sweet
commented
Jun 5, 2024
This was referenced Jun 5, 2024
aganders3
approved these changes
Jun 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and works in my manual testing, with no blocking bugs. I think we're on the same page about refactoring, etc. so I am happy to see this merged to move us toward feature-complete.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #49
Closes #62 (by making it no longer relevant)
This stores selection state in the URL hash. In order to make this work, we need some state that reflects the selected points/cells/tracks independent of
PointCanvas.curTime
because the ordering of the React effects when re-hydrating from the entire state can be different compared to when the user is interacting with the application.Previously, the canvas stored the last selected point indices, which is transient state that depends on
PointCanvas.curTime
. Here we stored the all the point IDs that were selected by the user (inspired from #93). Alternatively, we considered storing the track IDs that were selected in #91 , but that doesn't work as well with the rest of the application logic.This PR also updates the URL hash to store some simpler state that not been added like point brightness. It also refactors that code a little to make it easier to keep new state in sync. Though there is still a lot of duplication that could be improved.
It does not fix #30 , which is related, but can be solved independently.