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

Track selection state in shareable URL #49

Closed
andy-sweet opened this issue Mar 12, 2024 · 0 comments · Fixed by #95
Closed

Track selection state in shareable URL #49

andy-sweet opened this issue Mar 12, 2024 · 0 comments · Fixed by #95
Assignees
Labels
enhancement New feature or request

Comments

@andy-sweet
Copy link
Collaborator

In #44 we added the ability to share and ingest URLs that contain some of the viewer state.

Selection state was not included as part of that PR because it's a little complicated to begin, may be in flux with #42 , and also has timing/ordering complications.

The goal of this issue to add selection state to that tracked by the shareable URL.

@andy-sweet andy-sweet added the enhancement New feature or request label Mar 12, 2024
@andy-sweet andy-sweet self-assigned this Mar 13, 2024
andy-sweet added a commit that referenced this issue Jun 6, 2024
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.
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
1 participant