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

[Gutenberg] Disable editor Jetpack-powered features based on Jetpack Features Removal phases #19691

Merged
merged 6 commits into from
Dec 30, 2022

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Nov 30, 2022

To test

The following features in the editor will be disabled when reaching the phase of disabling Jetpack-powered features:

  • Disable Jetpack blocks
    • Remove Jetpack blocks from the block picker
    • Display Jetpack blocks as unsupported
  • Disable @-mentions and X-posts features
  • Remove Editor’s help support
  • Remove Reusable blocks
  • Disable Unsupported Block Editor (UBE)

1 - Editor Jetpack-powered features ENABLED in WordPress app

Preparation

  1. Navigate to App Settings in the WordPress app and open Debug settings.
  2. Turn Jetpack Features Removal Phase Four and Jetpack Features Removal Phase For New Users flags off.

Check Jetpack blocks

  1. Create a post.
  2. Tap on ➕ Add Blocks button.
  3. Scroll down the block list.
  4. Observe that the Jetpack blocks are present within the Jetpack powered section section and can be added to the post.
  5. Add all Jetpack blocks (Contact Info, Story, Layout Grid blocks).
  6. Observe that all Jetpack blocks are displayed and can be edited.
  7. Save the post with some Jetpack blocks (this post will be used in other test cases).

Check @-mentions and X-posts features

  1. Add a Paragraph block.
  2. Type the + character and observe that the x-post sheet is displayed.
    NOTE: x-post feature only works in sites with the O2 plugin enabled like P2-based sites. In order to test this, please use a P2-based site.
  3. Type the @ character and observe that the @-mentions sheet is displayed.
  4. Observe that in the toolbar the @ format button is displayed.

Check the help's support section

  1. Open a post.
  2. Tap on the three dots button to open the contextual menu.
  3. Observe that there's the option Help & Support that references Support, tap on it.
  4. Observe that the section Get support is present.

Check Reusable blocks

  1. Create a reusable block in the web version of the editor (instructions here).
  2. Create a post in the app.
  3. Tap on ➕ Add Blocks button.
  4. Observe that in the bottom sheet the "Reusable" tab is shown.
  5. Tap on the "Reusable" tab and insert a Reusable block.
  6. Observe that the block is displayed.
  7. Save the post with at least one Reusable block (this post will be used in other test cases).

Check Unsupported Block Editor (UBE)

  1. Create a post in the web version of the editor.
  2. Add a block that is not supported in the native version like the Table block.
  3. Save the post (this post will be used in other test cases).
  4. Open the same post in the app.
  5. Observe that the block is displayed as unsupported.
  6. Tap on the block and try to edit it with UBE.
  7. Observe that it can be edited with UBE.

2 - Editor Jetpack-powered features DISABLED in WordPress app

Preparation

  1. Navigate to App Settings in the WordPress app and open Debug settings.
  2. Turn Jetpack Features Removal Phase Four flag on.

NOTE: It's recommended that the following test cases are also checked by turning the Jetpack Features Removal Phase For New Users flag on and Jetpack Features Removal Phase Four flag off in Debug settings.

Check Jetpack blocks

  1. Open the previous post saved with Jetpack blocks.
  2. Observe that the Jetpack blocks are displayed as unsupported.
  3. Tap on a Jetpack block and observe that a bottom sheet is displayed indicating that the block is not supported.
  4. Tap on ➕ Add Blocks button.
  5. Scroll down the block list.
  6. Observe that the Jetpack blocks are NOT present.

Check @-mentions and X-posts features

  1. Add a Paragraph block.
  2. Type the + character and observe that the x-post sheet is NOT displayed.
    NOTE: x-post feature only works in sites with the O2 plugin enabled like P2-based sites. In order to test this, please use a P2-based site.
  3. Type the @ character and observe that the @-mentions sheet is NOT displayed.
  4. Observe that in the toolbar the @ format button is NOT displayed.

Check the help's support section

  1. Open a post.
  2. Tap on the three dots button to open the contextual menu.
  3. Observe that there's the option Help but doesn't reference Support, tap on it.
  4. Observe that the section Get support is NOT present.

Check Reusable blocks

  1. Open the previous post saved with Reusable blocks.
  2. Observe that the Reusable block is displayed as unsupported.
  3. Tap on the block and observe that a bottom sheet is displayed indicating that the block is not supported.
  4. Tap on ➕ Add Blocks button.
  5. Observe that in the bottom sheet the "Reusable" tab is NOT shown.

Check Unsupported Block Editor (UBE)

  1. Open the previous post saved with unsupported blocks.
  2. Observe that the block is displayed as unsupported.
  3. Tap on the block and observe that it can't be edited with UBE.

3- Editor Jetpack-powered features ENABLED in Jetpack app

  1. Navigate to App Settings in the Jetpack app and open Debug settings.
  2. Turn Jetpack Features Removal Phase Four flag on. This flag should be omitted by the Jetpack app.
  3. Repeat the same test cases described in "1 - Editor Jetpack-powered features ENABLED in WordPress app":
    • Check Jetpack blocks
    • Check @-mentions and X-posts features
    • Check the help's support section
    • Check Reusable blocks
    • Check Unsupported Block Editor (UBE)

Regression Notes

  1. Potential unintended areas of impact
    Only the editor should be affected.

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    N/A

  3. What automated tests I added (or what prevented me from doing so)
    N/A

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.

@fluiddot fluiddot added the Gutenberg Editing and display of Gutenberg blocks. label Nov 30, 2022
@fluiddot fluiddot added this to the 21.5 milestone Nov 30, 2022
@fluiddot fluiddot self-assigned this Nov 30, 2022
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 7, 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 pr19691-2788fa5 on your iPhone

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

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 7, 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 pr19691-2788fa5 on your iPhone

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

@fluiddot fluiddot force-pushed the gutenberg/disable-jp-editor-features branch from e47c3d8 to e6479b8 Compare December 12, 2022 15:54
@fluiddot fluiddot marked this pull request as ready for review December 12, 2022 15:54
@fluiddot fluiddot force-pushed the gutenberg/disable-jp-editor-features branch from e6479b8 to 677e26c Compare December 12, 2022 16:22
@derekblank
Copy link
Contributor

Nice work @fluiddot. I've added my testing experiences -- they are all green, with the exception of the "Get Support" section appearing in the WordPress app when Jetpack-powered features are disabled. I'm curious if this matches your testing experiences.

1 - Editor Jetpack-powered features ENABLED in WordPress app:

  1. Create a post. 🟢
  2. Tap on ➕ Add Blocks button. 🟢
  3. Scroll down the block list. 🟢
  4. Observe that the Jetpack blocks are present within the Jetpack powered section section and can be added to the post. 🟢
  5. Add some Jetpack blocks. 🟢
  6. Add a Paragraph block. 🟢
  7. Type the + character and observe that the x-post sheet is displayed. 🟢
  8. Type the @ character and observe that the @-mentions sheet is displayed. 🟢
  9. Observe that in the toolbar the @ format button is displayed. 🟢
  10. Tap on the three dots button to open the contextual menu. 🟢
  11. Observe that there's the option Help & Support that references Support, tap on it. 🟢
  12. Observe that the section Get support is present. 🟢
  13. Save the post with some Jetpack blocks and close the editor. 🟢

2 - Editor Jetpack-powered features DISABLED in WordPress app:

  1. Navigate to App Settings and open Debug settings. 🟢
  2. Turn Jetpack Features Removal Phase Four flag on. 🟢
  3. Open the previous post saved with Jetpack blocks. 🟢
  4. Observe that the Jetpack blocks are displayed as unsupported. 🟢
  5. Tap on ➕ Add Blocks button. 🟢
  6. Scroll down the block list. 🟢
  7. Observe that the Jetpack blocks are NOT present. 🟢
  8. Add a Paragraph block. 🟢
  9. Type the + character and observe that the x-post sheet is NOT displayed. 🟢
  10. Type the @ character and observe that the @-mentions sheet is NOT displayed. 🟢
  11. Observe that in the toolbar the @ format button is NOT displayed. 🟢
  12. Tap on the three dots button to open the contextual menu. 🟢
  13. Observe that there's the option Help but doesn't reference Support, tap on it. 🟢
  14. Observe that the section Get support is NOT present. 🔴

3- Editor Jetpack-powered features ENABLED in Jetpack app:

  1. Navigate to App Settings and open Debug settings. 🟢
  2. Turn Jetpack Features Removal Phase Four flag on. This flag should be omitted by the Jetpack app. 🟢
  3. Create a post. 🟢
  4. Tap on ➕ Add Blocks button. 🟢
  5. Scroll down the block list. 🟢
  6. Observe that the Jetpack blocks are present within the Jetpack powered section section and can be added to the post. ⚪ (I observe separate Jetpack blocks in a section list marked "Reusable", is this correct?)
  7. Add a Paragraph block. 🟢
  8. Type the + character and observe that the x-post sheet is displayed. 🟢
  9. Type the @ character and observe that the @-mentions sheet is displayed. 🟢
  10. Observe that in the toolbar the @ format button is displayed. 🟢
  11. Tap on the three dots button to open the contextual menu.
  12. Observe that there's the option Help & Support that references Support, tap on it. 🟢
  13. Observe that the section Get support is present. 🟢

@fluiddot
Copy link
Contributor Author

Thank you @derekblank for testing the changes 🙇 ! I went through the testing instructions again to check the steps that failed for you:

2 - Editor Jetpack-powered features DISABLED in WordPress app:

  1. Observe that the section Get support is NOT present. 🔴

Good catch! It also failed when I tested the installable builds, however, succeeds when testing locally. This made me realize that I completely forgot to update the bundle in the Gutenberg Mobile PR 🤦, which basically means that the Gutenberg changes aren't included in the build. I'll generate a new RN bundle and create new installable builds.

2 - Editor Jetpack-powered features DISABLED in WordPress app:

Observe that the Jetpack blocks are displayed as unsupported. 🟢

It's interesting that this step succeeded in your case. Following the above comment, due to the fact that the RN bundle wasn't updated, the Jetpack blocks shouldn't have been displayed as unsupported since this was a new change 🤔.

@fluiddot
Copy link
Contributor Author

I'll generate a new RN bundle and create new installable builds.

Bundle updated in e461d84. @derekblank let me know if could perform another review once the installable builds are generated, thanks!

@@ -1191,6 +1191,30 @@ extension GutenbergViewController: GutenbergBridgeDataSource {
func gutenbergCapabilities() -> [Capabilities: Bool] {
let isFreeWPCom = post.blog.isHostedAtWPcom && !post.blog.hasPaidPlan
let isWPComSite = post.blog.isHostedAtWPcom || post.blog.isAtomic()

// Disable Jetpack-powered editor features in WordPress app based on Features Removal coordination
if JetpackFeaturesRemovalCoordinator.generalPhase() == .four {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are two phases where Jetpack features should be removed:

  • four
  • newUsers

I suggest adding a helper to identify whether features should be removed or not. Something along the lines of shouldRemoveJetpackFeatures. This helper should return true if the general phase is four or newUsers. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, true, thanks @hassaanelgarem for the call-up about the two phases 🙇 .

I suggest adding a helper to identify whether features should be removed or not. Something along the lines of shouldRemoveJetpackFeatures. This helper should return true if the general phase is four or newUsers. What do you think?

Good idea, I'll work on adding a function to determine when the Jetpack features should be removed. Similarly, I'll replicate this suggestion in Android 👍 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggestion applied in fb13609.

@derekblank
Copy link
Contributor

derekblank commented Dec 15, 2022

It's interesting that this step succeeded in your case. Following the above comment, due to the fact that the RN bundle wasn't updated, the Jetpack blocks shouldn't have been displayed as unsupported since this was a new change 🤔.

Actually, this particular case makes sense -- I was running both local and installable builds when testing. When running locally I was pointing at the Gutenberg Mobile branch, so I was able to pick up the Gutenberg Mobile changes, not realizing they could have different results. However, now I am wondering why the other step, Observe that the section Get support is NOT present. 🔴 was also failing for me locally, while succeeding for you. I ran through the testing steps multiple times on different Simulator devices (as I only have one physical iOS testing device), so it is possible I was mixing feedback from local and installable build testing when doing various testing runs. This is especially possible as at the time I was not feeling well while testing this. 😓 Either way, I am retesting the installable builds with the updated bundle. 👍

@derekblank derekblank self-requested a review December 15, 2022 08:17
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.

After retesting the installable builds with the updated bundle, I was able to succeed on every step of the testing criteria. 🟢

LGTM! 🚀

Copy link
Contributor

@hassaanelgarem hassaanelgarem left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@fluiddot fluiddot force-pushed the gutenberg/disable-jp-editor-features branch from a38f060 to 74d38a6 Compare December 27, 2022 15:53
Copy link
Contributor

@geriux geriux left a comment

Choose a reason for hiding this comment

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

All tests passed correctly ✅

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants