IDE-321 Feat: Finalize multi-step undo/redo system#5180
IDE-321 Feat: Finalize multi-step undo/redo system#5180harshsomankar123-tech wants to merge 23 commits intoCatrobat:developfrom
Conversation
9a7eb0c to
bc828ac
Compare
There was a problem hiding this comment.
Pull request overview
Implements a project-scoped multi-step undo/redo mechanism by introducing a dedicated snapshot/history manager, wiring it into ScriptFragment/SpriteActivity, and updating UI/tests to reflect the new enabled/disabled behavior.
Changes:
- Added
ProjectUndoManagerto manage per-project snapshot stacks (undo/redo) and variable snapshots. - Updated
ScriptFragmentandSpriteActivityto drive undo/redo via the new manager and keep menu items visible but disabled when unavailable. - Added/updated unit + UI tests and ensured undo history is cleared on project delete/rename.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectUndoManager.java | New undo/redo snapshot manager with disk-backed snapshots, TTL cleanup, and clear helpers. |
| catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ScriptFragment.java | Integrates multi-step undo/redo, adds async-guard, and refreshes UI after project reload. |
| catroid/src/main/java/org/catrobat/catroid/ui/SpriteActivity.java | Adds lazy ProjectUndoManager, introduces redo menu handling, and updates menu enable/visibility logic. |
| catroid/src/main/res/menu/menu_script_activity.xml | Adds redo action and defaults undo/redo to disabled + hidden until prepared. |
| catroid/src/main/java/org/catrobat/catroid/common/Constants.java | Adds UNDO_DIRECTORY_NAME constant for snapshot storage. |
| catroid/src/main/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectListFragment.kt | Clears undo history when deleting/renaming projects from the list. |
| catroid/src/main/java/org/catrobat/catroid/ui/fragment/ProjectOptionsFragment.kt | Clears undo history on project rename/delete via project options. |
| catroid/src/androidTest/java/org/catrobat/catroid/uiespresso/ui/fragment/UndoTest.java | Updates existing undo assertions and adds multi-step + rapid-click coverage. |
| catroid/src/test/java/org/catrobat/catroid/ui/recyclerview/fragment/ProjectUndoManagerTest.java | Adds unit tests for stack limiting/history clearing (currently has issues). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ames and robust restoration.
211bbe7 to
fcd3cfa
Compare
|



Jira Ticket: https://catrobat.atlassian.net/browse/IDE-321
Description
Implements a robust project-scoped multi-step undo/redo system. This PR focuses exclusively on the core reliability of the undo/redo chain, state persistence, and UI synchronization.
Key Fixes & Features:
code.xmlsnapshots by ensuring project saves before every undo/redo push.isUndoRedoInProgressguard to prevent overlapping async project loads during rapid clicking.findFragmentByTag→findFragmentById) so the script view correctly updates after every operation.sceneNameandspriteNameare correctly stored in all history entries.Screen Recording
Screen.Recording.2026-03-31.at.06.33.02.mov
Checklist for this pull request
Please review the contributing guidelines and wiki pages of this repository.