Skip to content

Conversation

@bencodeorg
Copy link
Contributor

@bencodeorg bencodeorg commented Dec 10, 2025

Adds version history to Sketch Lab. The approach here was to pass our handler that updates sources in SourcesContainer to the version history component as a prop. Ideally, we'd like to unify these approaches to managing sources at some point in the future.

image

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.

Copy link
Contributor

@molly-moen molly-moen left a 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}));
Copy link
Contributor

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?

Copy link
Contributor Author

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!

@bencodeorg bencodeorg marked this pull request as ready for review December 11, 2025 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants