Page MenuHomePhabricator

The same keyboard shortcut cannot simultaneously be 'Show changes' and 'Switch to the visual editor'
Closed, DuplicatePublic

Description

Steps to reproduce:

  1. Enable two-tab mode (for ease of seeing what's going on).
  2. Open a page in an older wikitext editor, e.g., the 2010-era WikiEditor.
  3. Hover over the 'Edit' tab at the top of the page, and notice that the tooltip tells you that the keyboard shortcut is meta-v.
  4. Hover over the 'Show changes' button under the edit window, and notice that the tooltip tells you that the keyboard shortcut is also meta-v.
  5. Press meta-v. I wonder which one will happen?
  6. Either enable or disable VisualEditor's new built-in wikitext mode. Try it again. Get opposite result.

Originally reported by @Geekdiva at https://www.mediawiki.org/wiki/Topic:Tsbluqcc7urcmzqd

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

You mean 'Show changes' instead of 'Show preview', and both the exact shortcut and behaviour depends on the browser (in Firefox it is shift-alt-v, and with two elements with the same key, it just moves focus between them and doesn't activate the element), but yes, there shouldn't be two elements with the same access key.

I tried testing this in Chrome first, and the shortcuts are not displayed, although they do work.

When I tested this in the Firefox, the shortcuts are different than the ones in the description, with no duplication. Why are my shortcuts different?

^⌥e - Edit
^⌥p - Show Preview
^⌥v - Show Changes

(For the benefit of non-Mac users, is Option, which is kind of like Alt, and ^ is Control.)

The Edit and Show Preview shortcuts worked fine. The Show Changes shortcut didn't work at all; if I had the edit window selected it inserted the square root symbol , and if I didn't have the edit window selected it highlighted the Show Changes button but didn't actually activate it.

When I tested this in Chrome, the Edit and Show Preview shortcuts were the same. Curiously, if I pressed ^⌥v, it asked me if I wanted to switch to VisualEditor, which was different behaviour than Firefox.

In summary:

  • I can't reproduce the core problem; my shortcuts are different from those in the description, with no duplication.
  • There are weird behaviours and inconsistencies:
    • ^⌥v does not seem to do anything in Firefox.
    • ^⌥v asks me if I want to switch to VisualEditor in Chrome.
Deskana changed the task status from Open to Stalled.Jun 20 2017, 7:21 PM

This may be an issue with shortcuts on non-Macs. Needs investigation.

@Deskana you might want to read up on https://en.wikipedia.org/wiki/Wikipedia:Keyboard_shortcuts#Using_access_keys

accesskeys are the accesskey attribute on a link (a very old technique for keyboard accessibility that Wikipedia has supported for 14 years or so) which unfortunately varies across browser and operating system in terms of which modifiers you need to use (they are usually shown in the tooltip of the control).

The "Edit" tab has accesskey 'v', while the "Edit source" tab has the 'e' accesskey. Now when you are in the (old) source editor, there is an OLDER convention where the button "show preview" has the accesskey 'p' and "show changes" has the accesskey 'v'. The 'newer' VE edit tab thus reuses a much older assigned accesskey, and the behavior of which of the two commands is executed becomes undefined (though i believe the first control in the DOM usually will be the one executed).

And then the new source editor and VE try to reimplement those conventions etc. etc. it's a bit of confusing and sometime conflicting mess.

TheDJ renamed this task from The same keyboard shortcut cannot simultaneously be 'Preview page' and 'Switch to the visual editor' to The same keyboard shortcut cannot simultaneously be 'Show changes' and 'Switch to the visual editor'.Jun 20 2017, 9:05 PM
TheDJ updated the task description. (Show Details)