Page MenuHomePhabricator

Search for VE commands using keyboard only
Closed, ResolvedPublic

Description

As seen in Google Docs, the @ sequence now lets you search for commands as well as people to mention (also files and other insertable things):

image.png (323×345 px, 18 KB)

This would make for easier-to-learn keyboard accessibility. Instead of having to remember the shortcut for the thing you want to do, you just have to see/guess what it is called in the menu, e.g. insert citation becomes "@cite" instead of "ctrl + shift + k". Furthermore the search results could use localised messages, so in Spanish one could type "@citar" for the same function.

It solves a couple of other problems

  • Many menu items still have no keyboard shortcut, and we are running out of letters to use that don't conflict with system shortcuts
  • Some items are insertable using the keyboard using a sequence, e.g. <math but these aren't translated
  • Some keyboard shortcuts are hard/impossible to use on non-English keyboard layouts

Note the Google Docs model works well for inserting items, as that is usually done with no selection, and the only cleanup required is to delete the @.

Alternatively one could provide a "search for command" shortcut (like Ctrl+Shift+P in SublimeText). This would work better for commands that usually operate on a selection, e.g. Bold/Superscript/Link.

Event Timeline

Change 744905 had a related patch set uploaded (by DLynch; author: DLynch):

[VisualEditor/VisualEditor@master] [WIP] Fuzzy command bar

https://gerrit.wikimedia.org/r/744905

I'm wondering if this is the same idea as quick actions. We've discussed the concept of slash commands happening within VE that could start with allowing for basic editing functionality and then expand out to more meaty tools (such as policy info).

Additionally, I also see this is as being particularly useful as a way to trigger templates. For example if you want to ask an admin to edit an article, or if you want to tell another contributor that an edit that they just made needs a citation.

Here are some explorations that we did together:

Screen Shot 2022-01-05 at 12.40.51 PM.png (726×1 px, 254 KB)

Esanders claimed this task.

Resolved via T66905!