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

Widgets Editor: add show block bread crumbs feature toggle to more menu #32569

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Jun 10, 2021

Description

¡Hola!

This PR follows up on #32498 (comment), where it was suggested we add a showBlockBreadcrumbs feature to the more menu in the Widgets Editor.

How has this been tested?

  1. Fire up this branch and head over to the Widgets editor at /wp-admin/themes.php?page=gutenberg-widgets
  2. Check that the breadcrumbs block appears in the footer when you select a block in the widget editor. (It should be on by default)
  3. Open the More menu and toggle Block breadcrumbs 🍞 Check that the feature toggles on and off.
  4. Try coconut sugar as a substitute for cane sugar if you like caramely flavours.

Unit test for the selector:

npm run test-unit packages/edit-widgets/src/store/test/selectors.js

Screenshots

Jun-10-2021 14-05-44

Types of changes

New feature toggle for the Widgets Editor.

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).

@ramonjd ramonjd force-pushed the add/widget-editor-show-block-breadcrumbs-feature-toggle branch from 774a43a to d1f518e Compare June 10, 2021 04:51
@ramonjd ramonjd marked this pull request as ready for review June 10, 2021 04:55
@critterverse
Copy link
Contributor

Awesome, thanks @ramonjd! Looks/works great for me.

@ramonjd ramonjd force-pushed the add/widget-editor-show-block-breadcrumbs-feature-toggle branch from d1f518e to a34b842 Compare June 11, 2021 04:03
Copy link
Member

@kevin940726 kevin940726 left a comment

Choose a reason for hiding this comment

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

Code LGTM 👍. My only question is whether we should keep this on by default? Personally I think this should be enabled by default.

@ramonjd
Copy link
Member Author

ramonjd commented Jun 11, 2021

My only question is whether we should keep this on by default? Personally I think this should be enabled by default.

Thanks for the review!

I was wondering about this too, but couldn't decide on the best way to do it.

Would there be a better way than just dispatching a toggle action in packages/edit-widgets/src/components/layout/interface.js if it's not activated?

if ( ! select( editPostStore ).isFeatureActive( 'showBlockBreadcrumbs' ) ) {
    useDispatch( editWidgetsStore ).toggleFeature( 'showBlockBreadcrumbs' );
}

🤷

@kevin940726
Copy link
Member

You can set showBlockBreadcrumbs to true in edit-widgets/src/store/defaults.js. That should do the job I think.

