-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix extra undo/redo step when removing or replacing all blocks #54457
Fix extra undo/redo step when removing or replacing all blocks #54457
Conversation
Size Change: +20 B (0%) Total Size: 1.52 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, Nik!
Batching these actions makes sense to me and changes test well ✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one
Flaky tests detected in 8f3645e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6184502167
|
What?
By testing this issue I observed when we remove all blocks from a page there is an extra
undo/redo
step created. This is because after removing the last block we want to avoid a focus lossan we always add a default block in that case. The issue is fixed by batching these two dispatched actions.
Testing Instructions
undo/redo
step on trunk and not in this PRBefore
Screen.Recording.2023-09-14.at.11.07.43.AM.mov
After
Screen.Recording.2023-09-14.at.11.08.36.AM.mov