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 #16

Open
fygure opened this issue Dec 18, 2023 · 1 comment
Open

Undo/redo #16

fygure opened this issue Dec 18, 2023 · 1 comment
Assignees
Labels
feature New feature or request major component Crucial component to the app priority work on this first refactor Something needs redoing

Comments

@fygure
Copy link
Owner

fygure commented Dec 18, 2023

For each action to shapes we want to keep track of what happens to them at the App component level

actions:

  • adding a shape
  • deleting a shape
  • dragging a shape (involves keeping track of x & y positions and getting them through onDragStart / onDragEnd events)

General idea: create an array state that and keep track of the current index (number of actions done so far), when a user wants to undo, take the penultimate index value and reload the shape based on the action, this is similar to redo except increasing the index.

@fygure fygure added feature New feature or request help wanted Extra attention is needed urgent Work on this first labels Dec 18, 2023
@fygure fygure self-assigned this Dec 18, 2023
@fygure fygure changed the title undo/redo for shapes Undo/redo for shapes Dec 18, 2023
@fygure fygure added the major component Crucial component to the app label Dec 18, 2023
@ChristopherOosthuizen ChristopherOosthuizen self-assigned this Dec 19, 2023
@fygure fygure removed urgent Work on this first help wanted Extra attention is needed labels Dec 22, 2023
@fygure fygure added the priority work on this first label Jan 4, 2024
@fygure fygure added the refactor Something needs redoing label Jan 30, 2024
@fygure
Copy link
Owner Author

fygure commented Jan 30, 2024

Another method is to create the undo/redo functionality similar to how the playbook is implemented

@fygure fygure changed the title Undo/redo for shapes Undo/redo Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request major component Crucial component to the app priority work on this first refactor Something needs redoing
Projects
None yet
Development

No branches or pull requests

3 participants