-
Notifications
You must be signed in to change notification settings - Fork 35
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 create/remove entity, add/remove component #789
Conversation
…ame in delete confirm dialog
I asked Claude Sonnet 3.5 on the code base via Cursor IDE. PromptEvents are emitted with Events.emit that triggers an action that does a DOM change (that does createElements or setAttribute for eample) and other events are emitted with Events.emit to notify of a change. Do a thorough search of the code base to list them all to write a exhaustive documentation. For each event tell me if it's to create a change or to notify a change. If it's an action and is not currently handled via an undoable command, please tell me. I'm not interested in events emitted with sceneEl.emit or el.emit, only list those emitted with Events.emit.
AnswerI'll provide an exhaustive list of all Events.emit calls, categorizing them as either creating a change or notifying of a change. I'll also note if any action events are not currently handled via an undoable command.
This list covers all the Events.emit calls in the codebase. Many of the events that create changes (like entityselect, inspectortoggle, and various modal openings) are not currently handled via undoable commands. Implementing undoable commands for these actions could improve the editor's undo/redo functionality and overall user experience. |
Probably The purpose may not be accurate, it depends of the point of view, it can be considered an action that changes the React ui or select box in viewport (entityselect, objectselect). |
…moveComponentCommand to ComponentRemoveCommand
…mand similar to EntityUpdateCommand
… updateEntity from entityupdate command to lib/entity.js
Wow this is a lot of refactoring! I took some time to look at all the changes Here are some things I'm noticing
things to test:
bugs found;
other comments:
|
I implemented the undo for the duplicate action (d shortcut). |
For the next things, I created: |
No that was a bug in my implementation, fixed by 0ca98b3 |
… be sure we include only properties we set explicitely if we undo and then redo
75492d0
to
3e512c4
Compare
Some notes: |
I also tested the implementation in my project. I didn't find any other issue. |
@vincentfretin thanks for all this work. Regarding nanoid, I think it's great to have autoid on our entities. I think the only issue with this is sometimes a user will be surprised to see a random ID or wish to change it. Therefore in a future ticket we could allow the end-user to more easily change |
The user shouldn't see the random id anywhere, if you still see it somewhere let me know it's an issue. |
did final testing, all looks good to me feedback
|
Yes that's correct, you said you wanted something simple for the drag and drop. ;) |
This closes #704
Lots of refactoring here.
Although I manually tested all that, please do some tests on your own to be sure I didn't break anything and all is working correctly.