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] Prevent x-post icon showing on self-hosted sites #16507

Merged
merged 3 commits into from
May 10, 2022

Conversation

SiobhyB
Copy link
Contributor

@SiobhyB SiobhyB commented May 9, 2022

Fixes WordPress/gutenberg#40546

Description

The x-post icon — + — is currently displaying in the formatting toolbar for text-based blocks on self-hosted sites. The icon is unresponsive when tapped, as x-posts currently only work with P2-based themes (which can't be self-hosted at the time of writing).

The fix proposed in this PR involves adding a check for whether a site uses the WP.com rest API before enabling the icon. This is inline with the check used to determine whether @mentions are supported on a site.

Testing Steps

To test:

  • Open a post/page on a self-hosted site.
  • Add a Paragraph block.
  • Scroll the toolbar, located at the bottom of the screen, until reaching the last item.
  • Observe that all of the formatting buttons (i.e. bold, italic, etc.) are functional and there's no longer a redundant + icon.

Screenshots

Before After

Regression Notes

  1. Potential unintended areas of impact
  • The x-post icon should still be accessible from the toolbar for sites with the P2 theme enabled.
  • There should be no other changes to the formatting toolbar on self-hosted sites, only the non-functional + icon should be removed.
  1. What I did to test those areas of impact (or what existing automated tests I relied on)

I manually tested the existing x-post functionality on a site with P2 enabled and confirmed it worked as expected. I also tested the formatting toolbar for the paragraph block on a self-hosted site and didn't spot any unexpected regressions/changes.

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

As this was a small bug fix, I didn't determine that extra automated tests were necessary.

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.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 9, 2022

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

@SiobhyB SiobhyB added gutenberg-mobile Gutenberg Editing and display of Gutenberg blocks. labels May 9, 2022
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented May 9, 2022

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

@SiobhyB SiobhyB marked this pull request as ready for review May 10, 2022 11:26
@SiobhyB SiobhyB requested review from mchowning and jhnstn May 10, 2022 11:27
@SiobhyB SiobhyB self-assigned this May 10, 2022
Copy link
Contributor

@mchowning mchowning left a comment

Choose a reason for hiding this comment

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

Code change makes sense and is working perfectly in my testing. Great job!

@SiobhyB
Copy link
Contributor Author

SiobhyB commented May 10, 2022

Awesome, thanks Matt! 🎉

@SiobhyB SiobhyB merged commit 9841f15 into trunk May 10, 2022
@SiobhyB SiobhyB deleted the gutenberg/fix/remove-x-mentions-icon-self-hosted branch May 10, 2022 14:41
@SiobhyB SiobhyB added this to the 19.9 milestone May 10, 2022
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.

Text block: Extra + toolbar button in self-hosted sites (Only Android)
3 participants