[RNMobile] Add improvements to Reusable block#30966
Merged
Conversation
|
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
42cf0ba to
26406a3
Compare
7 tasks
dcalhoun
approved these changes
Apr 28, 2021
Member
dcalhoun
left a comment
There was a problem hiding this comment.
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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-mobilePR: wordpress-mobile/gutenberg-mobile#3391Description
This PR introduces the following improvements on the Reusable block:
InnerBlockcomponentNOTE: 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_blockHere 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.jsfiles for terms that need renaming or removal).