Skip to content
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

Undo/Redo actions in Synectic editors using redux-undo #1006

Open
nelsonni opened this issue Nov 10, 2022 · 0 comments
Open

Undo/Redo actions in Synectic editors using redux-undo #1006

nelsonni opened this issue Nov 10, 2022 · 0 comments
Assignees
Labels
feature Feature requests or improvements

Comments

@nelsonni
Copy link
Member

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.

@nelsonni nelsonni added the feature Feature requests or improvements label Nov 10, 2022
@nelsonni nelsonni self-assigned this Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests or improvements
Projects
None yet
Development

No branches or pull requests

1 participant