Revert caption handling changes to maintain consistent image block behavior#73914
Conversation
Co-authored-by: cbravobernal <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Size Change: -26 B (0%) Total Size: 2.54 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 6ab6762. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20132840427
|
talldan
left a comment
There was a problem hiding this comment.
LGTM! It's nice to be able to simplify some of this code 🎉
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Copilot. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
f8c924d
into
fix/remove-caption-block-edit
…#73552) * Remove caption as comment requires * Make image caption the source of truth for overrides * Revert caption handling changes to maintain consistent image block behavior (#73914) * Initial plan * Revert caption handling to preserve existing behavior Unlinked contributors: Copilot. Co-authored-by: cbravobernal <[email protected]> Co-authored-by: talldan <[email protected]> Co-authored-by: ockham <[email protected]>
What?
Reverts changes from #73552 that modified caption handling when replacing images.
Why?
The conditional
isCaptionBoundlogic introduced different behavior for bound vs unbound captions, breaking the image block's existing pattern of preserving user-entered captions when replacing images.How?
Removed the conditional logic that treated bound and unbound captions differently. The image block now consistently omits empty media library captions to preserve existing user-entered captions, regardless of binding state.
Before (introduced in #73552):
After (restored original behavior):
Testing Instructions
Testing Instructions for Keyboard
Same as above using keyboard navigation to select and replace the image.
Screenshots or screencast
N/A - behavior restoration, no UI changes
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.