Language Change NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar fancyFranci
fancyFranci
19 Jun 2022

Summary of Changes

This is a new plugin, developed in the GSoC 21 Accessibility project.

It introduces keyboard shortcuts to the administrator site like pressing J + F to jump into the search field or J + S to save. Other extensions are able to add their shortcuts as well by hooking in on the onLoadShortcuts event. All(!) of them are listed in a modal window, which shows up by pressing J + X.

The current state is just the start. Further steps would be the editing of shortcuts, the possibility to disable them, changing the overview-text-hint to a button in the corner etc. The editing was there already but it had some flaws, so it will come later (without flaws) :)

Thanks to @Krshivam25 the student behind this GSoC project, @chmst, @bembelimen, and @brianteeman for alle the work and feedback!

Testing Instructions

Make sure the shortcut plugin is enabled and start by pressing J + X (in sequence, not at the same time!) for the overview. Have a look at the hint, which tells you the same at the bottom of the page. Then visit different pages and try out the shortcuts :)

If your motivated you can let your plugin add new shortcuts and test them! Add "onLoadShortcuts" to the getSubscribedEvents and write something like this:

public function onLoadShortcuts(EventInterface $event): void {
   $shortcuts = $event->getArgument('shortcuts');
   $testShortcuts = array('test' => (object)['shortcut' => 'J + T', 'title' => 'Great Test', 'selector' => '#menu-collapse']);
   $event->setArgument('shortcuts',  array_merge($shortcuts, $testShortcuts));
}

Actual result BEFORE applying this Pull Request

You needed to click on buttons to do something

Expected result AFTER applying this Pull Request

You can use your keyboard to do something (besides typing text)

Documentation Changes Required

Yes, I will create a page to describe the build up of the shortcuts, how extensions can add them and what the default joomla shortcuts are. Part of it would be:

The 3rd party plugin needs to provide an array of shortcuts which are objects:
{ shortcut: string, selector: string, title: string }
The shortcut needs to be a keyboard input, separated by a plus e.g. "J + Y" or "ALT + Z + 7" (currently there is really no filtering).
Selectors are like CSS selectors to target an element. When it is an input element, the shortcut gives focus, otherwise it will be clicked.
The Title will be displayed in the overview. It could be the name of the target.

95c7fc4 20 Jun 2021 avatar HLeithner Drone
avatar fancyFranci fancyFranci - open - 19 Jun 2022
avatar fancyFranci fancyFranci - change - 19 Jun 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Jun 2022
Category Administration Language & Strings Repository JavaScript NPM Change SQL Installation Postgresql Front End Plugins
avatar brianteeman
brianteeman - comment - 19 Jun 2022

You need to add update sql scripts

avatar brianteeman
brianteeman - comment - 19 Jun 2022

image

avatar brianteeman
brianteeman - comment - 19 Jun 2022

Other extensions are able to add their shortcuts as well by hooking in on the onLoadShortcuts event.

Can you provide an example please

All of them are listed in a modal window, which shows up by pressing J + X.

Would that include these additional extension provided shortcuts

avatar fancyFranci fancyFranci - change - 19 Jun 2022
Labels Added: Language Change NPM Resource Changed ?
avatar joomla-cms-bot joomla-cms-bot - change - 19 Jun 2022
Category Administration Language & Strings Repository JavaScript NPM Change SQL Installation Postgresql Front End Plugins SQL Administration com_admin Postgresql Language & Strings Repository JavaScript NPM Change Installation Front End Plugins
avatar brianteeman
brianteeman - comment - 19 Jun 2022

When the keyboard focus is on a select then the hotkeys do not work

image

avatar brianteeman
brianteeman - comment - 19 Jun 2022

I am sorry I made a big accessibility mistake when I suggested using J as the modifier key.

If you are unable to press or have difficulty pressing shortcut key combinations then (on windows) you can enable sticky keys.

image

However the only sticky keys are the traditional modifiers.

The way github does it using the G key is that they appear to use it as a keyboard sequence and not a modifier.

In other words I can press G followed by I to go to issues
In this PR I have to press and hold J while pressing the S to go to the Search bar

avatar fancyFranci
fancyFranci - comment - 19 Jun 2022

When the keyboard focus is on a select then the hotkeys do not work

From my side this is intended. Users should be able to jump to a select value with a character, depending on the available values. Like pressing "u" in the "-select featured-" select, I want to jump to "unfeatured". If there is a value starting with "j", I want to select that.

avatar fancyFranci
fancyFranci - comment - 19 Jun 2022

All of them are listed in a modal window, which shows up by pressing J + X.

Would that include these additional extension provided shortcuts

Yes, as long as the provided shortcuts have a title, they are added to the overview.

@brianteeman Like your screenshot displayed it shortcuts can trigger different things, depending on the context. I did not find a screen where the Search and the Save & Close button are both present, so I let them use the same shortcut. Same with New and Save & New. Do you have concerns or is it their presentation in the overview which is an issue?

avatar brianteeman
brianteeman - comment - 19 Jun 2022

Do you have concerns or is it their presentation in the overview which is an issue?

Both.

In other systems only the valid shortcuts are displayed (see github for examples)

It is not normal to use the same shortcut for two different things. It really makes memorising them very difficult.

avatar brianteeman
brianteeman - comment - 19 Jun 2022

When the keyboard focus is on a select then the hotkeys do not work

From my side this is intended. Users should be able to jump to a select value with a character, depending on the available values. Like pressing "u" in the "-select featured-" select, I want to jump to "unfeatured". If there is a value starting with "j", I want to select that.

you are correct that they should be able to find a value beginning with J. But you are using J as a modifier key. In other words press J on its own and it will find the word beginning with J. Press J in combination with another key and the shortcut should happen.

avatar brianteeman
brianteeman - comment - 19 Jun 2022

Please add the plugin to the list of core plugins

// Core plugin extensions - system

avatar fancyFranci fancyFranci - change - 19 Jun 2022
The description was changed
avatar fancyFranci fancyFranci - edited - 19 Jun 2022
avatar fancyFranci
fancyFranci - comment - 19 Jun 2022

[...]
The way github does it using the G key is that they appear to use it as a keyboard sequence and not a modifier.

In other words I can press G followed by I to go to issues In this PR I have to press and hold J while pressing the S to go to the Search bar

Ooh thats the reason github does that... I hoped we would not need that, as it means splitting up the shortcuts, adding a timeout, and so on.

Is this something we could add to the future-feature-list or is it stopping this PR?

avatar brianteeman
brianteeman - comment - 19 Jun 2022

Is this something we could add to the future-feature-list or is it stopping this PR?

Well we can't call it an accessibility feature if it is not usable by someone who cannot press more than one key at a time. it needs to be a key sequence and not a key combination.

avatar brianteeman
brianteeman - comment - 19 Jun 2022

I think you can do it by setting a scope of J. But I could be completely wrong.

avatar fancyFranci
fancyFranci - comment - 20 Jun 2022

Do you have concerns or is it their presentation in the overview which is an issue?

Both.

In other systems only the valid shortcuts are displayed (see github for examples)

It is not normal to use the same shortcut for two different things. It really makes memorising them very difficult.

Ok, the only reason for doubling them were the matching characters. Search => S, Save => S, but yes, it is not optimal. Then I need to set "random" chars or do you have another idea? :/

avatar joomla-cms-bot joomla-cms-bot - change - 20 Jun 2022
Category Administration Language & Strings Repository JavaScript NPM Change SQL Installation Postgresql Front End Plugins com_admin SQL Administration com_admin Postgresql Language & Strings Repository JavaScript NPM Change Installation Libraries Front End Plugins
avatar brianteeman
brianteeman - comment - 20 Jun 2022

Then I need to set "random" chars or do you have another idea? :/

well F (find) is usually used in browsers to prevent conflicts with S (save)

avatar fancyFranci fancyFranci - change - 20 Jun 2022
The description was changed
avatar fancyFranci fancyFranci - edited - 20 Jun 2022
avatar fancyFranci fancyFranci - change - 20 Jun 2022
The description was changed
avatar fancyFranci fancyFranci - edited - 20 Jun 2022
avatar brianteeman
brianteeman - comment - 20 Jun 2022

image

This might look better if the keys come before the text?

avatar brianteeman
brianteeman - comment - 20 Jun 2022

It works much better now with the scope and using the keys in sequence. Its finally accessible.

However this means that it can not be called a modifier key. A modifier key is a key thata you hold down to change another key. And it doesnt work if you try to do that. Not sure what the correct terminology is. Will check that in the morning.

avatar fancyFranci
fancyFranci - comment - 20 Jun 2022

Indeed, the other way around looks better! Happy testing everyone

avatar brianteeman
brianteeman - comment - 20 Jun 2022

Note to self (or anyone else) of additional things to test tomorrow

  • English strings
  • RTL
  • non english keyboard
  • accessibility with screen reader
  • order the keys in the overview (and how to make that sensible in other languages?)
avatar brianteeman
brianteeman - comment - 20 Jun 2022

Can I request one additional ccore shortcut J D
takes you to the home dashboard

avatar bembelimen
bembelimen - comment - 20 Jun 2022

However this means that it can not be called a modifier key. A modifier key is a key thata you hold down to change another key. And it doesnt work if you try to do that.

grafik

This works for me, first pressing "J" and then "ALT + N" at the same time.

avatar bembelimen
bembelimen - comment - 20 Jun 2022
* [ ]  accessibility with screen reader

I wonder if we should show some kind of modal/text when "J" was pressed with aria-attributes to make aware, that we're in the shortcut mode?

avatar bembelimen
bembelimen - comment - 20 Jun 2022

Can I request one additional ccore shortcut J D takes you to the home dashboard

  • Create Article
  • Goto articles
  • [...] menus
  • [...] users

From everywhere...

avatar brianteeman
brianteeman - comment - 21 Jun 2022
* [ ]  accessibility with screen reader

I wonder if we should show some kind of modal/text when "J" was pressed with aria-attributes to make aware, that we're in the shortcut mode?

I will check what screen readers do with their own keys

avatar brianteeman
brianteeman - comment - 21 Jun 2022

Definition Lists

The code is currently

  • Defnition Term (dt) = Save
  • Definition Description (dd) = J+A

I think this is the wrong way around. @chmst what do you think?

avatar chmst
chmst - comment - 21 Jun 2022

Example here: Key combination first: https://webaim.org/resources/shortcuts/nvda
Also on Visual studio Code.

avatar chmst
chmst - comment - 21 Jun 2022

What Screenreaders announce depends on screenreader and OS. Will build a test installation where more people can perform tests.

avatar brianteeman
brianteeman - comment - 21 Jun 2022

Grrrh.
Using a keyboard sequence doesnt seem to work as I expected. It doesnt work at all in NVDA or Windows Narrator.

In both cases the combination J + X tries to go to the next checkbox.

avatar brianteeman
brianteeman - comment - 21 Jun 2022

successfully tested in arabic that both the display in RTL is correct and that the shortcut keys work in chrome for windows when chrome and joomla are set to use arabic language for display and arabic language for keyboard

avatar fancyFranci
fancyFranci - comment - 21 Jun 2022

Can I request one additional ccore shortcut J D takes you to the home dashboard

* Create Article

* Goto articles

* [...] menus

* [...] users

From everywhere...

I added the possibility in general and dashboard works. I can include more shortcuts of course, I only need details about urls and selectors.

avatar Quy
Quy - comment - 21 Jun 2022

Maybe sort in the same order as in the plugin and move text next to keys?

PLUGIN:
shortkey-plugin

MODAL:
shortkey-modal

avatar Quy
Quy - comment - 21 Jun 2022

Instead of using .badge, maybe use <kbd>. https://getbootstrap.com/docs/5.2/content/reboot/#user-input

avatar fancyFranci
fancyFranci - comment - 21 Jun 2022

Instead of using .badge, maybe use <kbd>. https://getbootstrap.com/docs/5.2/content/reboot/#user-input

Thanks for the hint, it makes the html much more readable.

avatar fancyFranci
fancyFranci - comment - 21 Jun 2022

[...] and move text next to keys?

Currently it is a dl and thats the default style of that kind of list. Previously it was a ul and all in line but wishes were to use a dl. Long story short I let the style like it is for now, but as more improvements are planned it could be part of them.
But I aligned the order at least :)

avatar fancyFranci
fancyFranci - comment - 21 Jun 2022

Ok guys, my target is to bring this feature into 4.2 beta-2 which will be released today in the evening. Otherwise shortcuts would need to wait until 4.3. So every further improvement will find its way into beta-3 and this PR here will get merged after 2 tests. I hope thats ok, @brianteeman ? :) Would be great when we can create a list of things needed to be finished before beta-3.

avatar fancyFranci fancyFranci - change - 21 Jun 2022
The description was changed
avatar fancyFranci fancyFranci - edited - 21 Jun 2022
avatar Quy
Quy - comment - 21 Jun 2022

Make the legend less prominent?

keyboard-shortcuts-legend

<span class="icon-keyboard fa-keyboard me-2" aria-hidden="true"></span> <kbd>J</kbd>+<kbd>X</kbd> <small>Keyboard Shortcuts</small>
avatar bembelimen bembelimen - test_item - 21 Jun 2022 - Tested successfully
avatar bembelimen
bembelimen - comment - 21 Jun 2022

I have tested this item successfully on b223844


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38092.

avatar chmst chmst - test_item - 21 Jun 2022 - Tested successfully
avatar chmst
chmst - comment - 21 Jun 2022

I have tested this item successfully on b223844

Great!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38092.

avatar brianteeman
brianteeman - comment - 21 Jun 2022

Grrrh. Using a keyboard sequence doesnt seem to work as I expected. It doesnt work at all in NVDA or Windows Narrator.

In both cases the combination J + X tries to go to the next checkbox.

avatar fancyFranci
fancyFranci - comment - 21 Jun 2022

Grrrh. Using a keyboard sequence doesnt seem to work as I expected. It doesnt work at all in NVDA or Windows Narrator.
In both cases the combination J + X tries to go to the next checkbox.

Sorry, that one got lost in all the comments. I'll have a look on that, maybe preventing defaults after J was pressed (not X alone) could be enough.

avatar Quy
Quy - comment - 21 Jun 2022

I find the legend in the footer a little distracting. My focus draws to it. It is useful in the beginning but I can see it becoming annoying after a while.

shortcut-footer

avatar brianteeman
brianteeman - comment - 21 Jun 2022

jx is a dl but the description in the plugin is a ul

avatar fancyFranci
fancyFranci - comment - 21 Jun 2022

I find the legend in the footer a little distracting. My focus draws to it. It is useful in the beginning but I can see it becoming annoying after a while.

Now the hint only appears on cpanel-pages like the home dashboard. As you said - its only useful at the beginning

avatar fancyFranci
fancyFranci - comment - 22 Jun 2022

Grrrh. Using a keyboard sequence doesnt seem to work as I expected. It doesnt work at all in NVDA or Windows Narrator.
In both cases the combination J + X tries to go to the next checkbox.

It seems like NVDA interrupt the keyboard input before js can do/prevent anything. Even when I change the shortcuts to something NVDA does not use, nothing happens besides making a sound. When we configure modifiers like ALT, they do not work in sequence because the browser interrupts (at least in my tests). What do you think @brianteeman ? :/

avatar brianteeman
brianteeman - comment - 22 Jun 2022

(not at my pc to test) what happens on github when you use nvda and the github shortcuts?

avatar fancyFranci
fancyFranci - comment - 22 Jun 2022

I tried out s for githubs search and I'm not jumping into the search field as long as nvda is running. Same with g and n, which should normally open notifications.

avatar fancyFranci
fancyFranci - comment - 22 Jun 2022

...but the command palette (which opens on ctrl+k) works with nvda

avatar brianteeman
brianteeman - comment - 22 Jun 2022

It looks like its a known issue with the nvda single character shortcuts
https://www.nvaccess.org/files/nvda/documentation/userGuide.html#SingleLetterNavigation

avatar brianteeman
brianteeman - comment - 22 Jun 2022

yes looks like this is one of those cases where a real screen reader user knows what to do.

"In browse mode, you can now toggle single letter navigation on and off by pressing NVDA+shift+space. When off, single letter keys are passed to the application, which is useful for some web applications such as Gmail, Twitter and Facebook."

or you switch from browse to focus mode.

Havng read the nvda manual link I am happy enough that the current code is ok to merge

avatar fancyFranci fancyFranci - close - 22 Jun 2022
avatar fancyFranci fancyFranci - merge - 22 Jun 2022
avatar fancyFranci fancyFranci - change - 22 Jun 2022
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-06-22 14:42:55
Closed_By fancyFranci
avatar fancyFranci
fancyFranci - comment - 22 Jun 2022

Thanks everybody! :)

avatar brianteeman
brianteeman - comment - 22 Jun 2022

thank you all.

Cant wait to read the docs how this can be extended by extensions

avatar fancyFranci
fancyFranci - comment - 22 Jun 2022

I wrote an example in the test instructions which I used myself to test added shortcuts. But yes, docs will follow.

Add a Comment

Login with GitHub to post a comment