-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Is your feature request related to a problem? Please describe.
The Editor uses react-ace to provide undo/redo functionality at the character insertion/deletion level, but the undo actions stack is flushed when focus moves away from the AceEditor instance in a card. This makes it difficult to add undo/redo actions to buttons in the header section of a card (i.e. those sections are outside of the focus area of the AceEditor instance), and certainly doesn't allow undo/redo at the Stack level. This also makes it difficult to work with multiple cards and violates expected behavior for an editable window.
Describe the solution you'd like
Following from the Using Redux Undo suggestions in the Redux documentation, we can implement undo/redo functionality at the Redux reducer level using the redux-undo module. redux-undo is a reducer enhancer (higher-order reducer) that provides an undoable function, which takes an existing reducer and a configuration object and enhances your existing reducer with undo functionality.
Describe alternatives you've considered
Continuing to use the undo/redo functionality in react-ace, but capturing and storing the changes in Redux so that other components can read and update the undo actions stack for particular cards. This might become unwieldy given that there might be race-conditions when multiple cards attempt to read/write to the same undo actions stack.