Closed lithops-zty closed 3 weeks ago
User should type in undo
and press <Enter>
to execute UndoCommand
. Assumption for the first 2 section is that we only implement undo. The 3rd section explains how we implement redo, after implementing undo
undo
is run, we can pop the top of the stack. (Assumption here is that we are only planning to implement undo.)This is not explicitly discussed yet, but I think we should go with option 1 since it is a universal method which is easier to implement.
stateList[stateList.length - 2]
stateList
(in backend), and cannot simply pop the "stack" (in the frontend).stateList
, then decrement when undo and increment when redo.stateList
, then we will delete everything from index+1
all the way to the end of the stateList
, before we add the new state that this modifying command producesundo
, we might go back too far in history and the pointer goes beyond the viewport of the command history windowOther points of discussion:
@weiseng18 Thanks for the detailed description on this part! I think implementing both undo/redo should be feasible because such implemented as been given in AB4 Developer Guide. If you haven't read through this, I think maybe we can discuss on the feasibility of fully adapting this approach, or any adjustments to be made to match our own product requirements. Regard rest of the things, since I am the one doing undo/redo feature, I will seek advice from @lithops-zty as well, thank you
UI:
Backend: