Skip to content
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: Image block preserves alt text from media library #18919

Merged
merged 7 commits into from
Jun 23, 2022

Conversation

dcalhoun
Copy link
Member

@dcalhoun dcalhoun commented Jun 21, 2022

Fixes wordpress-mobile/gutenberg-mobile#4977. When the alt text for a media item is present in the media library, copy the alt text into the Image block when the media item is selected. The changes in this PR ensure the alt text value is exposed to the block editor.

To test: See steps outlined in WordPress/gutenberg#41839.

Regression Notes

  1. Potential unintended areas of impact
    Inserting various types of media may break.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manually tested inserting various media blocks within the editor.
  3. What automated tests I added (or what prevented me from doing so)
    None, majority of work and automated testing placed in Gutenberg.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@dcalhoun dcalhoun added Media Gutenberg Editing and display of Gutenberg blocks. labels Jun 21, 2022
@dcalhoun dcalhoun added this to the 20.2 milestone Jun 21, 2022
@dcalhoun dcalhoun self-assigned this Jun 21, 2022
@dcalhoun dcalhoun changed the title Fix/image block preserves alt text fix: Image block preserves alt text from media library Jun 21, 2022
When the alt text for a media item is present in the media library, that
value should be copied into the Image block when inserted. This behavior
avoids the need to re-enter the alt text for each image inserted into
the post content.
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 21, 2022

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18919-8eb9120 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 21, 2022

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18919-8eb9120 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@dcalhoun dcalhoun marked this pull request as ready for review June 21, 2022 19:23
@dcalhoun dcalhoun requested a review from derekblank June 21, 2022 23:36
Copy link
Contributor

@derekblank derekblank left a comment

Choose a reason for hiding this comment

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

I was able to successfully test using the native WPiOS app following these steps for Image w/ alt text, Video, and File blocks, and did not note any issues from the code. LGTM. 👍

@dcalhoun dcalhoun modified the milestones: 20.2, 20.3 Jun 22, 2022
@dcalhoun dcalhoun changed the base branch from trunk to gutenberg/after_1.79.0 June 23, 2022 18:02
@dcalhoun dcalhoun merged commit 029ed1d into gutenberg/after_1.79.0 Jun 23, 2022
@dcalhoun dcalhoun deleted the fix/image-block-preserves-alt-text branch June 23, 2022 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. Media [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Images Inserted From WP Media Library Do Not Contain Already Added Alt Text
3 participants