While working on several other tickets (notably T295353#7513913 and T299490#7648758) we realized that the "move part up/down" as well as "delete part" features in the sidebar behave different, depending on the user's needs and their workflow:
- Mouse users need to select a part by clicking. It becomes blue (= selected). Now the toolbar buttons at the bottom can be used.
- Keyboard users can do the same by tabbing to the part, selecting it with space, tabbing to the toolbar buttons, and pressing them with enter.
- The hotkeys Ctrl + Delete and Ctrl + Shift + Up/Down behave different. They don't act on the selected but the focused part. This was an intentional design decision with blind users in mind.
This is a constant source of confusion and inconsistencies, like the ARIA labels only describing one of these workflows. We decided to:
- Remove the special behavior for these 3 hotkeys (see below for where this code lives).
- Instead assign them to the toolbar buttons so the hotkeys do the exact same as the buttons.
- Make sure Macs accept both Ctrl + Delete as well as ⌘+Backspace.
- This might leave blind users in confusing situations where they accidentally delete something they can't see. We decided to ignore this for now and possibly come back to this as part of T289653: Screenreader support for the new VisualEditor template editor sidebar.
Note this is only about the 3 up/down/delete hotkeys. The other 3 "add template/template parameter/wikitext content" hotkeys don't have this problem.
Note 2: When a button is disabled the relevant hotkey should do nothing.
Technical details:
- Remove up/down/delete code from MWTransclusionOutlinePartWidget.onHeaderKeyPressed.
- Remove up/down/delete stuff from MWTransclusionOutlineButtonWidget.onKeyDown.
- Instead add trigger code to MWTransclusionDialog.setupHotkeyTriggers.
This is split from T299490: Add shortcuts to hover tooltips on buttons in adv toolbar.