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

Prevent "Undo Level" after Setting Featured Image via Image Block #15072

Closed

Conversation

SiobhyB
Copy link
Contributor

@SiobhyB SiobhyB commented Jul 26, 2021

This PR is intended as a temporary workaround for WordPress/gutenberg#32937

gutenberg: WordPress/gutenberg#33057
gutenberg-mobile: wordpress-mobile/gutenberg-mobile#3682

Description

As outlined in WordPress/gutenberg#32937, the undo/redo functionality doesn't work as expected after setting a featured image via the image block.

After setting a featured image via the block and then tapping undo, it appears as though the action has successfully reverted, as the Featured banner is removed from the block. However, the image still remains as the post's featured image.

With this PR, the issue is worked around by preventing an "undo level" from being created after a featured image is set via the image block. Tapping undo or redo immediately after setting a featured image via the image block should no longer have any effect.

See the Gutenberg PR for further details.

Testing

To test: Please refer to the Gutenberg PR as the most central, up-to-date place for testing instructions.

Regression Notes

  1. Potential unintended areas of impact

As we're changing the default behaviour of the undo/redo functionality, there's some possibility for unintended side effects to that functionality.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

I relied on manual testing to confirm that the undo/redo functionality worked as expected.

  1. What automated tests I added (or what prevented me from doing so)

The changes are relatively small and don't warrant automated tests.


PR submission checklist:

  • I have completed the Regression Notes.
  • 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.

The new sentence added here will serve to notify users of the undo/redo limitations after setting an image as featured via the image block.
@SiobhyB SiobhyB added [Type] Bug Gutenberg Editing and display of Gutenberg blocks. gutenberg-mobile labels Jul 26, 2021
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jul 26, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jul 26, 2021

You can test the changes on this Pull Request by downloading the APKs:

Siobhan added 4 commits July 26, 2021 17:19
With this commit, the text from "string.notice_undo_limitations" is added, via concatenation, to the existing text for the notice that displays when a image is set as featured via the image block.
The aim of this commit is to make the text associated with each showNotice() function more readable, by moving each piece to its own individual variable.
The goal is to make it clearer to users that this text is "secondary" in its importance and can be skimmed.
@SiobhyB SiobhyB self-assigned this Jul 27, 2021
@SiobhyB SiobhyB marked this pull request as ready for review July 27, 2021 11:23
@SiobhyB SiobhyB requested a review from fluiddot July 27, 2021 11:27
Siobhan and others added 11 commits July 30, 2021 18:21
With this commit, we're removing the changes that were made to the notice's text in the previous commit. This follows the discussion found in the commnts of the related PR: WordPress/gutenberg#33057 (comment)
…' of github.com:wordpress-mobile/WordPress-Android into gutenberg/32937-featured-button-undo-redo-functionality
…' of github.com:wordpress-mobile/WordPress-Android into gutenberg/32937-featured-button-undo-redo-functionality
@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR is not assigned to a milestone.

Generated by 🚫 dangerJS

@fluiddot
Copy link
Contributor

fluiddot commented Aug 9, 2021

@SiobhyB I see that this PR only bumps the Gutenberg Mobile reference, which will be already done when cutting a new Gutenberg Mobile release so probably it won't be necessary to merge it. Please let me know if you still would like to have this reviewed and merged into WPAndroid.

@SiobhyB
Copy link
Contributor Author

SiobhyB commented Aug 9, 2021

@fluiddot, you're right, no need to review and merge this one! It was originally created when the plan was to add text to the "notice" but is no longer needed. I'll go ahead to close. :)

@SiobhyB SiobhyB closed this Aug 9, 2021
@fluiddot fluiddot deleted the gutenberg/32937-featured-button-undo-redo-functionality branch August 9, 2021 13:26
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. [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants