-
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
Enable the verse block for mobile #21883
Conversation
Size Change: +10 B (0%) Total Size: 824 kB
ℹ️ View Unchanged
|
@@ -34,6 +34,7 @@ export default function VerseEdit( { | |||
</BlockControls> | |||
<RichText | |||
tagName={ Block.pre } | |||
identifier='content' |
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 looks like this is a required attribute to allow the verse block to be merged with the paragraph block, otherwise I would get a console error:
`RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was ${ typeof attributeKey }` |
I essentially copied this from the paragraph block:
identifier="content" |
|
When return is tapped inside a verse block on the mobile editor, a
This issue is not specific to the verse block – the preformatted block already has this issue – it uses I propose:
Any thoughts @iamthomasbishop? |
Is this also happening on posts written in the classic editor (Aztec) and on posts written on the web? Also, is this happening just for PRE-based blocks/markup or the different newline/ It looks like an issue with the posts list rendering itself, in which case I wouldn't consider it a blocker for the Verse block.
Yes please, thanks!
I'd add that as another subtask. |
This is not happening on posts created in the classic editor nor posts written on the web.
Tapping return inside a paragraph block just creates a new block, which I think makes paragraphs a different category – do you agree? Added issues here:
|
Should we add a Unit Test to this too? Something simple like this should be enough: gutenberg/packages/block-library/src/code/test/edit.native.js Lines 13 to 20 in ea4fa88
|
Thanks for pointing out the lack of unit tests, @etoledom! I've added those now. |
The MERGE_BLOCKS store action requires RichText components to have an identifier. The identifier must be one of the block's attributes.
Remove the devOnly flag to make the verse block not only available on debug builds, but also in production builds.
9cda988
to
d57347f
Compare
I'm getting seeing some tests fail on Travis, e.g.:
I noticed the build badge was showing that Gutenberg was failing on Friday so I'm not sure if there is some flakiness in the test suite. I've re-run the test suite twice on Travis and I've also ran |
Thanks a lot for your tests, @ceyhun.
I also checked the @SergioEstevao I want to let you know about this because you're wrangling the release today and are familiar with this work. I'd like to see if there is still an issue with Aztec that needs to be resolved but I'm not yet very familiar with the repo. |
The bug @ceyhun found was fixed in the Aztec library by @SergioEstevao which powers the rich text components on mobile, such as that found in the verse block. The gist of it is that the libxml2 library used by Aztec was collapsing whitespace elements when these elements were between other tags.
the whitespace between the |
Retest resultsI found one new minor bug, and all the other test cases passed. Minor bug foundIf you type bold text, then add a few spaces, then right align the block, the spaces you typed are lost. If no formatting is applied, the bug doesn't occur. It's also iOS specific. I'd say this is another angle of the bug fixed above (cc @SergioEstevao). @iamthomasbishop, do you agree this is not a blocker for the verse block? If so, I'll add it to the list of Verse Block non-blockers. Here are two gifs showing the bug. Notice the extra spaces typed after the "Hello ". As you can see, only in the first example – where the text is formatted (bolded) – is the bug present.
|
@ceyhun re-requesting a review here please 🙏. |
@guarani I tested with the new version of Aztec and the bug you found when switching alignment is still there. At this point I think this is UITextView layout/presentation issue so it shouldn't be a blocker for this PR. |
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.
All working well, extra kudos for adding the unit tests!
Addresses: wordpress-mobile/gutenberg-mobile#1886
Related: wordpress-mobile/gutenberg-mobile#2185
Description
Enable the verse block for production builds.
How has this been tested?
Demo
Types of changes
New feature: verse block for mobile
Checklist: