Add ability to share features in URL param in local editing#808
Merged
Conversation
This file contains hidden or 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
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.
With local editing, the annotations are stored in the user's browser indexedDb. (The annotations can't be in the session, that would make the session too big very quickly.) Because they are not in the session, if you share a session at a particular location, the person you share it with won't see your Apollo track annotations, since they don't have them in their indexedDb.
This provides a way to encode one or more features in a URL parameter so when you open a link with that URL parameter, it automatically adds the feature to your indexedDb. If it detects the feature has already been loaded (e.g. the user has clicked on that link in the past), it gives the option to keep the new annotation, the old annotation, or both.
This motivation came up when trying to write more entries for the user guide. This way we can create links in the user guide that will take users to a session with the Apollo annotation already loaded and in the correct state. It makes following the user guide much simpler, since the user doesn't have to set anything up, they just click the link it's ready to go.
This could also be extended in the future to allow a "Share this feature" menu item in the UI.