-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Add improvements to Reusable block #30966
Merged
fluiddot
merged 1 commit into
trunk
from
rnmobile/update/reusable-block-use-inner-block
Apr 29, 2021
Merged
[RNMobile] Add improvements to Reusable block #30966
fluiddot
merged 1 commit into
trunk
from
rnmobile/update/reusable-block-use-inner-block
Apr 29, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fluiddot
added
the
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
label
Apr 19, 2021
Size Change: 0 B Total Size: 1.46 MB ℹ️ View Unchanged
|
2 tasks
These changes also cover a couple of error cases: 1. Render a reusable block inside itself 2. Render a block that doesn't exist
fluiddot
force-pushed
the
rnmobile/update/reusable-block-use-inner-block
branch
from
April 20, 2021 17:14
42cf0ba
to
26406a3
Compare
7 tasks
dcalhoun
approved these changes
Apr 28, 2021
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.
Very nice! I tested this with a WP.com site on an iPhone SE and Samsung Galaxy S20. Both worked as expected.
7 tasks
This was referenced May 14, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Block] Block
The "Reusable Block" Block
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gutenberg-mobile
PR: wordpress-mobile/gutenberg-mobile#3391Description
This PR introduces the following improvements on the Reusable block:
InnerBlock
componentNOTE: Reusable block is only available in development mode.
Minor bugs identified during testing
Block's title is not displayed in the floating toolbar
For some reason I haven't found out yet, the floating toolbar only fetches the block's title from the initial blocks request that only gets 10 items. If the selected reusable block is not included in that list, the block's title is not displayed but shows Reusable block.
I'd like to investigate this issue further, the content of the reusable block is fetched when it is mounted so in theory the title should be updated too in the state and therefore accessible by the floating toolbar. Since it's a minor issue, I think it shouldn't block this PR.
Screenshot
Reusable block's data is cached for 10 minutes on Android
I realised that on Android the network requests from React native are cached by default for 10 minutes. For now this is only affecting the media items because it's the only data that is requested from React native, I haven't found any major issue regarding this although I haven't explored deeply. However for the reusable blocks this behaviour could be a problem because the content is modified often.
Here are the references to the code:
My idea is to solve this issue in a separate PR but it shouldn't block this PR.
EDIT: This issue is addressed in this PR.
How has this been tested?
NOTE: Reusable blocks can be managed by navigating to the "Reusable blocks page":
https://wordpress.com/types/wp_block/<YOUR_WPCOM_SITE_DOMAIN>
https://<YOUR_SELF_HOSTED_SITE_DOMAIN>/wp-admin/edit.php?post_type=wp_block
Here are the steps for creating reusable blocks in the web version:
Option 1:
Option 2:
Preview content
Deleted reusable block
Recursive block rendering
Screenshots
Preview content
reusable-block-preview.mp4
Deleted reusable block
reusable-block-deleted-block.mp4
Recursive block rendering
reusable-block-recursive-rendering.mp4
Types of changes
New feature
Checklist:
*.native.js
files for terms that need renaming or removal).