anglaro
(anglaro)
December 13, 2024, 1:02pm
1
Most programming ides have undo and redo buttons on drag and drop as well as on code. I think it will be really convenient if kodular had undo and redo buttons instead of pressing ctrl+z on my keyboard because new developers can sometimes make mistakes and there must be an easy way to undo a certain action.
Diego
(Diego Barreiro Pérez)
February 8, 2026, 8:16pm
2
We are adding support for this in the next version:
master ← barreeeiroo:undo-redo
opened 07:58PM - 08 Feb 26 UTC
General items:
- [ ] I have updated the relevant documentation files under do… cs/
- [x] My code follows the:
- [x] [Google Java style guide](https://google.github.io/styleguide/javaguide.html) (for .java files)
- [ ] [Google JavaScript style guide](https://google.github.io/styleguide/jsguide.html) (for .js files)
- [x] `ant tests` passes on my machine
If your code changes how something works on the device (i.e., it affects the companion):
- [ ] I branched from `ucr`
- [ ] My pull request has `ucr` as the base
Further, if you've changed the blocks language or another user-facing designer/blocks API (added a SimpleProperty, etc.):
- [ ] I have updated the corresponding version number in appinventor/components/src/.../common/YaVersion.java
- [ ] I have updated the corresponding upgrader in appinventor/appengine/src/.../client/youngandroid/YoungAndroidFormUpgrader.java (components only)
- [ ] I have updated the corresponding entries in appinventor/blocklyeditor/src/versioning.js
For all other changes:
- [x] I branched from `master`
- [x] My pull request has `master` as the base
What does this PR accomplish?
*Description*
Adds Undo/Redo functionality to the Designer. It implements a diff-based stack, rather than full screen snapshots.
## Functionality Details
* Stacks are limited to 100 edits backwards ("undo") and 50 edits forwards ("redo").
* Stacks are per-screen: switching screens maintains the old stack. So, navigating back to the previous screen allows to "restore" the history.
* When a component is deleted either by Ctrl+Z or Delete button directly, this is propagated to blocks editor to delete all those blocks. Blocks editor now has that in their own Undo stack, so it's possible to restore as well there (see the last demo video). As of now, restoring a component from Undo/Redo Designer doesn't restore the blocks, but I think this is the intended behaviour to make the Designer be able to "create" blocks automatically...
* There's a small bug/feature: in the Table Arrangement, there are 3 actions happening when a component is moved: move component, and x2 set property in the arrangement. These 2 correspond go the row/columns. In the demo, you'll notice that I need to Ctrl+Z 3 times to actually undo that action.
## Demo Recordings
### Classic Theme Demo
https://github.com/user-attachments/assets/cbcb5950-51e9-409f-be13-bcbe42bc758c
### New Theme Demo
https://github.com/user-attachments/assets/10a312ae-a6ca-4ec7-bf0e-eb2e18836d92
### Layouts Demo
https://github.com/user-attachments/assets/139f8159-1911-4d91-ab32-8c70a93061eb
### Components' Blocks Destroy/Restore Demo
https://github.com/user-attachments/assets/252a33e6-7c3c-41f2-be34-491ff1d9eef2
7 Likes
this feature would be helpfull