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

Delete block shortcut: update to be more intuitive and farther from "undo" #68139

Open
jasmussen opened this issue Dec 19, 2024 · 8 comments · May be fixed by #68164
Open

Delete block shortcut: update to be more intuitive and farther from "undo" #68139

jasmussen opened this issue Dec 19, 2024 · 8 comments · May be fixed by #68164
Assignees
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Status] In Progress Tracking issues with work in progress

Comments

@jasmussen
Copy link
Contributor

When you select an image, you can press Delete or Backspace to delete it. This is intuitive enough.

When you select a paragraph, those keys delete characters, as you would in any text editor. But if you want to delete the entire paragraph, the current default shortcut is ControlOptionZ on Mac, or ControlAltZ on Windows.

This shortcut is both far from the backspace/delete keys that usually are related to removing, it's also very close to the undo command, CommandZ. It may be confusing to have a destructive action share the same keycode as undo.

Beyond allowing users to customize keyboard shortcuts, which would be highly valuable regardless (#3218), is there a keyboard shortcut that is more intuitive (closer to Backspace and Delete keys), farther from undo, and doet not conflict with other assigned shortcuts?

Can that shortcut be:

  • Mac: Command + Shift + Delete
  • Windows: Control + Shift + Delete

Conceptually the two modifier keys help indicate: this is a forceful action, and the dual nature of backspace and delete both working for this action would match the behavior for non-text blocks.

Related: #51356

@jasmussen jasmussen added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Dec 19, 2024
@jarekmorawski
Copy link
Contributor

Sounds good to me! I immediately thought of the Shift + Delete combination before I even finished reading your description. Can we drop Command/Control? The shortcut would then work similarly to Shift + Enter in Figma that immediately zooms out and selects the parent of the currently edited object.

@jasmussen
Copy link
Contributor Author

The simpler the better, the main reason I avoided "Shift+Delete" is because on Windows in older iterations, Shift + Delete would map to "Cut". It's my impression this is very rarely used today, so it might be okay, but that was the motivation for the larger set, at least.

@yogeshbhutkar
Copy link
Contributor

I believe the Shift+Delete combination is a solid approach to proceed with. I'll be linking a PR for the patch shortly.

@Mamaduka
Copy link
Member

@t-hamano is a Windows shortcuts wizard (🧙); let's see what he thinks about the proposal.

Personally, the current shortcut never made sense to me; even using the Delete or D key as the last part of the combo would be preferable.

Let's ensure we're not overriding any obvious OS or browser shortcut with a new combo.

@t-hamano
Copy link
Contributor

On Windows, the shortcut is Shift+Alt+Z. I have never used the current keyboard shortcuts because the three keys are so close together that they are difficult to press 😅

the main reason I avoided "Shift+Delete" is because on Windows in older iterations, Shift + Delete would map to "Cut".

Unfortunately, in my environment, this shortcut still works as "cut":

5d5d469a36d154bb804d6e7179d47758.mp4

It would be better if we could check shortcut conflicts not only on Windows OS and Mac, but also on Linux OS.

By the way, I looked into the history of this shortcut and found that initially Ctrl+Alt+Backspace (Alt+Cmd+Backspace) was used (#8805). It seems that it was later changed to the current shortcut key (#10008).

@yogeshbhutkar
Copy link
Contributor

the main reason I avoided "Shift+Delete" is because on Windows in older iterations, Shift + Delete would map to "Cut".

Unfortunately, in my environment, this shortcut still works as "cut":

Maybe then, as per the suggestion provided by @Mamaduka, we can try out Shift + d instead of Shift + delete, if it doesn't overlap with any other pre-existent shortcuts.

@t-hamano
Copy link
Contributor

shift+d is needed to type capital D. Below are all the possible shortcuts in Windows:

Key Action
ctrl+d ⚠️ Chrome and Firefox shortcut (bookmark current page)
shift+d ❌ Type a capital D
alt+d ⚠️ Chrome and Firefox shortcut (Focus the address bar)
ctrl+shift+d ❌ Block Editor shortcut (Duplicate the selected block)
ctrl+alt+d ✅ Avairable
shift+alt+d ❌ Block Editor shortcut (Strikethrough the selected text.)
ctrl+shift+alt+d ✅ Avairable
ctrl+del ⚠️ OS shortcut (Delete words to the right)
shift+del ⚠️ Chrome shortcut (Cut)
alt+del ✅ Avairable
ctrl+shift+del ⚠️ Chrome and Firefox shortcut (Delete browsing data)
ctrl+alt+del ⚠️ OS shortcut (Launch Task Manager)
shift+alt+del ✅ Avairable
ctrl+shift+alt+del ✅ Avairable

Personally, I find the del key more intuitive than the d key given its role. Also, it would be nice to be able to use the same key combinations across both operating systems.

In that sense, ctrl+shift+del seems the most natural choice to me, but this shortcut is for deleting browsing data. Since there are probably no users who frequently delete browsing data, I think it would be fine to overwrite this shortcut, but what do you think?

@yogeshbhutkar
Copy link
Contributor

ctrl+shift+del seems the most natural choice to me

This sounds good to me. I will be updating the PR to incorporate the changes discussed here. Thanks for the suggestions 🚀.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Status] In Progress Tracking issues with work in progress
Projects
None yet
5 participants