Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Filter all of generated links to include the snapshot UUID if present in the request #47

Closed
westonruter opened this issue Jun 12, 2016 · 2 comments · Fixed by #70
Closed
Milestone

Comments

@westonruter
Copy link
Contributor

When viewing the frontend of the site, clicking around should preserve the snapshot state as much as possible.

See https://github.com/xwp/wordpress-develop/pull/61/files#diff-4fb8a477f559bdfad2c1e6db6d1c8b06R887

@westonruter
Copy link
Contributor Author

As part of this, we should remove all Admin Bar nodes that link the user into the admin. There could be an “Exit Preview” button that just strips out the UUID from the URL. Or whenever clicking an admin bar node that links you away from the preview, there could be a confirm prompt on click to alert them that they are leaving the snapshot preview. If they click cancel, then we could do event.preventDefault().

@westonruter
Copy link
Contributor Author

Additionally, we can make use of sessionStorage to capture whether or not the user was in a snapshot frontend preview. If they end up landing on a new URL but didn't explicitly exit the preview, and yet the sessionStorage says that a specific snapshot UUID is being previewed, then there can be a prompt to restore the snapshot state. This would be a failsafe to recover from JS directing a user somewhere when the links aren't filtered.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants