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
Block editor: add a keyboard shortcut to create group from the selected blocks #46972
Open
t-hamano
wants to merge
3
commits into
trunk
Choose a base branch
from
enhancement/shorcut-selected-blocks-to-group
base: trunk
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+133
−3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Size Change: +114 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
Flaky tests detected in 80c0285.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Package] Keyboard Shortcuts
/packages/keyboard-shortcuts
[Type] Enhancement
A suggestion for improvement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Closes #42227
What?
This PR adds a keyboard shortcut to create a group block from the selected blocks.
Why?
Many design tools provide shortcuts for grouping elements. It would make sense to add a similar shortcut, especially since the grouping of blocks should be done frequently in the site editing.
How?
To explore which key combinations were available, I tested all variations that included the letter
G
. The list can be found in this comment.The results show that the following two modifiers are available:
primaryAlt
:⌘ command
+⌥ option
+G
on Mac /ctrl
+alt
+G
on Windowsecondary
:⌘ command
+shift
+⌥ option
+G
on Mac /ctrl
+shift
+alt
+G
I chose
primaryAlt
because thesecondary
modifier could be used for ungrouping (unwrapping) in the future.However, as noted in this comment, it appears that Ctrl + Alt is usually used for Windows OS-level functions. I would appreciate your advice on whether it makes sense to add this shortcut and whether it will cause any confusion to the user.
Also, this shortcut will not allow to create a group block if a single group block is selected. This is consistent with the behavior of group block transformation.
Testing Instructions
ctrl
+alt
+G
. On Mac, press⌘ command
+⌥ option
+G
.Screenshots or screencast
83a8606c38f7f66351eb8b7854058146.mp4