Skip to content

Navigator iterations: Selection and focus #22705

@adamziel

Description

@adamziel

The problem

This continues the discussion about selection and focus started in #22089 (comment)

At the moment clicking on an item in BlockNavigation selects the block in the editor area. This was the original goal of the BlockNavigation and it feels natural in the post editor:

2020-05-28 11-22-39 2020-05-28 11_23_15

On the menu management screen this behavior does not feel natural to me at all - especially if you primarily use the keyboard. On that screen, the BlockNavigation is no longer supposed to be a shortcut to find the proper block in the editor area. Instead, it's became a kind of an editor itself - it allows you to move the block around, duplicate/delete/copy it, edit the label, and so on. Once the focus is inside of the BlockNavigation, it only makes sense to keep it there. Transferring it to the editor area is confusing and a little bit frustrating:

2020-05-28 11-26-56 2020-05-28 11_28_26

(which also means we should change the name BlockNavigation or use a different component)

I found it pretty hard to make progress on the ellipsis menu (#22089) without clarity on the details of selection/focus interactions. We know that moving the focus over to the editor area is confusing, but what exactly should happen? This affects many of the explored navigator features such as duplicating/removing/clicking an item, editing the label, or editing the link.

The explorations

I played with selecting the navigator item AND corresponding editor area block on single click, and enabling the edit mode inside of the navigator on double click.

2020-05-28 12-57-44 2020-05-28 12_58_52

Mouse interactions seemed pretty natural. Keyboard navigation still need a good equivalent of a double click. Perhaps pressing the enter for the first time = selection, pressing enter for the second time = edit mode?

Also, as you can see on the gif above, it's possible to use the keyboard to focus on a non-active/selected item. Here's an experiment where a related editor area block is automatically selected when the focus shifts in the navigator:

2020-05-28 13-16-02 2020-05-28 13_16_32

And then I thought - maybe we don't need to synchronize the selection with the editor at all if the navigator is supposed to provide most or all of the editor features (editing the label and link, moving the block, duplicating, and so on). Here's how that looks like:

2020-05-28 13-25-40 2020-05-28 13_26_21

In this scenario, a single enter would enable the edit mode.

cc @karmatosed @tellthemachines @noisysocks @draganescu @talldan

Metadata

Metadata

Assignees

Labels

[Feature] List ViewMenu item in the top toolbar to select blocks from a list of links.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions