Skip to content

Format Library: Improve inline image replacement workflow #70598

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

Merged

Conversation

Sukhendu2002
Copy link
Contributor

@Sukhendu2002 Sukhendu2002 commented Jul 3, 2025

What?

Closes: #25909

This PR improves the user experience when working with inline images by addressing issue #25909, where users couldn't easily replace an existing inline image.

Changes:

  1. Dynamic Button Label: Changes the toolbar button title to "Replace image" when an inline image is selected.
  2. Image Preselection: Preselects the current image in the media library when replacing an inline image, providing better context for users.

Testing Instructions

  1. Open the block editor and create a new post
  2. Add a paragraph block and type some text
  3. Place your cursor in the paragraph and open the format dropdown (+ icon)
  4. Select "Inline image" from the dropdown menu
  5. Upload or select an image from the media library
  6. After the image is inserted, click on it to select it
  7. Verify that the toolbar button now shows "Replace image" instead of "Inline image"
  8. Click the "Replace image" button
  9. Verify that the media library opens with the current image already selected/highlighted
  10. Select a different image and confirm it replaces the existing inline image

Screenshots or screencast

Screen.Recording.2025-07-03.at.1.49.30.PM.mov

@Sukhendu2002 Sukhendu2002 marked this pull request as ready for review July 3, 2025 09:34
@Sukhendu2002 Sukhendu2002 requested a review from ellatrix as a code owner July 3, 2025 09:34
Copy link

github-actions bot commented Jul 3, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Sukhendu2002 <sukhendu2002@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: melchoyce <melchoyce@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Package] Format library /packages/format-library labels Jul 3, 2025
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Sukhendu2002!

@Mamaduka Mamaduka merged commit 9769b62 into WordPress:trunk Jul 3, 2025
60 of 61 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.2 milestone Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Format library /packages/format-library [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inline Images: Can't replace image
2 participants