-
Notifications
You must be signed in to change notification settings - Fork 523
Sketch Lab: support version history #69984
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
base: staging-next
Are you sure you want to change the base?
Conversation
molly-moen
left a comment
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.
Seems reasonable, one comment!
| if (onRestore) onRestore(startSources); | ||
| } else if (isLatest) { | ||
| dispatch(resetToCurrentVersion()); | ||
| if (onRestore) dispatch(resetToCurrentVersion({onRestore})); |
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.
should onRestore be required here to call resetToCurrentVersion? As-is will this cause broken behavior in Web Lab 2/Python lab?
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.
Yes guessing it will, thanks for the callout. Think I was just trying to avoid TS errors. I will tidy and request review!
Adds version history to Sketch Lab. The approach here was to pass our handler that updates sources in
SourcesContainerto the version history component as a prop. Ideally, we'd like to unify these approaches to managing sources at some point in the future.Links
Testing story
Tested manually that I could view/restore intermediate versions, the initial version (with "start over" warning modal), and go back to the current version. Also tested that viewing a version made the canvas readonly and that changes were not saved if the page was reloaded after viewing (but not restoring) an old version.
Follow-up work
There's a UI to created named versions with a description, which relies on setting a bit of Redux state (
hasEdited) that Sketch Lab doesn't support yet. To simplify things, I'll do that as a follow-up.