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
Conversation
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's do it. We can always revert this specific part if we change our mind.
Thanks for the review @MarcoZehe! |
🤔 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) |
@youknowriad I see what you mean. We probably need a different approach then. I'll have a look at it today. |
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.
I wonder if we need to make a slight distinction between these two modes.
@youknowriad What do you think? |
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. |
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. |
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. |
|
Ok, I think I have a fix coming up. I'll add more e2e tests too. |
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. |
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 youEnter
.How has this been tested?
Screenshots
Types of changes
Checklist: