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

Navigation mode: enable on tab if no block is selected #19238

Merged
merged 3 commits into from Dec 21, 2019

Conversation

@ellatrix
Copy link
Member

ellatrix commented Dec 19, 2019

Description

Following up on #19235 (review).

Currently, Edit mode is enabled by default. With the new tabbing behaviour, it might be a bit strange to immediately enter Edit mode when you first tab in the editor and to a block.

Instead, I would suggest to enable Navigation mode if the user navigates with Tab and if there are no blocks selected (yet).

The idea is that Navigation mode is in some way the default mode that you Escape to, and Edit mode the mode that you Enter.

How has this been tested?

Screenshots

Types of changes

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. .
@ellatrix ellatrix requested review from talldan and youknowriad as code owners Dec 19, 2019
@@ -1277,6 +1277,11 @@ export const blockListSettings = ( state = {}, action ) => {
* @return {string} Updated state.
*/
export function isNavigationMode( state = false, action ) {
// Let inserting block always trigger Edit mode.
if ( action.type === 'INSERT_BLOCKS' ) {
return false;

This comment has been minimized.

Copy link
@ellatrix

ellatrix Dec 21, 2019

Author Member

@youknowriad @MarcoZehe Curious to know what you think about this. Edit mode will be enabled if you insert a block, as most likely you'll be wanting to edit the block, even if you came from navigation mode. I can also omit this if it doesn't make sense.

This comment has been minimized.

Copy link
@MarcoZehe

MarcoZehe Dec 21, 2019

Contributor

I actually think it does make sense, since inserting the block usually means that you will want to edit it right away. The mobile app behaves like this, too, once you insert a block, you are usually thrown into text editing mode if it's a block you can edit like this.

This comment has been minimized.

Copy link
@ellatrix

ellatrix Dec 21, 2019

Author Member

Ok, let's do it. We can always revert this specific part if we change our mind.

@ellatrix ellatrix requested a review from MarcoZehe Dec 21, 2019
@ellatrix ellatrix merged commit c81be93 into master Dec 21, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@ellatrix ellatrix deleted the try/navigation-mode-tab branch Dec 21, 2019
@ellatrix

This comment has been minimized.

Copy link
Member Author

ellatrix commented Dec 21, 2019

Thanks for the review @MarcoZehe!

@youknowriad

This comment has been minimized.

Copy link
Contributor

youknowriad commented Dec 23, 2019

🤔 This is a bit disturbing.

While working on the document settings sidebar, I hit "Tab" to navigate controls and then when I try to select a block and type, I find myself in Navigation mode. I think we should probably revert this as it's a bit disturbing for sighted users who have mixed workflows. (mouse and keyboard)

@ellatrix

This comment has been minimized.

Copy link
Member Author

ellatrix commented Dec 23, 2019

@youknowriad I see what you mean. We probably need a different approach then. I'll have a look at it today.

@ellatrix

This comment has been minimized.

Copy link
Member Author

ellatrix commented Dec 23, 2019

I didn't release blocks in navigation mode are not "click-through", in other words, that you land in edit mode when you click on a block. I see that's because navigation mode is the same as selection mode.

  • When you use the keyboard, it does make sense to land in navigation mode if the block selection is cleared.
  • When you use the mouse, it does not make sense to land in select mode if the block selection is cleared. It's fine to be in navigation mode if clicking on the block would put you in edit mode.

I wonder if we need to make a slight distinction between these two modes.

  • In navigation mode, clicking on a block puts you in edit mode
  • In select mode, clicking on a block maintains selection mode.

@youknowriad What do you think?

@ellatrix

This comment has been minimized.

Copy link
Member Author

ellatrix commented Dec 23, 2019

So the difference is: navigation mode shouldn't be persistent when you have the intention to edit a block (insert a block or click on the block). Select mode should be persistent.

@youknowriad

This comment has been minimized.

Copy link
Contributor

youknowriad commented Dec 23, 2019

I think we should be cautious with mode fatigue here. People will have to learn the difference between these and I personally think the current distinction is sufficient. if we create a block for just making the "click on block" different, we'll end up with a big number of modes.

I know also @jasmussen went back and forth a lot on this.

@ellatrix

This comment has been minimized.

Copy link
Member Author

ellatrix commented Dec 23, 2019

I agree, it would be best to not create any differences. @youknowriad @jasmussen May I ask what "Select" mode is used for? Why is it persistent when clicking on blocks? What can you do with it?

I still believe we navigation mode should be the default mode, and should be enabled when you clear block selection, but only if clicking on a block puts you in edit mode.

@youknowriad

This comment has been minimized.

Copy link
Contributor

youknowriad commented Dec 23, 2019

"Select" mode is used for? Why is it persistent when clicking on blocks? What can you do with it?

  • It supports top to children selection for nested blocks
  • you can click twice to enter edit mode
  • it will support Drag and drop by clicking anywhere on the block, not just the drag handle.
  • One tab stop between blocks.
@ellatrix

This comment has been minimized.

Copy link
Member Author

ellatrix commented Dec 23, 2019

Ok, I think I have a fix coming up. I'll add more e2e tests too.

@jasmussen

This comment has been minimized.

Copy link
Contributor

jasmussen commented Dec 23, 2019

Riad got it. I'm in low power mode over the holiday break, so I'm slow to chime in. I would say that selection mode or navigation mode or "the select tool" are three names for the same thing. In this mode you select blocks, whether through tabbing to them, or clicking them with the cursor. Additionally it's a way to traverse complex nesting situations where you click through each layer.

@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.