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

[Mobile] Modified More block to be read-only #16005

Merged
merged 5 commits into from
Jun 6, 2019

Conversation

etoledom
Copy link
Contributor

@etoledom etoledom commented Jun 5, 2019

gutenberg-mobile side PR: wordpress-mobile/gutenberg-mobile#1079

As mentioned in wordpress-mobile/gutenberg-mobile#859 (comment), I opted for modifying the More block to be read only, in order for it to be ready for the next release.

I did a fast test using RichText. It does work well on iOS, but it had some alignment issues on Android, that would need native code to be fixed. It also had a visual glitch on split.

Fixing those issues on Android, it looks promising to use RichText to make this component editable.
Alternatively, we might also want to think on a simpler PlaneText component that we can manipulate at the native level for these cases.

On the design side, I noticed on web that More block and Page Break block look the same, so I implemented the same design we use for Page Break on mobile too.

more-block

To test:

  • Run the app.
  • Search for the Read More block in the example content (or add one if it's a new post)
  • Check that it's not editable.
  • Check that it can be selectable by tapping anywhere in the block.
  • Paste this in the HTML mode:
<!-- wp:more {"customText":"Read more custom from web"} -->
<!--more Read more custom from web-->
<!-- /wp:more -->
  • Go back to Visual mode.
  • Check that it shows custom content.

@etoledom etoledom 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 Jun 5, 2019
@etoledom etoledom requested a review from hypest June 5, 2019 13:53
@etoledom etoledom self-assigned this Jun 5, 2019
@etoledom etoledom changed the title Modified More block to be read-only [Mobile] Modified More block to be read-only Jun 5, 2019
@etoledom etoledom marked this pull request as ready for review June 5, 2019 14:01
@etoledom etoledom force-pushed the rnmobile/859-more-block-enhancements branch from c8ff1e2 to 797c3c7 Compare June 5, 2019 14:04
onBlur={ onBlur }
<View
accessible={ ! this.props.isSelected }
accessibilityLabel={ __( 'More block' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "Read more block"? More feels a bit ambiguous

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified the accessibility config based on wordpress-mobile/gutenberg-mobile#937

Now all blocks will have a default label based on the gutenberg-defined block name.

Copy link
Contributor

@koke koke left a comment

Choose a reason for hiding this comment

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

Looking 😍 to me

@etoledom etoledom merged commit b030fce into master Jun 6, 2019
@etoledom
Copy link
Contributor Author

etoledom commented Jun 6, 2019

Thank you!

@etoledom etoledom deleted the rnmobile/859-more-block-enhancements branch June 6, 2019 14:04
@youknowriad youknowriad added this to the Gutenberg 5.9 milestone Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants