Image: Fix non-local image ID removal undo trap#77367
Conversation
|
Size Change: +41 B (0%) Total Size: 7.75 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in b72778d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24445878784
|
|
This is what I'm seeing. Very subtle! This branch Kapture.2026-04-15.at.20.29.36.mp4Trunk Kapture.2026-04-15.at.20.35.39.mp4 |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Makes me wish we had a selector to check the undo/redo stack. I couldn't for ages see the difference between this PR and trunk. I think because when uploading the image, the caption is selected straight away and that creates an undo layer? |
|
The bug is more visible if you open a saved post where this effect would apply. You select the image block -> effect kicks in -> undo level is created and can't be cleared. That's what I tried to showcase in my screencast.
Consumers shouldn't care about this. I think a good rule is to avoid using |
I was thinking of myself for debugging 😄 Thanks for the fix! |
|
Great catch, thanks for fixing this up! |
What?
This is a follow-up to #77178.
PR prevents "undo trap" for the Image block when attachment is missing from the site. Similar effects should mark attribute changes as non-persistent.
Testing Instructions
idattribute is removed.Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2026-04-15.at.12.53.57.mp4