@kevin940726 kevin940726 added [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Enhancement A suggestion for improvement. Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Jun 11, 2021
@kevin940726 kevin940726 added this to PRs needing review in Block-based Widgets Editor via automation Jun 11, 2021
Added `showBlockBreadcrumbs` feature to the more menu in the Widgets Editor.
Importing it into the Widgets interface, but waiting on WordPress#32498 to merge before final integration.
…Active` selector and associated test.

We should know that the reducer hasn't initialized the state via an error rather than have that error swallowed.
@ramonjd ramonjd force-pushed the add/widget-editor-show-block-breadcrumbs-feature-toggle branch from 8f6334a to 31f53d5 Compare June 11, 2021 22:24
@ramonjd
Copy link
Member Author

ramonjd commented Jun 11, 2021

You can set showBlockBreadcrumbs to true in edit-widgets/src/store/defaults.js. That should do the job I think.

OMG, I can't believe I didn't see that file! 😆 Thanks for pointing it out.

@ramonjd ramonjd moved this from PRs needing review to Done in Block-based Widgets Editor Jun 14, 2021
@ramonjd ramonjd merged commit 81cdf87 into WordPress:trunk Jun 14, 2021
@ramonjd ramonjd deleted the add/widget-editor-show-block-breadcrumbs-feature-toggle branch June 14, 2021 03:03
@ramonjd ramonjd added this to the Gutenberg 10.9 milestone Jun 14, 2021
@youknowriad
Copy link
Contributor

Any thoughts about the inconsistency between the widgets and the post editors, I mean in the post editor, it's always shown while in the widgets editor, it's an option. Is this something to consolidate? cc @jasmussen

@jasmussen
Copy link
Contributor

The toggle option does exist in the post editor, though you have to go into preferences:

bread

The widget screen is looking good at the moment. It's looking a lot like the block editor, also, the benefit being it's recognizable, the downside is you would probably also expect things to be in the same places. Meaning in this case, it might be best to move it inside a preferences dialog, just like it is in the post editor — otherwise it's just two ways to accomplish the same.

@youknowriad youknowriad removed the Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jun 14, 2021
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Jun 15, 2021
…ta 2.

This includes:

**Various**

 - Fix multi selection for nested blocks WordPress/gutenberg#32536
 - Consistently show the drop indicator while dragging blocks WordPress/gutenberg#31896
 - Fix horizontal drop indicator WordPress/gutenberg#32589
 - Fix Safari flickering issue WordPress/gutenberg#32581
 - Silence useSelect zombie bug errors WordPress/gutenberg#32088

**Template Editor**

 - Clarify the template creation modal WordPress/gutenberg#32427
 - Only add skip links for block templates WordPress/gutenberg#32451

**Widgets Editor**

 - Add block breadcrumb WordPress/gutenberg#32498 WordPress/gutenberg#32528 WordPress/gutenberg#32569
 - Saved deleted and restored widgets. WordPress/gutenberg#32534
 - Fix unsaved changes detection WordPress/gutenberg#32573
 - Fix button spacing in the header WordPress/gutenberg#32585
 - Avoid extra undo levels WordPress/gutenberg#32572
 - Move Legacy Widget block to the `@wordpress/widgets` package WordPress/gutenberg#32501
 - Fix Social Links color inheritance WordPress/gutenberg#32625
 - Use Button appender WordPress/gutenberg#32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings WordPress/gutenberg#32358 WordPress/gutenberg#32622
 - Use CSS Custom Properties for the preset styles WordPress/gutenberg#32627

**Performance**

 - Remove is-typing classname to improve typing performance WordPress/gutenberg#32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.


git-svn-id: https://develop.svn.wordpress.org/trunk@51149 602fd350-edb4-49c9-b593-d223f7449a82
nylen pushed a commit to nylen/wordpress-develop-svn that referenced this pull request Jun 15, 2021
…ta 2.

This includes:

**Various**

 - Fix multi selection for nested blocks WordPress/gutenberg#32536
 - Consistently show the drop indicator while dragging blocks WordPress/gutenberg#31896
 - Fix horizontal drop indicator WordPress/gutenberg#32589
 - Fix Safari flickering issue WordPress/gutenberg#32581
 - Silence useSelect zombie bug errors WordPress/gutenberg#32088

**Template Editor**

 - Clarify the template creation modal WordPress/gutenberg#32427
 - Only add skip links for block templates WordPress/gutenberg#32451

**Widgets Editor**

 - Add block breadcrumb WordPress/gutenberg#32498 WordPress/gutenberg#32528 WordPress/gutenberg#32569
 - Saved deleted and restored widgets. WordPress/gutenberg#32534
 - Fix unsaved changes detection WordPress/gutenberg#32573
 - Fix button spacing in the header WordPress/gutenberg#32585
 - Avoid extra undo levels WordPress/gutenberg#32572
 - Move Legacy Widget block to the `@wordpress/widgets` package WordPress/gutenberg#32501
 - Fix Social Links color inheritance WordPress/gutenberg#32625
 - Use Button appender WordPress/gutenberg#32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings WordPress/gutenberg#32358 WordPress/gutenberg#32622
 - Use CSS Custom Properties for the preset styles WordPress/gutenberg#32627

**Performance**

 - Remove is-typing classname to improve typing performance WordPress/gutenberg#32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.


git-svn-id: https://develop.svn.wordpress.org/trunk@51149 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Jun 15, 2021
…ta 2.

This includes:

**Various**

 - Fix multi selection for nested blocks WordPress/gutenberg#32536
 - Consistently show the drop indicator while dragging blocks WordPress/gutenberg#31896
 - Fix horizontal drop indicator WordPress/gutenberg#32589
 - Fix Safari flickering issue WordPress/gutenberg#32581
 - Silence useSelect zombie bug errors WordPress/gutenberg#32088

**Template Editor**

 - Clarify the template creation modal WordPress/gutenberg#32427
 - Only add skip links for block templates WordPress/gutenberg#32451

**Widgets Editor**

 - Add block breadcrumb WordPress/gutenberg#32498 WordPress/gutenberg#32528 WordPress/gutenberg#32569
 - Saved deleted and restored widgets. WordPress/gutenberg#32534
 - Fix unsaved changes detection WordPress/gutenberg#32573
 - Fix button spacing in the header WordPress/gutenberg#32585
 - Avoid extra undo levels WordPress/gutenberg#32572
 - Move Legacy Widget block to the `@wordpress/widgets` package WordPress/gutenberg#32501
 - Fix Social Links color inheritance WordPress/gutenberg#32625
 - Use Button appender WordPress/gutenberg#32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings WordPress/gutenberg#32358 WordPress/gutenberg#32622
 - Use CSS Custom Properties for the preset styles WordPress/gutenberg#32627

**Performance**

 - Remove is-typing classname to improve typing performance WordPress/gutenberg#32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.

Built from https://develop.svn.wordpress.org/trunk@51149


git-svn-id: http://core.svn.wordpress.org/trunk@50758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this pull request Jun 15, 2021
…ta 2.

This includes:

**Various**

 - Fix multi selection for nested blocks WordPress/gutenberg#32536
 - Consistently show the drop indicator while dragging blocks WordPress/gutenberg#31896
 - Fix horizontal drop indicator WordPress/gutenberg#32589
 - Fix Safari flickering issue WordPress/gutenberg#32581
 - Silence useSelect zombie bug errors WordPress/gutenberg#32088

**Template Editor**

 - Clarify the template creation modal WordPress/gutenberg#32427
 - Only add skip links for block templates WordPress/gutenberg#32451

**Widgets Editor**

 - Add block breadcrumb WordPress/gutenberg#32498 WordPress/gutenberg#32528 WordPress/gutenberg#32569
 - Saved deleted and restored widgets. WordPress/gutenberg#32534
 - Fix unsaved changes detection WordPress/gutenberg#32573
 - Fix button spacing in the header WordPress/gutenberg#32585
 - Avoid extra undo levels WordPress/gutenberg#32572
 - Move Legacy Widget block to the `@wordpress/widgets` package WordPress/gutenberg#32501
 - Fix Social Links color inheritance WordPress/gutenberg#32625
 - Use Button appender WordPress/gutenberg#32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings WordPress/gutenberg#32358 WordPress/gutenberg#32622
 - Use CSS Custom Properties for the preset styles WordPress/gutenberg#32627

**Performance**

 - Remove is-typing classname to improve typing performance WordPress/gutenberg#32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.

Built from https://develop.svn.wordpress.org/trunk@51149


git-svn-id: https://core.svn.wordpress.org/trunk@50758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@critterverse
Copy link
Contributor

Also opened #32711 based on @jasmussen's note above! We're looking at adding a third Preference ("Use theme styles") in the near future, which might be a good time to switch over to the modal treatment.

F-Wilke pushed a commit to FiliagoDev/WordPress that referenced this pull request Jul 31, 2021
…ta 2.

This includes:

**Various**

 - Fix multi selection for nested blocks WordPress/gutenberg#32536
 - Consistently show the drop indicator while dragging blocks WordPress/gutenberg#31896
 - Fix horizontal drop indicator WordPress/gutenberg#32589
 - Fix Safari flickering issue WordPress/gutenberg#32581
 - Silence useSelect zombie bug errors WordPress/gutenberg#32088

**Template Editor**

 - Clarify the template creation modal WordPress/gutenberg#32427
 - Only add skip links for block templates WordPress/gutenberg#32451

**Widgets Editor**

 - Add block breadcrumb WordPress/gutenberg#32498 WordPress/gutenberg#32528 WordPress/gutenberg#32569
 - Saved deleted and restored widgets. WordPress/gutenberg#32534
 - Fix unsaved changes detection WordPress/gutenberg#32573
 - Fix button spacing in the header WordPress/gutenberg#32585
 - Avoid extra undo levels WordPress/gutenberg#32572
 - Move Legacy Widget block to the `@wordpress/widgets` package WordPress/gutenberg#32501
 - Fix Social Links color inheritance WordPress/gutenberg#32625
 - Use Button appender WordPress/gutenberg#32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings WordPress/gutenberg#32358 WordPress/gutenberg#32622
 - Use CSS Custom Properties for the preset styles WordPress/gutenberg#32627

**Performance**

 - Remove is-typing classname to improve typing performance WordPress/gutenberg#32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.

Built from https://develop.svn.wordpress.org/trunk@51149


git-svn-id: http://core.svn.wordpress.org/trunk@50758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Enhancement A suggestion for improvement.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants