Skip to content

#3463618: Include component props form in undo

When !178 (merged) gets merged, we will already have most of what we need for this feature: the component form gets properly re-rendered.

By setting the key prop to the component's ID in !178 (merged) we tell React not to re-render the form unless another component is selected. This was necessary to avoid re-rendering the form while the user is interacting with a field, which would interrupt the user by dropping the focus from the form. Now we need to extend the key to account for prop changes coming from undo/redo. @jessebaker had the creative idea to append how many times undo/redo was hit — basically changing the key any time undo/redo is used. Iterating on this, I added a Redux middleware that generates a unique ID for each undo/redo action that is dispatched, and also stores this unique ID in the Redux store.

xb-component-prop-undo.gif

Merge request reports

Loading