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

[RNMobile] Show "Add to beginning" and "Add to end" option always #28610

Merged

Conversation

AmandaRiu
Copy link
Contributor

@AmandaRiu AmandaRiu commented Jan 29, 2021

Description

Closes wordpress-mobile/gutenberg-mobile#2344 by making the long-press options Add to beginning and Add to end available in all scenarios. Prior to this PR these options were only available when no blocks were selected.

Related PR

gutenberg-mobile: wordpress-mobile/gutenberg-mobile#3074

How has this been tested?

  1. Open the demo app
  2. Long-press on the inserter button, verify options Add to beginning and Add to end are displayed.
  3. Tap on Add to beginning and select a block. Verify block added to the beginning.
  4. With no block selected, long-press on inserter again, this time tap on Add to end and select a block. Verify added to end of post.
  5. Select a block in the editor, then long-press on the inserter. Verify new options Add to beginning and Add to end are displayed.
  6. Tap on Add to beginning and select a block. Verify added to beginning of document.
  7. Repeat for the other options available when long-pressing on inserter with a block selected and verify each work.

Screenshots

No block selected BEFORE AFTER
long-press-before long-press-after
Block selected BEFORE AFTER
long-press-focused-before long-press-focused-after

Types of changes

  • Updated logic to show the Add to beginning and Add to end option always.
  • Changed the icon for Add block before and Add block after to plusCircle per design recommendation here.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

Updates the logic to always show the "add to beginning" and "add to end"
options when inserting a new block via a longpress on the inserter.
@AmandaRiu AmandaRiu marked this pull request as ready for review January 29, 2021 23:25
@cameronvoell cameronvoell self-requested a review February 5, 2021 06:27
@cameronvoell cameronvoell 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 Feb 5, 2021
Copy link
Member

@cameronvoell cameronvoell left a comment

Choose a reason for hiding this comment

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

Changes are looking good @AmandaRiu , nice work!

Figured I'd note here that I also tested inside the group block, and the add to beginning and end would stay confined to the group block which is what I expected to happen. Looks good! :shipit:

@cameronvoell cameronvoell merged commit b492113 into WordPress:master Feb 5, 2021
@github-actions github-actions bot added this to the Gutenberg 10.0 milestone Feb 5, 2021
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.

Show "Add to beginning" and "Add to end" option for all blocks when long-pressing the inserter button
2 participants