Page MenuHomePhabricator

Show sequence shortcuts in the help dialog (CommandHelpDialog)
Closed, ResolvedPublic8 Story Points


The help dialog currently uses the trigger registry to help list keyboard shortcuts. We should do a similar thing for the sequence registry so we can output a listing like:

#<space>Numbered list
*<space>Bullet list

Things to consider:

  1. Do we need to indicate which sequences must match the start of a paragraph first (e..g list, but not links)
  2. How to generate the descriptions and key sequence labels. Should be easy for the simple ones above for some are regex based.
  3. Some sequences probably shouldn't be listed, e.g. all the auto-linking sequences (http://, ISBN) and the wikitext warning sequences
  4. VE-MW has many more sequences than VE-core so test in both.

Event Timeline

Esanders created this task.Oct 20 2015, 2:47 PM
Esanders raised the priority of this task from to Needs Triage.
Esanders updated the task description. (Show Details)
Esanders added a project: VisualEditor.
Esanders added a subscriber: Esanders.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 20 2015, 2:47 PM
Esanders updated the task description. (Show Details)Oct 20 2015, 2:53 PM
Esanders set Security to None.

Potentially some of these can be merged with their existing entries in the CommandHelpDialog, e.g.

Link - CTRL + K, or type [[

Jdforrester-WMF triaged this task as Normal priority.
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.

Change 248370 had a related patch set uploaded (by DLynch):
Include sequences in the command help dialog

Change 248373 had a related patch set uploaded (by DLynch):
Add mediawiki-specific sequences to the command help dialog

Following a bunch of feedback, it now looks like:

This has changed the rendering of existing shortcuts, to use a key-border and to always have a + between the keys to emphasize that they need to be pressed all at once. (Regardless of platform -- the + was always there on PC.)

So there's another group of sequences that we haven't considered here which are extensions' sequences, e.g. "<ref" for citations, or "<syntax" for a code block.

This may affect our design for sequences as putting 7 characters in a box may be too long. We also need a way of extensions registering shortcuts with the dialog (either using the existing sequence registry, or another sequence help registry).

Currently these sequences exist in:

  • Cite & Citoid
  • Math
  • Syntaxhighligh_GeSHi
  • Score
  • wikihiero

Something like <section does indeed turn out a bit long:

Seems like there's two options:

  1. Have the MWCommandHelpDialog know about them and try to register them, and account for the possibility they're not registered. This is conveniently centralized, but does make it difficult for third-party extensions to ever get in on this action.
  2. Provide some sort of registration call. This is mostly a pain if we want to allow fairly arbitrary positioning of the registered sequences / triggers -- my existing patch is jumping through various hoops to do things like "place the heading sequence immediately after the heading trigger in the list". If we just wanted to drop anything registered into the end of the "other" section it'd be really simple, or even just at the end of any particular named section.

I think extensions can be shows in their own group in an arbitrary order. I'd rather not have references to extensions in VE.

On reflection I think the 'key' styling doesn't quite work for sequences though, because it suggests (partly by using text-transform uppercase which is misleading here) that just pressing the key is what you need to do to trigger the sequence, when in fact it is that you have to type a string into the editor, which is subtly different.

I think if we drop the key styling from sequences the fact we have it on triggers helps distinguish the two better.

Here's a potential styling difference:

Change 248370 merged by jenkins-bot:
[BREAKING CHANGE] Include sequences in the command help dialog

Jdforrester-WMF closed this task as Resolved.Nov 2 2015, 5:30 PM
Jdforrester-WMF removed a project: Patch-For-Review.

Change 248373 merged by jenkins-bot:
Add mediawiki-specific sequences to the command help dialog