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

Grouping blocks using keyboard shortcuts #15980

Closed
mapk opened this issue Jun 4, 2019 · 15 comments
Closed

Grouping blocks using keyboard shortcuts #15980

mapk opened this issue Jun 4, 2019 · 15 comments
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Dev Ready for, and needs developer efforts

Comments

@mapk
Copy link
Contributor

mapk commented Jun 4, 2019

Based on a discussion in #14908 it looks like this should be its own issue so it doesn't hold up the merge for the grouping action. I outlined the problem in this comment, but sharing here for better visibility.

The Problem

⌘G is often used for grouping items in graphics applications. It would be nice to use that familiarity with grouping blocks within Gutenberg. However, the browsers currently use ⌘G for finding the next instance of a word when searching the page.

Proposals

  1. Use a new shortcut ⌘⌥G for grouping and ⇧⌘⌥G for ungrouping. Hijacking a browser shortcut ⌘G may not be optimal. This shortcut is very text-based, and so is Gutenberg, so this might be best to leave as is.

  2. Use the ⌘G only when two or more blocks are selected. When people have selected a couple of blocks, they're more than likely to perform an action with them then begin searching for words. Hijack ⌘G only in this case. Otherwise ⌘G would function as the browser shortcut for finding words.

Let's hear your thoughts around this and come to an agreement.

@mapk mapk added Needs Accessibility Feedback Need input from accessibility Needs Decision Needs a decision to be actionable or relevant Needs Design Feedback Needs general design feedback. labels Jun 4, 2019
@mapk mapk changed the title Grouping block using keyboard shortcuts Jun 4, 2019
@getdave
Copy link
Contributor

getdave commented Jun 4, 2019

I have a local branch prepped to add the keyboard shortcuts back. This will be pushed as soon as #14908 is merged.

We can then decide on the exact screenshots. The code has already been written so it may as well get used if we decide keyboard shortcuts are a good idea.

@talldan
Copy link
Contributor

talldan commented Jun 11, 2019

Use the ⌘G only when two or more blocks are selected. When people have selected a couple of blocks, they're more than likely to perform an action with them then begin searching for words. Hijack ⌘G only in this case. Otherwise ⌘G would function as the browser shortcut for finding words.

Not strongly opinionated about this, but I do wonder whether this option would result in some confusion around why grouping a single block using the shortcut doesn't work (and results in the browser behaviour being triggered).

On the flipside, I do agree that Cmd+G / Ctrl+G is a very widely recognised shortcut for grouping and it might be instinctive for users to try it.

@afercia
Copy link
Contributor

afercia commented Jun 14, 2019

Discussed during today's accessibility bug scrub.

browsers currently use ⌘G for finding the next instance of a word when searching the page

Noting ⌘G is on macOS. In other operating systems browsers use different shortcuts. Regardless, this would break one of the native browsers shortcuts on one of the most used operating systems. We agree we share @anevins12 considerations:

In this context I think we should use another shortcut. I'm making a terrible assumption that people who group by keyboard are expert users and therefore can learn a different shortcut. It's a pain but we get over it as we have done with other software. It's not worth affecting all users for the benefit of the few

Personally, I use text search a lot. I wouldn't be happy to see that native text search doesn't work in Gutenberg and I guess I wouldn't be alone.

Also, when considering keyboard shortcuts please refer to the recommendations in #3218 and related issues.

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed Needs Accessibility Feedback Need input from accessibility labels Jun 14, 2019
@MariusKauer
Copy link

I agree that hijacking ⌘G would be the most intuitive solution for most users. But overriding a (probably) often used shortcut doesn‘t seem like the right way to do that.

Using ⌘⌥G might need some getting used to but seems like the best option in the long term.

@mapk
Copy link
Contributor Author

mapk commented Jun 26, 2019

Alrighty. I think with @afercia's suggestions and our consensus, we have a way forward. Let's go with option 1 from the initial issue.

We'll also want to keep in mind Andrea's suggestions posted below.

find a shortcut that works universally across all keyboard layouts (I doubt there's one)
use a single key shortcut, as mentioned on #3084
make the shortcut configurable on a per user basis

@mapk mapk added Needs Dev Ready for, and needs developer efforts and removed Needs Decision Needs a decision to be actionable or relevant Needs Design Feedback Needs general design feedback. labels Jul 11, 2019
@mrfoxtalbot
Copy link

I was just going to suggest this and found this open issue. I also have a background in graphic design and I find myself pressing ⌘G all the time in the block editor.

I agree that we do not want to highjack browser shortcuts but I would love to see ⌘⌥G and ⇧⌘⌥G implemented :)

Cheers!

@mapk
Copy link
Contributor Author

mapk commented Nov 7, 2019

@getdave I believe we have a way forward. Can you work on this?

Use a new shortcut ⌘⌥G for grouping and ⇧⌘⌥G for ungrouping.

@getdave
Copy link
Contributor

getdave commented Feb 18, 2020

Looks like I neglected to those this. Grouping via keyboard shortcuts has been in place for a good while now. 🎉

@getdave getdave closed this as completed Feb 18, 2020
@talldan
Copy link
Contributor

talldan commented Feb 19, 2020

@getdave What's the shortcut? I tried it the other day and couldn't find it.

@kauaicreative
Copy link

This still appears to be an issue on Windows, Chrome version 85.0.4183.121 (Official Build) (64-bit)

Ctrl+g opens up Chrome find text and does not group the block contents

@talldan talldan reopened this Sep 30, 2020
@getdave
Copy link
Contributor

getdave commented Sep 30, 2020

Here's the PR which added the functionality

#14908

Also here was the original linked Issue #14601.

Note when I implemented this I studied carefully the best keyboard shortcut so as not to collide with existing "known" OS shortcuts. That said, there's always remove for improvement so if these need to be updated in light of new evidence it should be (technically) trivial.

@talldan
Copy link
Contributor

talldan commented Sep 30, 2020

@getdave It doesn't seem like it was ever shipped as per this commit on the PR - 4707009.

I've reopened the issue.

@getdave
Copy link
Contributor

getdave commented Sep 30, 2020

It doesn't seem like it was ever shipped

I'd totally missed that! Thanks for reopening. 🤞 we can find a consensus this time.

@DamChtlv
Copy link

Hi!
Any update on this? It would really fasten integration :)

@annezazu
Copy link
Contributor

Closing this out as this was implemented :) #46972

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Dev Ready for, and needs developer efforts
9 participants