-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Prefetch xpost suggestions in Gutenberg #15562
Conversation
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
Adding you here @fluiddot since you mentioned you'd like to review/test this. If you're not comfortable reviewing the code, a test is still much appreciated 🙇 and you can just leave a comment instead of an approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Suggestions delay is gone
✅ Switching to another site also prefetches suggestions
Looks good! sir!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works perfect, nice work 🎊 !
Minor issue: The only thing I noted which I don't know if it's by design is that when you have only the symbol +
/@
in the text input and press backspace it hides the x-post UI but doesn't remove the character from the paragraph block. So if you want to trigger the UI again you have to remove the symbol and input it again.
Thank you!
Thanks for reporting that @fluiddot! I think this is a bug that's already in production (tested on iOS and on the Android beta) so I created wordpress-mobile/gutenberg-mobile#2943. |
Addresses wordpress-mobile/gutenberg-mobile#2602
This PR prefetches the suggestion data that populates the Xpost suggestion UI. Without this, the user experiences a network delay when first inserting an Xpost suggestion in the block editor.
Expected behavior
RPReplay_Final1609258379.MP4
Note: The throttle introduced in #15558 is a 60 second throttle. This means that the user will still experience the network delay if they wait for more than 60 seconds between opening the editor and inserting an Xpost suggestion.
To test
What you'll need: Two or more WordPress.com sites that are capable of xposting (https://wordpress.com/p2/ can be used to create xpost-capable sites). It's best if you can test with a site that has lots of Xpost suggestions (10 to 20), to ensure that the network delay would be noticeable if present.
Xpost in Gutenberg
+
and verify that the list of Xpost suggestions is shown immediately (no network delay should be noticeable)+
(or long press the@
toolbar button and select Xpost) and expect the list of suggestions to be shown immediatelyNote: There is an issue which @antonis first reported in #15139 (comment) where sites that don't have Xposts suggestions (e.g. non-P2 sites) show the suggestions UI for an instant while the network loads. I didn't address that here because I had difficulty updating the Gutenberg capability when switching between sites while in the the editor. I created wordpress-mobile/gutenberg-mobile#2942 to address this in a later PR.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.