upnotes-io / react-todo

A generic todo list componet for react. This is being used in an electron based app: https://upnotes.io
8 stars 41 forks source link

Add undo/redo support across items add and removal #38

Closed kamalkishor1991 closed 9 months ago

kamalkishor1991 commented 1 year ago

Ctr/cmd + z and ctr/cmd + y should work accross multiple items while undo and redo. Please refer to google keep behavier of undo and redo for checkboxes.

AnasMansy commented 1 year ago

i want to work on this issue Inkedredo is this what i should do ?

kamalkishor1991 commented 1 year ago

@AnasMansy yes. You can also put buttons for it along with support for shortcuts. Assigning it to you.

AnasMansy commented 1 year ago

@kamalkishor1991 is this the expected ?

redo1

bhujoshi commented 1 year ago

Hi @AnasMansy, This UI is distracting for user. For now, just implement undo/redo using shortcuts.

AnasMansy commented 1 year ago

@kamalkishor1991 @bhujoshi i need help can you help me to know a way to implement undo redo

kamalkishor1991 commented 1 year ago

@AnasMansy You can use undo and redo as a state and append into state once new item is added/removed and remove from state if undo is triggered. For simplicity you can only implement undo first. You can also refer to this question for reference https://stackoverflow.com/questions/64963955/implementing-undo-redo-function-in-react

kamalkishor1991 commented 1 year ago

@AnasMansy can you please create a pull request with your changes?

AnasMansy commented 1 year ago

@kamalkishor1991 sure sorry about that

shahanahmed86 commented 11 months ago

@kamalkishor1991 I've created a pull request which has the implementation of the required feature that is "ctrl+z" or "ctrl+y". demo

shahanahmed86 commented 9 months ago

@kamalkishor1991 This feature has already been done on the pull request, right?

kamalkishor1991 commented 9 months ago

yes @shahanahmed86 Thanks for reminding. Closing this issue now.