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

Block Settings Menu: Don't render 'Move to' if there is only one block. #33158

Conversation

getsource
Copy link
Member

Description

In the Block Settings Menu, instead of disabling, don't render "Move to" when there is only one block.

This is a follow-up for consideration from #33135 and this comment from @mtias.

Other items in the Block Settings Dropdown aren't displayed when they aren't actionable.

Assuming there are no a11y concerns, I like the idea of further reducing noise and interface elements when possible.

See: #33029, #33135

How has this been tested?

Using wp-env:

  • Check to confirm "Move to" is disabled with one block
  • Add another block
  • Check to confirm "Move to" is enabled and functions
  • Remove one block
  • Check to confirm "Move to" is disabled again.

Also tested with npm run test.

Screenshots

The current/before behavior can be seen in the video at the top of #33135.

Proposed Change:

Screen.Recording.2021-07-02.at.16.22.16.mov

Types of changes

Enhancement.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • 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 (please manually search all *.native.js files for terms that need renaming or removal).

@getsource getsource added [Type] Enhancement A suggestion for improvement. [Feature] Blocks Overall functionality of blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Jul 2, 2021
@getsource getsource requested a review from ellatrix as a code owner July 2, 2021 07:41
Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@ntsekouras ntsekouras merged commit f077bbe into WordPress:trunk Jul 2, 2021
@github-actions github-actions bot added this to the Gutenberg 11.1 milestone Jul 2, 2021
@mtias
Copy link
Member

mtias commented Jul 3, 2021

Other items in the Block Settings Dropdown aren't displayed when they aren't actionable.

Also the movers and drag handle themselves are not shown when a single block is in place, so this is consistent.

@getsource getsource deleted the update/no-render-move-to-with-one-block/33029 branch July 6, 2021 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants